Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- sintaks di view -->
- <table id="table_picking" class="table table-bordered table-striped">
- <thead>
- <tr align="center">
- <th>Production</th>
- <th>Product ID</th>
- <th>Product Name</th>
- <th>Lot</th>
- <th>Cost Center</th>
- <th>Operation Number</th>
- <th>Delivery</th>
- <th>Journal</th>
- <th>Operation Name</th>
- <th>Status</th>
- <th>Action</th>
- </tr>
- </thead>
- <tbody>
- </tbody>
- </table>
- <div class="card-body">
- <!-- Tabel data -->
- <p class="card-text view_picking">
- </p>
- </div>
- <!-- /.card-body -->
- <script>
- function listdatapicking()
- {
- var table = $('#table_picking').DataTable({
- "processing": true,
- "serverSide": true,
- "order": [],
- "ajax":{
- url: "<?= site_url('picking/listdata') ?>",
- type: "POST"
- },
- "columnDefs": [{
- "targets": 0,
- "orderable": false
- }],
- "scrollX": true
- });
- }
- $(document).ready(function(){
- listdatapicking();
- });
- function check(pl_unix)
- {
- $.ajax({
- type: "post",
- url: "<?= site_url('picking/check') ?>",
- data: {
- pl_unix: pl_unix
- },
- dataType: "json",
- success: function(response){
- console.log(response.res);
- if(response.res)
- {
- $('.view_picking').html(response.res);
- }
- },
- error: function(xhr, ajaxOptions, thrownError) {
- alert(xhr.status + "\n" + xhr.responseText + "\n" + thrownError);
- }
- });
- }
- </script>
- //controller
- public function checkPage()
- {
- if($this->request->isAJAX())
- {
- $pl_unix = $this->request->getVar('pl_unix');
- // $row = $this->m_picking_data->find($pl_unix);
- $row = $this->m_picking_data->where('pl_unix', $pl_unix)->first();
- // $unix = $row['pl_unix'];
- $data = [
- // 'header' => 'Picking',
- // 'heading' => 'Double Check Picking',
- 'unix' => $row['pl_unix'],
- 'production' => $row['pl_production'],
- 'product_id' => $row['pl_product_id'],
- 'product_name' => $row['pl_product_name'],
- 'lot_control' => $row['pl_lot_control'],
- 'cost_center' => $row['pl_cost_center'],
- 'operation_number' => $row['pl_operation_number'],
- 'delivery' => $row['pl_delivery'],
- 'tf_journal' => $row['pl_tf_journal'],
- 'operation_name' => $row['pl_operation_name'],
- 'result' => $row['dt_result']
- ];
- $msg = [
- 'res' => view('Picking/cek', $data)
- ];
- echo json_encode($msg);
- }else{
- exit('Maaf request tidak dapat diproses!');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment