예제 #1
0
     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)) {
     echo '<a href="' . URL . 'suratkeluar/edit/' . $value->getId() . '" title="ubah data surat" class=tip><input class="btn btn-green" type=button value=Ubah></a> 
         <a href="' . URL . 'suratkeluar/remove/' . $value->getId() . '" title="hapus data surat" class=tip><input class="btn btn-danger" type=button value=Hapus onclick="return selesai()"></a> ';
예제 #2
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;
 }
예제 #3
0
 public function test()
 {
     $mon = new Monitoring_Model();
     $start = $mon->cekNextDay(date('Y-m-d h:m:s'), true);
     echo $start;
 }
예제 #4
0
 public function test()
 {
     $date = '2013-06-25 16:30:00';
     $mon = new Monitoring_Model();
     echo $mon->cekNextDay($date, false, 5);
 }
예제 #5
0
 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');
 }