function getFather()
{
    $db = new DB();
    global $param;
    global $first;
    $id = $param['projectId'];
    if (!empty($id)) {
        $data = $db->getrow("select * from " . $first . "vote_project where id=" . $id . "");
        echo json_encode($data);
    }
}
Example #2
0
function delmenu($menuType, $menuId)
{
    $db = new DB();
    if ($menuType == 1) {
        /*
         * 若要删除的菜单按钮为活动类型,则活动的模块表为wx_activity_module
         */
        // 查找出存储活动数据的表
        $sql_table = "select b.id,reviewTable from wx_wechat_module as a left join wx_activity_module as b on a.id=b.menuid where a.id='{$menuId}'";
        $res_table = $db->getrow($sql_table);
        if ($res_table['reviewTable'] == 'wx_activity_interact_project') {
            /*
             * 图片互动类型的活动
             */
            $sql_delete_interact = "DELETE a,b,c,d from wx_activity_interact as b left join wx_activity_interact_project as a on a.id=b.projectId\n\t\t\tleft join wx_activity_leaveword as c on c.activityId=b.id\n\t\t\tleft join wx_activity_zan as d on d.activityId=b.id\n\t\t\twhere a.moduleId='{$res_table['id']}'";
            $res_delete_interact = $db->execsql($sql_delete_interact);
            if (mysql_affected_rows() >= 0) {
                $error1 = 1;
                //删除成功
            } else {
                $error1 = 0;
                //删除失败
            }
        } elseif ($res_table['reviewTable'] == 'wx_vote_project') {
            /*
             * 投票类型的活动
             */
            $sql_delete_vote = "delete a,b,c from wx_vote_project as a left join wx_vote_option as b on b.voteId=a.id\n\t\t\t\t\t                                                  left join wx_vote_interact as c on c.voteId=a.id";
            $res_delete_vote = $db->execsql($sql_delete_vote);
            if (mysql_affected_rows() >= 0) {
                $error1 = 1;
                //删除成功
            } else {
                $error1 = 0;
                //删除失败
            }
        }
        // 删除菜单数据库表
        $sql_delete_menu = "delete a,b from wx_wechat_module as a left join wx_activity_module as b on a.id=b.menuId where a.id='{$menuId}'";
        $res_delete_menu = $db->execsql($sql_delete_menu);
        if (mysql_affected_rows() > 0) {
            $error2 = 1;
            // 删除成功
        } else {
            $error2 = 0;
            // 删除失败
        }
        if ($error1 && $error2) {
            $del['error'] = "删除成功";
        } else {
            $del['error'] = "删除失败";
        }
    } elseif ($menuType == 2) {
        /*
         * 若要删除的菜单按钮为文章列表类型,则活动的模块表为wx_activity_module
         */
        // 判断要删除的是否是菜单
        if ($menuId != 0) {
            /*
             * 是菜单类型
             */
            // 删除相关文件
            $sql_file = "select thumb,media from wx_info as b left join wx_articlelist_module as a on a.id=b.moduleId where a.menuId='{$menuId}'";
            $res_file = $db->execsql($sql_file);
            foreach ($res_file as $val_file) {
                if (!empty($val_file['thumb'])) {
                    unlink($val_file['thumb']);
                }
                if (!empty($val_file['media'])) {
                    $media = explode(';', $val_file['media']);
                    foreach ($media as $key_media => $val_media) {
                        if (empty($val_media)) {
                            unset($media[$key_media]);
                        } else {
                            unlink($val_media);
                        }
                    }
                }
            }
            // 删除数据库中的数据
            $sql_delete_articlelist = "DELETE a,b,c,d from wx_info as b left join wx_articlelist_module as a on a.id=b.moduleId\n\t\t\tleft join wx_leaveword as c on c.infoId=b.id\n\t\t\tleft join wx_zan as d on d.infoId=b.id\n\t\t\twhere a.menuId='{$menuId}'";
            $res_delete_articlelist = $db->execsql($sql_delete_articlelist);
            if (mysql_affected_rows() >= 0) {
                $error1 = 1;
                //删除成功
            } else {
                $error1 = 0;
                //删除失败
            }
            // 删除菜单数据库表
            $sql_delete_menu = "delete a,b from wx_wechat_module as a left join wx_articlelist_module as b on a.id=b.menuId where a.id='{$menuId}'";
            $res_delete_menu = $db->execsql($sql_delete_menu);
            if (mysql_affected_rows() > 0) {
                $error2 = 1;
                // 删除成功
            } else {
                $error2 = 0;
                // 删除失败
            }
            if ($error1 && $error2) {
                $del['error'] = "删除成功";
            } else {
                $del['error'] = "删除失败";
            }
        } else {
            $del['error'] = "不是菜单类型,不能删除";
        }
    } elseif ($menuType == 3) {
        /*
         * 菜单类型为人才理念
         */
        $sql_delete_talent2 = "delete from wx_talent_philosophy";
        $sql_delete_talent2 = $db->execsql($sql_delete_talent2);
        if (mysql_affected_rows() >= 0) {
            $errortalent2 = 1;
            // 删除成功
        } else {
            $errortalent2 = 0;
            // 删除失败
        }
        // 删除菜单数据库表
        $sql_delete_menu = "delete from wx_wechat_module  where id='{$menuId}'";
        $res_delete_menu = $db->execsql($sql_delete_menu);
        if (mysql_affected_rows() > 0) {
            $errortalent1 = 1;
            // 删除成功
        } else {
            $errortalent1 = 0;
            // 删除失败
        }
        if ($errortalent1 && $errortalent2) {
            $del['error'] = "删除成功";
        } else {
            $del['error'] = "删除失败";
        }
    } elseif ($menuType == 4) {
        /*
         * 菜单类型为人才招聘
         */
        $sql_delete_talent1 = "delete from wx_talent_recruit";
        $res_delete_talent1 = $db->execsql($sql_delete_talent1);
        if (mysql_affected_rows() >= 0) {
            $errortalent1 = 1;
            // 删除成功
        } else {
            $errortalent1 = 0;
            // 删除失败
        }
        // 删除菜单数据库表
        $sql_delete_menu = "delete from wx_wechat_module  where id='{$menuId}'";
        $res_delete_menu = $db->execsql($sql_delete_menu);
        if (mysql_affected_rows() > 0) {
            $errortalent2 = 1;
            // 删除成功
        } else {
            $errortalent2 = 0;
            // 删除失败
        }
        if ($errortalent1 && $errortalent2) {
            $del['error'] = "删除成功";
        } else {
            $del['error'] = "删除失败";
        }
    } elseif ($menuType == 5) {
        /*
         * 菜单类型为企业简介
         */
        // 删除相关文件
        $sql_file = "select picture from wx_profile";
        $res_file = $db->execsql($sql_file);
        foreach ($res_file as $val_file) {
            unlink($val_file['picture']);
        }
        // 删除数据库中的数据
        $sql_delete_profile = "delete from wx_profile";
        $res_delete_profile = $db->execsql($sql_delete_profile);
        if (mysql_affected_rows() >= 0) {
            $error1 = 1;
            // 删除成功
        } else {
            $error1 = 0;
            // 删除失败
        }
        // 删除菜单数据库表
        $sql_delete_menu = "delete from wx_wechat_module  where id='{$menuId}'";
        $res_delete_menu = $db->execsql($sql_delete_menu);
        if (mysql_affected_rows() > 0) {
            $error2 = 1;
            // 删除成功
        } else {
            $error2 = 0;
            // 删除失败
        }
        if ($error1 && $error2) {
            $del['error'] = "删除成功";
        } else {
            $del['error'] = "删除失败";
        }
    } elseif ($menuType == 6) {
        /*
         * 菜单类型为地图导航
         */
        // 删除数据库中的数据
        $sql_delete_map = "delete from wx_map";
        $res_delete_map = $db->execsql($sql_delete_map);
        if (mysql_affected_rows() >= 0) {
            $error1 = 1;
            // 删除成功
        } else {
            $error1 = 0;
            // 删除失败
        }
        // 删除菜单数据库表
        $sql_delete_menu = "delete from wx_wechat_module  where id='{$menuId}'";
        $res_delete_menu = $db->execsql($sql_delete_menu);
        if (mysql_affected_rows() > 0) {
            $error2 = 1;
            // 删除成功
        } else {
            $error2 = 0;
            // 删除失败
        }
        if ($error1 && $error2) {
            $del['error'] = "删除成功";
        } else {
            $del['error'] = "删除失败";
        }
    }
    return $del;
}
Example #3
0
<?php

session_start();
error_reporting(0);
header("content-type:text/json;charset=utf-8");
require_once '../../../common/php/dbaccess.php';
$db = new DB();
//die;
if (strtolower($_SESSION['captchaCode']) != strtolower($_GET['captchaCode'])) {
    $login['error'] = 2;
    //验证码错误
} else {
    $number = $_GET['number'];
    //管理员编号
    $pwd = md5(md5($_GET['pwd']));
    //管理员密码,并进行两次md5编码
    $sql_user = "select id,name from wx_admin where number='{$number}' and pwd='{$pwd}'";
    $res_user = $db->getrow($sql_user);
    $login['error'] = -1;
    if (empty($res_user)) {
        $login['error'] = 0;
        //登录失败
    } else {
        $_SESSION['admin']['id'] = $res_user['id'];
        $_SESSION['admin']['name'] = $res_user['name'];
        $login['adminName'] = $res_user['name'];
        $login['error'] = 1;
        //登录成功
    }
}
echo json_encode($login);
 // $subcom['coordinate']='89.5341,87.145646';
 if (empty($subcom['companyName']) || empty($subcom['address']) || empty($subcom['phone']) || empty($subcom['email'])) {
     echo 2;
     //请检查空值
 } else {
     if (empty($subcom['coordinate'])) {
         echo 3;
         //坐标值获取失败
     } elseif (!$regex->isEmail($subcom['email'])) {
         echo 4;
         //email格式错误
     } else {
         //判断是否有置顶项,若有,则取消其他置顶
         if ($subcom['isTop'] == 1) {
             $sql_top = "select id from wx_map where isTop=1";
             $res_top = $db->getrow($sql_top);
             if (!empty($res_top)) {
                 $sql_topDel = "update wx_map set isTop=0 where id=" . $res_top['id'];
                 $res_topDel = $db->execsql($sql_topDel);
             }
         }
         //判断同一子公司名称是否重复添加
         $sql_repeat = "select id from wx_map where companyName='{$subcom['companyName']}'";
         $res_repeat = $db->getrow($sql_repeat);
         if (!empty($res_repeat)) {
             echo 6;
             //该子公司信息已存在,不能重复添加
         } else {
             $insert = $db->insert('wx_map', $subcom);
             if ($insert) {
                 echo 1;
<?php

/**
 * 文化理念信息展示
 */
header("content-type:text/json;charset=utf-8");
require_once '../../../common/php/dbaccess.php';
// echo "90";
$db = new DB();
//查找文化理念的infoId
$sql_id = "select a.id from wx_info as a left join wx_articlelist_module as b on a.moduleId=b.id where b.type=2";
$res_id = $db->getrow($sql_id);
$infoId = $res_id['id'];
/**
 * ************显示某篇文章信息的具体内容***************
 */
$sql_info_details = "select thumb,title,date,content from wx_info where id='{$infoId}'";
$res_info_details = $db->getrow($sql_info_details);
$details['title'] = $res_info_details['title'];
$details['date'] = $res_info_details['date'];
$details['content'] = $res_info_details['content'];
$details['thumb'] = $res_info_details['thumb'];
echo json_encode($details);
<?php

header("content-type:text/json;charset=utf-8");
require_once '../../../common/php/dbaccess.php';
require_once '../../../common/php/regexTool.class.php';
$db = new DB();
$regex = new regexTool();
//查找企业文化的ID
$sql_culture_id = "select b.id from wx_wechat_module as a left join wx_articlelist_module as b on a.id=b.menuId where a.parentId!=0 and a.menuType=0";
$res_culture_id = $db->getrow($sql_culture_id);
$parentId = $res_culture_id['id'];
//企业文化在wx_articlelist_module中的id
$type = $_GET['type'];
//获取type值,确定是哪种操作
if ($type == "addList") {
    $name = $_GET['name'];
    //新增的模块名称
    $menuType = $_GET['menuType'];
    //"picture":图文;"video":视频
    if (empty($name) || empty($menuType)) {
        echo 2;
        //请检查空值
    } else {
        switch ($menuType) {
            case 'picture':
                $mediaType = 0;
                $urlPC = '../../article/html/articlelist.html';
                $wechat = "../../article/html/newslist.php?moduleId=";
                break;
            case 'video':
                $mediaType = 1;
//获取要求
// $type="list";
$review_id = $_POST['id'];
//获取要显示的活动类型的ID
// $review_id=1;
/*
 * 往期回顾的列表显示
 */
if ($type == "list") {
    $list_type = $_POST['list_type'];
    //获取
    // $list_type="manager_leaveword";
    $sql_reviewName = "select reviewTable from wx_activity_module where id =" . $review_id;
    //选择往期回顾表
    // 	echo $sql_reviewName;
    $res_reviewName = $db->getrow($sql_reviewName);
    // 	var_dump($res_reviewName);
    $reviewName = $res_reviewName['reviewTable'];
    // 	echo $reviewName;die;
    $page = $_POST['page'];
    //获取页码
    // $page=1;
    $num = 10;
    //每页的容量
    $start = ($page - 1) * $num;
    if ($list_type == "wx") {
        $a = 1;
        $sql = "select * from " . $reviewName . " where review = " . $a;
        // 	echo $sql;die;
        $result = mysql_query($sql);
        // 	var_dump($result);
$regex = new regexTool();
session_start();
$openid = $_SESSION['openid'];
// if($openid != ""){
$type = $_REQUEST['type'];
//list:列表显示;details:具体内容显示
if ($type == 'list') {
    /**
     * ************显示文章信息列表***************
     */
    $page = $_REQUEST['page'];
    $moduleId = $_REQUEST['moduleId'];
    $list = array();
    //根据moduleId查询模块名称
    $sql_name = "select name from wx_articlelist_module where id=" . $moduleId;
    $res_name = $db->getrow($sql_name);
    $list['moduleName'] = $res_name['name'];
    $num = 10;
    //每页显示10条
    $start = ($page - 1) * $num;
    //本页显示的起始位置
    // 从wx_info中查询出文章信息的基本文章信息
    $sql_info_num = "select id from wx_info where moduleId='{$moduleId}' and importance=0 ";
    $res_info_num = $db->execsql($sql_info_num);
    $list['PageNum'] = ceil(count($res_info_num) / $num);
    if ($page == 1) {
        //查找是否有置顶项,在首页显示
        $sql_top_select = "select id,title,thumb,abstract,content,date,is_leaveword,is_zan,importance from wx_info where moduleId='{$moduleId}' and importance=1 order by date desc ";
        $res_top_select = $db->execsql($sql_top_select);
        if (!empty($res_top_select)) {
            //有置顶项
Example #9
0
//验证用户是否已登陆
if ($userID != NULL) {
    $sql = "SELECT * FROM stuinfo WHERE ID = '{$userID}'";
} else {
    if (isset($_GET["paper"])) {
        $paper_md5 = $_GET["paper"];
        $sql = "SELECT * FROM stuinfo WHERE PAPER_MD5 = '{$paper_md5}'";
    } else {
        header("Location: index.php ");
        exit;
    }
}
require_once "library/db.php";
$db = new DB();
$db->query("{$sql}");
$userInfo = $db->getrow();
$isLogin = true;
$_SESSION['userID'] = $userInfo["ID"];
require_once 'config/config.exam.php';
//验证是否存在题号
if (!($userInfo["SINGLE_ID"] || $userInfo["MULTI_ID"] || $userInfo["JUDGE_ID"])) {
    exit;
}
//确保页面由exam提交
if (!isset($_POST["sure"])) {
    exit;
}
//是否成绩已存在
if ($userInfo["STU_SCO"] != NULL) {
    echo '您的试卷已提交,请勿重复提交!';
    exit;
        } else {
            $list['list'] = $res_list;
        }
    } else {
        $list['error'] = 3;
        // 参数错误
    }
    echo json_encode($list);
} elseif ($type == 'check') {
    /***************查看某项活动的详情以及用户参与情况 ,并显示出三个比较热门的参与情况*******************/
    $projectId = $_GET['projectId'];
    $openid = $_GET['openid'];
    if ($regex->isNumber($projectId)) {
        //查询图片互动审核功能是否开启
        $sql_audit = "select flag from wx_audit where name='pictureInteract'";
        $res_audit = $db->getrow($sql_audit);
        //查看某项活动的详情
        $sql_pro = "select title,start,end,content,num,media,thumb,valid from wx_activity_interact_project where id=" . $projectId;
        $res_pro = $db->getrow($sql_pro);
        if (!empty($res_pro)) {
            $res_check['project'] = $res_pro;
            // 		if($openid != ""){
            //显示三个热门参与情况
            if ($res_audit['flag'] == 1) {
                //审核功能开启
                $sql_hot = "select c.id as activityId,a.lwdnum,b.zannum,c.projectId from \n        \t\t        wx_activity_interact as c \n                        left join \n                        (select activityId,count(*) as lwdnum from wx_activity_leaveword GROUP BY activityId )as a\n                        on a.activityId=c.id\n                        left JOIN (select activityId,count(*) as zannum from wx_activity_zan GROUP BY activityId) as b \n                        on c.id=b.activityId\n                        WHERE c.projectId=" . $projectId . " and c.audit=1\n                        ORDER BY (a.lwdnum+b.zannum) desc, c.id  LIMIT 0,3";
            } else {
                //审核功能关闭
                $sql_hot = "select c.id as activityId,a.lwdnum,b.zannum,c.projectId from \n        \t\t        wx_activity_interact as c \n                        left join \n                        (select activityId,count(*) as lwdnum from wx_activity_leaveword GROUP BY activityId )as a\n                        on a.activityId=c.id\n                        left JOIN (select activityId,count(*) as zannum from wx_activity_zan GROUP BY activityId) as b \n                        on c.id=b.activityId\n                        WHERE c.projectId=" . $projectId . " \n                        ORDER BY (a.lwdnum+b.zannum) desc, c.id  LIMIT 0,3";
            }
            $res_hot = $db->execsql($sql_hot);
            // 保存成功
        } else {
            $error = 0;
            // 保存失败
        }
    }
    $file['error'] = $error;
    echo json_encode($file);
    /*
     * 显示员工的具体内容
     */
} elseif ($type == "details") {
    // 	$details_id=$_POST['id'];//获取要查看的招聘信息ID
    $details_id = 1;
    $sql_details = "select * from wx_talent_philosophy where id=" . $details_id;
    $res_details = $db->getrow($sql_details);
    $file['details'] = $res_details;
    echo json_encode($file);
    /*
     * 修改员工的图集和内容
     * 
     * 获取将要修改的员工信息
     */
} elseif ($type == "modify_past") {
    // 	$pastModify_id = $_POST['id']; // 获取原来的信息ID
    $pastModify_id = 1;
    $sql_past = "select * from wx_talent_philosophy where id=" . $pastModify_id;
    $res_past = $db->getrow($sql_past);
    $file['modify_past'] = $res_past;
    echo json_encode($file);
    /*
 //活动的图片
 $activity['valid'] = 1;
 //活动默认为开启状态
 $activity['review'] = 0;
 //默认为不用于往期回顾
 if ($regex->isNumber($menuId)) {
     if (empty($activity['title']) || empty($activity['content']) || empty($activity['num'])) {
         echo 2;
         // 请检查空项
     } elseif ($starttime < strtotime($activity['end']) && strtotime($activity['end']) <= strtotime('+6 month')) {
         /**
          * ***************截止日期为当前日期之后,距今半年之前***************************
          */
         $sql_activity_moduleId = "select id from wx_activity_module where menuId='{$menuId}'";
         // echo $sql_activity_moduleId;die;
         $res_activity_moduleId = $db->getrow($sql_activity_moduleId);
         $activity['moduleId'] = $res_activity_moduleId['id'];
         $insert_activity = $db->insert('wx_activity_interact_project', $activity);
         /* $conn = mysql_connect ( '127.0.0.1', 'root', '123456' ) or die ( print_r ( mysql_error (), true ) );
         		    mysql_query ( "set names 'utf8'" ); // 数据库输出编码
         		    $selectdb = mysql_select_db ( 'r017a7n50m7v5152', $conn ); // 打开数据库
         			$sql = "INSERT INTO wx_activity_interact_project(title,content,num,type,start,end,thumb,media,valid,review,moduleId) VALUES ('test3','xyxyxyxyxyxyxyxyxyyx','7','1','2015-12-23 13:21:58','2015-12-31 13:17','','','1','0','2') ";
         		  //echo $sql;//die;
         		    mysql_query ( $sql, $conn ); */
         //echo "909090";
         //$insert_activity = $db->insert_test ( );
         $insert_activity = 1;
         if ($insert_activity) {
             echo 1;
             // 添加成功
         } else {
        $file['empty'] = true;
    } else {
        $file['empty'] = false;
        $file['show'] = $res_show;
    }
    echo json_encode($file);
} elseif ($type == 'updateInfo') {
    /**
     * *****************后台管理员编辑、修改文章信息的具体内容,点击“修改”按钮**********************
     */
    $infoId = $_GET['infoId'];
    //获取显示具体内容的文章信息ID
    //$infoId = 5; // 获取显示具体内容的文章信息ID
    if ($regex->isNumber($infoId)) {
        $sql_updateInfo = "select title,content,picture from wx_info where id='{$infoId}'";
        $res_updateInfo = $db->getrow($sql_updateInfo);
        /* // 	将查询出的media的url根据“;”分开,单独存放
        		 $updateInfo_media=explode(';', $res_updateInfo['media']);
        		 foreach ($updateInfo_media as $val_updateInfo_media){
        		 $updateInfo['media'][]=$val_updateInfo_media;
        		} */
        $updateInfo['title'] = $res_updateInfo['title'];
        $updateInfo['content'] = $res_updateInfo['content'];
        $updateInfo['picture'] = $res_updateInfo['picture'];
        //var_dump($updateInfo);
        echo json_encode($res_updateInfo);
    }
} elseif ($type == 'updateInfoOK') {
    /**
     * *****************后台管理员编辑、修改文章信息的具体内容,点击“提交”按钮**********************
     */
Example #14
0
<?php

session_start();
require_once '../library/db.php';
$userNumber = dowith_sql(isset($_POST["STU_NUM"]) ? $_POST["STU_NUM"] : '');
$password = dowith_sql(isset($_POST["STU_PSW"]) ? $_POST["STU_PSW"] : '');
unset($_POST["STU_NUM"]);
isset($_POST["STU_PSW"]);
//接受用户输入开始验证
if ($userNumber != NULL && $password != NULL) {
    $db = new DB();
    $sql = "SELECT * FROM admin WHERE USER_NUM = '{$userNumber}' AND USER_PSW = '{$password}'";
    $db->query("{$sql}");
    $userInfo = $db->getrow();
    if ($userInfo) {
        $_SESSION['adminID'] = $userInfo["ID"];
        //添加session供全局验证
        $ip = $_SERVER['REMOTE_ADDR'];
        if ($userInfo["LOG_IP"]) {
            //记录IP
            $userUpdate["LOG_IP"] = $userInfo["LOG_IP"] . ';' . $ip;
        } else {
            $userUpdate["LOG_IP"] = $ip;
        }
        if (!$userInfo["LOG_TIMES"]) {
            $userUpdate["LOG_TIMES"] = 1;
        } else {
            $userUpdate["LOG_TIMES"] = $userInfo["LOG_TIMES"] + 1;
        }
        $db->update("admin", $userUpdate, "ID='{$userInfo['ID']}'");
        header("Location: user.php?action=1 ");
<?php

header("content-type:text/json;charset=utf-8");
require_once '../../../common/php/dbaccess.php';
require_once '../../../common/php/regexTool.class.php';
$db = new DB();
$regex = new regexTool();
session_start();
$sql_password = "select pwd from wx_admin where id =" . $_SESSION['admin']['id'];
//获取 用户数据库中原来的密码
$res_password = $db->getrow($sql_password);
$a = $res_password['pwd'];
//获取用户之前的密码密文
$past_password = md5(md5($_POST['past_password']));
//获取用户输入的密码并进行md5两次编码
$passwordType = $_POST['pastpwdType'];
/***************判断用户密码是否正确**********************/
if ($passwordType == "pastpwdType") {
    if ($past_password != $a) {
        echo 0;
        //密码输入错误
    } elseif ($past_password == $a) {
        echo 1;
    }
} elseif ($passwordType == "newpwdType") {
    $now_password1 = $_POST['now_password1'];
    //获取用户第一次的新密码
    $now_password2 = $_POST['now_password2'];
    //获取用户第二次的新密码
    /*************判断两次新密码输入是否相同***************/
    if ($now_password1 == $now_password2) {
Example #16
0
<?php

session_start();
require_once '../../php/db_mysql/dbaccess.php';
// error_reporting(0);
$db = new DB();
$username = 'lio';
$password = 123;
$sql = "select * from login where username = '{$username}' and password = '{$password}'";
// echo $sql;die;
$result = $db->getrow($sql);
$status = 0;
if (empty($result)) {
    $status = -1;
    $arr['status'] = $status;
} else {
    $status = 1;
    $arr['status'] = $status;
    $arr['username'] = $result['username'];
    $_SESSION['user']['number'] = $result['password'];
    //    $_SESSION['user']['name'] = $result['username'];
    //    $_SESSION['user']['companyID'] = $result['FCompanyID'];
    //    $_SESSION['user']['sectionID'] = $result['FSectionID'];
    //    $sql = "select a.FName, b.FName,c.FName from t_hs_employee as a inner join t_hs_company as b on a.FCompanyID = b.FID inner join
    // 	  t_hs_section as c on a.FSectionID = c.FID where a.FNumber = '".$username."'";
    // 	 //echo "sql:".$sql;
    //    $result = $db->get_num_row ( $sql );
    //    if(!empty($result)){
    //      $_SESSION['user']['companyname'] = $result[1];
    //      $_SESSION['user']['sectionname'] = $result[2];
    //    }
 $sql_max_seq = "SELECT id FROM wx_info WHERE moduleId ='{$moduleId}'";
 $res_max_seq = $db->execsql($sql_max_seq);
 $numAll = count($res_max_seq);
 //判断位置是否超出范围
 if ($nseq <= 0 || $nseq > $numAll) {
     $flag = 5;
     //已超出有效位置范围
     echo $flag;
     die;
 }
 //查找序号为$nseq的文章的id和seq
 $sql_n = "select seq,importance from wx_info  where moduleId='{$moduleId}' order by importance desc,seq asc limit 0," . $nseq;
 $res_n = $db->execsql($sql_n);
 $seq = $res_n[$nseq - 1]['seq'];
 $sql_re = "select seq from wx_info where id='{$infoId}'";
 $res_re = $db->getrow($sql_re);
 $reSeq = $res_re['seq'];
 if ($res_n[$nseq - 1]['importance'] == 0 && $is_top == 1) {
     $flag = 3;
     //请将文章取消置顶后移到此位置
     echo $flag;
     die;
 }
 if ($res_n[$nseq - 1]['importance'] == 1 && $is_top == 0) {
     $flag = 4;
     //请将文章置顶后移到此位置
     echo $flag;
     die;
 }
 if ($seq > $reSeq) {
     $sql1 = "select id,seq from wx_info where seq > '{$reSeq}' and seq <= '{$seq}' and moduleId='{$moduleId}'";
Example #18
0
<?php

/**
 * 判断用户是否已在PC端绑定,并根据微信ID将职员编号取出,保存到session中
 */
require_once 'dbaccess.php';
$db = new DB();
session_start();
// 获取微信ID
$openid = '0002';
// 判断微信是否已确认绑定
$sql_type = "select FType,FNumber from t_hs_wechat where FWechatID='{$openid}'";
$res_type = $db->getrow($sql_type);
// var_dump($res_type);die;
if ($res_type['FType'] == NULL) {
    echo 2;
    // 请先在PC端绑定微信号
} elseif ($res_type['FType'] == 0) {
    echo 0;
    // 显示确认界面
} else {
    // 获取该职员编号,存入session中
    $_SESSION['emp_number'] = $res_type['FNumber'];
    echo 1;
    // 进入预约界面
}
Example #19
0
        $check_data['check'] = $res_check;
        $check_data['error'] = 1;
        //数据不为空
    }
    echo json_encode($check_data);
} elseif ($type == 'checkFuzzy') {
    /**********************模糊查询公司名称**************************/
    $keyword = $_GET['keyword'];
    $sql_checkFuzzy = "select * from wx_map where companyName like '%" . $keyword . "%'";
    $res_checkFuzzy = $db->execsql($sql_checkFuzzy);
    echo json_encode($res_checkFuzzy);
} elseif ($type == 'checkOne') {
    /*********用户输入通过模糊查询输入完整的子公司名称后,显示该公司具体的信息*************/
    $companyName = $_GET['companyName'];
    $sql_company = "select * from wx_map";
    $res_company = $db->getrow($sql_company);
    echo json_encode($res_company);
} elseif ($type == 'detail') {
    $id = $_GET['id'];
    $sql_select = "select * from wx_map where id = " . $id;
    $res_checkFuzzy = $db->execsql($sql_select);
    echo json_encode($res_checkFuzzy);
} elseif ($type == 'allName') {
    $sql_name = "select companyName from wx_map";
    $res_name = $db->execsql($sql_name);
    $allName = array();
    foreach ($res_name as $key_name => $val_name) {
        $allName[$key_name] = $val_name['companyName'];
    }
    echo json_encode($allName);
}
//获取要求
// $type="list";
$review_id = $_POST['moduleId'];
//获取要显示的活动类型的ID
// $review_id=2;
/*
 * 往期回顾的列表显示
 */
if ($type == "list") {
    $list_type = $_POST['list_type'];
    //获取列表操作中的选项
    $list_type = "essence_get";
    // $list_type="manager_leaveword";
    $sql_reviewName = "select reviewTable from wx_activity_module where id =" . $review_id;
    //选择往期回顾表
    $res_reviewName = $db->getrow($sql_reviewName);
    $reviewName = $res_reviewName['reviewTable'];
    // 	$reviewName=wx_activity_interact_project;
    // 	echo $reviewName;die;
    $page = $_POST['page'];
    //获取页码
    $page = 1;
    $num = 10;
    //每页的容量
    $start = ($page - 1) * $num;
    if ($list_type == "wx") {
        //微信端显示
        $a = 1;
        // 		$review_name="往期回顾";
        // 		$sql_name="select id ,name from wx_activity_module where name !='{$review_name}'";
        // // 		echo $sql_name;
Example #21
0
header("content-type:text/json;charset=utf-8");
require_once './dbaccess.php';
$db = new DB();
$type = $_GET['type'];
if ($type == "showmenuPC") {
    /*
     * 将菜单按级别输出名字和ID,用于PC端左侧菜单展示
     */
    //获取一级模块名称
    $sql_menu = "select id,name,urlPC,menuType from wx_wechat_module where parentId=0 order by seq asc";
    $res_menu = $db->execsql($sql_menu);
    //遍历获取二级模块名称
    foreach ($res_menu as $key_First => $val_First) {
        //如果是文章列表类型的菜单,则输出moduleId
        $sql_type = "select name from wx_wechat_module_type where id='{$val_First['menuType']}'";
        $res_type = $db->getrow($sql_type);
        // 		echo $sql_type;die;
        if ($res_type['name'] == "文章列表") {
            $sql_module = "select id from wx_articlelist_module where menuId='{$val_First['id']}'";
            $res_module = $db->getrow($sql_module);
            $res_menu[$key_First]['moduleId'] = $res_module['id'];
        }
        //自身连接查询
        $sql_second = "select s.id,s.name,s.urlPC,s.parentId,s.menuType from wx_wechat_module as s left join wx_wechat_module as p\n\t\ton s.parentId=p.id where p.id='{$val_First['id']}' order by s.seq asc";
        $res_second = $db->execsql($sql_second);
        foreach ($res_second as $key_second => $val_second) {
            //如果是文章列表类型的菜单,则输出moduleId
            $sql_type = "select name from wx_wechat_module_type where id='{$val_second['menuType']}'";
            $res_type = $db->getrow($sql_type);
            if ($res_type['name'] == "文章列表") {
                // 				echo $val_second['name'];die;
    // echo $sql_list;die;
    $res_list = $db->execsql($sql_list);
    $file['list'] = $res_list;
    $file['num'] = mysql_num_rows($result);
    // 	var_dump($res_list);die;
    echo json_encode($file);
    /*
     * **********招聘信息的详细展示******************
     */
} elseif ($type == "details") {
    // 	echo "234";
    $details_id = $_POST['id'];
    //获取要查看的招聘信息ID
    // 	$details_id=24;
    $sql_details = "select * from wx_talent_recruit where id=" . $details_id;
    $res_details = $db->getrow($sql_details);
    $file['details'] = $res_details;
    $sql_other = "select other from wx_talent_recruit where id =" . $details_id;
    $res_other = $db->getrow($sql_other);
    // 	 echo $sql_other;
    $res = explode('|', $res_other['other']);
    $file['details']['other'] = $res;
    $sql_content = "select content from wx_talent_recruit where id =" . $details_id;
    $res_content = $db->getrow($sql_content);
    // 	 echo $sql_other;
    $res = explode('|', $res_content['content']);
    $file['details']['content'] = $res;
    echo json_encode($file);
    /*
     * ************添加招聘信息*********************
     */
$regex = new regexTool();
$type = $_POST['type'];
//获取要求
// $type="list";
$review_id = $_POST['moduleId'];
//获取要显示的活动类型的ID
$review_id = 2;
/*
 * 往期回顾的列表显示
 */
if ($type == "list") {
    $list_type = $_POST['list_type'];
    //获取列表操作中的选项
    $sql_reviewName = "select reviewTable from wx_activity_module where id =" . $review_id;
    //选择往期回顾表
    $res_reviewName = $db->getrow($sql_reviewName);
    $reviewName = $res_reviewName['reviewTable'];
    $page = $_POST['page'];
    //获取页码
    $page = 1;
    $num = 10;
    //每页的容量
    $start = ($page - 1) * $num;
    if ($list_type == "wx") {
        //微信端显示
        $reviewName = $_POST['reviewName'];
        $sql = "select * from " . $reviewName . " where review = 1";
        $result = mysql_query($sql);
        $sql_list = "select id,title,review,start,thumb,content from " . $reviewName . " where review =\n\t\t'{$a}' and valid = 0 order by start desc limit " . $start . "," . $num;
        //选择能够往期回顾的活动
        // 			echo $sql_list;die;