Exemple #1
0
 public function index()
 {
     $query = RKit::getData('search_txt');
     if (!empty($query['search_txt'])) {
         $this->bindModel->where('area_name like ("%' . $query['search_txt'] . '%")');
     }
     $this->setData('search', $query['search_txt']);
     $this->lists($query);
 }
Exemple #2
0
 public function doUpload()
 {
     $params = $this->getData('params');
     $upload = array('Field' => 'file');
     $file = $_FILES['file'];
     $fileUrl = RKit::doAttachment("upload", $upload);
     $resource = array('size' => $file["size"], 'oname' => $file["name"], 'resource_url' => $fileUrl);
     if ($fileUrl !== FALSE) {
         $this->_addResource($resource);
     }
     $params = '{\\"params\\":' . $params . ',\\"files\\":"' . $fileUrl . '"}';
     echo '<script>window.parent.callback_upload(\'' . $params . '\');</script>';
     exit;
 }
Exemple #3
0
 /**
  * 输出ajax信息
  * @param int $statusCode
  * @param string $msg
  * @param array $data
  */
 protected function echoAjax($statusCode, $msg, $data = array())
 {
     $response = array('status' => (int) $statusCode, 'msg' => $msg);
     RKit::printJson(array_merge($response, $data));
 }
Exemple #4
0
 /**
  * 记录日志
  * @param string $msg
  */
 protected function log($msg)
 {
     RKit::appendFileLog($this->rauth->getUserInfo('employmentId'), $this->rauth->getUserInfo('loginName'), $this->activeModule, $msg);
 }
Exemple #5
0
 public function saveBefore($isInsert)
 {
     if ($isInsert) {
         $this->upass = isset($this->upass) && !empty(trim($this->upass)) ? RKit::makePwd($this->uname . $this->upass) : RKit::makePwd($this->uname . DEFAULTPWD);
         $this->reg_date = time();
         $this->reg_ip = $this->input->ip_address();
     }
 }