public function loadProspect()
 {
     $page = isset($_POST['page']) ? $_POST['page'] : 1;
     $limit = isset($_POST['rows']) ? $_POST['rows'] : 10;
     $sidx = isset($_POST['sidx']) ? $_POST['sidx'] : 'prosid';
     $sord = isset($_POST['sord']) ? $_POST['sord'] : 'DESC';
     $start = $limit * $page - $limit;
     $start = $start < 0 ? 0 : $start;
     $where = whereLoad();
     $count = $this->model_prospect->getTotalProspect($where);
     if ($count > 0) {
         $total_pages = ceil($count / $limit);
     } else {
         $total_pages = 0;
     }
     if ($page > $total_pages) {
         $page = $total_pages;
     }
     $query = $this->model_prospect->getDataProspect($start, $limit, $sidx, $sord, $where);
     $responce = new stdClass();
     $responce->page = $page;
     $responce->total = $total_pages;
     $responce->records = $count;
     $i = 0;
     if (count($query) > 0) {
         foreach ($query as $row) {
             $del = "hapusData('" . $row->prosid . "','" . $row->pros_nama . "')";
             $hapus = '<a href="javascript:void(0);" onclick="' . $del . '" title="Hapus"><i class="ace-icon fa fa-trash-o bigger-120 orange"></i>';
             $agenda = '-';
             $fpt = '-';
             $edit = '-';
             $detail = '<a href="#transaksi_prospect/detailProspect?id=' . $row->prosid . '" title="Detail"><i class="ace-icon glyphicon glyphicon-list bigger-100"></i>';
             if ($row->pros_salesman == ses_krid) {
                 $agenda = '<a href="#transaksi_prospect/agendaProspect?id=' . $row->prosid . '" title="Agenda"><i class="ace-icon fa fa-calendar"></i>';
                 if ($row->warm > 0) {
                     $fpt = '<a href="#transaksi_prospect/addFpt?id=' . $row->prosid . '" title="FPT"><i class="ace-icon fa fa-book bigger-100"></i>';
                 }
                 $edit = '<a href="#transaksi_prospect/editProspect?id=' . $row->prosid . '" title="Edit"><i class="ace-icon glyphicon glyphicon-pencil bigger-100"></i>';
             }
             $responce->rows[$i]['id'] = $row->prosid;
             if ($row->deal > 0) {
                 $status = '<img src="' . path_img() . 'hot_deal.png" width=20;height=20;>';
             } else {
                 if ($row->hot > 0) {
                     $status = '<img src="' . path_img() . 'hot.png" width=20;height=20;>';
                 } else {
                     if ($row->warm > 0) {
                         $status = '<img src="' . path_img() . 'warm.png" width=20;height=20;>';
                     } else {
                         $status = '<img src="' . path_img() . 'prospek.png" width=20;height=20;>';
                     }
                 }
             }
             $responce->rows[$i]['cell'] = array($row->pros_kode, $row->pros_nama, $row->kr_nama, $status, $agenda, $fpt, $edit, $detail);
             $i++;
         }
     }
     echo json_encode($responce);
 }
Example #2
0
 public function loadStockUnit()
 {
     $page = isset($_POST['page']) ? $_POST['page'] : 1;
     $limit = isset($_POST['rows']) ? $_POST['rows'] : 10;
     $sidx = isset($_POST['sidx']) ? $_POST['sidx'] : 'merkid';
     $sord = isset($_POST['sord']) ? $_POST['sord'] : '';
     $start = $limit * $page - $limit;
     $start = $start < 0 ? 0 : $start;
     $where = whereLoad();
     $count = $this->model_sales->getTotalStockUnit($where);
     if ($count > 0) {
         $total_pages = ceil($count / $limit);
     } else {
         $total_pages = 0;
     }
     if ($page > $total_pages) {
         $page = $total_pages;
     }
     $query = $this->model_sales->getDataStockUnit($start, $limit, $sidx, $sord, $where);
     $responce = new stdClass();
     $responce->page = $page;
     $responce->total = $total_pages;
     $responce->records = $count;
     $i = 0;
     if (count($query) > 0) {
         foreach ($query as $row) {
             $del = "hapusData('" . $row->mscid . "', '" . $row->cty_deskripsi . "')";
             $hapus = '<a href="javascript:void(0);" onclick="' . $del . '" title="Hapus"><i class="ace-icon fa fa-trash-o bigger-120 orange"></i>';
             $edit = '<a href="#master_sales/editStockUnit?id=' . $row->mscid . '" title="Edit"><i class="ace-icon glyphicon glyphicon-pencil bigger-100"></i>';
             $view = '<a href="#master_sales/viewStockUnit?id=' . $row->mscid . '" title="View"><i class="ace-icon glyphicon glyphicon-list bigger-100"></i>';
             $responce->rows[$i]['id'] = $row->mscid;
             $responce->rows[$i]['cell'] = array($view, $edit, $hapus, $row->merk_deskripsi, $row->cty_deskripsi, $row->warna_deskripsi, $row->msc_norangka, $row->msc_nomesin, $row->msc_kondisi);
             $i++;
         }
     }
     echo json_encode($responce);
 }
 function loadRak()
 {
     $page = isset($_POST['page']) ? $_POST['page'] : 1;
     $limit = isset($_POST['rows']) ? $_POST['rows'] : 10;
     $sidx = isset($_POST['sidx']) ? $_POST['sidx'] : 'gdg_deskripsi';
     $sord = isset($_POST['sord']) ? $_POST['sord'] : '';
     $start = $limit * $page - $limit;
     $start = $start < 0 ? 0 : $start;
     $where = whereLoad();
     $this->load->model('model_sparepart');
     $count = $this->model_sparepart->getTotalRak($where);
     if ($count > 0) {
         $total_pages = ceil($count / $limit);
     } else {
         $total_pages = 0;
     }
     if ($page > $total_pages) {
         $page = $total_pages;
     }
     $query = $this->model_sparepart->getAllRak($start, $limit, $sidx, $sord, $where);
     $responce = new stdClass();
     $responce->page = $page;
     $responce->total = $total_pages;
     $responce->records = $count;
     $i = 0;
     if (count($query) > 0) {
         foreach ($query as $row) {
             $del = "hapusRak('" . $row->rakid . "')";
             $hapus = '<a href="javascript:;" onclick="' . $del . '" title="Hapus"><i class="ace-icon fa fa-trash-o bigger-120 orange"></i>';
             $edit = '<a href="#master_sparepart/editRak?id=' . $row->rakid . '" title="edit"><i class="ace-icon glyphicon glyphicon-pencil bigger-100"></i>';
             $responce->rows[$i]['id'] = $row->gdgid;
             $responce->rows[$i]['cell'] = array($row->rak_deskripsi, $row->gdg_deskripsi, $edit);
             $i++;
         }
     }
     echo json_encode($responce);
 }
 public function loadTipeJurnal()
 {
     $page = isset($_POST['page']) ? $_POST['page'] : 1;
     $limit = isset($_POST['rows']) ? $_POST['rows'] : 10;
     $sidx = isset($_POST['sidx']) ? $_POST['sidx'] : 'ccid';
     $sord = isset($_POST['sord']) ? $_POST['sord'] : '';
     $start = $limit * $page - $limit;
     $start = $start < 0 ? 0 : $start;
     $where = whereLoad();
     $count = $this->model_finance->getTotalTipeJurnal($where);
     if ($count > 0) {
         $total_pages = ceil($count / $limit);
     } else {
         $total_pages = 0;
     }
     if ($page > $total_pages) {
         $page = $total_pages;
     }
     $query = $this->model_finance->getDataTipeJurnal($start, $limit, $sidx, $sord, $where);
     $responce = new stdClass();
     $responce->page = $page;
     $responce->total = $total_pages;
     $responce->records = $count;
     $i = 0;
     if (count($query) > 0) {
         foreach ($query as $row) {
             $del = "hapusData('" . $row->tipeid . "', '" . $row->tipe_deskripsi . "')";
             $vie = "viewData('" . $row->tipeid . "', '" . $row->tipe_deskripsi . "')";
             $hapus = '<a href="javascript:void(0);" onclick="' . $del . '" title="Hapus"><i class="ace-icon fa fa-trash-o bigger-120 orange"></i>';
             $viewjurnal = '<a href="javascript:void(0);" onclick="' . $del . '" title="View"><i class="ace-icon fa fa-book bigger-120 orange"></i>';
             $edit = '<a href="#master_finance/editTipeJurnal?id=' . $row->tipeid . '" title="Edit"><i class="ace-icon glyphicon glyphicon-pencil bigger-100"></i>';
             $setjurnal = '<a href="#master_finance/setTipeJurnal?id=' . $row->tipeid . '" title="Setting"><i class="ace-icon glyphicon glyphicon-list bigger-100"></i>';
             $responce->rows[$i]['id'] = $row->tipeid;
             $responce->rows[$i]['cell'] = array($row->tipeid, $row->tipe_postcode, $row->tipe_deskripsi, $viewjurnal, $setjurnal, $edit);
             $i++;
         }
     }
     echo json_encode($responce);
 }
 /**
  * 
  */
 function loadFakturSparepart()
 {
     $page = isset($_POST['page']) ? $_POST['page'] : 1;
     $limit = isset($_POST['rows']) ? $_POST['rows'] : 10;
     $sidx = isset($_POST['sidx']) ? $_POST['sidx'] : 'not_nomer';
     $sord = isset($_POST['sord']) ? $_POST['sord'] : '';
     $start = $limit * $page - $limit;
     $start = $start < 0 ? 0 : $start;
     $where = whereLoad();
     $count = $this->model_util_sparepart->getTotalFaktur($where);
     if ($count > 0) {
         $total_pages = ceil($count / $limit);
     } else {
         $total_pages = 0;
     }
     if ($page > $total_pages) {
         $page = $total_pages;
     }
     $query = $this->model_util_sparepart->getAllFaktur($start, $limit, $sidx, $sord, $where);
     $responce = new stdClass();
     $responce->page = $page;
     $responce->total = $total_pages;
     $responce->records = $count;
     $i = 0;
     if (count($query) > 0) {
         foreach ($query as $row) {
             $print = '<a href="javascript:;" onclick="print(\'' . $row->notid . '\',' . $i . ')" title="Print"><i class="ace-icon glyphicon glyphicon-print bigger-120"></i>';
             $responce->rows[$i]['id'] = $row->notid;
             $responce->rows[$i]['cell'] = array($row->not_nomer, $row->spp_noslip, date('d-m-Y', strtotime($row->not_tgl)), $row->pel_nama, number_format($row->not_total), $print);
             $i++;
         }
     }
     echo json_encode($responce);
 }
 function loadDataWo()
 {
     $page = isset($_POST['page']) ? $_POST['page'] : 1;
     $limit = isset($_POST['rows']) ? $_POST['rows'] : 10;
     $sidx = isset($_POST['sidx']) ? $_POST['sidx'] : 'wo_nomer';
     $sord = isset($_POST['sord']) ? $_POST['sord'] : '';
     $start = $limit * $page - $limit;
     $start = $start < 0 ? 0 : $start;
     $where = whereLoad();
     $count = $this->model_trservice->getTotalWo($where);
     if ($count > 0) {
         $total_pages = ceil($count / $limit);
     } else {
         $total_pages = 0;
     }
     if ($page > $total_pages) {
         $page = $total_pages;
     }
     $query = $this->model_trservice->getAllWo($start, $limit, $sidx, $sord, $where);
     $mekanik = $this->model_trservice->getDataMekanik();
     $mek = "<option value=''>Pilih Mekanik</option>";
     if (count($mekanik) > 0) {
         foreach ($mekanik as $list) {
             $mek .= "<option value='" . $list['krid'] . "' >" . $list['kr_nama'] . "</option>";
         }
     }
     $responce = new stdClass();
     $responce->page = $page;
     $responce->total = $total_pages;
     $responce->records = $count;
     $i = 0;
     if (count($query) > 0) {
         foreach ($query as $row) {
             $mknk = '';
             $pending = '-';
             $clock = "<label><input class='ace ace-switch btn-rotate' id='cek{$i}' onclick='clocking(\"" . $i . "\",\"" . $row['cloid'] . "\")' type='checkbox' name='cek[]'><span class='lbl'></span></label>";
             if ($row['clo_status'] == '0') {
                 $status = 'BELUM CLOCK ON';
                 $mknk = "<select id='krid{$i}' name='krid' class='ace col-xs-10 col-sm-10' style='width: 100%'>" . $mek . "</select>";
             } else {
                 if ($row['clo_status'] == '1') {
                     $status = 'PROSES PENGERJAAN';
                     $clock = "<label><input checked class='ace ace-switch btn-rotate' id='cek{$i}' onclick='clocking(\"" . $i . "\",\"" . $row['cloid'] . "\")' type='checkbox' name='cek[]'><span class='lbl'></span></label>";
                     $pending = "<a href='javascript:;' title='Pending' onclick='pending(\"" . $i . "\",\"" . $row['cloid'] . "\")'><i class='green ace-icon glyphicon glyphicon-off'></i></a>";
                     $mknk = $row['kr_nama'];
                 } else {
                     if ($row['clo_status'] == '2') {
                         $status = 'PENDING';
                         $mknk = "<select id='krid{$i}' name='krid' class='ace col-xs-10 col-sm-10' style='width: 100%'>" . $mek . "</select>";
                     } else {
                         $status = 'SELESAI';
                         $clock = 'PROSES NOTA';
                         $mknk = $row['kr_nama'];
                     }
                 }
             }
             $responce->rows[$i]['id'] = $row['woid'];
             $responce->rows[$i]['cell'] = array($row['wo_nomer'], $row['msc_nopol'], $row['pel_nama'], $status, $mknk, $clock, $pending);
             $i++;
         }
     }
     echo json_encode($responce);
 }
 /**
  * 
  */
 function loadFakturService()
 {
     $page = isset($_POST['page']) ? $_POST['page'] : 1;
     $limit = isset($_POST['rows']) ? $_POST['rows'] : 10;
     $sidx = isset($_POST['sidx']) ? $_POST['sidx'] : 'wo_nomer';
     $sord = isset($_POST['sord']) ? $_POST['sord'] : '';
     $start = $limit * $page - $limit;
     $start = $start < 0 ? 0 : $start;
     $where = whereLoad();
     $count = $this->model_util_service->getTotalFakturService($where);
     if ($count > 0) {
         $total_pages = ceil($count / $limit);
     } else {
         $total_pages = 0;
     }
     if ($page > $total_pages) {
         $page = $total_pages;
     }
     $query = $this->model_util_service->getAllFakturService($start, $limit, $sidx, $sord, $where);
     $responce = new stdClass();
     $responce->page = $page;
     $responce->total = $total_pages;
     $responce->records = $count;
     $i = 0;
     if (count($query) > 0) {
         foreach ($query as $row) {
             $batal = '-';
             if ($row->inv_status == 0) {
                 $batal = '<a href="javascript:;" onclick="batal(\'' . $row->invid . '\',\'' . $row->woid . '\')" title="Hapus"><i class="ace-icon fa fa-trash-o bigger-120 orange"></i>';
             }
             $print = '<a href="javascript:;" onclick="print(\'' . $row->invid . '\')" title="Print"><i class="ace-icon glyphicon glyphicon-print bigger-120"></i>';
             $responce->rows[$i]['id'] = $row->invid;
             $responce->rows[$i]['cell'] = array($row->wo_nomer, $row->pel_nama, date('d-m-Y', strtotime($row->inv_tgl)), $row->msc_nopol, $row->msc_nomesin, '<input type="text" autocomplete="off" id="alasan' . $row->invid . '" name="alasan' . $row->invid . '" 
                  class="col-xs-10 col-sm-10 upper" style="width:100%" />', $batal, $print);
             $i++;
         }
     }
     echo json_encode($responce);
 }
 public function loadBisnis()
 {
     $page = isset($_POST['page']) ? $_POST['page'] : 1;
     $limit = isset($_POST['rows']) ? $_POST['rows'] : 10;
     $sidx = isset($_POST['sidx']) ? $_POST['sidx'] : 'areaid';
     $sord = isset($_POST['sord']) ? $_POST['sord'] : '';
     $start = $limit * $page - $limit;
     $start = $start < 0 ? 0 : $start;
     $where = whereLoad();
     $count = $this->model_prospect->getTotalBisnis($where);
     if ($count > 0) {
         $total_pages = ceil($count / $limit);
     } else {
         $total_pages = 0;
     }
     if ($page > $total_pages) {
         $page = $total_pages;
     }
     $query = $this->model_prospect->getDataBisnis($start, $limit, $sidx, $sord, $where);
     $responce = new stdClass();
     $responce->page = $page;
     $responce->total = $total_pages;
     $responce->records = $count;
     $i = 0;
     if (count($query) > 0) {
         foreach ($query as $row) {
             $del = "hapusData('" . $row->bisnisid . "', '" . $row->bisnis_nama . "')";
             $hapus = '<a href="javascript:void(0);" onclick="' . $del . '" title="Hapus"><i class="ace-icon fa fa-trash-o bigger-120 orange"></i>';
             $edit = '<a href="#master_prospect/editBisnis?id=' . $row->bisnisid . '" title="Edit"><i class="ace-icon glyphicon glyphicon-pencil bigger-100"></i>';
             $responce->rows[$i]['id'] = $row->bisnisid;
             $responce->rows[$i]['cell'] = array($row->bisnis_nama, $row->bisnis_deskripsi, $edit, $hapus);
             $i++;
         }
     }
     echo json_encode($responce);
 }
 public function loadFpk()
 {
     $page = isset($_POST['page']) ? $_POST['page'] : 1;
     $limit = isset($_POST['rows']) ? $_POST['rows'] : 10;
     $sidx = isset($_POST['sidx']) ? $_POST['sidx'] : 'fpkid';
     $sord = isset($_POST['sord']) ? $_POST['sord'] : '';
     $start = $limit * $page - $limit;
     $start = $start < 0 ? 0 : $start;
     $where = whereLoad();
     $count = $this->model_trsales->getTotalFpk($where);
     if ($count > 0) {
         $total_pages = ceil($count / $limit);
     } else {
         $total_pages = 0;
     }
     if ($page > $total_pages) {
         $page = $total_pages;
     }
     $query = $this->model_trsales->getAllFpk($start, $limit, $sidx, $sord, $where);
     $responce = new stdClass();
     $responce->page = $page;
     $responce->total = $total_pages;
     $responce->records = $count;
     $i = 0;
     if (count($query) > 0) {
         foreach ($query as $row) {
             $del = "hapus('" . $row->fpkid . "')";
             $hapus = '<a href="javascript:void(0);" onclick="' . $del . '" title="Hapus"><i class="ace-icon fa fa-trash bigger-120 red"></i>';
             $print = '<a href="javascript:void(0);" onclick="print(\'' . $row->fpkid . '\')" title="Print"><i class="ace-icon fa fa-print bigger-120 green"></i>';
             $edit = '<a href="#transaksi_sales/editPoLeasing?id=' . $row->fpkid . '" title="View"><i class="ace-icon glyphicon glyphicon-pencil bigger-100"></i>';
             $responce->rows[$i]['id'] = $row->fpkid;
             $responce->rows[$i]['cell'] = array($row->fpk_no, date('d-m-Y', strtotime($row->fpk_tgl)), $row->spk_no, $row->spk_nokontrak, $row->leas_nama, $edit, $print, $hapus);
             $i++;
         }
     }
     echo json_encode($responce);
 }