function update_component() { $comp = GetAllSelect('payroll_component', 'id')->result(); foreach ($comp as $c) { $data = array('session_id' => $this->new_session, 'payroll_component_id' => $c->id); $filter = array('session_id' => 'where/' . $this->new_session, 'payroll_component_id' => 'where/' . $c->id); $num_rows = GetAllSelect('payroll_component_session', 'id', $filter)->num_rows(); if ($num_rows > 0) { $this->db->where('session_id', $this->new_session)->where('payroll_component_id', $c->id)->update('payroll_component_session', $data); } else { $this->db->insert('payroll_component_session', $data); } $filter2 = array('session_id' => 'where/' . $this->old_session, 'payroll_component_id' => 'where/' . $c->id); $comp_sess_before = getValue('id', 'payroll_component_session', $filter2); print_ag($comp_sess_before); $comp_value = getAll('payroll_component_value', array('payroll_component_session_id' => 'where/' . $comp_sess_before))->row(); print_ag($comp_value); $comp_sess_new = getValue('id', 'payroll_component_session', $filter); $num_rows_new = GetAllSelect('payroll_component_value', 'id', array('payroll_component_session_id' => 'where/' . $comp_sess_new))->num_rows(); if (!empty($comp_value)) { $data2 = array('payroll_component_session_id' => $comp_sess_new, 'from' => $comp_value->from, 'to' => $comp_value->to, 'formula' => $comp_value->formula, 'is_condition' => $comp_value->is_condition, 'min' => $comp_value->min, 'max' => $comp_value->max, 'created_by' => sessId(), 'created_on' => dateNow()); if ($num_rows_new > 0) { $this->db->where('payroll_component_session_id', $comp_sess_new)->update('payroll_component_value', $data2); } else { $this->db->insert('payroll_component_value', $data2); } } print_ag($this->db->last_query()); } }
public function ajax_update() { //$this->_validate(); $data = array('kode' => $this->input->post('kode'), 'title' => $this->input->post('title'), 'catatan' => $this->input->post('catatan'), 'lokasi_gudang_id' => $this->input->post('lokasi_gudang_id'), 'edited_by' => sessId(), 'edited_on' => dateNow()); $this->gudang->update(array('id' => $this->input->post('id')), $data); echo json_encode(array("status" => TRUE)); }
public function ajax_update() { //$this->_validate(); $data = array('mata_uang_asing' => $this->input->post('mata_uang_asing'), 'nilai_dalam_rupiah' => $this->input->post('nilai_dalam_rupiah'), 'catatan' => $this->input->post('catatan'), 'edited_by' => sessId(), 'edited_on' => dateNow()); $this->main->update(array('id' => $this->input->post('id')), $data); echo json_encode(array("status" => TRUE)); }
public function ajax_update() { //$this->_validate(); $data = array('code' => $this->input->post('kode'), 'name' => $this->input->post('title'), 'type' => $this->input->post('type'), 'ref_id' => $this->input->post('ref'), 'modify_user_id' => sessId(), 'modify_date' => dateNow()); $this->coa_setup->update(array('id' => $this->input->post('id')), $data); echo json_encode(array("status" => TRUE)); }
function add() { permissionUser(); $list = array('kode_barang' => $this->input->post('kode_barang'), 'deskripsi' => $this->input->post('deskripsi'), 'diretur' => $this->input->post('diretur'), 'diterima' => $this->input->post('diterima'), 'satuan' => $this->input->post('satuan')); $data = array('no' => $this->input->post('no'), 'tanggal_transaksi' => date('Y-m-d', strtotime($this->input->post('tanggal_transaksi'))), 'pengeluaran_id' => $this->input->post('pengeluaran_id'), 'catatan' => $this->input->post('catatan'), 'created_by' => sessId(), 'created_on' => dateNow()); $this->db->insert($this->table_name, $data); $insert_id = $this->db->insert_id(); for ($i = 0; $i < sizeof($list['kode_barang']); $i++) { $data2 = array($this->file_name . '_id' => $insert_id, 'kode_barang' => $list['kode_barang'][$i], 'deskripsi' => $list['deskripsi'][$i], 'diretur' => str_replace(',', '', $list['diretur'][$i]), 'diterima' => str_replace(',', '', $list['diterima'][$i]), 'satuan_id' => $list['satuan'][$i]); $this->db->insert($this->table_name . '_list', $data2); } redirect($this->module . '/' . $this->file_name, 'refresh'); }
function addwidget() { //insertTerms(); $termid = $this->input->post('id'); $pos = $this->input->post('pos'); $widget = $this->input->post('widget'); $s = array('term_id' => $termid); $name = $this->m_database->fieldRow('terms', $s, 'name'); $slug = $this->m_database->fieldRow('terms', $s, 'slug'); $data = json_encode(array('prefix' => $widget)); $time = strtotime(dateNow(TRUE)); insertTerms("sidebar", $name . "_item", $slug . "-item-" . $time, "", $termid, $data); echo json_encode('ok'); }
function add() { permissionUser(); $list = array('barang_id' => $this->input->post('barang_id'), 'catatan_barang' => $this->input->post('catatan_barang'), 'buku' => $this->input->post('buku'), 'satuan_buku' => $this->input->post('satuan_buku'), 'fisik' => $this->input->post('fisik'), 'satuan_id' => $this->input->post('satuan_id')); $data = array('no' => $this->input->post('no'), 'tgl' => date('Y-m-d', strtotime($this->input->post('tgl'))), 'catatan' => $this->input->post('catatan'), 'created_by' => sessId(), 'created_on' => dateNow()); $this->db->insert($this->module . '_' . $this->file_name, $data); $insert_id = $this->db->insert_id(); for ($i = 0; $i < sizeof($list['barang_id']); $i++) { $data2 = array($this->file_name . '_id' => $insert_id, 'barang_id' => $list['barang_id'][$i], 'catatan' => $list['catatan_barang'][$i], 'buku' => str_replace(',', '', $list['buku'][$i]), 'satuan_buku' => str_replace(',', '', $list['satuan_buku'][$i]), 'fisik' => str_replace(',', '', $list['fisik'][$i]), 'satuan_id' => $list['satuan_id'][$i]); $this->db->insert($this->module . '_' . $this->file_name . '_list', $data2); $this->db->where(array('barang_id' => $list['barang_id'][$i])); $this->db->update('stok', array('dalam_stok' => $list['fisik'][$i])); } redirect($this->module . '/' . $this->file_name, 'refresh'); }
function send() { $sess_id = sessId(); $data = array('sender_id' => sessId(), 'receiver_id' => $this->input->post('receiver_id'), 'message' => $this->input->post('msg'), 'sent_on' => dateNow()); $this->db->insert('chat', $data); $id = $this->input->post('receiver_id'); $data['id'] = $id; $data['sess_name'] = getName(sessId()); $data['buddy_name'] = getName($id); $q = "SELECT *\n FROM chat\n WHERE (sender_id = '{$sess_id}' AND receiver_id = '{$id}')\n OR (sender_id = '{$id}' AND receiver_id = '{$sess_id}')\n order by sent_on desc\n limit 10\n "; $data['message'] = $this->db->query($q); //lastq(); $data['photo'] = ''; $data['photo_chat'] = ''; $this->load->view('chat/detail', $data); }
function send_notification($id) { permissionUser(); $url = base_url() . $this->file_name . '/detail/' . $id; $subject = 'Pengajuan Work Order'; $isi = getName(sessId()) . " membuat Work Order, Untuk melihat detail silakan <a href={$url}> KLIK DISINI </a>."; $no = getValue('no', $this->table_name, array('id' => 'where/' . $id)); //SEND NOTIFICATION TO PRODUCTION $group_id = array('8'); $user_id = $this->db->select('user_id')->where_in('group_id', $group_id)->get('users_groups')->result(); foreach ($user_id as $u) { $data = array('sender_id' => sessId(), 'receiver_id' => $u->user_id, 'sent_on' => dateNow(), 'judul' => $subject, 'isi' => $isi, 'no' => $no, 'url' => $url); $this->db->insert('notifikasi', $data); $this->send_email(getEmail($u->user_id), $subject, $isi); } return TRUE; }
function registerDo($username, $password, $nama, $hp, $emailx, $role, $status, $sendMail = FALSE) { $checkUsername = array('username' => $username); if ($this->CI->m_database->isBOF('userlogin', $checkUsername) == TRUE) { $checkEmail = array('email' => $emailx); if ($this->CI->m_database->isBOF('userlogin', $checkEmail) == TRUE) { $checkHP = array('hp' => $hp); if ($this->CI->m_database->isBOF('userlogin', $checkHP) == TRUE) { $dbPass = $this->CI->m_security->createPassword($password); $dUser = array('username' => $username, 'password' => $dbPass, 'nama' => $nama, 'hp' => $hp, 'email' => $emailx, 'status' => $status); if ($this->CI->m_database->addRow('userlogin', $dUser) == TRUE) { $IDUser = $this->CI->m_database->lastInsertID(); taxonomyCreate($IDUser, 'role_user', $role); $tglSekarang = dateNow(TRUE); taxonomyCreate($IDUser, 'register_user', $tglSekarang); if ($sendMail == TRUE) { $this->CI->load->library('m_net'); $myMail = optionGet('company_email'); $myName = optionGet('company_name'); $subject = optionGet('email_register_subject'); $message = optionGet('email_register_message'); $output = ''; $output .= $message . '<br/>'; $output .= 'Username : <b>' . $username . '</b><br/>'; $output .= 'Password : <b>' . $password . '</b><br/>'; $output .= '<hr/>'; $output .= 'Regards,<br/><p> </p>'; $output .= $myName; $this->CI->m_net->SendEmail($myMail, $myName, $emailx, $subject, $output, '', ''); return true; } else { return true; } } else { return false; } } else { return false; } } else { return false; } } else { return false; } }
public function ajax_add() { //$this->_validate(); $dibayar = str_replace(',', '', $this->input->post('dibayar')); $kurensi = $this->input->post('kurensi'); $list_id = $this->input->post('inv'); $saldo = str_replace(',', '', $this->input->post('saldo')); $data = array('list_id' => $list_id, 'no' => $this->input->post('no'), 'coa_id' => $this->input->post('coa_id'), 'tgl_dibayar' => date('Y-m-d', strtotime($this->input->post('tgl_dibayar'))), 'dibayar' => $dibayar, 'catatan' => $this->input->post('catatan'), 'created_by' => sessId(), 'created_on' => dateNow()); $insert = $this->main->save($data); $terbayar = getValue('terbayar', 'purchase_hutang_list', array('id' => 'where/' . $list_id)); $terbayar = $terbayar + $dibayar; $status = $saldo > 0 ? 2 : 3; $data_list = array('terbayar' => $terbayar, 'saldo' => $saldo, 'status_hutang_id' => $status, 'edited_by' => sessId(), 'edited_on' => dateNow()); $this->db->where('id', $list_id)->update('purchase_hutang_list', $data_list); rekening('purchase_hutang', $insert, $data['coa_id'], 'out', $data['dibayar'], 0, $kurensi); echo json_encode(array("status" => TRUE)); }
function add() { permissionUser(); $list = array('kode_barang' => $this->input->post('kode_barang'), 'deskripsi' => $this->input->post('deskripsi'), 'diretur' => $this->input->post('diretur'), 'diterima' => $this->input->post('diterima'), 'satuan' => $this->input->post('satuan')); $data = array('no' => $this->input->post('no'), 'tanggal_transaksi' => date('Y-m-d', strtotime($this->input->post('tanggal_transaksi'))), 'ref_id' => $this->input->post('penerimaan_id'), 'catatan' => $this->input->post('catatan'), 'created_by' => sessId(), 'created_on' => dateNow()); $this->db->insert($this->table_name, $data); $insert_id = $this->db->insert_id(); for ($i = 0; $i < sizeof($list['kode_barang']); $i++) { $data2 = array($this->file_name . '_id' => $insert_id, 'kode_barang' => $list['kode_barang'][$i], 'deskripsi' => $list['deskripsi'][$i], 'diretur' => str_replace(',', '', $list['diretur'][$i]), 'diterima' => str_replace(',', '', $list['diterima'][$i]), 'satuan_id' => $list['satuan'][$i]); if ($this->db->insert($this->table_name . '_list', $data2)) { $sisa = getValue('dalam_stok', 'stok', array('barang_id' => 'where/' . $list['kode_barang'][$i])) - $list['diretur'][$i]; $this->db->where('barang_id', $list['kode_barang'][$i])->update('stok', array('dalam_stok' => $sisa)); $status = $list['diretur'][$i] >= $list['diterima'][$i] ? 4 : 5; } } $this->insert_po_status($this->input->post('penerimaan_id')); redirect($this->module . '/' . $this->file_name, 'refresh'); }
function add() { permissionUser(); $list = array('kode_barang' => $this->input->post('kode_barang'), 'deskripsi' => $this->input->post('deskripsi'), 'jumlah' => $this->input->post('jumlah'), 'satuan' => $this->input->post('satuan'), 'harga' => $this->input->post('harga'), 'disc' => $this->input->post('disc'), 'catatan_barang' => $this->input->post('catatan_barang')); //print_mz($list); $data = array('no' => $this->input->post('no'), 'tanggal_transaksi' => date('Y-m-d', strtotime($this->input->post('tanggal_transaksi'))), 'tanggal_pengiriman' => date('Y-m-d', strtotime($this->input->post('tanggal_pengiriman'))), 'po' => $this->input->post('po'), 'jatuh_tempo_pembayaran' => date('Y-m-d', strtotime($this->input->post('jatuh_tempo'))), 'no_faktur' => $this->input->post("no_faktur"), 'tanggal_faktur' => date('Y-m-d', strtotime($this->input->post('tanggal_faktur'))), 'catatan' => $this->input->post('catatan'), 'created_by' => sessId(), 'created_on' => dateNow()); $this->db->where('po', $this->input->post('po'))->update('purchase_order', array('is_invoiced' => 1)); $this->db->insert($this->table_name, $data); $insert_id = $this->db->insert_id(); if ($this->input->post('metode_pembayaran_id') == 2) { $data_hutang = array('pembelian_id' => $insert_id, 'total' => str_replace(',', '', $this->input->post('saldo')), 'terbayar' => 0, 'saldo' => str_replace(',', '', $this->input->post('saldo')), 'status_hutang_id' => 1); $this->db->insert('purchase_hutang_list', $data_hutang); } for ($i = 0; $i < sizeof($list['kode_barang']); $i++) { $data2 = array($this->file_name . '_id' => $insert_id, 'kode_barang' => $list['kode_barang'][$i], 'deskripsi' => $list['deskripsi'][$i], 'jumlah' => str_replace(',', '', $list['jumlah'][$i]), 'satuan_id' => $list['satuan'][$i], 'harga' => str_replace(',', '', $list['harga'][$i]), 'disc' => str_replace(',', '', $list['disc'][$i])); $this->db->insert($this->table_name . '_list', $data2); } redirect($this->module . '/' . $this->file_name, 'refresh'); }
function send_notification($id) { permissionUser(); $url = base_url() . 'purchase/order/INV/' . $id; $isi = getName(sessId()) . " Melakukan Transaksi cash_ledger Barang <a href={$url}> KLIK DISINI </a> "; $approver = getAll('approver'); foreach ($approver->result() as $r) { $data = array('sender_id' => sessId(), 'receiver_id' => $r->user_id, 'sent_on' => dateNow(), 'judul' => 'cash_ledger Order', 'isi' => $isi, 'url' => $url); $this->db->insert('notifikasi', $data); } return TRUE; }
?> €</span></p> <p>Avancée <span><?php echo percentageDonation($totalAmount7); ?> %</span></p> <p class="italic"><?php echo $totalDonor7; ?> contributeur(s)</p> </div> </div> <div class="col-md-6 col-lg-4 single-day"> <div class="visual-icon <?php dateNow('2016-02-26'); ?> "> <h3>9</h3> </div> <div class="content"> <p>Contribution <span><?php echo $totalAmount8; ?> €</span></p> <p>Avancée <span><?php echo percentageDonation($totalAmount8); ?> %</span></p> <p class="italic"><?php echo $totalDonor8;
function send_notification($id) { permissionUser(); $url = base_url() . 'stok/penerimaan/detail/' . $id; $isi = getName(sessId()) . " Melakukan Transaksi Penerimaan Barang <a href={$url}> KLIK DISINI </a> "; $no = getValue('no', 'stok_penerimaan', array('id' => 'where/' . $id)); $approver = getAll('approver'); foreach ($approver->result() as $r) { $data = array('sender_id' => sessId(), 'receiver_id' => $r->user_id, 'sent_on' => dateNow(), 'no' => $no, 'judul' => 'Penerimaan Order', 'isi' => $isi, 'url' => $url); $this->db->insert('notifikasi', $data); } return TRUE; }
function upload() { $file = fopen('D:\\barang__.csv', "r"); $count = 0; /*satuan : Pcs M roll=300m roll pack set */ while (($emapData = fgetcsv($file, 10000, ",")) !== FALSE) { $count++; if ($count > 10) { $barang_id = getValue('id', 'barang', array('kode' => 'where/' . $emapData[4])); $data = array('barang_id' => $barang_id, 'dalam_stok' => $emapData[91], 'created_by' => 1, 'created_on' => dateNow()); $this->db->insert('stok', $data); //$cek = getAll('barang', array('kode'=>'where/'.$emapData[4]))->num_rows(); //if($cek<1)$this->db->insert('barang', $data);else $this->db->where('kode', $emapData[4])->update('barang', $data); echo '<pre>'; echo $this->db->last_query(); echo '</pre>'; } } }
function editlink() { $title = $this->input->post('title'); $url = $this->input->post('url'); $menu = $this->input->post('menu'); $pos = $this->input->post('pos'); $parent = $this->input->post('parent'); $slug = stringCreateSlug($title); $jsondata = json_encode(array('create' => dateNow(TRUE), 'relasi' => 'link', 'value' => $url)); //updateTerms($menu,'menu_'.$pos,$title,$slug."_menu","",$parent,$jsondata); $tipe = "menu_" . $pos . "_" . getThemeActive(); $catSlug = dbField('terms', 'term_id', $menu, 'slug'); updateTerms($menu, $tipe, $title, $catSlug, "", $parent, $jsondata); echo json_encode('ok'); }
<h5 class="box-title">Info Event</h5> <div class="box-tools pull-right"> <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button> </div> </div> <div class="box-body" > <div class="col-xs-8"> <label>Tanggal Event</label> <div class="input-group"> <?php $lastTanggal2 = ''; $valTanggal2 = set_value('tanggalevent'); if (!empty($valTanggal2)) { $lastTanggal2 = set_value('tanggalevent'); } else { $lastTanggal2 = dateNow(); } $lastTanggal3 = ''; $valTanggal3 = set_value('jamevent'); if (!empty($valTanggal3)) { $lastTanggal3 = set_value('jamevent'); } else { $lastTanggal3 = date("H:i"); } ?> <input type="text" name="tanggalevent" class="form-control tanggal" id="tanggal2" readonly="" required="" value="<?php echo $lastTanggal2; ?> "/> <span class="input-group-btn"> <button class="btn btn-default" type="button" id="tritgl2"><i class="fa fa-calendar"></i></button>
public function delete_by_id($id) { $data = array('is_deleted' => 1, 'deleted_by' => sessId(), 'deleted_on' => dateNow()); $this->db->where('id', $id); $this->db->update($this->table, $data); //$this->db->delete($this->table); }
function addGalleryFile($galleryID, $file, $mime, $alt = '') { $d = array('gallery_id' => $galleryID, 'gallery_date' => dateNow(TRUE), 'gallery_file' => $file, 'gallery_mime' => $mime, 'gallery_alt' => $alt); if ($this->m_database->addRow('gallery_images', $d) == TRUE) { return true; } else { return false; } }
function notif_manager($id) { permissionUser(); $url = base_url() . $this->module . '/' . $this->file_name . '/detail/' . $id; $isi = getName(sessId()) . " Mengajuan Purchase Order, Untuk melakukan approval silakan <a href={$url}> KLIK DISINI </a>."; $approver = getAll('approver', array('level' => 'where/2')); foreach ($approver->result() as $r) { $data = array('sender_id' => sessId(), 'receiver_id' => $r->user_id, 'sent_on' => dateNow(), 'judul' => 'Pengajuan Purchase Order', 'isi' => $isi, 'url' => $url); $this->db->insert('notifikasi', $data); } return TRUE; }
public function ajax_update() { $data = array('kode' => $this->input->post('kode'), 'nama' => $this->input->post('nama'), 'telp_1' => $this->input->post('telp_1'), 'telp_2' => $this->input->post('telp_2'), 'email' => $this->input->post('email'), 'alamat' => $this->input->post('alamat'), 'komisi' => $this->input->post('komisi'), 'catatan' => $this->input->post('catatan'), 'edited_by' => sessId(), 'edited_on' => dateNow()); $this->main->update(array('id' => $this->input->post('id')), $data); echo json_encode(array("status" => TRUE)); }
function generateFeed($type = "atom", $view) { //$this->CI->load->library('ext/feed'); require_once dirname(__FILE__) . '/ext/Feedweb.php'; $this->CI->load->helper('text'); $feed = new Feedweb(); $this->CI->load->library('m_database'); $maxDate = $this->CI->m_database->maxRow('posts', '', 'post_date'); $feed->title = optionGet('site_title'); $feed->description = optionGet('site_description'); $feed->link = base_url(); $feed->lang = "id"; $feed->pubdate = $maxDate; $param = array('post_status' => 'publish'); $dPost = mc_allpost($param, 'post_date DESC', '', 20); if ($dPost['jumlah'] > 0) { foreach ($dPost['data'] as $rPost) { $title = $rPost->post_title; $author = ""; $url = permalinkPost($rPost->post_id); $date = $rPost->post_date; $desc = word_limiter($rPost->post_content, 50); if (!empty($rPost->post_user)) { $author = dbField('userlogin', 'user_id', $rPost->post_user, 'nama'); } else { $author = "Administrator"; } $feed->add($title, $author, $url, $date, $desc); } } else { $feed->add(optionGet('site_title'), optionGet('site_title'), base_url(), dateNow(TRUE), optionGet('site_description')); } $feed->render($type, $view); }
function send_notif($id) { $group_id = array('3', '4', '8', '9', '10'); $user_id = $this->db->select('user_id')->where_in('group_id', $group_id)->get('users_groups')->result(); $r = []; $receiver = $this->db->select('user_id')->where_in('group_id', $group_id)->get('users_groups')->result_array(); foreach ($receiver as $key => $value) { $r[] = getEmail($value['user_id']); //$r[] = '*****@*****.**'; } $r = implode(',', $r); $subject = 'Pembuatan Sales Order'; $no = getValue('no', $this->table_name, array('id' => 'where/' . $id)); $url = base_url() . $this->module . '/' . $this->file_name . '/detail/' . $id; $isi = $isi = getName(sessId()) . " membuat sales Order, Untuk melihat detail silakan <a href={$url}> KLIK DISINI </a>."; foreach ($user_id as $u) { $data = array('sender_id' => sessId(), 'receiver_id' => $u->user_id, 'sent_on' => dateNow(), 'judul' => $subject, 'no' => $no, 'isi' => $isi, 'url' => $url); $this->db->insert('notifikasi', $data); } $this->send_email($r, $subject, $isi); }
function adddraft() { $this->m_security->filterPost('title', 'required'); $this->m_security->filterPost('konten', 'required'); if ($this->m_security->startPost() == TRUE) { $judul = $this->input->post('title'); $konten = $this->input->post('konten'); $tglSekarang = dateNow(TRUE); $this->load->model('post_model', 'pm'); $this->pm->addPost($judul, $tglSekarang, $konten, "draft"); redirect(base_url(roleURIUser() . 'content/posts'), 'refresh'); } else { redirect(base_url(roleURIUser() . 'dashboard'), 'refresh'); } }
<?php // adHocMenu.php session_start(); require_once "adHocConst.php"; require_once "adHocInclude.php"; $connAdHoc = pdoConnect(cAdHocServer, cAdHocDatabase, cAdHocUsername, cAdHocPassword); //get today's date $pageDate = dateNow(); //request sitenum takes precedent over session sitenum if (isset($_REQUEST["sitenum"])) { $siteNum = $_REQUEST["sitenum"]; } else { if (isset($_SESSION["sitenum"])) { $siteNum = $_SESSION["sitenum"]; } else { $siteNum = "1"; } } $_SESSION["sitenum"] = $siteNum; traceHide("sitenum=" . $siteNum); if (isset($_REQUEST["nextmenu"])) { $nextMenu = $_REQUEST["nextmenu"]; } else { $nextMenu = "1"; } traceHide("nextmenu=" . $nextMenu); $sql = " SELECT menu_num, line_num, title, sub_menu_num, select_stmt" . " FROM menus" . " LEFT JOIN queries ON main_query_num = query_num" . " WHERE menu_num = " . $nextMenu . " AND hidden = 0" . " ORDER BY menu_num, line_num"; $adHocStmt = pdoQuery($sql, $connAdHoc); $adHocRows = pdoFetch($adHocStmt); ?>
function upload_barang2() { $file = fopen('D:\\barang.csv', "r"); $count = 0; /*satuan : Pcs M roll=300m roll pack set */ while (($emapData = fgetcsv($file, 10000, ",")) !== FALSE) { $count++; if ($count > 0) { switch ($emapData[6]) { case 'PCS': $satuan = 1; break; case 'ROLL': $satuan = 2; break; case 'roll=300m': $satuan = 3; break; case 'METER': $satuan = 4; break; case 'PACK': $satuan = 5; break; case 'SET': $satuan = 6; break; default: $satuan = 1; break; } if ($emapData[5] == 'Barang Inventaris') { $jenis = 3; } elseif ($emapData[5] == 'Barang Mentah') { $jenis = 2; } else { $jenis = 1; } $data = array('kode' => $emapData[1], 'merk' => $emapData[2], 'title' => $emapData[3], 'satuan' => 1, 'jenis_barang_id' => $jenis, 'created_by' => 1, 'created_on' => dateNow()); $cek = getAll('barang', array('kode' => 'where/' . $emapData[1]))->num_rows(); if ($cek < 1) { $this->db->insert('barang', $data); } else { $this->db->where('kode', $emapData[1])->update('barang', $data); } echo '<pre>'; echo $count . '-' . $this->db->last_query(); echo '</pre>'; $barang_id = getValue('id', 'barang', array('kode' => 'where/' . $emapData[1])); $num = getAll('stok', array('barang_id' => 'where/' . $barang_id))->num_rows; if ($num < 1) { $this->db->insert('stok', array('barang_id' => $barang_id)); } echo '<pre>'; echo $count . '-' . $this->db->last_query(); echo '</pre>'; } } }
function approve() { $level = $this->input->post('level'); //die($level); $id = $this->input->post('id'); //if($level == 1)$this->notif_manager($id); $data = array('is_app_lv' . $level => 1, 'app_status_id_lv' . $level => $this->input->post('app_status_id_lv' . $level), 'date_app_lv' . $level => dateNow(), 'user_app_lv' . $level => sessId(), 'note_app_lv' . $level => $this->input->post('note_lv' . $level)); $this->db->where('id', $id)->update($this->table_name, $data); echo json_encode(array("status" => $id)); }
function add() { //print_mz(str_replace(',', '', $this->input->post('total-ppn'))); permissionUser(); $list = array('kode_barang' => $this->input->post('kode_barang'), 'ref_id' => $this->input->post('ref_id'), 'deskripsi' => $this->input->post('deskripsi'), 'diterima' => $this->input->post('jumlah'), 'diorder' => $this->input->post('diorder'), 'satuan' => $this->input->post('satuan'), 'harga' => $this->input->post('harga'), 'disc' => $this->input->post('disc'), 'pajak' => $this->input->post('pajak'), 'catatan_barang' => $this->input->post('catatan_barang'), 'inc_ppn' => $this->input->post('pajak_checkbox1')); $data = array('no' => $this->input->post('no'), 'no_sj' => implode(',', $this->input->post('no_sj')), 'kontak_id' => $this->input->post('kontak_id'), 'up' => '', 'alamat' => $this->input->post('alamat'), 'project' => $this->input->post("project"), 'no_faktur' => $this->input->post("no_faktur"), 'metode_pembayaran_id' => $this->input->post('metode_pembayaran_id'), 'tanggal_transaksi' => date('Y-m-d', strtotime($this->input->post('tanggal_transaksi'))), 'tanggal_faktur' => date('Y-m-d', strtotime($this->input->post('tanggal_faktur'))), 'tanggal_pengantaran' => date('Y-m-d', strtotime($this->input->post('tanggal_pengiriman'))), 'so' => $this->input->post('so'), 'opsi_desimal' => $this->input->post('opsi_desimal'), 'gudang_id' => $this->input->post('gudang_id'), 'jatuh_tempo_pembayaran' => date('Y-m-d', strtotime($this->input->post('tanggal_pengiriman'))), 'kurensi_id' => $this->input->post('kurensi_id'), 'biaya_pengiriman' => str_replace(',', '', $this->input->post('biaya_pengiriman')), 'dibayar' => str_replace(',', '', $this->input->post('dibayar')), 'saldo' => str_replace(',', '', $this->input->post('saldo')), 'dibayar_nominal' => str_replace(',', '', $this->input->post('dibayar-nominal')), 'lama_angsuran_1' => $this->input->post('lama_angsuran_1'), 'lama_angsuran_2' => $this->input->post('lama_angsuran_2'), 'catatan' => $this->input->post('catatan'), 'pajak_komponen_id' => !empty($this->input->post('pajak_komponen_id')) ? implode(',', $this->input->post('pajak_komponen_id')) : '', 'total_ppn' => str_replace(',', '', $this->input->post('total-ppn')), 'total_pph22' => str_replace(',', '', $this->input->post('total-pph22')), 'total_pph23' => str_replace(',', '', $this->input->post('total-pph23')), 'total_diskon' => str_replace(',', '', $this->input->post('total-diskon')), 'total' => str_replace(',', '', $this->input->post('total')), 'total_plus_pajak' => str_replace(',', '', $this->input->post('total_plus_pajak')), 'created_by' => sessId(), 'created_on' => dateNow()); $nextrec = getValue('nextrec', 'numbersequencetable', array('table_name' => 'where/inv')); $this->db->where('table_name', 'inv')->update('numbersequencetable', array('nextrec' => $nextrec + 1)); $this->db->insert($this->table_name, $data); $insert_id = $this->db->insert_id(); if ($this->input->post('metode_pembayaran_id') == 2) { $data_hutang = array('penjualan_id' => $insert_id, 'total' => str_replace(',', '', $this->input->post('saldo')), 'terbayar' => 0, 'saldo' => str_replace(',', '', $this->input->post('saldo')), 'status_hutang_id' => 1); $this->db->insert('sales_piutang_list', $data_hutang); } for ($i = 0; $i < sizeof($list['kode_barang']); $i++) { $data2 = array($this->file_name . '_id' => $insert_id, 'ref_id' => $list['ref_id'][$i], 'kode_barang' => $list['kode_barang'][$i], 'deskripsi' => $list['deskripsi'][$i], 'diterima' => str_replace(',', '', $list['diterima'][$i]), 'diorder' => str_replace(',', '', $list['diorder'][$i]), 'satuan_id' => $list['satuan'][$i], 'inc_ppn' => $list['inc_ppn'][$i], 'harga' => str_replace(',', '', $list['harga'][$i]), 'disc' => str_replace(',', '', $list['disc'][$i]), 'pajak' => str_replace(',', '', $list['pajak'][$i]), 'catatan' => str_replace(',', '', $list['catatan_barang'][$i])); $this->db->insert($this->table_name . '_list', $data2); $this->db->where('id', $list['ref_id'][$i])->update('stok_pengeluaran', array('is_closed' => 1)); $this->load->library('upload'); $this->upload->initialize($this->set_upload_options()); if ($this->upload->do_multi_upload("attachment")) { $up = $this->upload->get_multi_upload_data(); $att = array('attachment' => $up[$i]['file_name']); $this->db->where('kode_barang', $list['kode_barang'][$i])->where($this->file_name . '_id', $insert_id)->update($this->table_name . '_list', $att); } else { $att = $this->input->post('attachment'); $attx = !empty($att[$i]) ? $att[$i] : ''; $this->db->where('kode_barang', $list['kode_barang'][$i])->where($this->file_name . '_id', $insert_id)->update($this->table_name . '_list', array('attachment' => $attx)); } } redirect($this->module . '/' . $this->file_name, 'refresh'); }