示例#1
0
 function index()
 {
     $data['title'] = 'ACS - Absent';
     $data['heading'] = 'Absent';
     $data['action'] = 'mod_absent/search' . $this->_filter();
     $data['action_update'] = 'mod_absent/update' . $this->_filter();
     $data['clear_btn'] = anchor('mod_absent/delete' . $this->_filter(), '<span class="glyphicon glyphicon-trash"></span> Clear', array('class' => 'btn btn-sm btn-danger', 'onclick' => "return confirm('are you sure')"));
     $data['auto_btn'] = anchor('mod_absent/update_auto' . $this->_filter(), '<span class="glyphicon glyphicon-edit"></span> Auto Absent', array('class' => 'btn btn-sm btn-warning', 'onclick' => "return confirm('are you sure')"));
     $data['fee_btn'] = anchor('mod_fee' . $this->_filter(), '<span class="glyphicon glyphicon-print"></span> Fee Weekly', array('class' => 'btn btn-sm btn-default'));
     $data['fee_senior_btn'] = anchor('mod_fee/fee_senior' . $this->_filter(), '<span class="glyphicon glyphicon-print"></span> Fee Monthly', array('class' => 'btn btn-sm btn-default'));
     $date_from = $this->input->get("date_from");
     $date_to = $this->input->get("date_to");
     if ($date_from != '' && $date_to != '') {
         $this->table->set_template(tbl_tmp());
         $from = date_create(format_tanggal_barat($date_from));
         $to = date_create(format_tanggal_barat($date_to));
         $head[] = 'No';
         $head[] = 'Moderator';
         while ($from <= $to) {
             $head[] = get_nama_hari(date_format($from, 'N')) . '<br/>' . date_format($from, 'd/m/Y');
             date_add($from, date_interval_create_from_date_string('1 days'));
         }
         $this->table->set_heading($head);
         $result = moderator();
         $i = 1;
         foreach ($result as $r) {
             $from = date_create(format_tanggal_barat($date_from));
             $to = date_create(format_tanggal_barat($date_to));
             $row[] = $i++;
             $row[] = $r[1];
             $j = 1;
             while ($from <= $to) {
                 $value = $this->mdl_mod_absent->get(date_format($from, 'Y-m-d'), $r[0]);
                 $row[] = form_dropdown($r[0] . '_' . date_format($from, 'dmy'), array('' => '', 'SIANG' => 'SIANG', 'MALAM' => 'MALAM', 'TRAINING' => 'TRAINING'), $value);
                 date_add($from, date_interval_create_from_date_string('1 days'));
                 $j++;
             }
             $this->table->add_row($row);
             unset($row);
             if ($i == 7) {
                 $this->table->add_row(array('data' => 'BEAT Moderator', 'colspan' => $j + 1, 'class' => 'text-center'));
             }
             if ($i == 10) {
                 $this->table->add_row(array('data' => 'MOVE Moderator', 'colspan' => $j + 1, 'class' => 'text-center'));
             }
         }
     }
     $data['table'] = $this->table->generate();
     $this->template->display('mod_absent', $data);
 }
示例#2
0
 function _header_training($pdf)
 {
     $date_from = $this->input->get("date_from");
     $date_to = $this->input->get("date_to");
     $pdf->SetFont('Arial', '', 10);
     $pdf->Cell(0, 5, 'Periode Tanggal : ' . $this->input->get('date_from') . ' s/d ' . $this->input->get('date_to'), 0, 0, 'C');
     $pdf->Ln(10);
     $pdf->SetFont('Arial', 'B', 10);
     $pdf->SetDrawColor(0, 0, 0);
     $pdf->SetTextColor(0, 0, 0);
     $pdf->Cell(10, 14, 'No', 1, 0, 'C');
     $pdf->Cell(40, 14, 'Moderator', 1, 0, 'C');
     $from = date_create(format_tanggal_barat($date_from));
     $to = date_create(format_tanggal_barat($date_to));
     $j = 0;
     while ($from <= $to) {
         $pdf->SetXY(60 + $j, 30);
         $pdf->Cell(18, 7, get_nama_hari(date_format($from, "N")), 1, 0, 'C');
         $pdf->SetXY(60 + $j, 37);
         $pdf->Cell(18, 7, date_format($from, "d/m/y"), 1, 0, 'C');
         date_add($from, date_interval_create_from_date_string('1 days'));
         $j += 18;
     }
     $pdf->SetXY($j + 60, 30);
     $pdf->Cell(30, 14, 'Jumlah', 1, 0, 'C');
     $pdf->Cell(0, 14, 'Total', 1, 0, 'C');
     $pdf->Ln(14);
 }