<?php require_once('../auth/auth.php');
$sundry_debitor_id=mysqli_fetch_assoc(mysqli_query($conn,"SELECT ac_g_catid FROM ac_sub_g_category WHERE  coid='$coid' AND g_type='su-deb' LIMIT 1 "))['ac_g_catid'];
$sundry_creditor_id=mysqli_fetch_assoc(mysqli_query($conn,"SELECT ac_g_catid FROM ac_sub_g_category WHERE   coid='$coid' AND g_type='su-cre' LIMIT 1 "))['ac_g_catid'];
 ?>
<section class="content pt-1">
   <div class="container-fluid">
      <div class="row">
         <div class="col-md-2">
            <div class="card card-primary card-outline direct-chat direct-chat-primary shadow-none" style="border-left:1px solid #969c9d;border-right:1px solid #969c9d;border-bottom:1px solid #969c9d;">
               <div class="card-header" style="padding: 0.2rem 0.3rem;">
                  <h3 class="card-title"> <?php echo language(10);?> </h3>
                  <div class="card-tools">
                     <span id="sdf"></span>
                     <button type="button" class="btn btn-tool" data-card-widget="remove">
                     <i class="fas fa-times"></i>
                     </button>
                  </div>
               </div>
               <div class="cscroll" style="max-height: 450px;">
                  <div class="card">
                      <div class="card-header" style="padding: 0.2rem 0.3rem;background:#dfdfdf;">
                           <h3 class="card-title"   
                              > <i class="fa fa-line-chart"> </i>  <?php echo language(219);?></h3>
                           <div class="card-tools">
                              <button type="button" class="btn btn-tool" data-card-widget="collapse">
                              <i class="fas fa-minus"></i>
                              </button>
                           </div>
                      </div>
                      <div class="card-body p-0">
                        <ul class="nav nav-pills flex-column">
                           <?php if(per('rep_profit')==1){ ?>
                           <li class="nav-item" title="profit">
                              <a href="#" class="nav-link navpad" onclick="pagecall('../display_report/profit_loss_search.php','#rptview');">
                              <i class="fas fa-inbox"></i> <?php echo language(181);?>
                              </a>
                           </li>
                           <?php } if(per('rep_trail')==1){ ?>
                           <li class="nav-item" title="trail">
                              <a href="#" class="nav-link navpad" onclick="pagecall('../display_report/trail_balance_search.php','#rptview');">
                              <i class="far fa-envelope"></i> <?php echo language(182);?>
                              </a>
                           </li>
                           <?php } if(per('rep_group')==1){ ?>
                           <li class="nav-item" title="group">
                             <a href="#" class="nav-link navpad" onclick="pagecall('../display_report/group_ledger.php','#rptview');">
                              <i class="far fa-file-alt"></i> <?php echo language(183);?>
                              </a>
                           </li>
                           <?php } if(per('rep_b_shit')==1){ ?>
                           <li class="nav-item" title="balance Sheet">
                              <a href="#" class="nav-link navpad" onclick="pagecall('../display_report/balance_sheet_search.php','#rptview');">
                              <i class="fas fa-filter"></i> <?php echo language(184);?>
                              </a>
                           </li>
                           <?php } ?>
                           <?php if(per('rep_d_book')==1){ ?>
                           <li class="nav-item" title="Day Book">
                              <a href="#" class="nav-link navpad" onclick="pagecall('../display_report/day_book_search.php','#rptview');">
                              <i class="fas fa-filter"></i>  <?php echo language(27);?>
                              </a>
                           </li>
                           <?php } ?>
                           <?php if(per('rep_c_flow')==1){ ?>
                           <li class="nav-item" title="CashFlow">
                              <a href="#" class="nav-link navpad" onclick="pagecall('../display_report/balance_sheet_search.php','#rptview');">
                              <i class="far fa-file-alt"></i>  <?php echo language(188);?>
                              </a>
                           </li>
                           <?php } ?>
                        </ul>
                      </div>
                    </div>
                  <hr class="m-0">
                  <div class="card">
                     <div class="card-header" style="padding: 0.2rem 0.3rem;background:#dfdfdf;">
                        <h3 class="card-title" data-card-widget="collapse"> <i class="fas fa-pie-chart"></i> <?php echo language(9);?></h3>
                        <div class="card-tools">
                           <button type="button" class="btn btn-tool" data-card-widget="collapse">
                           <i class="fas fa-minus"></i>
                           </button>
                        </div>
                     </div>
                     <div class="card-body p-0">
                        <ul class="nav nav-pills flex-column">
                           <?php if(per('erep_purchase')==1){ ?>
                           <li class="nav-item active">
                              <a href="#" class="nav-link navpad" onclick="pagecall('../display_report/purchase_register.php?itype=EPUR','#rptview');">
                              <i class="fas fa-inbox"></i> <?php echo language(185);?>
                              </a>
                           </li>
                           <?php } if(per('erep_item_pur')==1){ ?>
                           <li class="nav-item active">
                              <a href="#" class="nav-link navpad" onclick="pagecall('../display_report/item_purchase_register.php','#rptview');">
                              <i class="fas fa-inbox"></i> <?php echo language(313);?>
                              </a>
                           </li> 

                           <?php } if(per('erep_sales')==1){ ?>
                           <li class="nav-item">
                              <a href="#" title="sales" class="nav-link navpad" onclick="pagecall('../display_report/sales_register.php','#rptview');">
                              <i class="far fa-envelope"></i>  <?php echo language(186);?>
                              </a>
                           </li>
                         <?php } if(per('erep_item_sales')==1){ ?>
                           <li class="nav-item">
                              <a href="#" title="sales" class="nav-link navpad" onclick="pagecall('../display_report/item_sales_register.php','#rptview');">
                              <i class="far fa-envelope"></i> <?php echo language(316);?>
                              </a>
                           </li>
                         <?php } if(per('bw_profit')==1){ ?>
                           <li class="nav-item">
                              <a href="#" title="bill wise profite" class="nav-link navpad" onclick="pagecall('../display_report/sales_register.php?bw_profit=profit','#rptview');">
                              <i class="far fa-envelope"></i>  <?php echo language(314);?> 
                              </a>
                           </li>
                        <?php  } if(per('cus_item_wise_profit')==1){ ?>

                        <li class="nav-item">
                              <a href="#" title="bill wise profite" class="nav-link navpad" onclick="pagecall('../display_report/cus_item_wise_profit.php?bw_profit=profit','#rptview');">
                              <i class="far fa-envelope"></i>  <?php echo language(335);?> 
                              </a>
                        </li>
                  
                           <?php } if(per('rep_i_summary')==1){ ?>
                           <li class="nav-item">
                              <a href="#" class="nav-link navpad" onclick="pagecall('../display_report/item_summary_index.php','#rptview');">
                              <i class="far fa-file-alt"></i>  <?php echo language(187);?> 
                              </a>
                           </li>
                            <?php } if(per('rep_i_tar_aciv')==1){ ?>
                           
                          
                           <li class="nav-item" title="Item Target Vs Achievement">
                                 <a href="#" class="nav-link navpad" onclick="pagecall('../display_report/item_tar_vs_achiv_live.php','#rptview');">
                                    <i class="fa-solid fa-award"></i> <?php echo language(424);?>
                                 </a>
                              </li>
                              
                              
                           <?php } if(per('rep_i_tranfer')==1){ ?>
                           <li class="nav-item" title="Stock Tranfer">
                              <a href="#" class="nav-link navpad">
                              <i class="fas fa-filter"></i>  <?php echo language(180);?>
                              </a>
                           </li>
                           <?php } ?>
                           
                            <li class="nav-item" title="Serial Tracking ">
                              <a href="#" class="nav-link navpad" onclick="pagecall('../display_report/imei_tracking_index.php','#rptview');">
                              <i class="fas fa-barcode"></i>  <?php echo language(386);?>
                              </a>
                           </li>
                        </ul>
                     </div>
                  </div>
                  <hr class="m-0">
                  <div class="card" id="Payroll">
                     <div class="card-header" style="padding: 0.2rem 0.3rem;background:#dfdfdf;">
                        <h3 class="card-title" data-card-widget="collapse"> <i class="fa fa-balance"></i> Payroll</h3>
                        <div class="card-tools">
                           <button type="button" class="btn btn-tool" data-card-widget="collapse">
                           <i class="fas fa-plus"></i>
                           </button>
                        </div>
                     </div>
                     <div class="card-body p-0" style="display:none;">
                        <ul class="nav nav-pills flex-column">
                           <?php if(per('rep_payroll')==1){ ?>
                           <li class="nav-item active" title="Payroll">
                              <a href="#" class="nav-link navpad">
                              <i class="fas fa-inbox"></i> <?php echo language(177);?>
                              </a>
                           </li>
                           <?php } if(per('rep_atten')==1){ ?>
                           <li class="nav-item" title="attendence">
                              <a href="#" title="sales" class="nav-link navpad">
                              <i class="far fa-envelope"></i>  <?php echo language(179);?>
                              </a>
                           </li>
                           <?php } ?>
                        </ul>
                     </div>
                  </div>
                  <hr class="m-0">
                  <div class="card">
                     <div class="card-header" style="padding: 0.2rem 0.3rem;background:#dfdfdf;">
                        <h3 class="card-title" data-card-widget="collapse"> <i class="fas fa-user-group"></i> <?php echo language(310);?> </h3>
                        <div class="card-tools">
                           <button type="button" class="btn btn-tool" data-card-widget="collapse">
                           <i class="fas fa-minus"></i>
                           </button>
                        </div>
                     </div>
                    <div class="card-body p-0">
                        <ul class="nav nav-pills flex-column">
                           <?php if(per('rep_cus')==1){ ?>
                           <li class="nav-item active" title="Customer" onclick="pagecall('../customer/receivable_list.php?ac_type='+'su-deb'+'&debitor_id=<?php echo $sundry_debitor_id ?>','#rptview');">
                              <a href="#" class="nav-link navpad" >
                              <i class="fas fa-inbox"></i>  <?php echo language(189);?> 
                              </a>
                           </li>
                           
                           <?php } if(per('rep_ins')==1){ ?>
                           <li class="nav-item active" title="installment" onclick="pagecall('../display_report/installment_search.php','#rptview');">
                              <a href="#" class="nav-link navpad" >
                              <i class="fas fa-inbox"></i>  <?php echo language(359);?> 
                              </a>
                           </li>

                          
                           <?php } if(per('rep_supp')==1){ ?>
                           <li class="nav-item" title="Supplier">
                              <a href="#" title="sales" class="nav-link navpad" onclick="pagecall('../supplier/payable_list.php?ac_type='+'su-cre'+'&creditor_id=<?php echo $sundry_creditor_id ?>','#rptview');">
                              <i class="far fa-envelope"></i> <?php echo language(190);?>
                              </a>
                           </li>
                           
                            <?php } if(per('rep_cus_tar_aciv')==1){ ?>
                              <li class="nav-item" title="Accounts Target Vs Achievement">
                                 <a href="#" title="sales" class="nav-link navpad" onclick="pagecall('../display_report/none_transction_live.php?ac_type='+'su-deb'+'&debitor_id=<?php echo $sundry_debitor_id ?>','#rptview');">
                                    <i class="fa-solid fa-shield-halved"></i> <?php echo language(425);?>
                                 </a>
                              </li>
                           
                             <?php } if(per('rep_supp')==1){ ?>
                            <li class="nav-item" title="Best Customer">
                              <a href="#" title="sales" class="nav-link navpad" onclick="pagecall('../display_report/best_customer_search.php?ac_type='+'su-deb'+'&debitor_id=<?php echo $sundry_debitor_id ?>','#rptview');">
                              <i class="far fa-user"></i> <?php echo language(397);?>
                              </a>
                           </li>


                  


                           <?php } ?>
                        </ul>
                     </div>
                  </div>
               </div>
            </div>
         </div>
         <div class="col-md-10" id="rptview"></div>
      </div>
   </div>
</section>
<script>
   $('#Payroll').CardWidget('toggle');
</script>