<!-- Second navbar -->
<div class="navbar navbar-default" id="navbar-second">
<ul class="nav navbar-nav no-border visible-xs-block">
<li><a class="text-center collapsed" data-toggle="collapse" data-target="#navbar-second-toggle"><i class="icon-menu7"></i></a></li>
</ul>

<div class="navbar-collapse collapse" id="navbar-second-toggle">
<ul class="nav navbar-nav">
<li><a href="<?=site_url('admin');?>"><i class="icon-display4 position-left"></i> <?php echo lang('language_lang.menu_dashboard');?></a></li>
<?php
if(session()->get('permission')) {
$pages = json_decode(session()->get('permission'));
} else {
$permission_pages = pagePermission();
$pages = json_decode($permission_pages);
}
$this->db = db_connect();    
$this->session = session();
$admin_login=$this->session->get('userid');
$get_admin=$this->db->query("select * from admin where id='".$admin_login."'")->getRow();
$user_group = $get_admin->user_group;

?>
<?php if( in_array('Sitesettings', $pages) || in_array('Adminsettings', $pages) || in_array('Usersettings', $pages) || in_array('Loginsettings', $pages) || in_array('Emailsettings', $pages) || in_array('Withdrawsettings', $pages) || in_array('Transfersettings', $pages) || in_array('Referralsettings', $pages) || in_array('Footersettings', $pages) || in_array('Paymentsettings', $pages) || in_array('Currencysettings', $pages) || in_array('Langsettings', $pages) || in_array('Infoboxsettings', $pages) || in_array('Exchangesettings', $pages) || in_array('Addrsettings', $pages)  || in_array('Paysettings', $pages) || in_array('Tokensettings', $pages) ) { ?>
<li class="dropdown mega-menu mega-menu-wide"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-puzzle4 position-left"></i> <?php echo lang('language_lang.menu_settings');?> <span class="caret"></span></a>

<div class="dropdown-menu dropdown-content">
<div class="dropdown-content-body">
<div class="row">

<?php if( in_array('Sitesettings', $pages) || in_array('Usersettings', $pages) || in_array('Loginsettings', $pages) || in_array('Emailsettings', $pages)  ) { ?>
<div class="col-md-3">
<span class="menu-heading underlined"><?php echo lang('language_lang.menu_main_settings');?></span>
<ul class="menu-list">

<?php if( in_array('Sitesettings', $pages) ) { ?><li><a href="<?=site_url('admin/sitesettings');?>"><i class="icon-gear"></i> <?php echo lang('language_lang.menu_site_settings');?></a></li><?php } ?>
<?php if( in_array('Usersettings', $pages) ) { ?><li><a href="<?=site_url('admin/usersettings');?>"><i class="icon-user-check"></i> <?php echo lang('language_lang.menu_user_settings');?></a></li><?php } ?>
<?php if( in_array('Loginsettings', $pages) ) { ?><li><a href="<?=site_url('admin/loginsettings');?>"><i class="icon-key"></i> <?php echo lang('language_lang.menu_login_settings');?></a></li><?php } ?>
<?php if( in_array('Emailsettings', $pages) ) { ?><li><a href="<?=site_url('admin/emailsettings');?>"><i class="icon-mail5"></i> <?php echo lang('language_lang.menu_email_settings');?></a></li><?php } ?>


</ul>
</div>
<?php } ?>

<?php if( in_array('Withdrawsettings', $pages) || in_array('Transfersettings', $pages) || in_array('Referralsettings', $pages) || in_array('Langsettings', $pages) || in_array('Currencysettings', $pages) || in_array('Langsettings', $pages) || in_array('Paymentsettings', $pages) ) { ?>
<div class="col-md-3">
<span class="menu-heading underlined">Other Settings</span>
<ul class="menu-list">
<?php if( in_array('Withdrawsettings', $pages) ) { ?><li><a href="<?=site_url('admin/withdrawsettings');?>"><i class="icon-grid"></i> <?php echo lang('language_lang.menu_withdraw_settings');?></a></li><?php } ?>
<?php if( in_array('Referralsettings', $pages) ) { ?><li><a href="<?=site_url('admin/referralsettings');?>"><i class="icon-grid"></i> <?php echo lang('language_lang.menu_referral_settings');?></a></li><?php } ?>
<?php if( in_array('Currencysettings', $pages) ) { ?><li><a href="<?=site_url('admin/currencysettings');?>"><i class=" icon-cash"></i> <?php echo lang('language_lang.menu_currency_settings');?></a></li><?php } ?>
<?php if( in_array('Paymentsettings', $pages) ) { ?><li><a href="<?=site_url('admin/paymentsettings');?>"><i class="icon-grid"></i> <?php echo lang('language_lang.menu_payment_settings');?></a></li><?php } ?>
</ul>
</div>
<?php } ?>

<?php if( in_array('adminsettings', $pages) || in_array('apibinding', $pages)  || in_array('rewardsettings', $pages) || in_array('tradepairs', $pages) || in_array('tradestrategy', $pages) ) { ?>
<div class="col-md-3">
<span class="menu-heading underlined">Setting3</span>
<ul class="menu-list">

<?php if( in_array('adminsettings', $pages) ) { ?> <li><a href="<?php echo base_url('admin/adminsettings');?>"><i class="icon-user-check"></i> <?php echo lang('Trading Settings');?></a></li> <?php } ?>

<?php if( in_array('apibinding', $pages) ) { ?> <li><a href="<?php echo base_url('admin/apibinding');?>"><i class="icon-cogs"></i> <?php echo lang('API Binding Settings');?></a></li> <?php } ?>

<?php if( in_array('rewardsettings', $pages) ) { ?><li><a href="<?php echo base_url('admin/rewardsettings');?>"><i class="icon-grid"></i><?php echo "Rank Settings";?></a></li> <?php }?>

<?php if( in_array('tradepairs', $pages) ) { ?><li><a href="<?php echo base_url('admin/tradepairs');?>"><i class="icon-chart"></i><?php echo "Trading Pair Settings";?></a></li> <?php }?>
<?php if( in_array('tradestrategy', $pages) ) { ?> <li><a href="<?php echo base_url('admin/tradestrategy');?>"><i class="icon-briefcase"></i><?php echo "Suggested Strategy Settings";?></a></li> <?php }?>

</ul>
</div>
<?php } ?>



</div>
</div>
</div>
</li>
<?php } ?>

<?php if( in_array('Cms', $pages) || in_array('Faq', $pages) || in_array('News', $pages) || in_array('Message', $pages) || in_array('Ip', $pages) || in_array('Mailtemplate', $pages) || in_array('Slider', $pages) || in_array('Promotion', $pages) || in_array('Sendnewsletter', $pages) || in_array('Checkip', $pages) || in_array('Loghistory', $pages) ) { ?>
<li class="dropdown mega-menu mega-menu-wide">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-droplets position-left"></i> <?php echo lang('language_lang.menu_extra');?> <span class="caret"></span></a>
<div class="dropdown-menu dropdown-content">
<div class="dropdown-content-body">
<div class="row">
<?php if( in_array('Cms', $pages) || in_array('Faq', $pages) || in_array('News', $pages) || in_array('Message', $pages) || in_array('Ip', $pages) ) { ?>
<div class="col-md-3">
<span class="menu-heading underlined"><?php echo lang('language_lang.menu_page_content');?></span>
<ul class="menu-list">
<?php if( in_array('Cms', $pages) ) { ?><li><a href="<?=site_url('admin/cms');?>"><i class="icon-stack2"></i> <?php echo lang('language_lang.menu_cms_page');?></a> </li><?php } ?>
<?php if( in_array('Faq', $pages) ) { ?><li><a href="<?=site_url('admin/faq');?>"><i class="icon-question4"></i> <?php echo lang('language_lang.menu_faq_page');?></a> </li><?php } ?>
<?php if( in_array('News', $pages) ) { ?><li><a href="<?=site_url('admin/news');?>"><i class="icon-newspaper"></i> <?php echo lang('language_lang.menu_news_page');?></a> </li><?php } ?>
<?php if( in_array('Message', $pages) ) { ?><li><a href="<?=site_url('admin/message');?>"><i class="icon-envelop5"></i> <?php echo lang('language_lang.menu_msg_page');?></a> </li><?php } ?>
<?php if( in_array('Ip', $pages) ) { ?><li><a href="<?=site_url('admin/ip');?>"><i class="icon-envelop4"></i> <?php echo lang('language_lang.menu_block_ip');?></a> </li><?php } ?>
</ul>
</div>
<?php } ?>

<?php if( in_array('Mailtemplate', $pages) || in_array('Slider', $pages) || in_array('Promotion', $pages) || in_array('Sendnewsletter', $pages) || in_array('Checkip', $pages) ) { ?>
<div class="col-md-3">
<span class="menu-heading underlined"><?php echo lang('language_lang.menu_page_notification');?></span>
<ul class="menu-list">
<?php if( in_array('Mailtemplate', $pages) ) { ?><li><a href="<?=site_url('admin/mailtemplate');?>"><i class="icon-mail5"></i> <?php echo lang('language_lang.menu_mail_template');?></a> </li><?php } ?>
<?php if( in_array('Slider', $pages) ) { ?><li><a href="<?=site_url('admin/slider');?>"><i class="icon-images3"></i> <?php echo lang('language_lang.menu_slider');?></a> </li><?php } ?>
<?php if( in_array('Sendnewsletter', $pages) ) { ?><li><a href="<?=site_url('admin/sendnewsletter');?>"><i class="icon-newspaper2"></i> <?php echo lang('language_lang.sendnews_menu_lbl');?></a> </li><?php } ?>
<?php if( in_array('Checkip', $pages) ) { ?><li><a href="<?=site_url('admin/checkip');?>"><i class="icon-envelop3"></i> <?php echo lang('language_lang.checkip_lbl');?></a> </li><?php } ?>
</ul>
</div>
<?php } ?>

<?php if( in_array('Loghistory', $pages) ) { ?>
<div class="col-md-3">
<span class="menu-heading underlined"><?php echo lang('language_lang.menu_transaction_history');?></span>
<ul class="menu-list">
<?php if( in_array('Loghistory', $pages) ) { ?><li><a href="<?=site_url('admin/loghistory');?>"><i class="icon-people"></i> <?php echo lang('language_lang.adminhistory_log');?></a> </li><?php } ?>
</ul>
</div>
<?php } ?>
</div>
</div>
</div>
</li>
<?php } ?>

<?php if( in_array('Users', $pages) ) { ?>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="icon-users4 position-left"></i> <?php echo lang('language_lang.menu_user');?> <span class="caret"></span>
</a>
<ul class="dropdown-menu width-250">
<?php 
 if($user_group=='0' || $user_group=='1')
 {
?>
<li><a href="<?=site_url('admin/users');?>"><i class="icon-users position-left"></i> Group Users - A </a></li>
<?php 
}
?>
<?php 
 if($user_group=='0' || $user_group=='2')
 {
?>
<li><a href="<?=site_url('admin/newusers');?>"><i class="icon-users position-left"></i> Group Users -B </a></li>
<?php 
}
?>
<li><a href="<?=site_url('admin/bot/activate-list');?>"><i class="icon-users position-left"></i> Bot Activation</a></li>
<?php
$this->db = db_connect();
$resu=$this->db->query("select * from site_controls where site_id='390'");
$das=$resu->getResult();
if($das[0]->site_value=='on')
{
?>
<!--<li><a href="<?=site_url('admin/users/pending');?>"><i class="icon-users position-left"></i> <?php echo lang('language_lang.menu_user1');?></a></li>-->
<?php
}
?>

<!-- <li><a href="<?=site_url('admin/users/add');?>"><i class="icon-user-plus position-left"></i> <?php echo lang('language_lang.menu_new_user');?></a></li> -->
<!--<li><a href="<?=site_url('admin/users/pending_activation');?>"><i class="icon-user-plus position-left"></i> <?php echo "Pending Activation";?></a></li>-->
</ul>
</li>
<?php } ?>

<?php if( in_array('Finance/deposit', $pages) || in_array('Finance/bonus', $pages) || in_array('Finance/trade', $pages) || in_array('Finance/penalty', $pages) || in_array('Finance/fundtransfer', $pages) || in_array('Finance/pendingpayouts', $pages) || in_array('Finance/depositpay', $pages) || in_array('Finance/declinedeposit', $pages) || in_array('Finance/pendingdeposit', $pages) || in_array('Finance/listing', $pages) || in_array('Finance/market', $pages) || in_array('History/deposit', $pages) || in_array('History/expiredeposit', $pages) || in_array('History/payouts', $pages) || in_array('History/fundtransfer', $pages) || in_array('History/bonus', $pages) || in_array('History/earnings', $pages) || in_array('History/adminearnings', $pages) || in_array('Reports/deposit', $pages) || in_array('Reports/payouts', $pages) || in_array('Reports/fundtransfer', $pages) || in_array('Reports/bonus', $pages) || in_array('Reports/earnings', $pages) || in_array('Reports/adminearnings', $pages) || in_array('Reports/referralearnings', $pages) || in_array('History/exchange', $pages) || in_array('History/exchanges', $pages) || in_array('Reports/token', $pages) || in_array('Reports/exchange', $pages)) { ?>
<li class="dropdown mega-menu mega-menu-wide">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-puzzle4 position-left"></i> <?php echo lang('language_lang.menu_transaction');?> <span class="caret"></span></a>

<div class="dropdown-menu dropdown-content">
<div class="dropdown-content-body">
<div class="row">
<?php if( in_array('Finance/deposit', $pages) || in_array('Finance/bonus', $pages) || in_array('Finance/penalty', $pages) || in_array('Finance/fundtransfer', $pages) || in_array('Finance/pendingpayouts', $pages) || in_array('Finance/depositpay', $pages) || in_array('Finance/pendingdeposit', $pages) || in_array('Finance/declinedeposit', $pages) || in_array('Finance/trade', $pages) ) { ?>
<div class="col-md-3">
<span class="menu-heading underlined"><?php echo lang('language_lang.menu_finance');?></span>
<ul class="menu-list">

<?php if( in_array('Finance/bonus', $pages) ) { ?><li><a href="<?php echo site_url('admin/finance/bonus');?>"><i class="icon-grid"></i> <?php echo lang('language_lang.menu_send_bonus');?></a></li><?php } ?>
<?php if( in_array('Finance/penalty', $pages) ) { ?><li><a href="<?php echo site_url('admin/finance/penalty');?>"><i class="icon-grid"></i> <?php echo lang('language_lang.menu_send_penality');?></a></li><?php } ?>
<?php if( in_array('Finance/pendingpayouts', $pages) ) { ?><li><a href="<?php echo site_url('admin/finance/pendingdeposit');?>"><i class="icon-grid"></i> Pending Deposit</a></li><?php } ?>
<?php if( in_array('Finance/pendingpayouts', $pages) ) { ?><li><a href="<?php echo site_url('admin/finance/pendingwithdraw');?>"><i class="icon-grid"></i> Pending withdraw Request </a></li><?php } ?> 
</ul>
</div>

<!-- <div class="col-md-3">
<span class="menu-heading underlined"><br></span>
<ul class="menu-list">-->
<!--<?php if( in_array('Finance/trade', $pages)) {?><li><a href="<?php echo site_url('admin/finance/trade');?>"><i class="icon-grid"></i> <?php echo lang('language_lang.menu_trade');?></a></li><?php } ?>
<?php if( in_array('Finance/arbit', $pages)) {?><li><a href="<?php echo site_url('admin/finance/arbit');?>"><i class="icon-grid"></i> <?php echo lang('language_lang.menu_ex_aclist1');?></a></li><?php } ?>-->

<!--<li><a href="<?php echo site_url('admin/finance/buybacklist');?>"><i class="icon-grid"></i> <?php echo lang('language_lang.lbl_buylist');?></a></li>-->

<!--</ul>
</div>  -->




<?php } ?>
<?php if( in_array('History/deposit', $pages) || in_array('History/expiredeposit', $pages) || in_array('History/payouts', $pages) || in_array('History/fundtransfer', $pages) || in_array('History/bonus', $pages) || in_array('History/earnings', $pages) || in_array('History/adminearnings', $pages) || in_array('History/exchange', $pages) || in_array('History/exchanges', $pages) || in_array('History/token', $pages) ) { ?>
<div class="col-md-3">
<span class="menu-heading underlined"><?php echo lang('language_lang.menu_transaction_history');?></span>
<ul class="menu-list">
<li><a href="<?php echo site_url('admin/history/deposit');?>"><i class="icon-transmission"></i> <?php echo "Deposit";?></a></li>
<li><a href="<?php echo site_url('admin/history/transfer');?>"><i class="icon-transmission"></i> <?php echo "Transfer";?></a></li>
<?php if( in_array('History/payouts', $pages) ) { ?><li><a href="<?php echo site_url('admin/history/payouts');?>"><i class="icon-transmission"></i> <?php echo lang('language_lang.menu_payouts');?></a></li><?php } ?>


<?php if( in_array('History/bonus', $pages) ) { ?><li><a href="<?php echo site_url('admin/history/bonus');?>"><i class="icon-grid"></i> <?php echo lang('language_lang.menu_bonus_referal');?></a></li><?php } ?>

<?php if( in_array('History/earnings', $pages) ) { ?><li><a href="<?php echo site_url('admin/history/earnings');?>"><i class="icon-grid"></i> <?php echo lang('language_lang.menu_earnings');?></a></li><?php } ?>

<?php if( in_array('History/adminearnings', $pages) ) { ?><li><a href="<?php echo site_url('admin/history/adminearnings');?>"><i class="icon-grid"></i> <?php echo lang('language_lang.menu_admin_earnings');?></a></li><?php } ?>

</ul>
</div>
<?php } ?>
<?php if( in_array('Reports/deposit', $pages) || in_array('Reports/payouts', $pages) || in_array('Reports/fundtransfer', $pages) || in_array('Reports/bonus', $pages) || in_array('Reports/earnings', $pages) || in_array('Reports/adminearnings', $pages) || in_array('Reports/referralearnings', $pages) || in_array('Reports/token', $pages) || in_array('Reports/exchange', $pages) ) { ?>
<div class="col-md-3">
<span class="menu-heading underlined"><?php echo lang('language_lang.menu_reports');?></span>
<ul class="menu-list">
<?php if( in_array('Reports/deposit', $pages) ) { ?><li><a href="<?php echo site_url('admin/reports/deposits');?>"><i class="icon-grid"></i> <?php echo lang('language_lang.menu_deposit');?></a></li><?php } ?>
<?php if( in_array('Reports/fundtransfer', $pages) ) { ?><li><a href="<?php echo site_url('admin/reports/transfers');?>"><i class="icon-grid"></i> <?php echo lang('language_lang.menu_transfer');?></a></li><?php } ?>

<?php if( in_array('Reports/payouts', $pages) ) { ?><li><a href="<?php echo site_url('admin/reports/payouts');?>"><i class="icon-transmission"></i> <?php echo lang('language_lang.menu_payouts');?></a></li><?php } ?>
<?php if( in_array('Reports/bonus', $pages) ) { ?><li><a href="<?php echo site_url('admin/reports/bonus');?>"><i class="icon-grid"></i> <?php echo lang('language_lang.menu_bonus_referal');?></a></li><?php } ?>


<?php if( in_array('Reports/earnings', $pages) ) { ?><li><a href="<?php echo site_url('admin/reports/earnings');?>"><i class="icon-grid"></i> <?php echo lang('language_lang.menu_earnings');?></a></li><?php } ?>
<?php if( in_array('Reports/adminearnings', $pages) ) { ?><li><a href="<?php echo site_url('admin/reports/adminearnings');?>"><i class="icon-grid"></i> <?php echo lang('language_lang.menu_admin_earnings');?></a></li><?php } ?>

<?php if( in_array('Reports/referralearnings', $pages) ) { ?><li><a href="<?php echo site_url('admin/reports/referralearnings');?>"><i class="icon-grid"></i> <?php echo lang('language_lang.menu_referral_earnings');?></a></li><?php } ?>
</ul>
</div>
<?php } ?>

</div>
</div>
</div>
</li>
<?php } ?>

<?php if( in_array('Support', $pages) || in_array('Backup', $pages) ) { ?>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="icon-envelop5 position-left"></i> <?php echo lang('language_lang.support_lbl');?> <span class="caret"></span>
</a>
<ul class="dropdown-menu width-250">
<?php if(in_array('Support', $pages)) { ?><li><a href="<?php echo site_url('admin/support');?>"><i class="icon-mail-read position-left"></i> <?php echo lang('language_lang.ticket_lbl_view');?></a></li><?php } ?>
<?php if(in_array('Backup', $pages)) { ?><li><a href="<?php echo site_url('admin/backup');?>"><i class="icon-mail-read position-left"></i> <?php echo lang('language_lang.menu_restore_backup');?></a></li><?php } ?>
</ul>
</li>
<?php } ?>

<?php if(in_array('Subadmin', $pages)) { ?>
<li class="dropdown">
<a href="<?php echo site_url('#');?>" class="dropdown-toggle" data-toggle="dropdown">
<i class="icon-users2 position-left"></i> <?php echo lang('language_lang.subadminhistory_log');?> <span class="caret"></span>
</a>
<ul class="dropdown-menu width-250">
<li><a href="<?php echo site_url('admin/subadmin');?>"><i class="icon-users4 position-left"></i> <?php echo lang('language_lang.subadminhistory_log');?></a></li>
</ul>
</li>
<?php } ?>
</ul>

</div>
</div>
<!-- /second navbar -->