예제 #1
0
function registerEmail()
{
    $email = addslashes($_POST['email']);
    $regex = new regexTool();
    $sql = "select * from tuhao_user where email = '{$email}'";
    if (!$regex->isEmail($email)) {
        $message = array('success' => false, 'mes' => '邮箱格式错误');
    } elseif (fetchOne($sql)) {
        $message = array('success' => false, 'mes' => '邮箱被占用');
    } else {
        $message = array('success' => true, 'mes' => '');
    }
    return json_encode($message);
}
<?php

/*
 * 招聘信息上传
 */
header("content-type:text/json;charset=utf-8");
$path = dirname(dirname(dirname(__FILE__)));
// echo $path;
require_once '../../../common/php/dbaccess.php';
require_once '../../../common/php/regexTool.class.php';
$db = new DB();
$regex = new regexTool();
$type = $_POST['type'];
//  $type="details";
$file = array();
/*
 * ***********招聘信息标题列表显示*********************
 */
if ($type == "list") {
    $page = $_POST['page'];
    //获取页码
    // 	$page=1;
    $num = 10;
    //每页的容量
    $start = ($page - 1) * $num;
    $sql = "SELECT * FROM wx_talent_recruit";
    $result = mysql_query($sql);
    // $sql_list="select * from wx_talent_recruit order by date desc limit ".$start.",".$num;
    $sql_list = "select title,date,id from wx_talent_recruit order by date desc limit " . $start . "," . $num;
    // echo $sql_list;die;
    $res_list = $db->execsql($sql_list);
예제 #3
0
<?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确定执行的操作
 * $type='list': 显示文章信息列表
 * $type='details': 显示某篇文章信息的具体内容
 * $type='leaveword': 用户评论
 * $type='zan': 用户点赞 
 */
header("content-type:text/json;charset=utf-8");
require_once '../../../common/php/dbaccess.php';
require_once '../../../common/php/uploadFiles.php';
require_once '../../../common/php/regexTool.class.php';
require_once '../../../common/php/leaveword.class.php';
require_once '../../../common/php/zan.class.php';
$db = new DB();
$lwd = new LWD('wx_leaveword');
$zan = new ZAN('wx_zan');
$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);
예제 #5
0
<?php

/*
 * 招聘信息上传
 */
header("content-type:text/json;charset=utf-8");
$path = dirname(dirname(dirname(__FILE__)));
// echo $path;
require_once '../../../common/php/dbaccess.php';
require_once '../../../common/php/regexTool.class.php';
require_once '../../../common/php/uploadFiles.php';
$db = new DB();
$regex = new regexTool();
$type = $_POST['type'];
$file = array();
define(IP, "www.chinwhiz.cn");
session_start();
$subtype = $_GET['subtype'];
if ($subtype == 'thumb') {
    /**
     * ***缩略图上传功能***
     */
    unset($_SESSION['thumb']);
    $dest = uploadmulti('thumbpic', 2);
    $_SESSION['thumb'] = $dest[0];
    echo $dest[0];
    die;
}
if ($type == "list") {
    /*
     * ***********招聘信息标题列表显示*********************
예제 #6
0
/*
 * 子公司信息导航模块
 * 根据$type的值确定执行的操作
 * $type='add':后台管理员新增子公司信息
 * $type='del':后台管理员删除子公司信息
 * $type='updateOK':后台管理员更新子公司信息
 * $type='checkPage':分页查询公司信息
 * $type='checkFuzzy':模糊查询公司名称
 * $type='checkone':用户输入通过模糊查询输入完整的子公司名称后,显示该公司具体的信息
 */
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();
$type = $_GET['type'];
// $type='add';
// $type='del';
// $type='update';
// $type='checkPage';
// $type='checkFuzzy';
// $type='checkOne';
if ($type == 'add') {
    /**********************后台管理员新增子公司信息**************************/
    $subcom = array();
    $subcom['companyName'] = $_GET['companyName'];
    $subcom['address'] = $_GET['address'];
    $subcom['phone'] = $_GET['phone'];
    $subcom['email'] = $_GET['email'];
    $subcom['coordinate'] = $_GET['coordinate'];
 * $type= 'top':将某篇文章置顶
 */
header("content-type:text/json;charset=utf-8");
require_once '../../../common/php/dbaccess.php';
require_once '../../../common/php/uploadFiles.php';
require_once '../../../common/php/regexTool.class.php';
require_once '../../../common/php/leaveword_pc.class.php';
require_once '../../../common/php/zan.class.php';
require_once '../../../common/php/strlen.php';
$type = $_REQUEST['type'];
//list:列表显示;details:具体内容显示
session_start();
$db = new DB();
$lwd = new LWD('wx_leaveword');
$zan = new ZAN('wx_zan');
$regex = new regexTool();
define(IP, "www.chinwhiz.cn");
if ($type == 'list') {
    /**
     * ************显示文章信息列表***************
     */
    $page = $_REQUEST['page'];
    $moduleId = $_REQUEST['moduleId'];
    $list = array();
    $num = 10;
    //每页显示10条
    $start = ($page - 1) * $num;
    //本页显示的起始位置
    // 从wx_info中查询出文章信息的基本文章信息
    $sql_info_num = "select id from wx_info where moduleId='{$moduleId}' ";
    $res_info_num = $db->execsql($sql_info_num);
// print_r($_POST);
//print_r($_POST);print_r($_GET);die;
/*
 * 实现信息上传
 */
header('content-type:text/json;charset=utf-8');
require_once '../../../common/php/dbaccess.php';
require_once '../../../common/php/uploadFiles.php';
require_once '../../../common/php/strlen.php';
require_once '../../../common/php/regexTool.class.php';
define(IP, "www.chinwhiz.cn");
define(root, "C:\\AppServ\\www\\wechat-subscribe-master");
define(root2, "C:\\AppServ\\www");
$db = new DB();
// 实例化
$regex = new regexTool();
// session_start();
$subtype = $_GET['subtype'];
//遍历文章数组
if ($subtype == 'thumb') {
    /**
     * ***缩略图上传功能***
     */
    $dest = uploadmulti('thumbpic', 2);
    echo $dest[0];
} elseif ($subtype == 'preview') {
    /*
     *微信预览接口
     */
    /************************先将消息存到数据库********************************/
    $articles = $_POST['data'];
예제 #9
0
 * $type='details': 查看某项活动的某个用户参与的具体信息,以及其他用户对其的评论和点赞
 * $type='leaveword': 用户评论
 * $type='zan': 用户点赞 
 */
header("content-type:text/html;charset=utf-8");
require_once '../../../common/php/dbaccess.php';
require_once '../../../common/php/uploadFiles.php';
require_once '../../../common/php/regexTool.class.php';
require_once '../../../common/php/leaveword.class.php';
require_once '../../../common/php/zan.class.php';
session_start();
$openid = $_SESSION['openid'];
$db = new DB();
$lwd = new LWD('wx_activity_leaveword');
$zan = new ZAN('wx_activity_zan');
$regex = new regexTool();
$type = $_GET['type'];
if ($type == "ing") {
    /***************************显示当前正在进行的活动*************************/
    //将活动中的过期的活动关闭
    //wx_activity_interact_project表
    $sql_valid_activity = "select valid,end,id from wx_activity_interact_project";
    $res_valid_activity = $db->execsql($sql_valid_activity);
    $nowTime = time();
    foreach ($res_valid_activity as $val_valid_activity) {
        if ($val_valid_activity['valid'] == 1) {
            if (strtotime($val_valid_activity['end']) <= $nowTime) {
                $sql_update_activity = "update wx_activity_interact_project set valid=0 where id='{$val_valid_activity['id']}'";
                $res_update_activity = $db->execsql($sql_update_activity);
            }
        }
예제 #10
0
파일: regCheck.php 프로젝트: xw716825/xw
<?php

require_once 'regexTool.class.php';
$regex = new regexTool();
if (!$regex->noEmpty($_POST['username'])) {
    exit('用户名是必须填写的!');
}
if (!$regex->isEmail($_POST['email'])) {
    exit('email格式错误!');
}
if (!$regex->isMobile($_POST['mobile'])) {
    exit('手机号格式错误!');
}
//数据库写入
/*
 * @name : show
 * @description : output debug
 * @param $var : input data
 * @return void
 */
function show($var = null, $isdump = false)
{
    $func = $isdump ? 'var_dump' : 'print_r';
    if (empty($var)) {
        echo 'null';
    } elseif (is_array($var) || is_object($var)) {
        //array,object
        echo '<pre>';
        $func($var);
        echo '</pre>';
    } else {
예제 #11
0
<?php

header("content-type:text/html;charset=utf-8");
require_once '../../../common/php/dbaccess.php';
require_once '../../../common/php/uploadFiles.php';
require_once '../../../common/php/regexTool.class.php';
require_once '../../../common/php/leaveword_pc.class.php';
require_once '../../../common/php/zan.class.php';
$db = new DB();
$lwd = new LWD('wx_activity_leaveword');
$zan = new ZAN('wx_activity_zan');
$regex = new regexTool();
$type = $_REQUEST['type'];
if ($type == 'list') {
    /***************将过期的活动关闭,并分页显示图片互动活动列表*******************/
    //将活动中的过期的活动关闭
    //wx_activity_interact_project表
    $sql_valid_activity = "select valid,end,id from wx_activity_interact_project";
    $res_valid_activity = $db->execsql($sql_valid_activity);
    // 	var_dump($res_valid_activity);
    $nowTime = time();
    // 	echo $nowTime;die;
    foreach ($res_valid_activity as $val_valid_activity) {
        if ($val_valid_activity['valid'] == 1) {
            if (strtotime($val_valid_activity['end']) <= $nowTime) {
                $sql_update_activity = "update wx_activity_interact_project set valid=0 where id='{$val_valid_activity['id']}'";
                $res_update_activity = $db->execsql($sql_update_activity);
            }
        }
    }
    /* //wx_vote_project表