コード例 #1
0
ファイル: get_model.class.php プロジェクト: ahmatjan/huluphp
 public function sql_query($sql)
 {
     if (!empty($this->db_tablepre)) {
         $sql = str_replace('phpcms_', $this->db_tablepre, $sql);
     }
     return parent::query($sql);
 }
コード例 #2
0
 public function getRandomLessonMsg($num)
 {
     if (isset($num)) {
         $xueyuan = new model("xueyuan", "", "");
         $xueyuanList = $xueyuan->query("SELECT * FROM zhuanyelesson WHERE l_studentxueyuan IN (SELECT xy_name FROM xueyuan)");
     } else {
         return false;
     }
 }
コード例 #3
0
 public function main()
 {
     $Article = D('Article');
     $Member = D('Member');
     $Job = D('Job');
     $Feedback = D('Feedback');
     $ArticleC = $Article->count();
     $MemberC = $Member->count();
     $JobC = $Job->count();
     $FeedbackC = $Feedback->count();
     $this->assign(array('ArticleC' => $ArticleC, 'MemberC' => $MemberC, 'JobC' => $JobC, 'FeedbackC' => $FeedbackC));
     //获取系统信息
     $config = new model();
     $array = array();
     $serverinfo = PHP_OS . ' / PHP v' . PHP_VERSION;
     $serverinfo .= @ini_get('safe_mode') ? ' Safe Mode' : NULL;
     $dbversion = $config->query("SELECT VERSION()");
     $fileupload = @ini_get('file_uploads') ? ini_get('upload_max_filesize') : '<font color="red">不支持上传</font>';
     $dbsize = 0;
     $tablepre = C('DB_PREFIX');
     $query = $tables = $config->query("SHOW TABLE STATUS LIKE '{$tablepre}%'");
     //dump($query);
     foreach ($tables as $table) {
         $dbsize += $table['Data_length'] + $table['Index_length'];
     }
     $dbsize = $dbsize ? RealSize($dbsize) : '未知大小';
     $dbversion = $config->query("SELECT VERSION()");
     $magic_quote_gpc = get_magic_quotes_gpc() ? 'On' : 'Off';
     $array['serverinfo'] = $serverinfo;
     $array['dbversion'] = $dbversion;
     $array['fileupload'] = $fileupload;
     $array['dbsize'] = $dbsize;
     $array['dbversion'] = $dbversion[0]['VERSION()'];
     $array['magic_quote_gpc'] = $magic_quote_gpc;
     $this->assign($array);
     $this->display("Public:main");
 }
コード例 #4
0
 public function executesql()
 {
     $db = new model();
     $sql = $_POST['sql'];
     $sql = stripslashes($sql);
     $this->assign('sql', $sql);
     $l = $db->query($sql);
     if ($l !== false) {
         $type = 1;
     } else {
         $type = 0;
     }
     $this->assign('type', $type);
     $this->display("exesql");
 }
コード例 #5
0
 public function getClassList($pagefirst, $pagesize)
 {
     $check = new model("checkrecord", "", "");
     $num = $check->query("SELECT COUNT(DISTINCT record_class) AS num FROM checkrecord");
     $num = $num[0]['num'];
     import('ORG.Util.Page');
     $page = new page($num, $pagesize);
     $this->page = $page->show();
     return $this->query("SELECT DISTINCT record_class FROM checkrecord LIMIT {$pagefirst},{$pagesize}");
 }
コード例 #6
0
ファイル: weibologin.class.php プロジェクト: tmlsoft/main
 public function uninstall()
 {
     $model = new model();
     $model->query("DROP TABLE IF EXISTS `" . C('DB_PREFIX') . "weibobind`");
     return true;
 }
コード例 #7
0
 public function getUserMsg($username, $password)
 {
     $Msg = array();
     $login = new model('teacher', '', '');
     $username = mysql_real_escape_string($username);
     $password = mysql_real_escape_string($password);
     $info = $login->query("SELECT tech_id FROM teacher WHERE tech_name = '" . $username . "' AND password = '******'");
     if (!empty($info[0]['tech_id'])) {
         $Msg['status'] = true;
         $Msg['msg'] = "登录成功";
         $Msg['userid'] = $info[0]['tech_id'];
     } else {
         $Msg['status'] = false;
         $Msg['msg'] = "用户名或密码错误";
     }
     return $Msg;
 }
コード例 #8
0
	public function sql_query($sql) {
		if (!empty($this->db_tablepre)) $sql = str_replace('ZLCMS_', $this->db_tablepre, $sql);
		return parent::query($sql);
	}
コード例 #9
0
ファイル: friendlink.class.php プロジェクト: tmlsoft/main
 public function uninstall()
 {
     $model = new model();
     $model->query("DROP TABLE IF EXISTS `" . C('DB_PREFIX') . "friendlink`");
     $model->query("DELETE FROM `" . C('DB_PREFIX') . "system` WHERE `name`='flinkpos'");
     $this->cacheupdate();
     return true;
 }