function string($n) { if (js()) { if (typeof($n) === "number") { return Number($n) . toString(); } else { if (typeof($n) === "undefined") { return ""; } else { return $n . toString(); } } } else { return "" . $n; } }
</td> <td><?php echo Number($vl); ?> </td> <td><?php echo Number($vtk); ?> </td> <td> <?php //if(($v['EmployeeTitle']=='Senior-1') || ($v['EmployeeTitle']=='Senior-1') || ($v['EmployeeTitle']=='Senior-2') || ($v['EmployeeTitle']=='Supervisor')) if ($v['EmployeeTitle'] == 'Assistant' || $v['EmployeeTitle'] == 'Senior-2' || $v['EmployeeTitle'] == 'Associate Consultant') { echo Number($vot); } else { echo Number(0); } ?> </td> </tr> <?php $no++; } } ?> <?php //endforeach; ?>
function NumberAs($name = null, $number = 0) { // http://www.fileformat.info/info/unicode/category/Nd/list.htm static $language = ['ANSI' => 0x30, 'Arabic-Indic' => 0x660, 'Extended Arabic-Indic' => 0x6f0, 'Devanagari' => 0x966, 'Bengali' => 0x9e6, 'Gurmukhi' => 0xa66, 'Gujarati' => 0xae6, 'Oriya' => 0xb66, 'Tamil' => 0xbe6, 'Telugu' => 0xc66, 'Kannada' => 0xce6, 'Malayalam' => 0xd66, 'Thai' => 0xe50, 'Lao' => 0xed0, 'Tibetan' => 0xf20, 'Myanmar' => 0x1040, 'Khmer' => 0x17e0, 'Mongolian' => 0x1810, 'Fullwidth' => 0xff10, 'Mathematical Bold' => 0x1d7ce, 'Mathematical Double-Struck' => 0x1d7d8, 'Mathematical Sans-Serif' => 0x1d7e2, 'Mathematical Sans-Serif Bold' => 0x1d7ec, 'Mathematical Monospace' => 0x1d7f6]; // Default call with no args returns names of languages. if ($name == null) { return array_keys($language); } assert(array_key_exists($name, $language)); return Number($number, $language[$name]); }
function reportActualEmployee() { $this->getMenu(); $this->data['form']['date_from'] = $this->input->post('date_from'); $this->data['form']['date_to'] = $this->input->post('date_to'); $this->data['back'] = $this->data['site'] . '/report'; $this->data['row'] = ""; if (strlen($this->data['form']['date_from'] > 0)) { $rows = $this->reportModel->getReportActualEmployee($this->data['form']); if (count($rows) > 0) { $i = 1; foreach ($rows as $k => $v) { $class = $i % 2 == 0 ? $class = 'class="odd"' : ' '; $this->data['row'] .= " \t\t\n \t\t <tr {$class} >\n \t\t\t\t<td>{$i}</td>\n \t\t\t\t<td>{$v['employeename']}</td>\n \t\t\t\t<td>{$v['employeeid']}</td>\n\t <td>{$v['employeeapproval']}</td>\n <td>{$v['employeehiredate']}</td>\n\t\t\t\t\t<td class=currency>" . Number(number_format($v['hhour'], 0)) . "</td> \n\t\t\t\t\t<td class=currency>" . Number(number_format($v['phour'], 0)) . "</td>\n \t\t\t\t<td class=currency>" . Number(number_format($v['hour'], 0)) . "</td>\n </tr>"; $i++; } /* * $this->data['row'] .= " * <tr $class > * <td></td> * <td colspan=3 class='currency'><b>Total</b> * <td class=currency><b>".Number($total_day)."</b></td> * * <td class=currency><b>".Number($total_work_app)."</b></td> * <td class=currency><b>".Number($total_ot_app)."</b></td> * <td class=currency><b>".Number($total_hour_app)."</b></td> * <td class=currency><b>".Number($total_day_app)."</b></td> * * <td class=currency><b>".Number($total_work_wait)."</b></td> * <td class=currency><b>".Number($total_ot_wait)."</b></td> * <td class=currency><b>".Number($total_hour_wait)."</b></td> * <td class=currency><b>".Number($total_day_wait)."</b></td> * * <td class=currency><b>".Number($total_work_re)."</b></td> * <td class=currency><b>".Number($total_ot_re)."</b></td> * <td class=currency><b>".Number($total_hour_re)."</b></td> * <td class=currency><b>".Number($total_day_re)."</b></td> * * <td class=currency><b>".Number($total_work_null)."</b></td> * <td class=currency><b>".Number($total_ot_null)."</b></td> * <td class=currency><b>".Number($total_hour_null)."</b></td> * <td class=currency><b>".Number($total_day_null)."</b></td> * </tr>"; */ } } else { $this->data['table'] = array(); } $this->load->view('report_actual_employee', $this->data); }
function export_ovt_rekap($tgl = NULL, $regs = NULL, $div = NULL, $sec = NULL, $pos = NULL, $grade = NULL) { $this->load->model('overtime_model', 'ovt'); $param = array("tgl" => $tgl, "rekap" => "rekap", "regs" => $regs, "divisi" => $div, "section" => $sec, "position" => $pos, "grade" => $grade); $exp = explode("~", $tgl); $list = $this->ovt->get_datatables($param); $dataz = array(); $no = 0; //$_POST['start']; foreach ($list->result() as $r) { $no++; //Acc Ovt $acc = 0; $q = GetAll("kg_view_overtime", array("id_employee" => "where/" . $r->id_employee, "date_full >=" => "where/" . $exp[0], "date_full <=" => "where/" . $exp[1], "date_temp" => "where/0000-00-00")); foreach ($q->result_array() as $s) { if ($s['job_level'] != "nonmanagement") { if ($s['ovt_hour_sum'] >= 2) { $acc += $s['ovt_hour_sum']; } } else { $acc += $s['ovt_hour_cal']; } } $q = GetAll("kg_view_overtime", array("id_employee" => "where/" . $r->id_employee, "date_temp >=" => "where/" . $exp[0], "date_temp <=" => "where/" . $exp[1])); foreach ($q->result_array() as $s) { if ($s['job_level'] != "nonmanagement") { if ($s['ovt_hour_sum'] >= 2) { $acc += $s['ovt_hour_sum']; } } else { $acc += $s['ovt_hour_cal']; } } if ($r->job_level != "nonmanagement") { $upah = $acc * GetConfigDirect('rest_time'); } else { $upah = $acc * (GetGapok($r->id_employee, $exp[0]) + GetHA($r->id_employee, $exp[0])) / GetConfigDirect('total_hour_ovt'); } $ot_rasio = GetOTRasio($r->id_employee, $exp[1]); //$upah / (GetGapok($r->id_employee, $exp[0]) + GetHA($r->id_employee, $exp[0]) + $upah) * 100; //$edit = '<a class="btn btn-sm btn-primary" href="javascript:void(0);" onclick="detailOvertime('."'".$r->id_employee."'".')"><i class="glyphicon glyphicon-info-sign"></i> Detail</a>'; $dataz[] = array($no, $r->ext_id, $r->person_nm, GetMonth(intval(substr($tgl, 16, 2))) . ' ' . substr($tgl, 11, 4), Decimal($r->ovt_hour_sum, 1), Decimal($acc), $ot_rasio, Number($upah)); } $data['list'] = $dataz; //print_mz($data['list']); $html = $this->load->view('export_overtime_rekap', $data); to_excel($html, 'ReportOvertimeRekap'); }