/** * �ж��鼮�Ƿ���� * ����true/false */ public function isExitByBookName($resource_book_name) { require_once '../../conndb/mysql/ConnMysqlClass.php'; $conn = ConnMysqlClass::getConnMysql(); mysql_select_db(ConnMysqlClass::getDBName(), $conn); $sql = "select resource_book_id from stack_resource_book where resource_book_name = '{$resource_book_name}'"; $result = mysql_query($sql); $row = mysql_fetch_array($result); return $row['resource_book_id'] == "" ? true : false; }
/** * 根据服务支持id删除此信息 * * @param 服务支持id $sup_res_sup_tecs_id * @return bool */ public function deleteTecsById($sup_res_sup_tecs_id) { //引入数据库操作类 require_once '../../conndb/mysql/ConnMysqlClass.php'; //链接数据库 $conn = ConnMysqlClass::getConnMysql(); mysql_select_db(ConnMysqlClass::getDBName(), $conn); $str_sql = "delete from rea1_support_resource_tecs where sup_res_sup_tecs_id = {$sup_res_sup_tecs_id}"; $myq = mysql_query($str_sql, $conn); mysql_close($conn); return $myq; }
/** * 验证登录 * $emp_name,$emp_pwd */ public function doLogin($emp_name, $emp_pwd) { //引入数据库操作类 require_once '../../conndb/mysql/ConnMysqlClass.php'; //链接数据库 $conn = ConnMysqlClass::getConnMysql(); mysql_select_db(ConnMysqlClass::getDBName(), $conn); $str_sql = "select emp_name from rea1_emp where emp_name = '{$emp_name}' and emp_pwd = '{$emp_pwd}'"; $result = mysql_query($str_sql); $row = mysql_fetch_array($result); mysql_close($conn); return $row['emp_name']; }
/** * 通过图片id获得图片信息 * * @param $pic_id */ public function getPicUrlNameById($pic_id) { //引入数据库操作类 require_once '../../conndb/mysql/ConnMysqlClass.php'; //链接数据库 $conn = ConnMysqlClass::getConnMysql(); mysql_select_db(ConnMysqlClass::getDBName(), $conn); $str_sql = "select pic_urlname from rea1_resource_pic where pic_id = {$pic_id}"; $result = mysql_query($str_sql); $row = mysql_fetch_array($result); mysql_close($conn); return $row['pic_urlname']; }
/** * 新增技术解答 * * @param 技术解答INFO $arrAnswerInfo */ public function addAnswer($arrAnswerInfo) { //引入数据库操作类 require_once '../../conndb/mysql/ConnMysqlClass.php'; //链接数据库 $conn = ConnMysqlClass::getConnMysql(); mysql_select_db(ConnMysqlClass::getDBName(), $conn); $sup_res_answer_title = $arrAnswerInfo['sup_res_answer_title']; $sup_res_answer_content = $arrAnswerInfo['sup_res_answer_content']; $str_sql = "insert into rea1_support_resource_answer(sup_res_answer_title,sup_res_answer_content) values('{$sup_res_answer_title}','{$sup_res_answer_content}')"; $myq = mysql_query($str_sql, $conn); mysql_close($conn); return $myq; }
/** * 添加文件资源到数据库 * @param 文件资源信息 $arrFileInfo */ public function addFileSource($arrFileInfo) { //引入数据库操作类 require_once '../../conndb/mysql/ConnMysqlClass.php'; //链接数据库 $conn = ConnMysqlClass::getConnMysql(); mysql_select_db(ConnMysqlClass::getDBName(), $conn); $down_name = $arrFileInfo['down_name']; $down_urlname = $arrFileInfo['down_urlname']; $down_savedate = $arrFileInfo['down_savedate']; $str_sql = "insert into rea1_resource_down(down_name,down_urlname,down_savedate) values('{$down_name}','{$down_urlname}','{$down_savedate}')"; $myq = mysql_query($str_sql, $conn); mysql_close($conn); return $myq; }
/** * 获取技术解答列表 */ public function getAnswerList() { //引入数据库操作类 require_once '../conndb/mysql/ConnMysqlClass.php'; //链接数据库 $conn = ConnMysqlClass::getConnMysql(); mysql_select_db(ConnMysqlClass::getDBName(), $conn); $str_sql = "select sup_res_answer_title,sup_res_answer_content from rea1_support_resource_answer order by sup_res_answer_id desc"; $result = mysql_query($str_sql); $arrAnswers = array(); $var = 0; while ($row = mysql_fetch_array($result)) { $arrAnswers[$var++] = array("sup_res_answer_title" => $row['sup_res_answer_title'], "sup_res_answer_content" => $row['sup_res_answer_content']); } mysql_close($conn); return $arrAnswers; }
/** * 获取招聘类别列表 * @return 招牌类别对象数组 */ public function getCategoryList() { //引入数据库操作类 require_once '../../conndb/mysql/ConnMysqlClass.php'; //链接数据库 $conn = ConnMysqlClass::getConnMysql(); mysql_select_db(ConnMysqlClass::getDBName(), $conn); $str_sql = "select in_cat_id,in_cat_content from rea1_in_category order by in_cat_id desc"; $result = mysql_query($str_sql); $arrCagegorys = array(); $var = 0; while ($row = mysql_fetch_array($result)) { $arrCagegorys[$var++] = array("in_cat_id" => $row['in_cat_id'], "in_cat_content" => $row['in_cat_content']); } mysql_close($conn); return $arrCagegorys; }
/** * 获取产品信息列表 * */ public function getProductList($proType) { //引入数据库操作类 require_once '../conndb/mysql/ConnMysqlClass.php'; //链接数据库 $conn = ConnMysqlClass::getConnMysql(); mysql_select_db(ConnMysqlClass::getDBName(), $conn); $str_sql = "select pro.pro_name pro_name,pro.pro_intro pro_intro,pro.pro_overview pro_overview,pro.pro_explanation pro_explanation,pro.pro_parameter pro_parameter,pic.pic_urlname pic_urlname from rea1_product pro,rea1_resource_pic pic where pro.fk_pic_id = pic.pic_id and pro.fk_pro_cate_name = '{$proType}' order by pro_id desc"; $result = mysql_query($str_sql); $arrProducts = array(); $var = 0; while ($row = mysql_fetch_array($result)) { $arrProducts[$var++] = array("pic_urlname" => $row['pic_urlname'], "pro_name" => $row['pro_name'], "pro_intro" => $row['pro_intro'], "pro_overview" => $row['pro_overview'], "pro_explanation" => $row['pro_explanation'], "pro_parameter" => $row['pro_parameter']); } mysql_close($conn); return $arrProducts; }
/** * 获取下载资源列表 * * @return 资源对象集合 */ public function getDownList() { //引入数据库操作类 require_once '../conndb/mysql/ConnMysqlClass.php'; //链接数据库 $conn = ConnMysqlClass::getConnMysql(); mysql_select_db(ConnMysqlClass::getDBName(), $conn); $str_sql = "select f.down_urlname down_urlname,f.down_name down_name from rea1_support_resource_down d,rea1_resource_down f where d.fk_down_id = f.down_id order by d.sup_res_down_id desc"; $result = mysql_query($str_sql); $arrDowns = array(); $var = 0; while ($row = mysql_fetch_array($result)) { $arrDowns[$var++] = array("down_urlname" => $row['down_urlname'], "down_name" => $row['down_name']); } mysql_close($conn); return $arrDowns; }
/** * 获取新闻列表 * @return 新闻列表 */ public function getNewsList() { //引入数据库操作类 require_once '../conndb/mysql/ConnMysqlClass.php'; //链接数据库 $conn = ConnMysqlClass::getConnMysql(); mysql_select_db(ConnMysqlClass::getDBName(), $conn); $str_sql = "select news_id,news_title,news_content,news_createdate from rea1_news order by news_id desc"; $result = mysql_query($str_sql); $arrNews = array(); $var = 0; while ($row = mysql_fetch_array($result)) { $arrNews[$var++] = array("news_id" => $row['news_id'], "news_title" => $row['news_title'], "news_content" => $row['news_content'], "news_createdate" => $row['news_createdate']); } mysql_close($conn); return $arrNews; }
/** * 获取招聘信息对象集合 * * @return 招聘信息对象集合 */ public function getRecruitmentList($recType) { //引入数据库操作类 require_once '../conndb/mysql/ConnMysqlClass.php'; //链接数据库 $conn = ConnMysqlClass::getConnMysql(); mysql_select_db(ConnMysqlClass::getDBName(), $conn); $str_sql = "select fk_in_category,in_content from rea1_in where fk_in_category = '{$recType}' order by in_id desc"; $result = mysql_query($str_sql); $arrRecruitments = array(); $var = 0; while ($row = mysql_fetch_array($result)) { $arrRecruitments[$var++] = array("fk_in_category" => $row['fk_in_category'], "in_content" => $row['in_content']); } mysql_close($conn); return $arrRecruitments; }
/** * 添加新闻信息 * @param 新闻信息 $arrNewsInfo */ public function addNews($arrNewsInfo) { //引入数据库操作类 require_once '../../conndb/mysql/ConnMysqlClass.php'; //链接数据库 $conn = ConnMysqlClass::getConnMysql(); mysql_select_db(ConnMysqlClass::getDBName(), $conn); $news_title = $arrNewsInfo['news_title']; $news_content = $arrNewsInfo['news_content']; $news_createdate = $arrNewsInfo['news_createdate']; $str_sql = "insert into rea1_news(news_title,news_content,news_createdate) values('{$news_title}','{$news_content}','{$news_createdate}')"; $myq = mysql_query($str_sql, $conn); mysql_close($conn); return $myq; }
/** * 根据用户名获得id * 判断这个用户是否存在 * * @param 用户名 $user_name */ public function getUserIdByName($user_name) { require_once '../../conndb/mysql/ConnMysqlClass.php'; $conn = ConnMysqlClass::getConnMysql(); mysql_select_db(ConnMysqlClass::getDBName(), $conn); $result = mysql_query("SELECT user_id FROM stack_user WHERE user_name = '{$user_name}'"); $row = mysql_fetch_array($result); $user_id = $row['user_id']; mysql_close($conn); //大于0说明已经有这个用户了,不能注册了,小于0说明没这个用户可以注册 return $user_id > 0 ? "0" : "1"; }
/** * 修改产品信息 * * @param 产品信息 $arrProductInfo */ public function updateProductById($arrProductInfo) { //引入数据库操作类 require_once '../../conndb/mysql/ConnMysqlClass.php'; //链接数据库 $conn = ConnMysqlClass::getConnMysql(); mysql_select_db(ConnMysqlClass::getDBName(), $conn); $pro_id = $arrProductInfo['pro_id']; $fk_pro_cate_name = $arrProductInfo['fk_pro_cate_name']; $fk_pic_id = $arrProductInfo['fk_pic_id']; $pro_name = $arrProductInfo['pro_name']; $pro_intro = $arrProductInfo['pro_intro']; $pro_overview = $arrProductInfo['pro_overview']; $pro_explanation = $arrProductInfo['pro_explanation']; $pro_parameter = $arrProductInfo['pro_parameter']; $str_sql = "update rea1_product set fk_pro_cate_name = '{$fk_pro_cate_name}',fk_pic_id = {$fk_pic_id},pro_name = '{$pro_name}',pro_intro = '{$pro_intro}',pro_overview = '{$pro_overview}',pro_explanation = '{$pro_explanation}',pro_parameter = '{$pro_parameter}' where pro_id = {$pro_id}"; $myq = mysql_query($str_sql, $conn); mysql_close($conn); return $myq; }
/** * 添加评论 * * @param 评论内容 $discussDetail */ public function addDiscuss($discussDetail) { require_once '../../conndb/mysql/ConnMysqlClass.php'; $conn = ConnMysqlClass::getConnMysql(); mysql_select_db(ConnMysqlClass::getDBName(), $conn); $fk_resource_case_id = $discussDetail["fk_resource_case_id"]; $fk_user_id = $discussDetail["fk_user_id"]; $resource_case_discuss_data = $discussDetail["resource_case_discuss_data"]; $resource_case_discuss_content = $discussDetail["resource_case_discuss_content"]; $str_sql = "insert into stack_resource_case_discuss(fk_resource_case_id,fk_user_id,resource_case_discuss_data,resource_case_discuss_content) value({$fk_resource_case_id},{$fk_user_id},'{$resource_case_discuss_data}','{$resource_case_discuss_content}')"; $myq = mysql_query($str_sql, $conn); mysql_close($conn); return $myq; }
/** * 获得语言分类 */ public function getLanguageSort() { require_once '../../conndb/mysql/ConnMysqlClass.php'; $conn = ConnMysqlClass::getConnMysql(); mysql_select_db(ConnMysqlClass::getDBName(), $conn); $str_sql = "select language_sort_name from stack_resource_language_sort"; $result = mysql_query($str_sql); $languageSorts = array(); $var = 0; while ($row = mysql_fetch_array($result)) { $languageSorts[$var++] = array("language_sort_name" => $row['language_sort_name']); } //关闭数据库 mysql_close($conn); return $languageSorts; }
/** * 获得所有书籍总量 */ public function getBookCount() { require_once '../../conndb/mysql/ConnMysqlClass.php'; $conn = ConnMysqlClass::getConnMysql(); mysql_select_db(ConnMysqlClass::getDBName(), $conn); $str_sql = "select count(resource_book_id) from stack_resource_book"; $result = mysql_query($str_sql); $row = mysql_fetch_array($result); $bookCount = $row[0]; mysql_close($conn); return $bookCount; }
/** * 图片信息写入数据库 * @param 图片info $arrPicInfo */ public function InsertPic($arrPicInfo) { //引入数据库连接 require_once '../../conndb/mysql/ConnMysqlClass.php'; $conn = ConnMysqlClass::getConnMysql(); mysql_select_db(ConnMysqlClass::getDBName(), $conn); $fk_user_id = $arrPicInfo['fk_user_id']; $pic_name = $arrPicInfo['pic_name']; $pic_type = $arrPicInfo['pic_type']; $pic_highlight = $arrPicInfo['pic_highlight']; $pic_width = $arrPicInfo['pic_width']; $pic_height = $arrPicInfo['pic_height']; $pic_size = $arrPicInfo['pic_size']; $pic_up_data = $arrPicInfo['pic_up_data']; $pic_statue = $arrPicInfo['pic_statue']; $str_sql = "insert into stack_resource_pic(fk_user_id,pic_name,pic_type,pic_highlight,pic_width,pic_height,pic_size,pic_up_data,pic_statue) values({$fk_user_id},'{$pic_name}','{$pic_type}','{$pic_highlight}','{$pic_width}','{$pic_height}','{$pic_size}','{$pic_up_data}','{$pic_statue}')"; $myq = mysql_query($str_sql, $conn); mysql_close($conn); return $myq; }