예제 #1
0
}
// ini_set('default_charset', 'utf-8');
//--- 讀入基本設定
include "function/function.php";
require 'libs/Smarty.class.php';
include "base_config.php";
// include ADMINROOT."/getfile.php";
$msql = new phpMysql_h();
$tool = new tools_h();
$sql = "SELECT id FROM `wwd_application_speedmatch` WHERE applyid='" . $aid . "' AND cateid='" . $cateid . "' ";
// echo "<br>sql=".$sql; exit;
$msql->init();
$msql->query($sql);
if (list($id) = mysql_fetch_row($msql->listmysql)) {
    $tool->showmessage("此需求單已送過快速服務申請,請勿重複操作或聯繫客服人員確認!");
    $tool->goURL2("parent", "member_client_myneeds01.php");
    exit;
}
$hash = uniqid(mt_srand((double) microtime() * 1000000));
$sql = "INSERT INTO `wwd_application_speedmatch` (`hash`,`cateid` ,`applyid` ,`serial` ,`firstname` ,`sex` ,`mobile` ,`contactable` ,`office_city` ,\n\t\t`office_area` ,`isSeen` ,`SheetBuyPlace` ,`buySelf` ,`creator` ,`createdtime`) VALUES ('{$hash}', '{$cateid}',  '{$aid}',  '{$serial}',  '{$firstname}',  \n\t\t'{$sex}',  '{$mobile}',  '{$contactable}',  '{$office_city}',  '{$office_area}',  '{$isSeen}',  '{$SheetBuyPlace}',  '{$buySelf}',  '" . $_COOKIE[user_id] . "',  \n\t\tNOW());";
// error_log($sql."\r\n\r\n",3,"log_fast_do_sql.log");
$msql->init();
$msql->query($sql);
$sql2 = "SELECT id FROM `wwd_application_speedmatch` WHERE hash='" . $hash . "' ";
$msql->init();
$msql->query($sql2);
if (list($id2) = mysql_fetch_row($msql->listmysql)) {
    if ($_COOKIE[user_email] != "*****@*****.**") {
        $msql->init();
        $sql3 = "UPDATE " . $dbTable['application'][$cateid] . " SET status='2', isSpeedMatch='1', speedmatchTime=NOW() WHERE id={$aid} ";
        $msql->query($sql3);