Editando: equipment_stock.php
<?php $page='Matrial Stock'; $page_icon=""; $equipment_stock="active"; include("check.php"); include 'header.php'; $pid=@$_REQUEST['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">Material Stock List</h3> <div class="btn-group pull-right"> <a href="equipment_add.php" class="btn btn-primary"><i class="fa fa-plus"></i> Add Material</a> </div> <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 ="$('#project_list').tableExport({type: 'excel', escape: 'false'});"><img src='img/icons/xls.png' width="24"/> XLS</a></li> </ul> </div> </div> <div class="panel-body"> <table id="material_inword_reports" class="table datatable table-bordered table-hover"> <thead> <tr> <th class="text-center">#</th> <th>Material Name</th> <th class="text-center">Inward</th> <th class="text-center">Outward</th> <th class="text-center">Stock</th> <th class="text-center hidden_button">Action</th> </tr> </thead> <tbody> <?php $i = 1; $total = 0; $grand_in_total = 0; $grand_out_total = 0; $select = mysql_query("SELECT * FROM machinery_list ORDER BY name ASC"); while ($row = mysql_fetch_array($select)) { $grand_qty = 0; $grand_qty_inward = 0; $grand_qty_outword = 0; $machi_id = $row['machi_id']; $select_ac = mysql_query("select * from machinary_stock where pid='$pid' and machi_id='$machi_id' ORDER BY cdate ASC"); while ($row1 = mysql_fetch_array($select_ac)) { if ($row1['status'] == "Credit") { $grand_qty = $grand_qty + $row1['qty']; $grand_qty_inward = $grand_qty_inward + $row1['qty']; } else { $grand_qty = $grand_qty - $row1['qty']; $grand_qty_outword = $grand_qty_outword + $row1['qty']; } } ?> <tr id="baccount<?php echo $row['machi_id']; ?>"> <td class="text-center"><?php echo $i; ?></td> <td> <?php echo $row['name']; ?> </td> <td class="text-center" style="font-weight: bold"><?php echo $grand_qty_inward; $grand_in_total = $grand_in_total + $grand_qty_inward; ?></td> <td class="text-center" style="font-weight: bold"><?php echo $grand_qty_outword; $grand_out_total = $grand_out_total + $grand_qty_outword; ?></td> <td class="text-center" style="font-weight: bold"><?php echo $grand_qty; ?></td> <td class="text-center hidden_button"> <a href='equipment_ledger.php?id=<?php echo $row['machi_id']; ?>&pid=<?php echo $pid; ?>' class="label label-primary "><span class="fa fa-eye"></span></a> </td> </tr> <?php $i++; } ?> </tbody> <tbody> <tr style="background-color: #000; color: #fff"> <th class="text-center" colspan="2">Total</th> <th class="text-center"><?php echo $grand_in_total; ?></th> <th class="text-center"><?php echo $grand_out_total; ?></th> <th class="text-center"><?php echo $grand_in_total - $grand_out_total; ?></th> <th class="text-center hidden_button"></th> </tr> </tbody> </table> </div> </div> <!-- END DEFAULT DATATABLE --> </div> </div> </div> <!-- PAGE CONTENT WRAPPER --> <?php include 'footer.php'; ?>
Cancelar
Kerym Chaeceran