function data_nip($nip, $periode) { $this->load->model('periode_model'); $periode = $this->periode_model->get_by_id($periode)->row(); $sql = "select a.tanggal,e.nip,e.nama,a.time_in,a.time_out,a.id,a.ot_in,a.ot_out \n\t\tfrom employee e left join time_card_detail a \n\t\ton a.nip=e.nip where a.nip='" . $nip . "' and a.tanggal between '" . $periode->startdate . "' and '" . $periode->enddate . "'"; echo datasource($sql); }
function browse_data($offset = 0, $limit = 100, $nama = '') { $nama = $this->input->get('sid_cust'); $no = $this->input->get('sid_number'); $d1 = date('Y-m-d H:i:s', strtotime($this->input->get('sid_date_from'))); $d2 = date('Y-m-d H:i:s', strtotime($this->input->get('sid_date_to'))); $sql = $this->sql; if ($no != '') { $sql .= " and invoice_number='" . $no . "'"; } else { $sql .= " and invoice_date between '{$d1}' and '{$d2}'"; if ($nama != '') { $sql .= " and company like '{$nama}%'"; } if ($this->input->get('sid_salesman') != '') { $sql .= " and salesman like '" . $this->input->get('salesman') . "%'"; } if ($this->input->get('sid_posted') != '') { if ($this->input->get('sid_posted') == '1') { $sql .= " and posted=true"; } else { $sql .= " and (posted=false or posted is null)"; } } } $sql .= " limit {$offset},{$limit}"; echo datasource($sql); }
function browse_data($nama = '') { $sql = "select varname,varvalue,keterangan from system_variables \n \twhere varname like '% numbering' "; if ($this->input->get('sid_nama') != '') { $sql .= " and varname like '" . $this->input->get('sid_nama') . "% numbering'"; } $sql .= " order by varname"; echo datasource($sql); }
function browse_data($offset = 0, $limit = 10, $nama = '') { if ($this->input->get('sid_number')) { $sql = $this->sql . " and kodecrdb='" . $this->input->get('sid_number') . "'"; } else { $d1 = date('Y-m-d H:i:s', strtotime($this->input->get('sid_date_from'))); $d2 = date('Y-m-d H:i:s', strtotime($this->input->get('sid_date_to'))); $sql = $this->sql . " and tanggal between '" . $d1 . "' and '" . $d2 . "'"; } echo datasource($sql); }
function browse_data($offset = 0, $limit = 10, $nama = '') { if ($this->input->get('sid_number')) { $sql = $this->sql . " and kodecrdb='" . $this->input->get('sid_number') . "'"; } else { $d1 = date('Y-m-d H:i:s', strtotime($this->input->get('sid_date_from'))); $d2 = date('Y-m-d H:i:s', strtotime($this->input->get('sid_date_to'))); $sql = $this->sql . " and tanggal between '" . $d1 . "' and '" . $d2 . "'"; if ($this->input->get('sid_posted') != '') { if ($this->input->get('sid_posted') == '1') { $sql .= " and posted=true"; } else { $sql .= " and (posted=false or posted is null)"; } } } echo datasource($sql); }
function browse_data($offset = 0, $limit = 100, $nama = '') { $sql = $this->build_sql(); echo datasource($sql); }
function load_nomor($voucher) { $voucher = urldecode($voucher); $sql = "select i.purchase_order_number,i.po_date,p.date_paid,i.amount,\n\t\tp.amount_paid from payables_payments p left join purchase_order i \n\t\ton i.purchase_order_number=p.purchase_order_number\n\t\twhere p.no_bukti='{$voucher}'"; echo datasource($sql); }
function browse_data($offset = 0, $limit = 100, $nama = '') { $sql = $this->sql . ' where 1=1'; if ($this->input->get('sid_nama') != '') { $sql .= " user_group_id like '" . $this->input->get('sid_nama') . "%'"; } if ($this->input->get('sid_kel') != '') { $sql .= " user_group_name like '" . $this->input->get('sid_kel') . "%'"; } echo datasource($sql); }
function cicilan($cmd, $id = "") { $id = urldecode($id); if ($cmd == "list") { $sql = "select tanggal_jth_tempo,awal,pokok,bunga,angsuran,akhir, \n\t\t\tpayment_no,comments,loan_number,id \n\t\t\tfrom hr_emp_loan_schedule\t\n\t\t\twhere loan_number='{$id}'\n\t\t\torder by tanggal_jth_tempo"; echo datasource($sql); } }
function browse_data($offset = 0, $limit = 100, $nama = '') { $rek = $this->input->get('sid_rek'); $no = $this->input->get('sid_number'); $d1 = date('Y-m-d H:i:s', strtotime($this->input->get('sid_date_from'))); $d2 = date('Y-m-d H:i:s', strtotime($this->input->get('sid_date_to'))); $sql = $this->sql; if ($no != '') { $sql .= " and voucher='" . $no . "'"; } else { $sql .= " and check_date between '{$d1}' and '{$d2}'"; if ($rek != '') { $sql .= " and account_number like '{$rek}%'"; } if ($this->input->get('sid_type') != '') { $sql .= " trans_type='" . $this->input->get('sid_type') . "'"; } if ($this->input->get('sid_posted') != '') { if ($this->input->get('sid_posted') == '1') { $sql .= " and posted=true"; } else { $sql .= " and posted=false"; } } } $sql .= " limit {$offset},{$limit}"; echo datasource($sql); }
function list_not_paid($search) { $search = urldecode($search); $s = "select distinct loan_id from ls_invoice_header i \n\t\tjoin ls_cust_master c on c.cust_id=i.cust_deal_id \n\t\twhere i.paid=0 and (c.cust_name like '%" . $search . "%' or i.loan_id='{$search}') "; // and month(invoice_date) = ".date("m")." // AND year(invoice_date) = ".date("Y"); if ($query = $this->db->query($s)) { foreach ($query->result() as $inv) { $this->loan_master_model->calc_hari_telat($inv->loan_id); } } $s = "select c.cust_id,cust_name,i.invoice_number, i.invoice_date, \n\t\ti.idx_month,i.amount,i.paid,i.voucher,i.amount_paid,i.payment_method,i.date_paid,i.hari_telat,\n\t\ti.bunga,i.pokok,i.bunga_paid,i.pokok_paid \n\t\t from ls_invoice_header i left join ls_cust_master c on c.cust_id=i.cust_deal_id \n\t\twhere paid=0 and (cust_name like '%" . $search . "%' or i.loan_id='{$search}') \n\t\torder by i.invoice_date \n\t\tLIMIT 10"; echo datasource($s); }
function select($periode = "") { $sql = "select * from financial_periods"; if ($periode != "") { $sql .= " where period like '{$periode}%'"; } echo datasource($sql); }
function items($voucher) { $sql = "select cwi.account_id,coa.account,coa.account_description as description,\n\t\t\tamount,comments,invoice_number,ref1,line_number\t\n\t\t\tfrom check_writer_items cwi\n\t\t\tleft join chart_of_accounts coa on coa.id=cwi.account_id\n\t\t\twhere trans_id in (\n\t\t\tselect trans_id from check_writer where voucher='{$voucher}')"; echo datasource($sql); }
function filter($id = "") { $sql = "select * from " . $this->table_name; if ($id != "") { $sql .= " where cust_name like '%" . $id . "%'"; } echo datasource($sql); }
function browse_data($offset = 0, $limit = 10, $nama = '') { $sql = $this->sql . " where 1=1"; if ($this->input->get('sid_kode') != '') { $sql .= " and customer_pricing_code='" . $this->input->get('sid_kode') . "'"; } echo datasource($sql); }
function browse_data($offset = 0, $limit = 10, $nama = '') { if ($this->input->get('sid_po_number')) { $sql = $this->sql . " and purchase_order_number='" . $this->input->get('sid_po_number') . "'"; } else { $d1 = date('Y-m-d H:i:s', strtotime($this->input->get('sid_date_from'))); $d2 = date('Y-m-d H:i:s', strtotime($this->input->get('sid_date_to'))); $sql = $this->sql . " and po_date between '" . $d1 . "' and '" . $d2 . "'"; if ($this->input->get('sid_supplier')) { $sql .= " and supplier_name like '" . $this->input->get('sid_supplier') . "%'"; } if ($this->input->get('sid_posted') != '') { if ($this->input->get('sid_posted') == '1') { $sql .= " and posted=true"; } else { $sql .= " and (posted=false or posted is null)"; } } } echo datasource($sql); }
function list_by_po($nomor_po) { $nomor_po = urldecode($nomor_po); $sql = "select shipment_id,date_received,warehouse_code,receipt_by,selected ,ip.item_number,\n\t\ti.description,quantity_received\n\t\tfrom inventory_products ip left join inventory i on i.item_number=ip.item_number \n\t\twhere purchase_order_number='{$nomor_po}'"; echo datasource($sql); }
function filter($search = '') { $sql = "select * from ls_cust_master"; if ($search != "") { $sql .= " where cust_name like '%" . $search . "%'"; } echo datasource($sql); }
function browse_data($offset = 0, $limit = 10, $nama = '') { $sql = $this->sql; $no = $this->input->get('sid_nomor'); $d1 = date('Y-m-d H:i:s', strtotime($this->input->get('sid_date_from'))); $d2 = date('Y-m-d H:i:s', strtotime($this->input->get('sid_date_to'))); if ($no != '') { $sql .= " and shipment_id='" . $no . "'"; } $sql .= " limit {$offset},{$limit}"; echo datasource($sql); }
function list_by_trans_id($id) { $sql = "select i.line_number,i.account_id,c.account,c.account_description,\n\t\t\ti.invoice_number,i.amount,i.comments\n\t\t\tfrom check_writer_items i \n\t\t\tleft join chart_of_accounts c on c.id=i.account_id\n\t\t\twhere i.trans_id='{$id}'"; echo datasource($sql); }
function browse_data($offset = 0, $limit = 10, $nama = '') { $sql = $this->sql . " where 1=1"; if ($this->input->get('sid_nama') != '') { $sql .= " and inventory_class like '" . $this->input->get('sid_nama') . "%'"; } echo datasource($sql); }
function items($nomor) { $nomor = urldecode($nomor); $sql = "select p.item_number,i.description,p.quantity,p.id as line_number,p.unit,\n\t\tp.price,p.total\n\t\tfrom work_exec_detail p\n\t\tleft join inventory i on i.item_number=p.item_number\n\t\twhere work_exec_no='{$nomor}'"; echo datasource($sql); }
function browse_data($offset = 0, $limit = 100, $nama = '') { $sql = $this->sql . " where 1=1"; if ($this->input->get('sid_no') != '') { $sql .= " and mac_id='" . $this->input->get('sid_no') . "'"; } $sql .= " limit {$offset},{$limit}"; echo datasource($sql); }
function select_open_po($supplier) { $supplier = urldecode($supplier); $sql = "select p.purchase_order_number,p.po_date,p.due_date,p.terms \n from purchase_order p\n where p.supplier_number='{$supplier}' and p.potype='O' and ifnull(received,false)=false"; echo datasource($sql); }
function filter($nama = '', $type = 'json') { $nama = urldecode($nama); $sql = "select item_number,description\n\t\t from inventory where 1=1 and description like '" . $nama . "%' limit 100"; echo datasource($sql); }
function data() { $sql = "select e.nip,e.nama,a.time_in,a.time_out,a.id,a.time_total,a.supervisor,a.keterangan,\n\t\t\tttc_1x,ttc_2x,ttc_3x,ttc_4x,a.time_total_calc,a.salary_no,a.hari_libur,a.add_to_slip\n\t\tfrom employee e left join overtime_detail a \n\t\ton a.nip=e.nip and year(tanggal)=" . date("Y") . " and month(tanggal)=" . date('m') . " and day(tanggal)=" . date('d'); echo datasource($sql); }
function select() { $s = "select work_exec_no,wo_number,start_date,expected_date,person_in_charge,comments \n\t\tfrom work_exec"; echo datasource($s); }
function select($account = '') { $sql = "select account,account_description,id from chart_of_accounts where 1=1"; if ($account != "") { $sql .= " and (account like '{$account}%' or account_description like '%{$account}%')"; } echo datasource($sql); }
function browse_data($offset = 0, $limit = 100, $nama = '') { $sql = $this->sql . ' where 1=1'; if ($this->input->get("sid_nama")) { $sql .= " and description like '%" . $this->input->get("sid_nama") . "%'"; } echo datasource($sql); }
function experience($cmd, $id = '') { if ($cmd == "save") { $data = $this->input->post(); if (isset($data['startdate'])) { $data['startdate'] = date('Y-m-d H:i:s', strtotime($data['startdate'])); } if (isset($data['finishdate'])) { $data['finishdate'] = date('Y-m-d H:i:s', strtotime($data['finishdate'])); } if ($data['id'] == "" or $data['id'] == "0") { unset($data['id']); $ok = $this->db->insert("employeeexperience", $data); } else { $id = $data['id']; $this->db->where("id", $id); $ok = $this->db->update("employeeexperience", $data); } if ($ok) { echo json_encode(array('success' => true)); } else { echo json_encode(array('msg' => 'Some errors occured.')); } } if ($cmd == "load") { $sql = "select * from employeeexperience where employeeid='{$id}'"; echo datasource($sql); } if ($cmd == "delete") { $this->db->where("id", $id); $ok = $this->db->delete("employeeexperience"); if ($ok) { echo json_encode(array('success' => true)); } else { echo json_encode(array('msg' => 'Some errors occured.')); } } }