public static function about_action() { // 呈现 self::set('about', setting_model::get_about()); list($pager, $messages) = message_model::pager_all(array(array('id' => 'DESC'), g_int('page', 1), 10)); $pager['target'] = 'site/about'; self::set('pager', $pager); self::set('messages', $messages); self::set('logined', visitor::has_role('member')); self::set('captcha_question', setting_model::get_by_id(setting_model::id_captcha_question)->value); self::show_page('', 'three'); }
public static function delete_action() { // 拦截 self::method('delete'); self::role('member'); self::csrf('member'); // 校验 // 执行 message_model::del_by_id(g_int('id')); // 成功 self::send_json(true); }
echo user_model::departmentBox($dep, $dep); ?> </select> </select> <br> <select name="NGUOINHAN_CC" id="NGUOINHAN_CC" multiple="multiple" size="5" ondblclick="if(typeof(InsertIntoArrCC)=='function')eval('InsertIntoArrCC()');"> </select> <br> <input value="Chọn" class='input_button' onClick="BuildUsers_cc()" type="button"> <input value="Chọn tất cả" class='input_button' onClick="BuildUsersAll_cc()" type="button"> </div> <script> <?php echo message_model::arr_user_nguoinhan_cc($usernamedata); ?> FillComboByComboExp(document.getElementById("DEP_NGUOINHAN_CC"),document.getElementById("NGUOINHAN_CC"),ARR_NGUOINHAN_CC,null); </script> <div class="clr"></div> </div> <br> <div class="clr"></div> <div class="required"> <label id="lblTextIput" class="input">Tiêu đề<font color="red">*</font></label> <input type="text" size='72' maxlength="100" value="" id="tieude" name="tieude"> <span id="ERRtieude" class="box_erro_area"> <span id="ERRtieude" class="box_erro_area"></span> </div>
</div> <div style="float:left"> Tìm theo người gửi: <?php echo ProjectCommon::AutoComplete(autocomplete_model::getKeyword(), "ID_U", "EMP_NAME", "ID_U", "nguoigui", true, "width:200px", "ID_SEARCH", "nguoigui", $auto, "AutoSearch Box"); ?> <input type="button" class="input_button" onclick="document.frmInbox.submit();" name="send" value="Tìm" title="Tìm"> </div> <div style="float:right"> Tìm theo chủ đề <select name="filter_object" style="width:200px" id="filter_object" class="inputbox" size="1" onchange="document.frmInbox.submit();"> <?php echo message_model::chudeCombo($subject, $subject); ?> </select> </div> </div> </div> <div> <table width="100%" summary="List of messages" class="adminlist" id="inbox"> <caption><em> </em></caption> <thead> <tr> <th align=center width="15"><input type=checkbox name=DELALL onclick="SelectAll(this,'DEL')"></th> <th width="50%">Tiêu đề</th> <th>Ngày gửi</th>
function insertFile($idObject, $isTemp, $iddiv, $year, $type, $pdf = 0, $is_nogetcontent = 0) { $date = getdate(); if (!$type) { $type = -1; } $year = '2012'; if (!$idObject) { $idObject = 0; } if (!$isTemp) { $isTemp = 0; } $model = new filedinhkem_model(); //Lưu file đính kèm xuống thư mục tạm $temp_path = $model->getTempPath(); //lấy id người đăng nhập $user_log = new log_model(); $user = $user_log->getIdUserLogin(); foreach ($user as $au) { } //lấy idmessage $message_model = new message_model(); $thongtin = $message_model->getId_Thongtin(); foreach ($thongtin as $id_thongtin) { } $id_tn = $id_thongtin['id_thongtin'] + 1; //lấy idfood $food = new admin_model(); $max_food = $food->getMaxIdFood(); foreach ($max_food as $food_join) { } $ID = $food_join['ID'] + 1; //lấy id_project $project = new project_model(); $duan = $project->getMaxId(); foreach ($duan as $file_project) { $id_project = $file_project['ID_PR'] + 1; } $filepath = $temp_path . DIRECTORY_SEPARATOR . $_FILES['uploadedfile']['name']; if (!move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $filepath)) { return -1; } else { $file = new FileDinhKem(); $file->_time_update = $date['year'] . '-' . $date['mon'] . '-' . $date['mday'] . ' ' . $date['hours'] . ':' . $date['minutes'] . ':' . $date['seconds']; $file->_nam = $date['year']; $file->_thang = $date['mon']; $dirPath = $model->getDir($file->_nam, $file->_thang); $file->_id_thongtin = $id_tn; $file->_folder = $dirPath; $file->_id_object = $idObject; $file->_ID = $ID; $file->_id_project = $id_project; $file->_user = $au['ID_U']; $file->_filename = $_FILES['uploadedfile']['name']; $file->_mime = $_FILES['uploadedfile']['type']; $file->_type = $type; $model->insertFileObject($file); //get attachment id $id = $this->getId_Dk(); foreach ($id as $object) { $id_file = $object['ID_DK']; } $maso = $id_file . $file->_filename . $file->_time_update; //var_dump($maso); $maso = md5($maso); $model->md5_update($id_file, $maso); $newlocation = $dirPath . DIRECTORY_SEPARATOR . $maso; rename($filepath, $newlocation); $file->_pathFile = $newlocation; $file->_id_dk = $id_file; return $id_file; } }