public function savegiaobienche() { $user = JFactory::getUser(); if (Core::_checkPerAction($user->id, 'com_tochuc', 'tochuc', 'thanhlap') == false) { JFactory::getApplication()->enqueueMessage('Bạn không có quyền truy cập', 'error'); $this->setRedirect("index.php"); return; } //$file = JRequest::getVar('file_upload', null, 'files', 'array'); JSession::checkToken() or die('Invalid Token'); $model = Core::model('Tochuc/Tochuc'); $formData = JRequest::get('post'); $formData['tieude'] = 'QĐ ' . TochucHelper::getNameById($formData['nghiepvu_id'], 'ins_nghiepvu_bienche', 'nghiepvubienche', 'id') . ' ,Ngày ' . $formData['quyetdinh_ngay']; $vanban_id = $model->saveVanban(array('id' => $formData['vanban_id'], 'mahieu' => $formData['quyetdinh_so'], 'tieude' => $formData['tieude'], 'ngaybanhanh' => $formData['quyetdinh_ngay'])); $quatrinh_id = $model->saveQuatrinhBienche(array('id' => $formData['id'], 'quyetdinh_so' => $formData['quyetdinh_so'], 'quyetdinh_ngay' => $formData['quyetdinh_ngay'], 'ghichu' => $formData['ghichu'], 'hieuluc_ngay' => TochucHelper::strDateVntoMySql($formData['hieuluc_ngay']), 'dept_id' => $formData['dept_id'], 'nghiepvu_id' => $formData['nghiepvu_id'], 'ordering' => 99, 'nam' => $formData['nam'], 'vanban_id' => $vanban_id)); Core::delete('ins_dept_quatrinh_bienche_chitiet', array('quatrinh_id = ' => $quatrinh_id)); for ($i = 0; $i < count($formData['hinhthuc']); $i++) { $model->saveQuatrinhBiencheChitiet($quatrinh_id, $formData['hinhthuc'][$i], (int) $formData['bienche'][$i]); } $model->saveTaptin($vanban_id, $formData['fileupload_id']); $this->setRedirect("index.php?option=com_tochuc&controller=tochuc&task=default"); }
//$vanban['mahieu'] = '<a href="index.php?option=com_tochuc&controller=tochuc&task=download&id='.$vanban['id'].'" target="_blank">'.$vanban['mahieu'].', ngày '.$vanban['ngaybanhanh'].'</a>'; } else { $vanban = array(); } ?> <tr> <td><?php echo $i + 1; ?> </td> <td nowrap="nowrap"><?php echo $row['nam']; ?> </td> <td nowrap="nowrap"><?php echo TochucHelper::getNameById($row['nghiepvu_id'], 'ins_nghiepvu_bienche', 'nghiepvubienche', 'id'); ?> </td> <td nowrap="nowrap"><?php echo $vanban['mahieu']; ?> </td> <td nowrap="nowrap"> <ol> <?php $bienche = TochucHelper::getQuatrinhBiencheChiTietByQuatrinhId($row['id']); for ($j = 0; $j < count($bienche); $j++) { ?> <li><?php echo $bienche[$j]['name']; ?>
} } else { $vanban = array(); } ?> <tr> <td><?php echo $row['quyetdinh_ngay']; ?> </td> <td><?php echo $nhl = $row['hieuluc_ngay'] == '0000-00-00' ? "" : date('d/m/Y', strtotime($row['hieuluc_ngay'])); ?> </td> <td><?php echo TochucHelper::getNameById($row['cachthuc_id'], 'ins_dept_cachthuc'); ?> </td> <td><?php echo $vanban['mahieu']; ?> </td> <td><?php echo $row['chitiet']; ?> </td> <td><?php echo $row['ghichu']; ?> </td> <td nowrap="nowrap">