public function load_notif_header() { $data['notification'] = GetAll('notifikasi', array('is_read' => 'where/0', 'receiver_id' => 'where/' . sessId(), 'limit' => 'limit/3', 'id' => 'order/desc')); $data['notifications'] = GetAll('notifikasi', array('is_read' => 'where/0', 'receiver_id' => 'where/' . sessId(), 'id' => 'order/desc')); $data['notification_num'] = GetAll('notifikasi', array('is_read' => 'where/0', 'receiver_id' => 'where/' . sessId()))->num_rows(); $this->load->view('notification/head_notif_badge', $data); }
function index() { permissionUser(); $num_rows = getAll($this->table_name, array('receiver_id' => 'where/' . sessId()))->num_rows(); $this->data['last_id'] = $last_id = $num_rows > 0 ? $this->db->select('id')->where('receiver_id', sessId())->order_by('id', 'asc')->get($this->table_name)->last_row()->id : 0; $this->data['last_notif'] = getAll($this->table_name, array('receiver_id' => 'where/' . sessId(), 'id' => 'where/' . $last_id))->row(); $this->data['all_notification'] = GetAll('notifikasi', array('receiver_id' => 'where/' . sessId(), 'id' => 'order/desc')); $this->_render_page('notification/index', $this->data); }
function detail($id) { $this->data['title'] = $this->title . ' - Detail'; permissionUser(); $this->data['id'] = $id; $this->data['r'] = GetAll('stok_penyesuaian', array('id' => 'where/' . $id))->row(); $this->data['list'] = $this->main->get_list($id)->result(); $this->_render_page($this->module . '/' . $this->file_name . '/detail', $this->data); }
function print_pdf($id) { permissionUser(); $this->data['id'] = $id; $this->data['r'] = GetAll('stok_pemindahan', array('id' => 'where/' . $id))->row(); $this->data['list'] = $this->main->get_list($id)->result_array(); $this->load->library('pdf'); $html = $this->load->view($this->module . '/' . $this->file_name . '/pdf', $this->data, true); $this->pdf->load_html($html); $this->pdf->render(); $this->pdf->stream($id . '-' . $this->title . '.pdf'); }
function response_cat($id = null) { //error_reporting(0); if ($id != '') { /* $qdep=$this->model_getdata->get_department(); $data['listdep']=$qdep->result(); $data['bulan']=$this->model_getdata->namabulan(); */ $data['document'] = GetAll('report', array('id' => 'where/' . $id)); if ($data['document']->num_rows() > 0) { $this->load->view('report/category/main', $data); } else { echo "Dokumen Tidak Ditemukan"; } } }
function index() { if (!$this->ion_auth->logged_in()) { //redirect them to the login page redirect('auth/login', 'refresh'); } elseif (!$this->ion_auth->is_admin()) { //redirect them to the home page because they must be an administrator to view this //return show_error('You must be an administrator to view this page.'); return show_error('You must be an administrator to view this page.'); } else { //set the flash data error message if there is one $this->data['message'] = validation_errors() ? validation_errors() : $this->session->flashdata('message'); $filter = array('is_deleted' => 0); $query_options = GetAll('library', $filter); $this->data['user_all'] = $query_options->num_rows() > 0 ? $query_options : array(); $this->_render_page('library_table/index', $this->data); } }
function input($id = NULL) { $this->data['val'] = $this->data['list'] = array(); if ($id > 0) { $this->data['val'] = GetAll($this->file_name, array('id' => 'where/' . $id))->row_array(); $this->data['list'] = GetAll($this->file_name . '_list', array($this->file_name . '_id' => 'where/' . $id))->result_array(); } $this->data['title'] = $this->title . ' - Input'; permissionUser(); $this->data['module'] = $this->module; $this->data['file_name'] = $this->file_name; $this->data['r'] = $this->main->get_detail($id); $this->data['opt_barang'] = GetAll('barang')->result(); $this->data['barang'] = getAll('barang')->result_array(); $this->data['satuan'] = getAll('satuan')->result_array(); $this->data['opt_satuan'] = GetOptAll('satuan'); $this->_render_page($this->module . '/' . $this->file_name . '/input', $this->data); }
private function _get_datatables_query($param = NULL) { //Parameter $where = "id > 0 "; if (isset($param['divisi']) && $param['divisi'] > 0) { $id_sec = "("; $q = GetAll("hris_orgs", array("parent_id" => "where/" . $param['divisi'])); foreach ($q->result_array() as $r) { $id_sec .= "'" . $r['org_id'] . "',"; } $id_sec = substr($id_sec, 0, -1) . ")"; $where .= "AND org_id in " . $id_sec . " "; } if (isset($param['section']) && $param['section'] > 0) { $where .= "AND org_id='" . $param['section'] . "' "; } if (isset($param['position']) && $param['position'] > 0) { $where .= "AND job_class_id='" . $param['position'] . "' "; } if (isset($param['grade']) && $param['grade'] > 0) { $where .= "AND grade_job_class='" . $param['grade'] . "' "; } if (isset($param['regs'])) { if ($param['regs'] == "reguler") { $where .= "AND group_shift='N.A.' "; } else { if ($param['regs'] == "shift") { $where .= "AND group_shift in ('A', 'B', 'C', 'D') "; } } //$this->db->where_in("group_shift", array("A","B","C","D")); } //Query $select = "*"; $this->db->select($select); $this->db->from("kg_view_cuti_platfon"); $this->db->where($where); $this->db->order_by("person_nm", "asc"); }
function upload_excel() { $config['upload_path'] = './upload/files/excel'; $config['allowed_types'] = 'xlsx|xls|csv'; $config['overwrite'] = TRUE; $config['max_size'] = '10000'; $val = 0; $this->load->library('upload', $config); if (!$this->upload->do_upload('excelfile')) { $error = array('error' => $this->upload->display_errors()); die(print_r($error)); } else { $data = array('upload_data' => $this->upload->data()); // echo "success"; $data_upload = $this->upload->data(); //die(print_r($data_upload)); $result = $this->run_import($data_upload); //die(print_r($result)); foreach ($result as $row) { $employee_ext_id = $row['A']; $val = $row['C']; $employee_id = GetValue('employee_id', 'hris_employee', array('employee_ext_id' => 'where/' . $employee_ext_id)); //count $count = GetAll('payroll_monthly_deduction_medical', array('payroll_period_id' => 'where/' . $this->input->post('periode'), 'employee_id' => 'where/' . $employee_id))->num_rows(); if ($count > 0) { $val_old = GetValue('value', 'payroll_monthly_deduction_medical', array('employee_id' => 'where/' . $employee_id, 'payroll_period_id' => 'where/' . $this->input->post('periode'))); $val_new = $val_old + $val; $data_update = array('value' => $val_new); $this->all_model->update('payroll_monthly_deduction_medical', $data_update, array('employee_id' => $employee_id, 'payroll_period_id' => $this->input->post('periode'))); //lastq(); } else { $data_insert = array('payroll_period_id' => $this->input->post('periode'), 'employee_id' => $employee_id, 'value' => $val, 'created_by' => sessId(), 'created_on' => date('Y-m-d H:i:s')); $this->all_model->insert('payroll_monthly_deduction_medical', $data_insert); } } } redirect('payroll/medical'); }
function update_master_component_value($component_id) { $today = date('Y-m-d'); $master_id = GetAllSelect('payroll_master_component', 'payroll_component_id, payroll_master_id', array('payroll_component_id' => 'where/' . $component_id))->result(); $emp_id = getValue('employee_id', 'payroll_master', array('id' => 'where/' . $master_id)); $filter = array('payroll_component_id' => 'where/' . $component_id, 'session_id' => 'where/' . $this->session_id); $component_session_id = getValue('id', 'payroll_component_session', $filter); //lastq(); $com_val = $this->db->select('*')->where('payroll_component_session_id', $component_session_id)->get('payroll_component_value')->result(); $formula = ''; if (!empty($com_val)) { //print_ag($com_val); foreach ($com_val as $c) { $from = date('Y-m-d', strtotime($c->from)); $to = date('Y-m-d', strtotime($c->to)); //print_ag("$today lebih besar dari $from , $today kurang dari $to"); //print_mz($from); //if($today > $from && $today < $to)die('s'); if ($today >= $from && $today <= $to) { $formula = $c->formula; //echo $formula; $is_condition = $c->is_condition; $min = $c->min; $max = $c->max; } } } $tx = explode(' ', $formula); $r = ''; foreach ($master_id as $value) { if ($formula != null && $component_id != 60) { if (!in_array('IF', $tx)) { for ($i = 0; $i < sizeof($tx); $i++) { //print_mz($tx); if (preg_match("/[a-z]/i", $tx[$i])) { $session_id = '2015'; $g = getValue('id', 'payroll_component', array('code' => 'where/' . $tx[$i])); $detail = $this->payroll->get_employee_detail($emp_id); $det = $detail->row(); $employee_job_id = getValue('job_id', 'hris_employee_job', array('employee_id' => 'where/' . $emp_id)); $job_value_id = getValue('job_value_id', 'hris_jobs', array('job_id' => 'where/' . $employee_job_id)); $filter = array('session_id' => 'where/' . $session_id, 'job_value_id' => 'where/' . $job_value_id, 'job_class_id' => 'where/' . $det->job_class_id); $job_value_matrix = GetAll('payroll_job_value_matrix', $filter); //lastq(); $job_value_matrix_num = GetAll('payroll_job_value_matrix', $filter)->num_rows(); //lastq(); if ($tx[$i] == 'JVM') { $g = $jvm = $job_value_matrix_num > 0 ? $job_value_matrix->row()->value : 0; //print_r('jvm='.$g.'-'); } elseif ($tx[$i] == 'VAR') { $cm_param = GetAll('payroll_compensation_mix', array('session_id' => 'where/' . $session_id, 'job_class_id' => 'where/' . $det->job_class_id)); $cm_param_num = GetAll('payroll_compensation_mix', array('session_id' => 'where/' . $session_id, 'job_class_id' => 'where/' . $det->job_class_id))->num_rows(); //lastq(); $row = $cm_param->row(); $g = $var = $cm_param_num > 0 ? $row->var / 100 : 0 / 100; //print_mz('var='.$var.'-'); } elseif ($tx[$i] == 'CONV') { $g = getValue('value', 'payroll_exchange_rate', array('session_id' => 'where/' . $session_id)); } else { $g = getValue('value', 'payroll_master_component', array('payroll_master_id' => 'where/' . $value->payroll_master_id, 'payroll_component_id' => 'where/' . $g)); //print_r($g.'-'); } //print_r($value->component.'='.$g.'<br/>'); $tx[$i] = $g; } if (strpos($tx[$i], '%') !== false) { $tx[$i] = substr_replace($tx[$i], '/100', -1); } else { false; } $r .= $tx[$i]; } } else { $com = explode(PHP_EOL, $formula); //print_ag($com); for ($j = 0; $j < sizeof($com); $j++) { $ntx = ''; $bwgs = getValue('value', 'payroll_master_component', array('payroll_master_id' => 'where/' . $value->payroll_master_id, 'payroll_component_id' => 'where/60')); $hous = getValue('value', 'payroll_master_component', array('payroll_master_id' => 'where/' . $value->payroll_master_id, 'payroll_component_id' => 'where/66')); //print_mz($xj[$i]); $bwgshous = $bwgs + $hous; //print_mz($bwgshous); $xj = explode(' ', $com[$j]); //print_ag($xj); $n = ''; for ($i = 7; $i < sizeof($xj); $i++) { if (preg_match("/[a-z]/i", $xj[$i])) { //echo $j.'-'.$xj[$i].'<br/>'; switch ($xj[$i]) { case 'TK0': $xj[$i] = getValue('value', 'payroll_ptkp', array('title' => 'where/' . 'TK0')); break; case 'K0': $xj[$i] = getValue('value', 'payroll_ptkp', array('title' => 'where/' . 'K0')); break; case 'K1': $xj[$i] = getValue('value', 'payroll_ptkp', array('title' => 'where/' . 'K1')); //print_mz($xj[$i]); break; case 'K2': $xj[$i] = getValue('value', 'payroll_ptkp', array('title' => 'where/' . 'K2')); break; case 'K3': $xj[$i] = getValue('value', 'payroll_ptkp', array('title' => 'where/' . 'K3')); break; case 'UMK': //$xj[$i]=getValue('value', 'UMK', array('session'=>'where/'.$session_id)); $xj[$i] = 3000000; break; default: //print_ag($xj[$i]); $code = getValue('id', 'payroll_component', array('code' => 'where/' . $xj[$i])); $xj[$i] = getValue('value', 'payroll_master_component', array('payroll_master_id' => 'where/' . $value->payroll_master_id, 'payroll_component_id' => 'where/' . $code)); //print_ag($xj[$i]); break; } //print_ag('awa'.$j.'-'.$xj[$i]); } //print_ag($value->component); //print_ag($xj[$i]); if ($xj[$i] == '%') { $xj[$i] = '/100'; //print_ag('ke_replace '.$xj[$i]); } $ntx .= $xj[$i]; } //print_ag($value->code); //print_ag($xj); if ($xj[6] == '>') { $f = current(explode(";", $ntx)); //print_mz($ntx); $f = $this->evalmath($f); $f = @eval("return " . $f . ";"); //print_mz($f); $l = substr($ntx, strpos($ntx, ";") + 1); //print_ag($j.'-'.$l); $l = $this->evalmath($l); $l = @eval("return " . $l . ";"); //print_ag('>'.$bwgshous.$xj[6].$f.'='.$r); //print_mz($bwgshous.' > '.$f); if ($bwgshous > $f) { $r = $l; } } elseif ($xj[6] == '<') { $f = current(explode(";", $ntx)); //print_mz($ntx); $f = $this->evalmath($f); $f = @eval("return " . $f . ";"); //print_mz($f); $l = substr($ntx, strpos($ntx, ";") + 1); //print_ag($j.'-'.$l); $l = $this->evalmath($l); $l = @eval("return " . $l . ";"); //print_ag('>'.$bwgshous.$xj[6].$f.'='.$r); //print_mz($bwgshous.' > '.$f); if ($bwgshous < $f) { $r = $l; } } elseif ($xj[6] == '<=') { $f = current(explode(";", $ntx)); //print_mz($ntx); $f = $this->evalmath($f); $f = @eval("return " . $f . ";"); //print_mz($f); $l = substr($ntx, strpos($ntx, ";") + 1); //print_ag($j.'-'.$l); $l = $this->evalmath($l); $l = @eval("return " . $l . ";"); //print_ag('>'.$bwgshous.$xj[6].$f.'='.$r); //print_mz($bwgshous.' > '.$f); if ($bwgshous <= $f) { $r = $l; } } elseif ($xj[6] == '>=') { $f = current(explode(";", $ntx)); //print_mz($ntx); $f = $this->evalmath($f); $f = @eval("return " . $f . ";"); //print_mz($f); $l = substr($ntx, strpos($ntx, ";") + 1); //print_ag($j.'-'.$l); $l = $this->evalmath($l); $l = @eval("return " . $l . ";"); //print_ag('>'.$bwgshous.$xj[6].$f.'='.$r); //print_mz($bwgshous.' > '.$f); if ($bwgshous >= $f) { $r = $l; } } //print_ag($bwgshous.$xj[6].$f.'='.$r); } //print_ag($bwgshous.$xj[6].$f.$r); //print_ag($bwgshous.$xj[6].$f.$r); //print_mz($com); //print_ag($ntx); //print_ag($f); } $f = $this->evalmath($r); $tz = @eval("return " . $f . ";"); //print_ag($tz); //$is_condition = getValue('is_condition', 'payroll_component_value', array('payroll_component_id'=>'where/'.$value->component_id)); //$is_condition = 0; if ($is_condition == 1) { //$min = 1000; //$max = 70000000; //$min = getValue('min', 'payroll_component_value', array('payroll_component_id'=>'where/'.$value->component_id)); //$max = getValue('max', 'payroll_component_value', array('payroll_component_id'=>'where/'.$value->component_id)); if ($tz > $max) { $tz = $max; } elseif ($tz < $min) { $tz = $min; } else { $tz = $tz; } } $this->db->where('payroll_master_id', $value->payroll_master_id)->where('payroll_component_id', $component_id)->update('payroll_master_component', array('value' => $tz)); //echo '<pre>';print_r($this->db->last_query());echo "</pre><br/>"; } } }
private function _get_datatables_query($param = NULL) { //Parameter $exp = explode("~", $param['tgl']); $where = "date_full >= '" . $exp[0] . "' AND date_full <= '" . $exp[1] . "' "; if (isset($param['divisi']) && $param['divisi'] > 0) { $id_sec = "("; $q = GetAll("hris_orgs", array("parent_id" => "where/" . $param['divisi'])); foreach ($q->result_array() as $r) { $id_sec .= "'" . $r['org_id'] . "',"; } $id_sec = substr($id_sec, 0, -1) . ")"; $where .= "AND org_id in " . $id_sec . " "; } if (isset($param['section']) && $param['section'] > 0) { $where .= "AND org_id='" . $param['section'] . "' "; } if (isset($param['position']) && $param['position'] > 0) { $where .= "AND job_class_id='" . $param['position'] . "' "; } if (isset($param['grade']) && $param['grade'] > 0) { $where .= "AND grade_job_class='" . $param['grade'] . "' "; } if (isset($param['regs'])) { if ($param['regs'] == "reguler") { $where .= "AND group_shift='N.A.' "; } else { if ($param['regs'] == "shift") { $where .= "AND group_shift in ('A', 'B', 'C', 'D') "; } } //$this->db->where_in("group_shift", array("A","B","C","D")); } $person_id = permission(); if ($person_id != 1) { $bawahan = CekBawahan($person_id); $id_bawahan = "('" . $person_id . "',"; foreach ($bawahan as $r) { $id_bawahan .= "'" . $r . "',"; } $id_bawahan = substr($id_bawahan, 0, -1) . ")"; $where .= "AND person_id in " . $id_bawahan . " "; } //Query $select = "id, ext_id, person_nm, id_employee as a_id, SUM(jhk) as jhk, SUM(sakit) as sakit,\n SUM(cuti) as cuti,SUM(ijin) as ijin, SUM(late) as late, SUM(alpa) as alpa,SUM(off) as off, SUM(jh) as jh"; $this->db->select($select); $this->db->from($this->table); $i = 0; $like = ""; foreach ($this->column as $item) { if (isset($_POST['search']['value'])) { //($i===0) ? $this->db->like($item, $_POST['search']['value']) : $this->db->or_like($item, $_POST['search']['value']); $like .= $i === 0 ? " AND (" . $item . " LIKE '%" . $_POST['search']['value'] . "%' " : " OR " . $item . " LIKE '%" . $_POST['search']['value'] . "%' "; } $column[$i] = $item; $i++; } if ($like != "") { $like .= ")"; $this->db->where($where . $like); } else { $this->db->where($where); } $this->db->group_by(array("id_employee", "person_nm")); if (isset($_POST['order'])) { $this->db->order_by($column[$_POST['order']['0']['column']], $_POST['order']['0']['dir']); } else { if (isset($this->order)) { $order = $this->order; $this->db->order_by(key($order), $order[key($order)]); } } $this->db->order_by("person_nm", "asc"); }
function detail_email($id) { $sess_id = $this->data['sess_id'] = $this->session->userdata('user_id'); $this->data['sess_nik'] = $sess_nik = get_nik($sess_id); $this->data['recruitment'] = $this->recruitment_model->recruitment($id)->result(); $this->data['_num_rows'] = $this->recruitment_model->recruitment($id)->num_rows(); $this->data['status'] = getAll('recruitment_status', array('is_deleted' => 'where/0')); $this->data['urgensi'] = getAll('recruitment_urgensi', array('is_deleted' => 'where/0')); $jk = explode(',', getAll('users_recruitment_kualifikasi', array('id' => 'where/' . $id))->row('jenis_kelamin_id')); $pendidikan = explode(',', getAll('users_recruitment_kualifikasi', array('id' => 'where/' . $id))->row('pendidikan_id')); $komputer = explode(',', getAll('users_recruitment_kemampuan', array('id' => 'where/' . $id))->row('komputer')); $this->data['jenis_kelamin'] = $this->recruitment_model->get_jk($jk); $this->data['pendidikan'] = $this->recruitment_model->get_pendidikan($pendidikan); $this->data['komputer'] = $this->recruitment_model->get_komputer($komputer); $this->data['position_pengaju'] = $this->get_user_position($this->recruitment_model->recruitment($id)->row_array()['user_id']); $this->data['approval_status'] = GetAll('approval_status', array('is_deleted' => 'where/0')); return $this->load->view('form_recruitment/recruitment_mail', $this->data, TRUE); }
function add() { error_reporting(0); permissionUser(); //print_mz($this->input->post()); $laporan = $this->input->post('laporan'); $m_v = $this->input->post('m_v'); $user = $this->input->post('user_id'); foreach ($laporan as $m) { $cek = GetAll('report_permission', array('user_id' => 'where/' . $user, 'menu_id' => 'where/' . $m))->num_rows(); $data['menu_id'] = $m; $data['create'] = $m_c[$m] ? '1' : '0'; $data['view'] = $m_v[$m] ? '1' : '0'; $data['update'] = $m_u[$m] ? '1' : '0'; $data['delete'] = $m_d[$m] ? '1' : '0'; $data['user_id'] = $user; $data['user_group'] = GetValue('group_id', 'users_groups', array('user_id' => 'where/' . $user)); if ($cek == 0) { $this->db->insert('report_permission', $data); } else { $this->db->where(array('user_id' => $user, 'menu_id' => $m)); $this->db->update('report_permission', $data); } } redirect($this->module . '/' . $this->file_name, 'refresh'); }
function edit($id) { permission(); $q = GetAll("kg_kehadirandetil", array("id" => "where/" . $id)); $r = $q->result_array(); $data['val'] = $r[0]; $data['tgl'] = $r[0]['tahun'] . "-" . $r[0]['bulan'] . "-" . $r[0]['tanggal']; $data['absensi'] = array(array("jh", "Hadir"), array("off", "Off"), array("cuti", "Cuti"), array("ijin", "Ijin"), array("sakit", "Sakit"), array("alpa", "Alpa")); //print_mz($data['absensi']); for ($i = 0; $i <= 20; $i++) { $opt[$i] = $i; } $data['opt_lembur'] = $opt; $this->load->view('attendance_edit', $data); //$this->_render_page($this->filename.'_edit',$data); }
function INV($id) { permissionUser(); $this->data['id'] = $id; $this->data[$this->file_name] = GetAll('cash_ledger', array('id' => 'where/' . $id)); $this->data[$this->file_name . '_list'] = GetAll('cash_ledger_list', array('id' => 'where/' . $id)); $this->load->library('mpdf60/mpdf'); $html = $this->load->view($this->module . '/' . $this->file_name . '/invoice', $this->data, true); $mpdf = new mPDF(); $mpdf = new mPDF('A4'); $mpdf->WriteHTML($html); $mpdf->Output($id . '-' . $title . '.pdf', 'I'); }
function GetOTCal($id_emp, $date) { $exp = explode("-", $date); $att_start_period = GetConfigDirect('att_start_period'); if ($exp[2] < $att_start_period) { $awal = date("Y-m", mktime(0, 0, 0, $exp[1] - 1, $exp[2], $exp[0])) . "-" . $att_start_period; } else { $awal = $exp[0] . "-" . $exp[1] . "-" . $att_start_period; } $acc = 0; $sum_hour = 0; $qq = GetAll("kg_view_overtime", array("id_employee" => "where/" . $id_emp, "ovt_status" => "where/Approve", "date_full >=" => "where/" . $awal, "date_full <=" => "where/" . $date, "date_temp" => "where/0000-00-00")); if ($qq->num_rows() > 0) { foreach ($qq->result_array() as $ss) { if ($ss['job_level'] != "nonmanagement") { if ($ss['ovt_hour_sum'] >= 2) { $acc += $ss['ovt_hour_sum']; $sum_hour += $ss['ovt_hour_sum']; } } else { $acc += $ss['ovt_hour_cal']; $sum_hour += $ss['ovt_hour_sum']; } } } $qq = GetAll("kg_view_overtime", array("id_employee" => "where/" . $id_emp, "ovt_status" => "where/Approve", "date_temp >=" => "where/" . $awal, "date_temp <=" => "where/" . $date)); if ($qq->num_rows() > 0) { foreach ($qq->result_array() as $ss) { if ($ss['job_level'] != "nonmanagement") { if ($ss['ovt_hour_sum'] >= 2) { $acc += $ss['ovt_hour_sum']; $sum_hour += $ss['ovt_hour_sum']; } } else { $acc += $ss['ovt_hour_cal']; $sum_hour += $ss['ovt_hour_sum']; } } } return $sum_hour . "~" . $acc; }
public function loadsatuanexist($id) { $data['ex'] = GetAll('barang_satuan', array('barang_id' => 'where/' . $id))->result_array(); $data['options_satuan'] = options_row('barang', 'get_satuan', 'id', 'title', '-- Pilih Satuan --'); $this->load->view('barang/satuan_exist', $data); }
function exe_shift($person_id, $tgl) { $webmaster_id = permission(); $exp = explode("-", $tgl); $thn = $exp[0]; $grup = array("N.A.", "A", "B", "C", "D"); $bln = array("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"); if ($thn == "2016") { $jadwal_grup['N.A.'] = array("reg", "off", "off", "reg", "reg", "reg", "reg", "reg", "off", "off", "reg", "reg", "reg", "reg", "reg", "off", "off", "reg", "reg", "reg", "reg", "reg", "off", "off", "reg", "reg", "reg", "reg"); $jadwal_grup['A'] = array(1, 2, 2, 2, "off", 3, 3, "off", 1, 1, 1, 2, 2, "off", 3, 3, "off", "off", 1, 1, 2, 2, "off", 3, 3, 3, "off", 1); $jadwal_grup['B'] = array("off", 1, 1, 1, 2, 2, "off", 3, 3, "off", "off", 1, 1, 2, 2, "off", 3, 3, 3, "off", 1, 1, 2, 2, 2, "off", 3, 3); $jadwal_grup['C'] = array(3, 3, "off", "off", 1, 1, 2, 2, "off", 3, 3, 3, "off", 1, 1, 2, 2, 2, "off", 3, 3, "off", 1, 1, 1, 2, 2, "off"); $jadwal_grup['D'] = array(2, "off", 3, 3, 3, "off", 1, 1, 2, 2, 2, "off", 3, 3, "off", 1, 1, 1, 2, 2, "off", 3, 3, "off", "off", 1, 1, 2); } else { if ($thn == "2015") { $jadwal_grup['N.A.'] = array("reg", "reg", "off", "off", "reg", "reg", "reg", "reg", "reg", "off", "off", "reg", "reg", "reg", "reg", "reg", "off", "off", "reg", "reg", "reg", "reg", "reg", "off", "off", "reg", "reg", "reg"); $jadwal_grup['A'] = array(1, 1, 2, 2, 2, "off", 3, 3, "off", 1, 1, 1, 2, 2, "off", 3, 3, "off", "off", 1, 1, 2, 2, "off", 3, 3, 3, "off"); $jadwal_grup['B'] = array(3, "off", 1, 1, 1, 2, 2, "off", 3, 3, "off", "off", 1, 1, 2, 2, "off", 3, 3, 3, "off", 1, 1, 2, 2, 2, "off", 3); $jadwal_grup['C'] = array("off", 3, 3, "off", "off", 1, 1, 2, 2, "off", 3, 3, 3, "off", 1, 1, 2, 2, 2, "off", 3, 3, "off", 1, 1, 1, 2, 2); $jadwal_grup['D'] = array(2, 2, "off", 3, 3, 3, "off", 1, 1, 2, 2, 2, "off", 3, 3, "off", 1, 1, 1, 2, 2, "off", 3, 3, "off", "off", 1, 1); } } //echo $thn."<br>"; //print_mz($jadwal_grup); //foreach($grup as $g) { $emp = GetAll("kg_view_employee", array("person_id" => "where/" . $person_id)); foreach ($emp->result_array() as $r) { $g = $r['group_shift']; if (isset($jadwal_grup[$g])) { $id_employee = $person_id; $loop = 0; foreach ($bln as $b) { if ($b >= $exp[1]) { $datanginput = array('id_employee' => $id_employee, 'bulan' => $b, 'tahun' => $thn); $jml_hari = date("t", mktime(0, 0, 0, $b, 1, $thn)); $awal = $b == $exp[1] ? intval($exp[2]) : 1; for ($i = $awal; $i <= $jml_hari; $i++) { if ($loop == 28) { $loop = 0; } $datanginput['tgl_' . $i] = $jadwal_grup[$g][$loop]; $loop++; } $temp_datahitung = $datanginput; unset($temp_datahitung['bulan']); unset($temp_datahitung['tahun']); unset($temp_datahitung['id_employee']); $hitung = array_count_values($temp_datahitung); //print_mz($datanginput); if (!isset($hitung['1'])) { $hitung['1'] = 0; } if (!isset($hitung['2'])) { $hitung['2'] = 0; } if (!isset($hitung['3'])) { $hitung['3'] = 0; } if (!isset($hitung['reg'])) { $hitung['reg'] = 0; } if (!isset($hitung['off'])) { $hitung['off'] = 0; } $datanginput['jum_p'] = $hitung['1']; $datanginput['jum_s'] = $hitung['2']; $datanginput['jum_m'] = $hitung['3']; $datanginput['jum_ns'] = $hitung['reg']; $datanginput['jum_off'] = $hitung['off']; $cekdata = GetValue("id", "kg_jadwal_shift", array("id_employee" => "where/" . $id_employee, "bulan" => "where/" . $b, "tahun" => "where/" . $thn)); if (!$cekdata) { $datanginput['create_user_id'] = $webmaster_id; $datanginput['create_date'] = date("Y-m-d H:i:s"); //print_mz($datanginput); $this->db->insert('kg_jadwal_shift', $datanginput); //$log[]=date("d-m-Y H:i:s").'; BERHASIL! Karyawan dengan nama '.GetValue('name','kg_employee',array('nik'=>'where/'.$nik)).' dari departemen '.GetValue('title','kg_department',array('id'=>'where/'.GetValue('id_department','kg_employee',array('nik'=>'where/'.$nik)))).'. untuk periode '.$bln.' - '.$thn.' telah diinput'; } else { $datanginput['modify_user_id'] = $webmaster_id; $datanginput['modify_date'] = date("Y-m-d H:i:s"); $this->db->where("id_employee", $id_employee); $this->db->where("bulan", $b); $this->db->where("tahun", $thn); $this->db->update('kg_jadwal_shift', $datanginput); //lastq(); } } else { $datanginput = array('id_employee' => $id_employee, 'bulan' => $b, 'tahun' => $thn); $jml_hari = date("t", mktime(0, 0, 0, $b, 1, $thn)); //$awal = $b==$exp[1] ? intval($exp[2]) : 1; for ($i = 1; $i <= $jml_hari; $i++) { if ($loop == 28) { $loop = 0; } //$datanginput['tgl_'.$i]=$jadwal_grup[$g][$loop]; $loop++; } } } } } //} }
function form_cuti_pdf($id) { if (!$this->ion_auth->logged_in()) { //redirect them to the login page redirect('auth/login', 'refresh'); } $sess_id = $this->data['sess_id'] = $this->session->userdata('user_id'); $user_id = getValue('user_id', 'users_cuti', array('id' => 'where/' . $id)); $user_nik = get_nik($user_id); $cuti_details = $this->data['form_cuti'] = $this->form_cuti_model->form_cuti_supervisor($id)->result(); $this->data['_num_rows'] = $this->form_cuti_model->form_cuti_supervisor($id)->num_rows(); $this->data['approval_status'] = GetAll('approval_status', array('is_deleted' => 'where/0')); $this->data['sisa_cuti'] = !empty($this->get_sisa_cuti($user_nik)[0]['ENTITLEMENT']) ? $this->get_sisa_cuti($user_nik)[0]['ENTITLEMENT'] : '-'; $this->data['id'] = $id; $title = $this->data['title'] = 'Form Cuti-' . get_name($user_id); $this->load->library('mpdf60/mpdf'); $html = $this->load->view('cuti_pdf', $this->data, true); $mpdf = new mPDF(); $mpdf = new mPDF('A4'); $mpdf->WriteHTML($html); $mpdf->Output($id . '-' . $title . '.pdf', 'I'); }
function carilist() { $v = $_POST['v']; $cariref = $this->db->query("SELECT * FROM sales_order WHERE (id='{$v}' OR so='{$v}') "); if ($cariref->num_rows() > 0) { $data['refid'] = $cariref->row_array(); //if($data['refid']['is_app_lv1']==1){ if ($data['refid']['is_closed'] == 0) { $data['reftype'] = 'sales_order'; $cekparsial = $this->db->query("SELECT * FROM stok_pengeluaran_list WHERE ref_type='" . $data['reftype'] . "' AND order_id='" . $data['refid']['id'] . "' GROUP BY pengeluaran_id ORDER BY id DESC "); $so = getValue('so', 'sales_order', array('id' => 'where/' . $v)); $pengiriman_ke = getAll('stok_pengeluaran', array('ref_id' => 'where/' . $v)); // lastq(); if ($cekparsial->num_rows() > 0) { $data['part'] = TRUE; $data['partno'] = $pengiriman_ke->num_rows() + 1; $data['partdata'] = $cekparsial->row_array(); } $data['list'] = GetAll('sales_order_list', array('order_id' => 'where/' . $data['refid']['id']))->result_array(); $this->load->view('stok/pengeluaran/input_list', $data); } //} } }
public function get_modal() { if (!$this->ion_auth->logged_in()) { //redirect them to the login page redirect('auth/login', 'refresh'); } elseif (!$this->ion_auth->is_admin()) { //redirect them to the home page because they must be an administrator to view this //return show_error('You must be an administrator to view this page.'); return show_error('You must be an administrator to view this page.'); } else { //list of filterize limit comp_session for pagination $this->data['comp_session'] = $this->comp_session_model->comp_session()->result(); $f_payroll_type = array("is_deleted" => 0); $q_payroll_type = GetAll('payroll_type', $f_payroll_type); $this->data['payroll_type'] = $q_payroll_type->num_rows() > 0 ? $q_payroll_type : array(); $this->_render_page('comp_session/modal/index', $this->data); } }
function detail($id, $first_login = FALSE) { if (!$this->ion_auth->logged_in()) { //redirect them to the login page redirect('auth/login', 'refresh'); } elseif ($id != $this->session->userdata('user_id') && !$this->ion_auth->is_admin()) { //redirect them to the home page because they must be an administrator to view this //return show_error('You must be an administrator to view this page.'); return show_error('You can not view this page.'); } else { $this->data['message'] = validation_errors() ? validation_errors() : $this->session->flashdata('message'); $this->data['csrf'] = $this->_get_csrf_nonce(); $user = $this->person_model->getUsers($id)->row(); $user_emp = $this->person_model->getUserEmp($id)->row(); $user_course = $this->person_model->getUserCourse($id); $user_certificate = $this->person_model->getUserCertificate($id); $user_education = $this->person_model->getUserEducation($id); $user_exp = $this->person_model->getUserexperience($id); $user_sk = $this->person_model->getUserSk($id); $user_sti = $this->person_model->getUserSti($id); $user_jabatan = $this->person_model->getUserJabatan($id); $user_award = $this->person_model->getUserAward($id); $user_ikatan = $this->person_model->getUserIkatanDinas($id); $jsondata = file_get_contents(get_api_key() . 'users/lists/format/json'); $data = json_decode($jsondata, true); if ($this->cekNik($data, 'EMPLID', $user->nik) == TRUE) { $getdata = file_get_contents(get_api_key() . 'users/list/EMPLID/' . $user->nik . '/format/json'); $data = json_decode($getdata, true); $url = get_api_key() . 'users/employement/EMPLID/' . $user->nik . '/format/json'; $headers = get_headers($url); $response = substr($headers[0], 9, 3); if ($response != "404") { $getuser_info = file_get_contents($url); $user_info = json_decode($getuser_info, true); $this->data['user_info'] = $user_info; } else { //$this->data['user_info'] = $this->form_cuti_model->where('users.id',$user_id)->form_cuti_input()->result(); } //employee identity $this->data['id'] = $user->id; $this->data['nik'] = !empty($user->nik) ? $user->nik : '-'; $this->data['bod'] = !empty($user->bod) ? $user->bod : '-'; $this->data['is_birthday_reminder'] = $user->is_birthday_reminder; $this->data['first_login'] = $first_login; $this->data['first_name'] = !empty($user->first_name) ? $user->first_name : ''; $this->data['last_name'] = !empty($user->last_name) ? $user->last_name : ''; $this->data['business_unit'] = !empty($user->organization_title) ? $user->organization_title : ''; $this->data['marital'] = !empty($user->marital_title) ? $user->marital_title : ''; $this->data['phone'] = !empty($user->phone) ? $user->phone : ''; $this->data['email'] = !empty($user->email) ? $user->email : ''; $this->data['previous_email'] = !empty($user_info['PREVIOUSEMAIL']) ? $user_info['PREVIOUSEMAIL'] : '-'; $this->data['bb_pin'] = !empty($user_info['PINBB']) ? $user_info['PINBB'] : '-'; $this->data['photo'] = !empty($user->photo) ? $user->photo : ''; $this->data['s_kk'] = $this->form_validation->set_value('kk', $user->scan_kk); $this->data['s_akta'] = $this->form_validation->set_value('akta', $user->scan_akta); $user_folder = $user->id . $user->first_name; $this->data['u_folder'] = $user_folder; $url = get_api_key() . 'users/course/EMPLID/' . $user->nik . '/format/json'; $headers = get_headers($url); $response = substr($headers[0], 9, 3); if ($response != "404") { $getcourse = file_get_contents($url); $course = json_decode($getcourse, true); $this->data['course'] = $course; } else { $this->data['course'] = $user_course->result_array(); } $url = get_api_key() . 'users/certificate/EMPLID/' . $user->nik . '/format/json'; $headers = get_headers($url); $response = substr($headers[0], 9, 3); if ($response != "404") { $getcertificate = file_get_contents(get_api_key() . 'users/certificate/EMPLID/' . $user->nik . '/format/json'); $certificate = json_decode($getcertificate, true); $this->data['certificate'] = $certificate; } else { $this->data['certificate'] = $user_certificate->result_array(); } $url = get_api_key() . 'users/award/EMPLID/' . $user->nik . '/format/json'; $headers = get_headers($url); $response = substr($headers[0], 9, 3); if ($response != "404") { $getaward = file_get_contents(get_api_key() . 'users/award/EMPLID/' . $user->nik . '/format/json'); $award = json_decode($getaward, true); $this->data['award'] = $award; } else { $this->data['award'] = $user_award->result_array(); } //Education Tab API $url = get_api_key() . 'users/education/EMPLID/' . $user->nik . '/format/json'; $headers = get_headers($url); $response = substr($headers[0], 9, 3); if ($response != "404") { $geteducation = file_get_contents(get_api_key() . 'users/education/EMPLID/' . $user->nik . '/format/json'); $education = json_decode($geteducation, true); $this->data['education'] = $education; } else { $this->data['education'] = $user_education->result_array(); } //Experience Tab API $url = get_api_key() . 'users/experience/EMPLID/' . $user->nik . '/format/json'; $headers = get_headers($url); $response = substr($headers[0], 9, 3); if ($response != "404") { $getexperience = file_get_contents(get_api_key() . 'users/experience/EMPLID/' . $user->nik . '/format/json'); $experience = json_decode($getexperience, true); $this->data['experience'] = $experience; } else { $this->data['experience'] = $user_exp->result_array(); } //SK Tab API $url = get_api_key() . 'users/sk/EMPLID/' . $user->nik . '/format/json'; $headers = get_headers($url); $response = substr($headers[0], 9, 3); if ($response != "404") { $getsk = file_get_contents(get_api_key() . 'users/sk/EMPLID/' . $user->nik . '/format/json'); $sk = json_decode($getsk, true); $this->data['sk'] = $sk; } else { $this->data['sk'] = $user_sk->result_array(); } //STI Tab API $url = get_api_key() . 'users/sti/EMPLID/' . $user->nik . '/format/json'; $headers = get_headers($url); $response = substr($headers[0], 9, 3); if ($response != "404") { $getsti = file_get_contents(get_api_key() . 'users/sti/EMPLID/' . $user->nik . '/format/json'); $sti = json_decode($getsti, true); $this->data['sti'] = $sti; } else { $this->data['sti'] = $user_sti->result_array(); } //Riwayat_jabatan Tab API $url = get_api_key() . 'users/jabatan/EMPLID/' . $user->nik . '/format/json'; $headers = get_headers($url); $response = substr($headers[0], 9, 3); if ($response != "404") { $getjabatan = file_get_contents(get_api_key() . 'users/jabatan/EMPLID/' . $user->nik . '/format/json'); $jabatan = json_decode($getjabatan, true); $this->data['jabatan'] = $jabatan; } else { $this->data['jabatan'] = $user_exp->result_array(); } //Ikatan_Dinas Tab API $url = get_api_key() . 'users/ikatan_dinas/EMPLID/' . $user->nik . '/format/json'; $headers = get_headers($url); $response = substr($headers[0], 9, 3); if ($response != "404") { $getikatan_dinas = file_get_contents(get_api_key() . 'users/ikatan_dinas/EMPLID/' . $user->nik . '/format/json'); $ikatan_dinas = json_decode($getikatan_dinas, true); $this->data['ikatan_dinas'] = $ikatan_dinas; } else { $this->data['ikatan_dinas'] = $user_exp->result_array(); } $this->data['aviva'] = !empty($user_emp->aviva) ? $user_emp->aviva : !empty($user_info['AVIVA']) ? $user_info['AVIVA'] : '-'; $this->data['bpjs_kerja'] = !empty($user_emp->aviva) ? $user_emp->aviva : !empty($user_info['JAMSOSTEK']) ? $user_info['JAMSOSTEK'] : '-'; $this->data['ktp'] = !empty($user_emp->aviva) ? $user_emp->aviva : !empty($user_info['KTP']) ? $user_info['KTP'] : '-'; $this->data['ktp_valid_date'] = !empty($user_emp->aviva) ? $user_emp->aviva : !empty($user_info['KTPVALIDDATE']) ? $user_info['KTPVALIDDATE'] : '-'; $this->data['npwp'] = !empty($user_emp->aviva) ? $user_emp->aviva : !empty($user_info['NPWP']) ? $user_info['NPWP'] : '-'; $this->data['tax'] = !empty($user_emp->aviva) ? $user_emp->aviva : !empty($user_info['TAX']) ? $user_info['TAX'] : '-'; $this->data['bpjs_kesehatan'] = !empty($user_info['BPJS']) ? $user_info['BPJS'] : '-'; $this->data['bpjs_date'] = !empty($user_info['BPJS']) ? $user_info['BPJSDATE'] : '-'; $this->data['bumida'] = !empty($user_info['BUMIDA']) ? $user_info['BUMIDA'] : '-'; $this->data['bumida_date'] = !empty($user_info['BPJS']) ? $user_info['BUMIDADATE'] : '-'; $this->data['seniority_date'] = !empty($user_emp->seniority_date) ? $user_emp->seniority_date : !empty($user_info['SENIORITYDATE']) ? $user_info['SENIORITYDATE'] : '-'; $this->data['position'] = !empty($user_emp->position) ? $user_emp->position : !empty($user_info['POSITION']) ? $user_info['POSITION'] : '-'; $this->data['organization'] = !empty($user_info['ORGANIZATION']) ? $user_info['ORGANIZATION'] : '-'; $this->data['bu'] = !empty($user_info['BU']) ? $user_info['BU'] : '-'; $this->data['empl_status'] = !empty($user_emp->empl_status) ? $user_emp->empl_status : !empty($user_info['EMPLOYEESTATUS']) ? $user_info['EMPLOYEESTATUS'] : '-'; $this->data['employee_status'] = !empty($user_emp->employee_status) ? $user_emp->employee_status : !empty($user_info['STATUS']) ? $user_info['STATUS'] : '-'; $this->data['cost_center'] = !empty($user_emp->cost_center) ? $user_emp->cost_center : !empty($user_info['COSTCENTER']) ? $user_info['COSTCENTER'] : '-'; $this->data['position_group'] = !empty($user_emp->position_group) ? $user_emp->position_group : !empty($user_info['POSITIONGROUP']) ? $user_info['POSITIONGROUP'] : '-'; $this->data['grade'] = !empty($user_emp->grade) ? $user_emp->grade : !empty($user_info['GRADE']) ? $user_info['GRADE'] : '-'; $this->data['resign_reason'] = !empty($user_emp->resign_reason) ? $user_emp->resign_reason : !empty($user_info['RESIGNREASONCODEID']) ? $user_info['RESIGNREASONCODEID'] : '-'; $this->data['active_inactive'] = !empty($user_emp->active_inactive) ? $user_emp->active_inactive : !empty($user_info['ACTIVEINACTIVE']) ? $user_info['ACTIVEINACTIVE'] : '-'; } else { //employement $this->data['seniority_date'] = !empty($user_emp->seniority_date) ? $user_emp->seniority_date : '-'; $this->data['position'] = !empty($user_emp->position) ? $user_emp->position : '-'; $this->data['empl_status'] = !empty($user_emp->empl_status) ? $user_emp->empl_status : '-'; $this->data['employee_status'] = !empty($user_emp->employee_status) ? $user_emp->employee_status : '-'; $this->data['cost_center'] = !empty($user_emp->cost_center) ? $user_emp->cost_center : '-'; $this->data['position_group'] = !empty($user_emp->position_group) ? $user_emp->position_group : '-'; $this->data['grade'] = !empty($user_emp->grade) ? $user_emp->grade : '-'; $this->data['resign_reason'] = !empty($user_emp->resign_reason) ? $user_emp->resign_reason : '-'; $this->data['active_inactive'] = !empty($user_emp->active_inactive) ? $user_emp->active_inactive : '-'; } $this->data['s_photo'] = $this->form_validation->set_value('photo', $user->photo); $user_folder = $user->id . $user->first_name; $this->data['u_folder'] = $user_folder; //Company Sponsor Course Tab $this->data['user_course'] = $user_course; //Certificate Tab $this->data['user_certificate'] = $user_certificate; //Education Tab $this->data['user_education'] = $user_education; //Experience Tab $this->data['user_exp'] = $user_exp; //SuraKeputusan Tab $this->data['user_sk'] = $user_sk; $this->data['user_sti'] = $user_sti; $this->data['user_jabatan'] = $user_jabatan; $this->data['user_award'] = $user_award; $this->data['user_ikatan'] = $user_ikatan; //Mazhters $dt_temp = date("d"); //$dt_temp = date("d", mktime(1, 1, 1, date("m"), date("d")-1, date("Y"))); $this->baca_cron($dt_temp, date("m"), date("Y")); $mchID = GetValue("mchID", "users", array("id" => "where/" . $id)); $q = GetAll("view_att", array("mchID" => "where/" . $mchID)); $this->data['rekap_hadir'] = array("total" => 0, "hadir" => 0, "terlambat" => 0, "cuti" => 0, "ijin" => 0, "sakit" => 0, "alpa" => 0, "off" => 0); foreach ($q->result_array() as $r) { if ($r['jh'] || $r['terlambat']) { $this->data['rekap_hadir']['hadir']++; } if ($r['terlambat']) { $this->data['rekap_hadir']['terlambat']++; } if ($r['ijin']) { $this->data['rekap_hadir']['ijin']++; } if ($r['sakit']) { $this->data['rekap_hadir']['sakit']++; } if ($r['cuti']) { $this->data['rekap_hadir']['cuti']++; } if ($r['alpa']) { $this->data['rekap_hadir']['alpa']++; } if ($r['off']) { $this->data['rekap_hadir']['off']++; } $this->data['rekap_hadir']['total']++; } if ($this->data['rekap_hadir']['hadir'] != 0) { $this->data['persen_hadir'] = number_format($this->data['rekap_hadir']['hadir'] / $this->data['rekap_hadir']['total'] * 100, 1) != 0 ? number_format($this->data['rekap_hadir']['hadir'] / $this->data['rekap_hadir']['total'] * 100, 1) : $this->data['rekap_hadir']['hadir']; $this->data['persen_terlambat'] = number_format($this->data['rekap_hadir']['terlambat'] / $this->data['rekap_hadir']['total'] * 100, 1); } else { $this->data['persen_hadir'] = 0; $this->data['persen_terlambat'] = 0; } //End Mazhters if (date("m-d") !== date('m-d', strtotime($user->bod)) && $user->is_birthday_reminder == 1) { $this->db->query("update users set is_birthday_reminder = 0 where id = {$id}"); } $this->_render_page('person/detail', $this->data); } }
function get_modal() { if (!$this->ion_auth->logged_in()) { //redirect them to the login page redirect('auth/login', 'refresh'); } elseif (!$this->ion_auth->is_admin()) { //redirect them to the home page because they must be an administrator to view this //return show_error('You must be an administrator to view this page.'); return show_error('You must be an administrator to view this page.'); } else { $organization = $this->organization_model->getOrganization(); $this->data['organization'] = $organization; $f_organization_class = array("is_deleted" => 0); $q_organization_class = GetAll('organization_class', $f_organization_class); $this->data['q_organization_class'] = $q_organization_class; $this->data['organization_class'] = $q_organization_class->num_rows() > 0 ? $q_organization_class : array(); $f_organization = array("is_deleted" => 0); $q_organization = GetAll('organization', $f_organization); $this->data['q_organization'] = $q_organization; $this->data['parent'] = $q_organization->num_rows() > 0 ? $q_organization : array(); $this->_render_page('organization/modal/index', $this->data); } }
function bast($id = NULL) { permissionUser(); $this->data['id'] = $id; $this->data[$this->file_name] = GetAll($this->module . '_' . $this->file_name, array('id' => 'where/' . $id))->row_array(); $this->data[$this->file_name . '_list'] = GetAll($this->module . '_' . $this->file_name . '_list', array('id' => 'where/' . $id)); $this->load->library('mpdf60/mpdf'); $html = $this->load->view($this->module . '/' . $this->file_name . '/bast', $this->data, true); to_doc($html, 'BAST'); // $mpdf = new mPDF(); // $mpdf = new mPDF('A4'); // $mpdf->WriteHTML($html); // $mpdf->Output($id.'_BAST-'.$title.'.pdf', 'I'); }
function form_resignment_pdf($id) { if (!$this->ion_auth->logged_in()) { redirect('auth/login', 'refresh'); } $sess_id = $this->data['sess_id'] = $this->session->userdata('user_id'); $user_id = getValue('user_id', 'users_resignment', array('id' => 'where/' . $id)); $this->data['user_nik'] = get_nik($user_id); $form_resignment = $this->data['form_resignment'] = $this->form_resignment_model->form_resignment($id)->result(); $this->data['_num_rows'] = $this->form_resignment_model->form_resignment($id)->num_rows(); $this->data['approval_status'] = GetAll('approval_status', array('is_deleted' => 'where/0')); $this->data['id'] = $id; $title = $this->data['title'] = 'Form Karyawan Keluar-' . get_name($user_id); $this->load->library('mpdf60/mpdf'); $html = $this->load->view('resignment_pdf', $this->data, true); $mpdf = new mPDF(); $mpdf = new mPDF('A4'); $mpdf->WriteHTML($html); $mpdf->Output($id . '-' . $title . '.pdf', 'I'); }
public function get_modal() { if (!$this->ion_auth->logged_in()) { //redirect them to the login page redirect('auth/login', 'refresh'); } elseif (!$this->ion_auth->is_admin()) { //redirect them to the home page because they must be an administrator to view this //return show_error('You must be an administrator to view this page.'); return show_error('You must be an administrator to view this page.'); } else { //list of filterize limit library for pagination $this->data['library'] = $this->library_model->library()->result(); $f_parent_status = array("is_deleted" => 0); $q_parent_status = GetAll('library', $f_parent_status); $this->data['parent_group'] = $q_parent_status->num_rows() > 0 ? $q_parent_status : array(); $this->_render_page('library/modal/index', $this->data); } }
/** * Load view * * @access public * @param string $view * @param mixed $data * @param boolean $return * @return void */ public function load_view($view, $data = array(), $return = FALSE) { // Not include master view on ajax request if ($this->_ci->input->is_ajax_request()) { $this->_ci->load->view($view, $data); return; } // Title if (empty($this->title)) { $title = $this->brand_name; } else { $title = $this->title . $this->title_separator . $this->brand_name; } // Description $description = $this->description; // Metadata $metadata = array(); foreach ($this->metadata as $name => $content) { if (strpos($name, 'og:') === 0) { $metadata[] = '<meta property="' . $name . '" content="' . $content . '">'; } else { $metadata[] = '<meta name="' . $name . '" content="' . $content . '">'; } } $metadata = implode('', $metadata); // Javascript $js = array(); foreach ($this->js as $js_file) { $js[] = '<script src="' . assets_url($js_file) . '"></script>'; } $js = implode('', $js); // CSS $css = array(); foreach ($this->css as $css_file) { $css[] = '<link rel="stylesheet" href="' . assets_url($css_file) . '">'; } $person_id = $this->_ci->session->userdata('person_id'); $data['person_id'] = $person_id; $data['person_nm'] = getValue('person_nm', 'hris_persons', array('person_id' => 'where/' . $person_id)); if (!$data['person_nm']) { $data['person_nm'] = "Administrator"; } $data['person_img'] = file_exists('assets/assets/img/profiles/PICTURE_' . $person_id . '.JPG') ? assets_url('assets/img/profiles/PICTURE_' . $person_id . '.JPG') : assets_url('assets/img/profiles/photo-default.png'); //Inbox $inbox = 0; $list_notif = ""; $bawahan = CekBawahan($person_id); if (count($bawahan) > 0) { $q = GetAll("kg_view_attendance", array("no_slide" => "where/1", "date_full " => "order/asc", "date_full" => "group"), array("id_employee" => $bawahan)); if ($q->num_rows() > 0) { foreach ($q->result_array() as $r) { $inbox++; $list_notif .= "<a href='" . site_url('dashboard/index_slide/' . $r['date_full']) . "'>\n <div class='notification-messages notification-messages-full info'>\n <div class='message-wrapper'>\n <div class='heading'>Alert - No Slide Attend</div>\n <div class='description'>" . FormatTanggalShort($r['date_full']) . "</div>\n </div>\n <div class='clearfix'></div>\n </div></a>"; } } //Overtime/////////////////////////////////////////////////////////// $q = GetAll("kg_view_overtime", array("ovt_status" => "where/Waiting"), array("id_employee" => $bawahan)); foreach ($q->result_array() as $r) { $inbox++; $img = GetPP($r['id_employee']); $list_notif .= "<a href='" . site_url('attendance_form/overtime/' . $r['id']) . "'><div class='notification-messages info'>\n <div class='user-profile'>\n <img src='" . $img . "' width='35' height='35'>\n </div>\n <div class='message-wrapper'>\n <div class='heading'>" . $r['person_nm'] . " - Overtime</div>\n <div class='description'>" . FormatTanggalShort($r['date_full']) . "</div>\n <!--<div class='date pull-left'>A min ago</div>-->\n </div>\n <div class='clearfix'></div>\n </div></a>"; } //Cuti/////////////////////////////////////////////////////////// $q = GetAll("kg_view_cuti", array("cuti_status" => "where/Waiting"), array("id_employee" => $bawahan)); foreach ($q->result_array() as $r) { $inbox++; $img = GetPP($r['id_employee']); $list_notif .= "<a href='" . site_url('attendance_form/cuti/' . $r['id']) . "'><div class='notification-messages info'>\n <div class='user-profile'>\n <img src='" . $img . "' width='35' height='35'>\n </div>\n <div class='message-wrapper'>\n <div class='heading'>" . $r['person_nm'] . " - Leave</div>\n <div class='description'>" . FormatTanggalShort($r['tgl_start']) . "</div>\n <!--<div class='date pull-left'>A min ago</div>-->\n </div>\n <div class='clearfix'></div>\n </div></a>"; } } //die($list_notif); //OT Notif User Pribadi $q = GetAll("kg_view_overtime", array("ovt_status" => "where/Approve", "is_read" => "where/0", "create_user_id" => "where/" . $person_id)); foreach ($q->result_array() as $r) { $inbox++; $img = GetPP($r['modify_user_id']); $list_notif .= "<a href='" . site_url('attendance_form/overtime/' . $r['id']) . "'><div class='notification-messages info'>\n <div class='user-profile'>\n <img src='" . $img . "' width='35' height='35'>\n </div>\n <div class='message-wrapper'>\n <div class='heading'>" . strtok(GetValue("person_nm", "hris_persons", array("person_id" => "where/" . $r['modify_user_id'])), " ") . " - Approval Overtime</div>\n <div class='description'>" . FormatTanggalShort($r['date_full']) . "</div>\n <!--<div class='date pull-left'>A min ago</div>-->\n </div>\n <div class='clearfix'></div>\n </div></a>"; } //Cuti Notif User Pribadi $q = GetAll("kg_view_cuti", array("cuti_status" => "where/Approve", "is_read" => "where/0", "create_user_id" => "where/" . $person_id)); foreach ($q->result_array() as $r) { $inbox++; $img = GetPP($r['modify_user_id']); $list_notif .= "<a href='" . site_url('attendance_form/cuti/' . $r['id']) . "'><div class='notification-messages info'>\n <div class='user-profile'>\n <img src='" . $img . "' width='35' height='35'>\n </div>\n <div class='message-wrapper'>\n <div class='heading'>" . strtok(GetValue("person_nm", "hris_persons", array("person_id" => "where/" . $r['modify_user_id'])), " ") . " - Approval Leave</div>\n <div class='description'>" . FormatTanggalShort($r['tgl_start']) . "</div>\n <!--<div class='date pull-left'>A min ago</div>-->\n </div>\n <div class='clearfix'></div>\n </div></a>"; } $data['inbox'] = $inbox; $data['list_notif'] = $list_notif; $menu = $this->_ci->uri->segment(1, 0); $data['active'] = $data['active1'] = $data['active2'] = $data['active3'] = $data['active4'] = ""; switch ($menu) { case 'dashboard': $data['active'] = "class='active'"; break; case 'employee': $data['active1'] = "class='active'"; break; case 'attendance': $data['active2'] = "class='active'"; break; case 'attendance_form': $data['active2'] = "class='active'"; break; case 'config': $data['active3'] = "class='active'"; break; case 'report': $data['active4'] = "class='active'"; break; default: ${$data}['active1'] = "class='active'"; break; } //Sub Menu $submenu = $this->_ci->uri->segment(2); $param = $menu . "/" . $submenu; $data['active_1'] = $data['active_2'] = $data['active_3'] = ""; $data['active2_1'] = $data['active2_2'] = $data['active2_3'] = ""; $data['active3_1'] = $data['active3_2'] = $data['active3_3'] = ""; $data['active4_1'] = $data['active4_2'] = $data['active4_3'] = ""; switch ($param) { case 'dashboard/index': $data['active_1'] = "class='active'"; break; case 'dashboard/index_slide': $data['active_2'] = "class='active'"; break; case 'dashboard/overtime': $data['active_3'] = "class='active'"; break; case 'attendance/': $data['active2_1'] = "class='active'"; break; case 'attendance_form/overtime': $data['active2_2'] = "class='active'"; break; case 'config/': $data['active3_1'] = "class='active'"; break; case 'config/holiday': $data['active3_2'] = "class='active'"; break; case 'config/overtime': $data['active3_3'] = "class='active'"; break; default: ${$data}['active3_1'] = "class='active'"; break; } $css = implode('', $css); $header = $this->_ci->load->view('header', $data, TRUE); $footer = $this->_ci->load->view('footer', array(), TRUE); $sidebar = $this->_ci->load->view('sidebar', $data, TRUE); $main_content = $this->_ci->load->view($view, $data, TRUE); $body = $this->_ci->load->view('layout/' . $this->layout, array('header' => $header, 'footer' => $footer, 'sidebar' => $sidebar, 'main_content' => $main_content), TRUE); return $this->_ci->load->view('base_view', array('title' => $title, 'description' => $description, 'metadata' => $metadata, 'js' => $js, 'css' => $css, 'body' => $body, 'ga_id' => $this->ga_id), $return); }
function list_data($id_emp = NULL, $period = NULL) { $period = "2015-11-16~2015-12-15"; permission(); $data['emp'] = GetAll("kg_view_employee", array("person_id" => "where/" . $id_emp)); $data['id_emp'] = $id_emp; $data['period'] = $period; $data['date'] = substr($period, 11, 10); $exp = explode("-", $data['date']); $data['last_date'] = date("Y-m-d", mktime(0, 0, 0, $exp[1], $exp[0], $exp[2])); $data['ot_rasio'] = GetOTRasio($id_emp, $data['date']); $data['ot_rasio_last'] = GetOTRasio($id_emp, $data['last_date']); $data['ot_rasio_selisih'] = str_replace("%", "", $data['ot_rasio']) - str_replace("%", "", $data['ot_rasio_last']); if (str_replace("%", "", $data['ot_rasio']) > str_replace("%", "", $data['ot_rasio_last'])) { $data['high_low'] = "higher"; } else { $data['high_low'] = "lower"; } //$data['detail'] = $this->att->get_by_id($id_emp, $param)->result_array(); $this->load->view('list_data', $data); }
function flickr_api_setup() { $CI =& get_instance(); //$CI->load->library('flickr_api','flickr_api'); $q = GetAll('kg_flickr_api', array("id" => "where/1")); $val = $q->row_array(); $flickr_api_params = array('request_format' => $val['request_format'], 'response_format' => $val['response_format'], 'api_key' => $val['api_key'], 'secret' => $val['secret_key'], 'cache_use_db' => FALSE, 'cache_expiration' => $val['cache_expiration'], 'cache_max_rows' => $val['cache_max_rows']); //$CI->flickr_api->initialize($flickr_api_params); $CI->phpflickr->phpflickr($val['api_key'], $val['secret_key'], true); return $val; }
public function load_badge() { $data['notification_num'] = GetAll('chat', array('is_read' => 'where/0', 'receiver_id' => 'where/' . sessId()))->num_rows(); $this->load->view('message/badges', $data); }