Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $pop_no = null;
- $mon_popno = null;
- $nrows = count( $records );
- $KECIL = 0;
- $totalColumns = 20;
- // var_dump( $records );
- ?>
- <style>
- /*.datatable { width: 3000px;}*/
- .c_overflow { overflow-x: scroll;}
- .price-number { text-align: right; }
- .number-header { text-align: center; }
- .hidingrow { display: none; }
- .right { text-align: right; }
- .center { text-align: center; }
- .mytable thead tr th { vertical-align: top; }
- ::-webkit-scrollbar {
- width: 10px;
- height: 10px;
- -webkit-appearance: none;
- }
- ::-webkit-scrollbar-thumb {
- border-radius: 8px;
- background-color: rgba(0,0,0,.5);
- -webkit-box-shadow: 0 0 1px rgba(255,255,255,.5);
- }
- </style>
- <p>Record: <?php echo $nrows ?></p>
- <p class="hidingrow this-month"><?php echo date('F') ?></p>
- <table class="table datatable table-bordered table-hover mytable compact" cellspacing="0">
- <thead>
- <tr>
- <th width="20px">No</th>
- <th width="80px"><?php echo lang('label_date') ?></th>
- <th width="120px"><?php echo lang('label_sj_no') ?></th>
- <th width="100px"><?php echo lang('label_status') ?></th>
- <th width="70px"><?php echo lang('Approve') ?></th>
- <th width="80px"><?php echo lang('label_itemno') ?></th>
- <th width="300px"><?php echo lang('label_itemname') ?></th>
- <th width="50px" class="right"><?php echo lang('label_qty') ?></th>
- <th width="70px"><?php echo lang('label_uom') ?></th>
- <th width="100px"><?php echo lang('DlvOrderNo') ?></th>
- <th width="100px"><?php echo lang('label_so_no') ?></th>
- <th width="300px"><?php echo lang('label_remark') ?></th>
- <!-- <th width="150px"><?php echo lang('label_date') ?></th> -->
- <th width="250px"><?php echo lang('Customer') ?></th>
- <th width="200px"><?php echo lang('Customer').' '.lang('Area') ?></th>
- <!-- <th width="150px"><?php echo lang('label_date') ?></th> -->
- <th width="150px"><?php echo lang('label_pengangkut') ?></th>
- <th width="150px"><?php echo lang('label_kontainer_no') ?></th>
- <th width="100px"><?php echo lang('label_kendaraan_no') ?></th>
- <th width="200px"><?php echo lang('label_warehouse') ?></th>
- <?php if( ISSET2_('is_viewmoney')): ?>
- <th width="200px" class="right"><?php echo lang('label_price') ?></th>
- <th width="200px" class="right"><?php echo lang('label_amount') ?></th>
- <?php endif; ?>
- </tr>
- </thead>
- <tbody>
- <?php $index = 1; ?>
- <?php $iiRow = 0; ?>
- <?php $prevref = ''; ?>
- <?php $grandtotal = 0; ?>
- <?php $totAmount = 0; ?>
- <?php
- if (ISSET2_('is_viewmoney')) {
- $totalColumns;
- } else {
- $totalColumns = $totalColumns - 2;
- }
- $wrapColumns = $totalColumns - 1;
- $wrapCol = '';
- for ($i=1; $i < $wrapColumns; $i++) {
- $wrapCol .= "<td class='hidingrow'></td>";
- }
- ?>
- <?php for( $iRow =0; $iRow < $nrows; $iRow++): ?>
- <?php $iiRow = $iRow ?>
- <!-- Handle subtotal -->
- <?php if( $mon_popno != $records[$iRow]->HNO_BUK AND $iRow > 0 and ISSET2_('is_viewmoney')): ?>
- <tr>
- <td colspan="<?php echo $wrapColumns ?>" style="background-color: #ccc;">
- <strong>Total</strong>
- </td>
- <?php echo $wrapCol; ?>
- <td class="right">
- <strong><?php echo number_format($totAmount); ?></strong>
- </td>
- </tr>
- <?php $mon_popno = $records[$iRow]->HNO_BUK; ?>
- <?php $totAmount = 0; ?>
- <?php else: ?>
- <?php $mon_popno = $records[$iRow]->HNO_BUK; ?>
- <?php endif; ?>
- <?php $amount = $records[$iRow]->Harga * $records[$iRow]->Qty; ?>
- <?php $totAmount += $amount; ?>
- <?php $grandtotal += $amount; ?>
- <?php $pop_no = ''; ?>
- <tr>
- <td><?php echo $index ?></td>
- <td><?php list($strdate, $void) = GROUP_VALUE(
- $records[$iRow]->HNO_BUK,
- $prevref,
- date('d-m-Y', strtotime($records[$iRow]->Tgl))
- );
- echo $strdate; ?></td>
- <td><?php list($po_no, $prevref) = GROUP_VALUE(
- $records[$iRow]->HNO_BUK,
- $prevref,
- $records[$iRow]->HNO_BUK
- );
- // echo '<strong>'.$po_no.'</strong><br>';
- echo '<strong class="txno'.$records[$iRow]->ID.'">'.$po_no.'</strong><br>';
- ?>
- <?php if( $po_no ): ?>
- <a class="btn btn-success btn-xs" title="<?php echo lang('label_edit') ?>" href="<?php echo base_url('sj/add_sj_detail/'. $records[$iRow]->ID) ?>"><i class="fa fa-pencil"></i> </a>
- <a class="btn btn-info btn-xs voucher" title="<?php echo lang('Voucher') ?>" href="<?php echo $records[$iRow]->ID ?>"><i class="fa fa-print"></i> </a>
- <?php if (!$records[$iRow]->is_approve): ?>
- <a class="btn btn-primary btn-xs approve" title="<?php echo lang('Approve') ?>" href="<?php echo $records[$iRow]->ID ?>"><i class="fa fa-check"></i> </a>
- <?php endif ?>
- <a class="btn btn-danger btn-xs processcancel" title="<?php echo lang('label_cancel') ?>" href="<?php echo $records[$iRow]->ID ?>"><i class="fa fa-remove"></i> </a>
- <?php endif; ?>
- </td>
- <td>
- <?php if( $po_no ): ?>
- <?php echo TX_STATUS($records[$iRow]->ST_Cetak) ?>
- <?php endif; ?></td>
- <td align="center"><?php echo $records[$iRow]->B_APP ?></td>
- <td><?php echo $records[$iRow]->Kobar ?></td>
- <td><?php echo $records[$iRow]->ITEM_DESCRIPTION ?></td>
- <td class="right"><?php echo QTY_FORMAT_($records[$iRow]->Qty) ?></td>
- <td><?php echo ITEM_UOM( $records[$iRow]->Satuan, $records[$iRow]->STN, $records[$iRow]->STN2 ) ?></td>
- <td><?php echo $records[$iRow]->Ref ?></td>
- <td><?php echo $records[$iRow]->NO_SO ?></td>
- <td><?php echo $records[$iRow]->HKET ?></td>
- <!-- <td><?php echo date('d-m-Y', strtotime($records[$iRow]->DO_DATE)) ?></td> -->
- <td><?php echo $records[$iRow]->NAMA_CUST ?></td>
- <td><?php echo $records[$iRow]->CUST_WIL ?></td>
- <!-- <td><?php echo date('d-m-Y', strtotime($records[$iRow]->SO_DATE)) ?></td> -->
- <td><?php echo $records[$iRow]->NAMA_SOPIR ?></td>
- <td><?php echo $records[$iRow]->CATATAN_1 ?></td>
- <td><?php echo $records[$iRow]->NO_POLISI ?></td>
- <td><?php echo $records[$iRow]->NAMA_GUDANG ?></td>
- <?php if ( isset($is_viewmoney)): ?>
- <td class="right"><?php echo number_format($records[$iRow]->Harga)?></td>
- <td class="right"><?php echo number_format($amount)?></td>
- <?php endif; ?>
- </tr>
- <?php $index++; ?>
- <?php endfor; ?>
- <?php if( $nrows > 0 and ISSET2_('is_viewmoney')): ?>
- <tr>
- <td colspan="<?php echo $wrapColumns ?>" style="background-color: #ccc;">
- <strong>Total</strong>
- </td>
- <?php echo $wrapCol; ?>
- <td class="right">
- <strong><?php echo number_format($totAmount); ?></strong>
- </td>
- </tr>
- <?php $totAmount = 0; ?>
- <?php endif; ?>
- <?php if( ISSET2_('is_viewmoney')): ?>
- <tr>
- <td colspan="<?php echo $wrapColumns ?>" style="background-color: #ccc;">
- <strong><?php echo lang('label_net') ?></strong>
- </td>
- <?php echo $wrapCol; ?>
- <td class="right">
- <strong><?php echo number_format($grandtotal); ?></strong>
- </td>
- </tr>
- <?php endif; ?>
- </tbody>
- </table>
- <div class="col-sm-12"> </div>
- <div class="col-sm-12"> </div>
- <div class="recvtable modal fade">
- <div class="modal-dialog" style="width: 800px">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h4 class="modal-title"><?php echo lang('label_receivedqty') ?></h4>
- </div>
- <div class="modal-body">
- <div class="row col-lg-12 recvmutation">Loading...</div>
- <div class="row"> </div>
- <div> </div>
- <div> </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo lang('button_close') ?></button>
- </div>
- </div><!-- /.modal-content -->
- </div><!-- /.modal-dialog -->
- </div>
- <div class="modal errordialog fade">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h4 class="modal-title"><?php echo lang('Info') ?></h4>
- </div>
- <div class="modal-body">
- <p class="errorpan"></p>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal" ><?php echo lang('button_close') ?></button>
- </div>
- </div><!-- /.modal-content -->
- </div><!-- /.modal-dialog -->
- </div>
- <div class="voucher_frame hide"></div>
- <div class="voucher_modal modal fade"></div>
- <script>
- $.ajaxSetup({cache: false, async: false});
- var totalColom = $('.mytable td').length;
- var totalColom1 = $('.mytable th').length;
- console.log(totalColom, totalColom1);
- $(".datacontainer").on("click",".recvqty",function(event){
- event.preventDefault();
- $(".recvtable").modal('show');
- $(".recvmutation").load("<?php echo base_url('po/recvmutation') ?>/" + $(this).attr('href') + "/" + Math.random(1000000));
- });
- $(".voucher").click(function(event){
- var id = $(this).attr('href');
- var txno = $(".txno"+id).html();
- var cnf = confirm("Are you sure want to print "+txno+" ?");
- if(cnf) {
- $(".voucher_frame").html('<iframe src="<?php echo base_url('sj/voucher_sj_customer')?>/'+ id +'/'+'"></iframe>');
- $(".status" + id).html("<?php echo lang('status_print') ?>");
- return false;
- }
- return false;
- });
- $(".approve").click(function(e) {
- e.preventDefault();
- var id = $(this).attr('href');
- var txno = $(".txno"+id).html();
- var cnf = confirm("Are you sure want to Approve "+txno+" ?");
- if(cnf) {
- $.ajax({
- url: '<?php echo base_url('sj/approve_header') ?>/'+id,
- success: function(resp) {
- var res = JSON.parse(resp);
- if(res.error == '1') {
- $(".errordialog").modal('show');
- $(".errorpan").html(res.message);
- } else {
- $(".bapp" + id).html(res.bapp);
- }
- }
- });
- } else
- return false;
- });
- $(".recvmutation").on("click", ".ref", function(event){
- event.preventDefault();
- $(".refmodal").modal('show');
- $(".podata").load("<?php echo base_url('po/view_pono') ?>/" + $(this).attr('href') + "/" + Math.random(1000000));
- });
- $(".processcancel").click(function(event){
- event.preventDefault();
- var id = $(this).attr('href');
- var txno = $(".txno"+id).html();
- var cnf = confirm("Are you sure to cancel TX: "+txno+"?");
- if(!cnf)
- {
- return false;
- }
- $.ajax({
- url : "<?php echo base_url('sj/cancel')?>/" + id,
- async: false,
- success : function(msg){
- var res = JSON.parse(msg);
- $(".errorpan").html(res.message);
- $(".errordialog").modal('show');
- if(res.error == 0) {
- $(".status" + id).html("Batal/Cancel");
- $(".errorpan").html(res.message);
- $(".errordialog").modal('show');
- }
- }
- });
- return false;
- });
- var excel_file_name = 'SJ Overview ';
- var opt_remark = '';
- if(!$("#search_form input[name='datefrom']").val()) {
- opt_remark = 'in ' + $(".this-month").text();
- } else {
- opt_remark = 'from ' + $("#search_form input[name='datefrom']").val() + ' to ' + $("#search_form input[name='dateto']").val();
- }
- $(".mytable").DataTable({
- dom: 'B<i>t',
- scrollY: '<?php echo datatable_scrollY() ?>',
- scrollX: true,
- paging: false,
- ordering: false,
- bFilter: false,
- info: false,
- columnDefs: [
- { className: "right", targets: [7] },
- { className: "center", targets: [1,2,3,4,9,10,16] }
- ],
- fixedColumns: {
- leftColumns: 4
- },
- buttons: [
- {
- className: 'btn btn-success',
- extend: 'excel',
- text: 'Export to Excel',
- exportOptions: {
- modifier: {
- page: 'current'
- }
- },
- filename: excel_file_name.concat(opt_remark)
- }
- ]
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement