Editando: monthly_amount_report.php
<?php $page = 'Monthly Transaction Reports'; $page_icon = ""; $account = "active"; include("check.php"); include 'header.php'; $month=@$_REQUEST['month']; $id=@$_REQUEST['id']; $project_id=@$_REQUEST['project_id']; $id=@$_REQUEST['id']; $sid=@$_REQUEST['sid']; $spid=@$_REQUEST['spid']; $other_id=@$_REQUEST['other_id']; $project_id=@$_REQUEST['project_id']; ?> <!-- PAGE CONTENT WRAPPER --> <div class="page-content-wrap"> <div class="row"> <div class="col-md-12"> <!-- START DEFAULT DATATABLE --> <div class="panel panel-colorful"> <div class="panel-heading ui-draggable-handle modal-header"> <h3 class="panel-title"> <a href="javascript:void(0)" onclick="history.back(-1)" class="btn btn-primary" style="background-color: #000; color: #fff;"> <span class="fa fa-arrow-left"></span> </a> Monthly Transaction Reports</h3> <!-- <div class="pull-right"> <a href="javascript:void(0)" data-toggle="modal" data-target="#modal_addaccountform" class="btn btn-primary"><i class="fa fa-plus"></i> Add Account</a> </div>--> <!-- <ul class="panel-controls" style="margin-right: 5px;"> <li><a href="javascript:void(0);" class="panel-refresh"><span class="fa fa-refresh"></span></a></li> </ul>--> <div class="btn-group pull-right"> <button class="btn btn-danger dropdown-toggle" data-toggle="dropdown"><i class="fa fa-bars"></i> Export Data</button> <ul class="dropdown-menu"> <!-- <li><a href="#" onClick ="$('#emp_account').tableExport({type: 'json', escape: 'false'});"><img src='img/icons/json.png' width="24"/> JSON</a></li> <li><a href="#" onClick ="$('#emp_account').tableExport({type: 'json', escape: 'false', ignoreColumn: '[2,3]'});"><img src='img/icons/json.png' width="24"/> JSON (ignoreColumn)</a></li> <li><a href="#" onClick ="$('#emp_account').tableExport({type: 'json', escape: 'true'});"><img src='img/icons/json.png' width="24"/> JSON (with Escape)</a></li> <li class="divider"></li>--> <!-- <li><a href="#" onClick ="$('#emp_account').tableExport({type: 'xml', escape: 'false'});"><img src='img/icons/xml.png' width="24"/> XML</a></li> <li><a href="#" onClick ="$('#emp_account').tableExport({type: 'sql'});"><img src='img/icons/sql.png' width="24"/> SQL</a></li> <li class="divider"></li>--> <li><a href="#" onClick ="$('#all_tra_reports').tableExport({type: 'csv', escape: 'false'});"><img src='img/icons/csv.png' width="24"/> CSV</a></li> <li><a href="#" onClick ="$('#all_tra_reports').tableExport({type: 'txt', escape: 'false'});"><img src='img/icons/txt.png' width="24"/> TXT</a></li> <li class="divider"></li> <li><a href="#" onClick ="$('#all_tra_reports').tableExport({type: 'excel', escape: 'false'});"><img src='img/icons/xls.png' width="24"/> XLS</a></li> <li><a href="#" onClick ="$('#all_tra_reports').tableExport({type: 'doc', escape: 'false'});"><img src='img/icons/word.png' width="24"/> Word</a></li> <!--<li><a href="#" onClick ="$('#emp_account').tableExport({type: 'powerpoint', escape: 'false'});"><img src='img/icons/ppt.png' width="24"/> PowerPoint</a></li>--> <li class="divider"></li> <li><a href="#" onClick ="$('#all_tra_reports').tableExport({type: 'png', escape: 'false'});"><img src='img/icons/png.png' width="24"/> PNG</a></li> <!--<li><a href="#" onClick ="$('#emp_account').tableExport({type: 'pdf', escape: 'false'});"><img src='img/icons/pdf.png' width="24"/> PDF</a></li>--> </ul> </div> </div> <div class="panel-body"> <table id="all_tra_reports" class="table datatable table-hover table-striped"> <thead> <tr> <th style="width: 30px;">#</th> <th style="width: 90px">Date</th> <th>Project Name</th> <th>Employee / Supplier / Sub Cont.</th> <th>Notes</th> <th>Payment Method</th> <th style="width:90px">Debit Amount</th> <th style="width: 90px">Credit Amount</th> <th style="width: 90px">Balance</th> </tr> </thead> <tbody> <?php $i = 1; // $result = mysql_query("select c.name as c_name, s.name as s_name, p.* FROM product_master as p LEFT JOIN category as c ON p.cat_id = c.cat_id LEFT JOIN sub_category as s ON c.cat_id = s.cat_id where (p.name LIKE '$search%') or (c.name LIKE '$search%') ORDER BY p.pid DESC"); $total = 0; if($id!=NULL) { if($project_id==0) { $select_ac = mysql_query("select sp.name as spname,e.emp_sub_conta as echeck,p.name as pname,e.name as ename,a.payment_date as date, a.* from co_accounts as a LEFT JOIN project as p ON a.pid=p.pid LEFT JOIN employees as e ON a.eid= e.eid LEFT JOIN supplier as sp ON a.supplier_id=sp.supplier_id where `payment_date` LIKE '$month%' and e.eid='$id'"); }else{ $select_ac = mysql_query("select sp.name as spname,e.emp_sub_conta as echeck,p.name as pname,e.name as ename,a.payment_date as date, a.* from co_accounts as a LEFT JOIN project as p ON a.pid=p.pid LEFT JOIN employees as e ON a.eid= e.eid LEFT JOIN supplier as sp ON a.supplier_id=sp.supplier_id where `payment_date` LIKE '$month%' and e.eid='$id' and a.pid='$project_id'"); } } if($sid!=NULL) { if($project_id==0) { $select_ac = mysql_query("select a.*,a.transition_date as date,a.p_mode as p_method,e.name as ename,p.name as pname from emp_personal_account as a LEFT JOIN project as p ON a.pid=p.pid LEFT JOIN employees as e ON a.eid= e.eid where e.eid='$sid' and `transition_date` like '$month%'"); } else { $select_ac = mysql_query("select a.*,a.transition_date as date,a.p_mode as p_method,e.name as ename,p.name as pname from emp_personal_account as a LEFT JOIN project as p ON a.pid=p.pid LEFT JOIN employees as e ON a.eid= e.eid where e.eid='$sid' and `transition_date` like '$month%' and a.pid='$project_id'"); } } if($spid!=NULL) { if($project_id==0) { $select_ac = mysql_query("select sp.name as spname,p.name as pname,e.name as ename,a.payment_date as date,a.status as status a.* from co_accounts as a LEFT JOIN project as p ON a.pid=p.pid LEFT JOIN employees as e ON a.eid= e.eid LEFT JOIN supplier as sp ON a.supplier_id=sp.supplier_id where a.supplier_id='$spid' and a.status='Debit' and a.payment_date LIKE '$month%'"); }else { $select_ac = mysql_query("select sp.name as spname,p.name as pname,e.name as ename,a.payment_date as date,a.status as status a.* from co_accounts as a LEFT JOIN project as p ON a.pid=p.pid LEFT JOIN employees as e ON a.eid= e.eid LEFT JOIN supplier as sp ON a.supplier_id=sp.supplier_id where a.supplier_id='$spid' and a.status='Debit' and a.payment_date LIKE '$month%' and a.pid='$project_id'"); } } if($other_id!=NULL) { if($project_id==0) { $select_ac = mysql_query("select *,a.payment_date as date, e.name as ename,e.emp_sub_conta as echeck,p.name as pname from emp_accounts as a join project as p ON a.pid=p.pid LEFT JOIN employees as e ON a.eid= e.eid where a.title_material='$other_id' and a.status='Debit' and payment_date LIKE '$month%'"); } else { $select_ac = mysql_query("select *,a.payment_date as date, e.name as ename,e.emp_sub_conta as echeck,p.name as pname from emp_accounts as a join project as p ON a.pid=p.pid LEFT JOIN employees as e ON a.eid= e.eid where a.title_material='$other_id' and a.status='Debit' and payment_date LIKE '$month%' and a.pid='$project_id'"); } } while ($row = mysql_fetch_array($select_ac)) { ?> <tr id="baccount<?php echo $row['cid']; ?>"> <td><?php echo $i; ?></td> <td><?php echo $row['date']; ?></td> <td><?php echo $row['pname']; ?></td> <td><?php if ($spid!=NULL ) { echo 'Supplier Pay' . ' - ' . $row['spname']; } else { if ($other_id!=NULL) { echo 'Sub Cont' . ' - ' . $row['ename']; } if ($sid!=NULL) { echo 'Sub Cont' . ' - ' . $row['ename']; } else if ($row['echeck'] == "emp" && $id!=NULL) { echo 'Employee' . ' - ' . $row['ename']; } }; ?></td> <td><?php echo $row['narration']; ?></td> <td><?php echo $row['p_method']; ?></td> <?php if($id!=NULL){ if ($row['status'] == "Debit") { ?> <td><?php echo $row['amounts']; $total = $total - $row['amounts']; ?></td> <td>-</td> <?php } else { ?> <td>-</td> <td><?php echo $row['amounts']; $total = $total + $row['amounts']; ?></td> <?php } } else if($other_id!=NULL) { ?> <td><?php echo $row['amounts']; $total = $total + $row['amounts']; ?></td> <td>-</td> <?php } else { ?> <td><?php echo $row['amount']; $total = $total + $row['amount']; ?></td> <td>-</td> <?php } ?> <td><?php echo $total; ?></td> </tr> <?php $i++; } ?> </tbody> </table> </div> </div> <!-- END DEFAULT DATATABLE --> </div> </div> </div> <!-- PAGE CONTENT WRAPPER --> <!-- VIEW & EDIT PROJECT MODALS --> <?php include 'footer.php'; ?>
Cancelar
Kerym Chaeceran