Example #1
0
 public function calculateKinerja(User $user)
 {
     $sql = "SELECT \r\n                a.id_suratkeluar as no_agenda,\r\n                a.start as start,\r\n                a.end as end,\r\n                b.namaPegawai as nama\r\n                FROM suratkeluar a \r\n                LEFT JOIN user b ON a.user = b.username\r\n                WHERE a.user='******'nama_user') . "'\r\n                    ";
     $data = $this->select($sql);
     $arraydata = null;
     $monitoring = new Monitoring_Model();
     foreach ($data as $value) {
         $tgl1 = $value['start'];
         $tgl2 = $value['end'];
         if ($tgl2 == '0000-00-00 00:00:00' or $tgl2 == null) {
             $tgl2 = $tgl1;
         }
         $selisihhari = $monitoring->cekSelisihHari($tgl1, $tgl2);
         $start = explode(" ", $value['start']);
         $start = trim($start[1]);
         if ($value['end'] == '0000-00-00 00:00:00' or $value['end'] == null) {
             if (!is_null($arraydata)) {
                 $arraydata[3]++;
             } else {
                 $arraydata = array(strtoupper($value['nama']), 0, 0, 1);
             }
         } else {
             $end = explode(" ", $value['end']);
             $end = trim($end[1]);
             if ($selisihhari > 0) {
                 $hari1 = $monitoring->selisihJam($monitoring->jampulang, $start);
                 $hari2 = $monitoring->selisihJam($end, $monitoring->jammasuk);
                 $selisihjam = $hari1 + $hari2 + ($selisihhari - 1) * 10.5;
             } else {
                 $selisihjam = $monitoring->selisihJam($end, $start);
             }
             $kinerja = round($selisihjam / $monitoring->cekSifatSuratKeluar($value['no_agenda']) * 100, 2);
             if ($kinerja > 100) {
                 if (!is_null($arraydata)) {
                     $arraydata[2]++;
                 } else {
                     $arraydata = array(strtoupper($value['nama']), 0, 1, 0);
                 }
             } elseif ($kinerja <= 100) {
                 if (!is_null($arraydata)) {
                     $arraydata[1]++;
                 } else {
                     $arraydata = array(strtoupper($value['nama']), 1, 0, 0);
                 }
             }
         }
     }
     return $arraydata;
 }
Example #2
0
     //            <input type=checkbox name=cek[] value=' . $value->getId() . ' >
     echo '<td width=20%> <font color=blue><b>' . Tanggal::tgl_indo($value->getTglSurat()) . '</br>' . $no_surat . '</br>';
     if (!$arsip->isHasBeenArchived($value->getId(), 'SK')) {
         $mon = new Monitoring_Model();
         $add = (int) $mon->getDueDate('SK', $value->getId());
         $due_date = $mon->cekNextDay($value->getStart(), false, $add / 24);
         $tgl = explode(' ', $due_date);
         echo '<font color=red>batas waktu : ' . Tanggal::tgl_indo($tgl[0]) . ' ' . $tgl[1] . '</font>';
     }
     echo '</td>';
     echo '<td width=50%' . $value->getTipeSurat() . ' <font color=green>[' . $value->getUserCreate() . ']</font> 
     </br><a href="' . URL . 'suratkeluar/detil/' . $value->getId() . '" title="klik disini untuk melihat detil surat!" class=tip>' . $value->getAlamat() . '</br><i>' . $value->getPerihal() . '</i></a></b></font></td>';
 } else {
     echo '<td width=20%> ' . Tanggal::tgl_indo($value->getTglSurat()) . '</br>' . $no_surat . '</br>';
     if (!$arsip->isHasBeenArchived($value->getId(), 'SK')) {
         $mon = new Monitoring_Model();
         $add = (int) $mon->getDueDate('SK', $value->getId());
         $due_date = $mon->cekNextDay($value->getStart(), false, $add / 24);
         $tgl = explode(' ', $due_date);
         echo '<font color=red>batas waktu : ' . Tanggal::tgl_indo($tgl[0]) . ' ' . $tgl[1] . '</font>';
     }
     echo '</td>';
     echo '<td width=50%>' . $value->getTipeSurat() . ' <font color=green><i>[' . $value->getUserCreate() . ']</i></font> 
     </br><a href="' . URL . 'suratkeluar/detil/' . $value->getId() . '" title="klik disini untuk melihat detil surat!" class=tip>' . $value->getAlamat() . '</br><i>' . $value->getPerihal() . '</i></a></td>';
 }
 //echo '<td>' . $value['tgl_terima'] . '</td>';
 //echo '<td>' . $value['tgl_surat'] . '</td>';
 //echo '<td>' . $value['asal_surat'] . '</td>';
 //echo '<td>' . $value['perihal'] . '</td>';
 echo '<td width=30%>';
 if (Auth::isRole($role, 2)) {
Example #3
0
 //var_dump($this->notif->isRead($value['id_suratmasuk'],$user,'SM'));
 if ($this->notif->isRead($value->getId(), $user, 'SM')) {
     echo '<td width=20%><input type=checkbox id=cek' . $no . ' name=cek[] value=' . $value->getId() . ' onchange=cek();> <font color=blue><strong>' . Tanggal::tgl_indo($value->getTglTerima()) . '</br>' . $value->getAgenda() . '</strong></font></br>';
     if (!$arsip->isHasBeenArchived($value->getId(), 'SM')) {
         $mon = new Monitoring_Model();
         $add = (int) $mon->getDueDate('SM');
         $due_date = $mon->findNextHour($value->getStart(), $add);
         $tgl = explode(' ', $due_date);
         echo '<font color=red>batas waktu : ' . Tanggal::tgl_indo($tgl[0]) . ' ' . $tgl[1] . '</font>';
     }
     echo '</td>';
     echo '<td width=50%><b><font color=blue><a href="' . URL . 'suratmasuk/detil/' . $value->getId() . '" title="klik disini untuk melihat detil surat" class=tip>' . $value->getNomor() . '</a> || ' . Tanggal::tgl_indo($value->getTglSurat()) . '</br>' . $value->getAlamat() . '</br><i>' . $value->getPerihal() . '</i></font></b></td>';
 } else {
     echo '<td width=20%><input type=checkbox id=cek name=cek[] value=' . $value->getId() . ' onchange=cek();> ' . Tanggal::tgl_indo($value->getTglTerima()) . '</br>' . $value->getAgenda() . '</br>';
     if (!$arsip->isHasBeenArchived($value->getId(), 'SM')) {
         $mon = new Monitoring_Model();
         $add = (int) $mon->getDueDate('SM');
         $due_date = $mon->findNextHour($value->getStart(), $add);
         $tgl = explode(' ', $due_date);
         echo '<font color=red>batas waktu : ' . Tanggal::tgl_indo($tgl[0]) . ' ' . $tgl[1] . '</font>';
     }
     echo '</td>';
     echo '<td width=50%><a href="' . URL . 'suratmasuk/detil/' . $value->getId() . '" title="klik disini untuk melihat detil surat" class=tip>' . $value->getNomor() . '</a> || ' . Tanggal::tgl_indo($value->getTglSurat()) . '</br>' . $value->getAlamat() . '</br><font color=grey><i>' . $value->getPerihal() . '</i></font></td>';
 }
 //echo '<td>' . $value['tgl_terima'] . '</td>';
 //echo '<td>' . $value['tgl_surat'] . '</td>';
 //echo '<td>' . $value['asal_surat'] . '</td>';
 //echo '<td>' . $value['perihal'] . '</td>';
 echo '<td halign=center width=30%>';
 if (Auth::isRole($role, 2) and Auth::isBagian($bagian, 1)) {
     echo '<a href="' . URL . 'suratmasuk/edit/' . $value->getId() . '" title="ubah data surat" class=tip><input class="btn btn-green" type=button value=ubah></a> 
Example #4
0
 public function rekamArsip()
 {
     $id_lokasi = $_POST['box'];
     $id_surat = $_POST['id'];
     $tipe_surat = $_POST['tipe'];
     $jenis = $_POST['jenis'];
     $data = array('id_lokasi' => $id_lokasi, 'id_surat' => $id_surat, 'tipe_surat' => $tipe_surat, 'jenis' => $jenis);
     if ($this->model->rekamArsip($data)) {
         $this->view->success = "Data arsip telah berhasil disimpan";
         $mon = new Monitoring_Model();
         $time = $mon->cekNextDay(date('Y-m-d h:m:s'), true);
         if ($tipe_surat == 'SM') {
             //                $time = date('Y-m-d H:i:s');
             $datastat = array('stat' => '15', 'end' => $time);
             $where = 'id_suratmasuk=' . $id_surat;
             $this->model->update('suratmasuk', $datastat, $where);
             //update status -> arsip
         } elseif ($tipe_surat == 'SK') {
             //                $time = date('Y-m-d H:i:s');
             $datastat = array('status' => '23', 'end' => $time);
             $where = 'id_suratkeluar=' . $id_surat;
             $this->model->update('suratkeluar', $datastat, $where);
             //update status -> arsip
         }
         echo "<div id=success>Rekam arsip berhasil</div>";
     } else {
         echo "<div id=error>Rekam arsip gagal!</div>";
     }
     //        return true;
 }
 public function test()
 {
     $date = '2013-06-25 16:30:00';
     $mon = new Monitoring_Model();
     echo $mon->cekNextDay($date, false, 5);
 }
Example #6
0
 public function monitoring_edit()
 {
     $monitoring_model = new Monitoring_model();
     $certification_model = new Certification_Model();
     $validity_model = new Validity_model();
     $visit_model = new Visit_model();
     $this->validateAddPSBRiderQs();
     if (!$this->form_validation->run()) {
         $this->load->view('header');
         $this->load->view('nav');
         $this->load->view('sidebar');
         $this->load->view('monitoring_edit', array('monitoring_model' => $monitoring_model, 'certification_model' => $certification_model, 'validity_model' => $validity_model, 'visit_model' => $visit_model));
         $this->load->view('footer');
     } else {
         $profile_id = 9;
         $visit_count = $this->input->post('visit_count');
         //date
         $strVisitDate = $this->input->post('visit_date');
         $visitDateToDate = date_create($strVisitDate);
         $visit_date = date_format($visitDateToDate, "Y-m-d");
         //date
         $remarks = $this->input->post('remarks');
         $modified_by = 104;
         $date_modified = 'NOW()';
         $deleted = '0';
         //$certification_model
         $ref_id = $this->input->post('ref_cert_id');
         $certificate_no = $this->input->post('txtCertNo');
         $current_certificate = '0';
         //date
         $strIssuedDate = $this->input->post('date_issued');
         $issuedDateToDate = date_create($strIssuedDate);
         $date_issued = date_format($issuedDateToDate, "Y-m-d");
         //date
         $validity = $this->input->post('validity');
         $month_valid = $this->input->post('month_valid');
         $day_valid = $this->input->post('day_valid');
         $year_valid = $this->input->post('year_valid');
         $DELETED = '0';
         $updateResult = $monitoring_model->updateLswdoMonitoring($ref_id, $profile_id, $visit_count, $visit_date, $remarks, $modified_by, $deleted);
         if ($updateResult) {
             $monitoring_model = new Monitoring_Model();
             $certification_model = new Certification_Model();
             $visit_model = new Visit_model();
             $validity_model = new Validity_model();
             $this->load->view('header');
             $this->load->view('nav');
             $this->load->view('sidebar');
             $this->load->view('monitoring_edit', array('getDataByProfileID' => $monitoring_model->getDataByProfileID(), 'getVisitCount' => $visit_model->getVisitCount(), 'getValidity' => $validity_model->getValidity(), 'monitoring_model' => $monitoring_model, 'certification_model' => $certification_model, 'validity_model' => $validity_model, 'visit_model' => $visit_model));
             $this->load->view('footer');
         }
     }
 }
Example #7
0
 public function monitoring_add($profID)
 {
     if (!$this->session->userdata('user_id')) {
         redirect('/users/login', 'location');
     }
     $validity_model = new Validity_model();
     $visit_model = new Visit_model();
     $monitoring_model = new Monitoring_Model();
     $this->validateAddMonitoring();
     if ($this->form_validation->run() == FALSE) {
         //if ($this->input->post('insert') <> "") {
         $form_message = '';
         $this->load->view('header');
         $this->load->view('nav');
         $this->load->view('sidebar');
         $this->load->view('monitoring_add', array('getVisitCount' => $visit_model->getVisitCount(), 'getValidity' => $validity_model->getValidity(), 'monitoring_model' => $monitoring_model, 'visit_model' => $visit_model, 'validity_model' => $validity_model, 'getStatus' => $monitoring_model->getStatus(), 'countVisits' => $monitoring_model->countVisits($profID)));
         $this->load->view('footer');
     } else {
         //$certfication_model = new Certification_Model();
         /*$validity_model = new Validity_model();
           $visit_model = new Visit_model();
           $monitoring_model = new Monitoring_Model();*/
         //$profile_id ='9';
         $profile_id = $this->input->post('profile_id');
         //mglv
         $ref_cert_id = '0';
         $visit_count = $this->input->post('visit_count');
         $visit_status = $this->input->post('visit_status');
         //date
         $strVisitDate = $this->input->post('visit_date');
         $visitDateToDate = date_create($strVisitDate);
         $visit_date = date_format($visitDateToDate, "Y-m-d");
         //date
         $remarks = $this->input->post('remarks');
         $created_by = $this->session->userdata('user_id');
         $date_created = 'NOW()';
         $modified_by = $this->session->userdata('user_id');
         $date_modified = '0000-00-00';
         $deleted = '0';
         $addResult = $monitoring_model->insertLswdoMonitoring($profile_id, $ref_cert_id, $visit_count, $visit_date, $visit_status, $remarks, $created_by, $date_created, $modified_by, $date_modified, $deleted);
         if ($addResult) {
             $indicator_model = new indicator_model();
             /*$form_message = 'Add Success!';
               $this->load->view('header');
               $this->load->view('nav');
               $this->load->view('sidebar');
               $this->load->view('monitoring_list', array(
                   'getDataByProfileID' => $monitoring_model->getDataByProfileID(),
                   'getVisitCount' => $visit_model->getVisitCount(),
                   'getValidity' => $validity_model->getValidity(),
                   'monitoring_model' => $monitoring_model,
                   'visit_model' => $visit_model,
                   'validity_model' => $validity_model,
               ));
               $this->load->view('footer');*/
             $form_message = '';
             $this->load->view('header');
             $this->load->view('nav');
             $this->load->view('sidebar');
             $this->load->view('indicator_add', array('firstMotherIndicator' => $indicator_model->getFirstMotherIndicator(), 'firstIndicators' => $indicator_model->getFirstIndicators()));
             $this->load->view('footer');
             $this->redirectIndex($profile_id, $addResult);
         }
     }
 }
 public function test()
 {
     $mon = new Monitoring_Model();
     $start = $mon->cekNextDay(date('Y-m-d h:m:s'), true);
     echo $start;
 }
 public function input()
 {
     $notif = new Notifikasi();
     $upload = new Upload('upload');
     $mon = new Monitoring_Model();
     $time = $mon->cekNextDay(date('Y-m-d H:i:s'), true);
     $tgl = $_POST['tgl_surat'] == '0000-00-00' ? date('Y-m-d') : $_POST['tgl_surat'];
     $status = $_POST['nomor'] == '' ? '21' : '22';
     $data = array('rujukan' => $_POST['rujukan'], 'no_surat' => $_POST['nomor'], 'tipe' => $_POST['tipe'], 'tgl_surat' => Tanggal::ubahFormatTanggal($tgl), 'tujuan' => substr($_POST['tujuan'], 0, 8), 'perihal' => $_POST['perihal'], 'sifat' => $_POST['sifat'], 'jenis' => $_POST['jenis'], 'lampiran' => $_POST['lampiran'], 'user' => Session::get('user'), 'status' => $status, 'start' => $time);
     if ($this->model->input($data)) {
         //var_dump($data);
         //upload file surat, sementara di temp folder krn belom dapat nomor
         /* if($this->model->input($data)!=true){
            $this->view->success = "rekam data surat keluar berhasil";
            }else{
            $this->view->error = "rekam data surat keluar tidak berhasil";
            } */
         if (end(explode('.', $upload->getFileName())) == 'pdf') {
             $upload->setDirTo('arsip/');
         } elseif (end(explode('.', $upload->getFileName())) == 'docx' or end(explode('.', $upload->getFileName())) == 'doc') {
             $upload->setDirTo('arsip/temp/');
         }
         $tipe = 'K';
         $satker = substr($_POST['tujuan'], 0, 8);
         $id = 0;
         $sql = "SELECT MAX(id_suratkeluar) as id FROM suratkeluar";
         $did = $this->model->select($sql);
         foreach ($did as $valid) {
             $id = $valid['id'];
         }
         //nama baru akan terdiri dari tipe naskah_nomor surat_asal(asal/tetapi asal terlaku kepanjangan)
         $ubahNama = array($tipe, $id, $satker);
         $upload->setUbahNama($ubahNama);
         $upload->changeFileName($upload->getFileName(), $ubahNama);
         $namafile = $upload->getFileTo();
         $where = ' id_suratkeluar=' . $id;
         $data = array('file' => $namafile);
         $bagianu = Session::get('bagian');
         $upload->uploadFile();
         $this->model->uploadFile($data, $where);
         $dataks = $this->model->select("SELECT id_user FROM user WHERE role=2 AND bagian =" . $bagianu . " AND active='Y'");
         foreach ($dataks as $val) {
             $notif->set('id_user', $val['id_user']);
         }
         $notif->set('id_surat', $this->model->lastIdInsert($_POST['tipe']));
         $notif->set('jenis_surat', 'SK');
         $notif->set('role', 2);
         $notif->set('bagian', $bagianu);
         $notif->set('stat_notif', 1);
         $notif->addNotifikasi();
         @Session::createSession();
         $user = Session::get('user');
         $log = new Log();
         $log->addLog($user, 'REKAM SK', 'user ' . $user . ' rekam surat keluar tujuan ' . substr($_POST['tujuan'], 0, 6));
         unset($log);
         echo "<div id=success>Rekam data surat keluar berhasil</div>";
     } else {
         echo "<div id=error>Rekam data surat keluar gagal</div>";
     }
     //        return true;
     //        $this->view->render('suratkeluar/rekam');
 }