Пример #1
0
 public function certify()
 {
     $arr = array("error" => 0, 'content' => '');
     if ($_POST) {
         $arr = array("error" => 1, 'content' => '');
         $file = $_FILES['file'];
         if ($file['error'] == 0) {
             $table = array('`username`', '`mobile`');
             $check = yf_entry($table, 'worker_info', $file);
             if ($check) {
                 $arr['content'] = "导入成功";
             } else {
                 $arr['content'] = "导入失败";
             }
         } else {
             $arr['content'] = "请选择上传的文件";
         }
     }
     $sort = yf_empty($_GET['k'], '', true);
     $page = yf_empty(intval($_GET['page']), 1, true);
     $art_list = Model('worker')->get_list($sort, $page);
     $this->assign("art_list", $art_list['result']);
     $this->assign("art_page", $art_list['page']);
     $this->assign("arr", $arr);
     $this->display("certify.html");
 }
Пример #2
0
 /**
  * 显示表单数据
  */
 public function log()
 {
     $arr = array("error" => 0, 'content' => '');
     if ($_POST) {
         $this->admin_priv('entry_log', 2);
         $arr = array("error" => 1, 'content' => '');
         $form_id = intval($_POST['form_id']);
         $file = $_FILES['file'];
         if (empty($form_id)) {
             $arr['content'] = "系统错误";
         } else {
             if ($file['error'] == 0) {
                 $table = Model('forms')->get_table_type($form_id);
                 if (!empty($table)) {
                     $check = yf_entry($table, 'forms_log_' . $form_id, $file);
                     if ($check) {
                         $arr['content'] = "导入成功";
                     } else {
                         $arr['content'] = "导入失败";
                     }
                 } else {
                     $arr['content'] = "表单字段为空,上传失败";
                 }
             } else {
                 $arr['content'] = "请选择上传的文件";
             }
         }
     }
     $page = yf_empty(intval($_REQUEST['page']), 1, true);
     $id = intval($_GET[id]);
     $table_list = Model('forms')->get_table_list($id);
     $art_list = Model('forms')->log_list($id, $table_list['val'], $page);
     $this->assign('art_list', $art_list['data']);
     $this->assign('art_page', $art_list['pagelink']);
     $this->assign("table_list", $table_list);
     $this->assign("form_id", $id);
     $this->assign("arr", $arr);
     $this->display('log.html');
 }