/** * * 支付密码检测 */ function checkPayPwd() { $payPwd = get_post_value('payPwd'); //echo 'payPwd=>'.$payPwd; $user_id = 1; //测试user_id $pay = new Pays(); $checkPayPwd = $pay->checkPayPwd($payPwd, $user_id); if ($checkPayPwd) { //检验支付密码正确 session_start(); if (isset($_SESSION["countPayErrorTimes"])) { $_SESSION["countPayErrorTimes"] = 0; $errorTimes = $_SESSION["countPayErrorTimes"]; } $this->assign('message', $errorTimes); $this->setReturnType('message'); } else { session_start(); if (isset($_SESSION["countPayErrorTimes"])) { $_SESSION["countPayErrorTimes"] = $_SESSION["countPayErrorTimes"] + 1; if ($_SESSION["countPayErrorTimes"] >= 5) { //错误次数大于5次 修改支付状态 $this->lockPayStatus(); } $errorTimes = $_SESSION["countPayErrorTimes"]; } else { $_SESSION["countPayErrorTimes"] = 1; $errorTimes = $_SESSION["countPayErrorTimes"]; } $this->assign('message', $errorTimes); $this->setReturnType('message'); } }
function verify_code() { //session_start(); $code = get_post_value('code'); //echo $code; $m = new Register(); $data = $m->verify_code($code); if (!isset($data['username'])) { $this->assign('username', $data); return; } //print_r($data); $username = $data['username']; $user_id = $data['user_id']; $vip = $data['vip']; $language = $data['language']; $_SESSION["username"] = $username; $_SESSION['user_id'] = $user_id; $_SESSION['vip'] = $vip; $_SESSION['language'] = $language; //print_r($_SESSION); // $m = new Login(); // $m->setSession($user_id, $username, $vip, $language); // echo $_SESSION[$username]; $this->assign('username', $username); // $m->updateCart(); }
function findPwdStepFour() { $email = $_SESSION["emailForPwd"]; $newPwd = get_post_value('newPwd'); //echo $code; $m = new Security(); $data = $m->resetPwd($email, $newPwd); if ($data) { $this->assign('data', $data); } else { $this->assign('message', "重置失败,联系客服"); } }
function get_size() { $id = get_post_value("id"); $field = array('id', 'size', 'sku'); $m = new Products(); $m->clear(); $m->setTable(' vcb_product_ksize '); //设置表名 $m->setField($field); $m->setWhere('product_kind_id', '=', $id); $data = $m->select(); $this->assign('json', $data); $this->setReturnType('json'); }
/** * 登陆检测函数 */ function login() { $this->doNotRenderHeader = 1; $user = get_post_value('user'); $pwd = get_post_value('pwd'); $remenber = get_post_value('remenber'); $verifCode = get_post_value('verifCode'); //echo "verifCode=".$verifCode; //echo $this->verifCodeCheck($verifCode); if ($verifCode != null && $this->verifCodeCheck($verifCode) == "false") { $this->assign('message', 'false'); $this->setReturnType('message'); return; } //echo "user="******"pwd=".$pwd; //echo "remenber=".$remenber; $m = new Login(); $data = $m->loginIn($user, $pwd); //echo "data:".$data; if ($data) { //登陆验证成功 session_start(); if (isset($_SESSION["countErrorTimes"])) { $_SESSION["countErrorTimes"] = 0; } if ($remenber == "checked") { setcookie("username", $data, time() + 3600 * 240, '/'); setcookie("user", $user, time() + 3600 * 240, '/'); } $this->assign('message', 0); $this->setReturnType('message'); } else { //登录验证失败,错误次数加1 session_start(); if (isset($_SESSION["countErrorTimes"])) { $_SESSION["countErrorTimes"] = $_SESSION["countErrorTimes"] + 1; $errorTimes = $_SESSION["countErrorTimes"]; } else { $_SESSION["countErrorTimes"] = 1; $errorTimes = $_SESSION["countErrorTimes"]; } $this->assign('message', $errorTimes); $this->setReturnType('message'); } }
function add_favorites() { if (!Login::verifyLogin()) { header("Location: ../login/index"); exit; } $shop_id = get_post_value('shop_id'); $shop_site = get_post_value('shop_site'); $shop_username = get_post_value('shop_username'); $shop_url = get_post_value('shop_url'); $product_id = get_post_value('product_id'); $product = get_post_value('product'); $product_url = get_post_value('product_url'); $image_url = get_post_value('image_url'); $m = new Favorites(); $data = $m->addFavorites($shop_site, $shop_id, $shop_username, $shop_url, $product_id, $product_url, $product, $image_url); $this->assign('message', $data); $this->setReturnType('message'); }
/** * 返回国家最大序号 * @access public */ function get_orders() { //查询最大序号 $category_1 = get_post_value('category_1'); $m = new Category(); $m->clear(); $m->setTable('vcb_product_category_2'); $m->setWhere('status', '!=', '60000'); $m->setWhere('category_1_id', '=', $category_1); $data = $m->getFieldValue('MAX(orders) '); // 设置新的序号 if (is_null($data)) { $data = 1; } else { $data += 1; } $this->assign('message', $data); $this->setReturnType('message'); //只返回单值 }
} else { echo '<option value="' . $key . '">' . $value . '</option>'; } } ?> </select> </td> </tr> <tr> <td> 二级层类目:</td> <td><select name="floor_2" id="floor_2" onchange="setFloor_2()"> <option value=""></option> <?php if (!empty($floor_2)) { foreach ($floor_2 as $key) { if ($key['floor_2_id'] == get_post_value('floor_2')) { echo '<option value="' . $key['floor_2_id'] . '" selected="selected">' . $key['floor_2_cn'] . '</option>'; } else { echo '<option value="' . $key['floor_2_id'] . '">' . $key['floor_2_cn'] . '</option>'; } } } ?> </select> </td> </tr> <tr> <td> 三级层类目:</td> <td><select name="floor_3" id="floor_3" > </select> </td>
*/ require_once 'includes/login_constants.php'; require_once 'includes/utilities.php'; require_once 'includes/login_code.php'; require_once 'includes/page_constants.php'; require_once 'includes/poker_db_constants.php'; require_once 'includes/poker_db_code.php'; //require_secure(); session_start(); $login_username = get_post_value(LOGIN_USERNAME_KEY); $login_password = get_post_value(LOGIN_PASSWORD_KEY); $register_username = get_post_value(REGISTER_USERNAME_KEY); $register_password = get_post_value(REGISTER_PASSWORD_KEY); $register_confirm_password = get_post_value(CONFIRM_PASSWORD_KEY); $login_pressed = get_post_value(LOGIN_BUTTON_VALUE); $register_pressed = get_post_value(REGISTER_BUTTON_VALUE); $error_message = login_or_register($login_pressed, $register_pressed, $login_username, $login_password, $register_username, $register_password, $register_confirm_password); ?> <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Login or Register</title> <link rel="stylesheet" href="includes/login.css.php"> </head> <body> <div id="login_content"> <?php
二级层类目:<select name="floor_2" id="floor_2" > <option value=""></option> <?php if (!empty($floor_2)) { foreach ($floor_2 as $key) { if ($key['floor_2_id'] == get_post_value('floor_2')) { echo '<option value="' . $key['floor_2_id'] . '" selected="selected">' . $key['floor_2_cn'] . '</option>'; } else { echo '<option value="' . $key['floor_2_id'] . '">' . $key['floor_2_cn'] . '</option>'; } } } ?> </select> <input type="textbox" name="floor_3" id="floor_3" value="<?php echo get_post_value('floor_3'); ?> " /> <input type="submit" name="button" id="button" value="提交" /> <a href="add">新增</a> <table border="1" > <tr> <td >一级类目</td> <td >二级类目(中文)</td> <td >二级类目(泰文)</td> <td >序号</td> <td >三级类目(中文)</td> <td >三级类目(泰文)</td> <td >建立时间</td> <td >开始时间</td> <td >结束时间</td>
/** * 判断大区是否存在 * @access private * @param string $region_id 大区ID * @return true|false */ private function verify_region($region_id = NULL) { $country = get_post_value('country'); $region = get_post_value('region'); $m = new Address(); $m->clear(); $m->setTable('vcb_address_region'); $m->setWhere('country_id', '=', $country); $m->setWhere('region', '=', $region); $m->setWhere('status', '!=', '50000'); if ($region_id != null) { $m->setWhere('region_id', '!=', $region_id); } $data = $m->getFieldValue('COUNT(*)'); // 直接返回单条记录 return $data > 0 ? false : true; }
function to_favorites() { $id = get_post_value('id'); $m = new Favorites(); $data = $m->cartToFavorites($id); $this->assign('message', '1'); $this->setReturnType('message'); }
function delete() { $id = get_post_value('id'); $m = new Orders(); $m->delete($id); }
<form method="POST" action="index" name="myform"> <div> 国家:<select name="country" id="country"> <option value=""></option> <?php foreach ($country as $c) { if (get_post_value('country') == $c['country_id']) { echo "<option value='" . $c['country_id'] . "' selected='selected'>" . $c['country'] . "</option>"; } else { echo "<option value='" . $c['country_id'] . "'>" . $c['country'] . "</option>"; } } ?> </select> 大区:<input type="text" name="region" id="region" value='<?php echo get_post_value('region'); ?> '> <input name="submit" type="submit" value="提交" /> <a href="add">新增</a> </div> <table border="1" width ="600"> <tr> <td >国家名称</td> <td >序号</td> <td >大区名称</td> <td >状态</td> <td >修改</td> <td >删除</td> </tr>
$posterfilename = ""; $moviename_class = ""; $moviecast_class = ""; $moviedescription_class = ""; $posterfilename_class = ""; //checks if form has been submited and if empty sets to error if (isset($_POST["submit"])) { $moviename = get_post_value("moviename"); if (!$moviename) { $moviename_class = "error"; } $moviecast = get_post_value("moviecast"); if (!$moviecast) { $moviecast_class = "error"; } $moviedescription = get_post_value("moviedescription"); if (!$moviedescription) { $moviedescription_class = "error"; } //function returns posterfile name and returns any errors list($posterfilename, $posterfilename_error, $posterfilename_msg) = get_file_upload("posterfilename"); if (!$posterfilename) { $posterfilename_class = "error"; } //function gets row id of movie in database if ($moviename && $moviecast && $moviedescription && $posterfilename) { $rowid = add_movie($moviename, $moviedescription, $moviecast, $posterfilename); } else { $error_msg = "Please enter required fields."; } }
if ($key['floor_2_id'] == get_post_value('floor_2')) { echo '<option value="' . $key['floor_2_id'] . '" selected="selected">' . $key['floor_2_cn'] . '</option>'; } else { echo '<option value="' . $key['floor_2_id'] . '">' . $key['floor_2_cn'] . '</option>'; } } } ?> </select> 三级层类目:<select name="floor_3" id="floor_3" > </select> </div> <div> 产品名称:<input type="text" name="key" id="key" value="<?php echo get_post_value('key'); ?> "/> <input type="submit" name="submit" value="确定" /> <a href="add1">新增</a> </div> <table border="1" > <tr> <td >序号</td> <td >名称</td> <td >状态</td> <td >修改</td> <td >删除</td> <td >商品种类</td> </tr> <?php
function get_floor_3() { $floor_2 = get_post_value('floor_2'); $m = new Floor(); $data = $m->getFloor_3($floor_2); $this->assign('json', $data); $this->setReturnType('json'); }
function editaddress() { $user_id = Account::getUserId(); $this->doNotRenderHeader = 1; $m = new Account(); $country = get_post_value('country'); $region = get_post_value('region'); $province = get_post_value('province'); $city = get_post_value('city'); $district = get_post_value('district'); $address = get_post_value('address'); $postcode = get_post_value('postcode'); $mobile = get_post_value('mobile'); $tel = get_post_value('tel'); $data = $m->save($country, $region, $province, $city, $district, $address, $postcode, $mobile, $tel, $user_id); //var_dump($data); if (!empty($data)) { header("location:addr_success"); } $this->assign('data', $data); }
if ($_SERVER['REQUEST_METHOD'] == "POST") { $acctName = get_post_value('Account'); $firstName = get_post_value('FirstName'); $lastName = get_post_value('LastName'); $address = get_post_value('Address'); $city = get_post_value('City'); $state = get_post_value('State'); $country = get_post_value('Country'); $postalCode = get_post_value('postalCode'); $paymentTerm = 'Due Upon Receipt'; $invoiceOwner = get_post_value('invoiceOwner'); $term = get_post_value('Term'); $initTerm = get_post_value('Init'); $renewTerm = get_post_value('RenewTerm'); $autoRenew = get_post_value('AutoRenew'); $termStart = get_post_value('TermStart'); $contractEffdt = $termStart; $activationDt = $termStart; $acceptanceDt = $termStart; // set parent ID to the node in the hierarchy clicked $parentId = $_SESSION['accountId']; // echo 'payment in post: ' . $paymentTerm; if ($invoiceOwner == 'pbill') { $InvoiceOwnerId = $_SESSION['accountId']; } else { $InvoiceOwnerId = 'null'; } //echo 'parent id: ' . $_SESSION['parentId']; $subInfo = array('accountName' => $acctName, 'term' => $term, 'firstName' => $firstName, 'lastName' => $lastName, 'accountName' => $acctName, 'parentId' => $parentId, 'address' => $address, 'city' => $city, 'state' => $state, 'country' => $country, 'postalCode' => $postalCode, 'paymentTerm' => $paymentTerm, 'invoiceOwner' => $InvoiceOwnerId, 'initTerm' => $initTerm, 'renewTerm' => $renewTerm, 'autoRenew' => $autoRenew, 'termStart' => $termStart, 'contractEffdt' => $contractEffdt, 'activationDt' => $activationDt, 'acceptanceDt' => $acceptanceDt); //TODO add code to check up against app table $subRes = SubscriptionManager::partnerSubscribe($subInfo, $_SESSION['cart']);
foreach ($province as $p) { if (get_post_value('province') == $p['province_id']) { echo "<option value='" . $p['province_id'] . "' selected='selected'>" . $p['province'] . "</option>"; } else { echo "<option value='" . $p['province_id'] . "'>" . $p['province'] . "</option>"; } } ?> </select> <span id="msg_province" style="display: none">请选择省</span> </td> </tr> <tr> <td>序号</td> <td><input type="text" name="orders" id="orders" class="input_int" value='<?php echo get_post_value('orders'); ?> '> </td> </tr> <tr> <td>市</td> <td><input type="text" name="city" id="city" maxlength="50"> <span id="msg_city" style="display: none">请输入市名称</span></td> </tr> <tr> <td>启用</td> <td><input name="status" type="checkbox" id="status" value="10000" checked="checked"/></td> </tr> </table> <input name="submit" type="submit" value="提交" />
function add_cart() { $shop_site = get_post_value('shop_site'); $image_url = get_post_value('image_url'); $product = get_post_value('product'); $product_url = get_post_value('product_url'); $product_id = get_post_value('product_id'); $shop_url = get_post_value('shop_url'); $shop_username = get_post_value('shop_username'); $qty = get_post_value('qty'); $sku = get_post_value('sku'); $sku_name = get_post_value('sku_name'); $price = get_post_value('price_cn'); $shop_id = get_post_value('shop_id'); if (!Login::verifyLogin()) { // var_dump($cart_array); if (empty($_COOKIE['shop_cart_info'])) { // $cart_info[0]['shop_site'] = $shop_site; $cart_info[0]['image_url'] = $image_url; // $cart_info[0]['product'] = $product; // $cart_info[0]['product_url'] = $product_url; $cart_info[0]['product_id'] = $product_id; // $cart_info[0]['shop_url'] = $shop_url; //$cart_info[0]['shop_username'] = $shop_username; $cart_info[0]['qty'] = $qty; $cart_info[0]['sku'] = $sku; $cart_info[0]['sku_name'] = $sku_name; // $cart_info[0]['price'] = $price; //$cart_info[0]['shop_id'] = $shop_id; setcookie("shop_cart_info", serialize($cart_info), time() + 3600 * 24, '/'); $this->assign('message', 2); $this->setReturnType('message'); } else { $cart_array = unserialize(stripslashes($_COOKIE['shop_cart_info'])); $ar_keys = array_keys($cart_array); rsort($ar_keys); $max_array_keyid = $ar_keys[0] + 1; // $cur_cart_array[$max_array_keyid]['shop_site'] = $shop_site; $cart_array[$max_array_keyid]['image_url'] = $image_url; // $cur_cart_array[$max_array_keyid]['product'] = $product; // $cur_cart_array[$max_array_keyid]['product_url'] = $product_url; $cart_array[$max_array_keyid]['product_id'] = $product_id; // $cur_cart_array[$max_array_keyid]['shop_url'] = $shop_url; // $cur_cart_array[$max_array_keyid]['shop_username'] = $shop_username; $cart_array[$max_array_keyid]['qty'] = $qty; $cart_array[$max_array_keyid]['sku'] = $sku; $cart_array[$max_array_keyid]['sku_name'] = $sku_name; // $cur_cart_array[$max_array_keyid]['price'] = $price; // $cur_cart_array[$max_array_keyid]['shop_id'] = $shop_id; setcookie("shop_cart_info", serialize($cart_array), time() + 3600 * 24, '/'); $this->assign('message', 2); $this->setReturnType('message'); } } else { if (isset($_SESSION['user_id'])) { $user_id = $_SESSION['user_id']; } else { $this->assign('message', 0); $this->setReturnType('message'); exit; } // 保存数据 $m = new Cart(); $field = array('created' => date('Y-m-d H:i:s', time()), 'user_id' => $user_id, 'shop_username' => $shop_username, 'shop_url' => $shop_url, 'product_id' => $product_id, 'product_url' => $product_url, 'shop_url' => $shop_url, 'shop_username' => $shop_username, 'qty' => $qty, 'sku' => $sku, 'sku_name' => $sku_name, 'status' => '10000', 'product' => $product, 'image_url' => $image_url, 'price' => $price, 'shop_id' => $shop_id, 'shop_site' => $shop_site); $m->clear(); $m->setField($field); $m->setTable('vcb_cart'); $data = $m->insert(); if (!empty($data)) { $data = 1; } else { $data = 0; } $this->assign('message', 1); $this->setReturnType('message'); } }
/** * 判断是否存在 * @access private * @param string * @return true|false */ private function verifyCategory3($category_3_id = NULL) { $category_3_cn = get_post_value('category_3_cn'); $category_3_th = get_post_value('category_3_th'); $m = new Category(); $m->clear(); $m->setTable('vcb_product_category_3'); $m->setWhere('status', '!=', '60000'); $m->setWhere('category_3_cn', '=', $category_3_cn, 'AND', '('); $m->setWhere('category_3_th', '=', $category_3_th, 'OR', ')'); if ($category_2_id != null) { $m->setWhere('category_3_id', '!=', $category_3_id); } $data = $m->getFieldValue('COUNT(*)'); //直接返回单条记录 return $data > 0 ? false : true; }
</select> 市: <select name="city" id="city" > <option value=""></option> <?php foreach ($city as $c) { if (get_post_value('city') == $c['city_id']) { echo "<option value='" . $c['city_id'] . "' selected='selected'>" . $c['city'] . "</option>"; } else { echo "<option value='" . $c['city_id'] . "'>" . $c['city'] . "</option>"; } } ?> </select> 区县:<input type="text" name="district" id="district" value='<?php echo get_post_value('district'); ?> '> <input name="submit" type="submit" value="提交" /> <a href="add">新增</a> </div> <table border="1"> <tr> <td >国家名称</td> <td >大区名称</td> <td >省</td> <td >市</td> <td >序号</td> <td >县区</td> <td >状态</td>
command.js" type="text/javascript"></script> <script src="<?php echo JS_MODULE_PATH; ?> Floor2.js" type="text/javascript"></script> <form method="POST" action="add_save" name="myform" onsubmit="return verifyData()"> <table width="500" border="1"> <tr> <td width="147">一级类目:</td> <td width="337"> <select name="floor_1" id="floor_1" onchange="setOrders()"> <option value=""></option> <?php foreach ($floor_1 as $key => $value) { if ($key == get_post_value('floor_1')) { echo '<option value="' . $key . '" selected="selected">' . $value . '</option>'; } else { echo '<option value="' . $key . '">' . $value . '</option>'; } } ?> </select><span id="msg_floor_1" style="display: none">请输入一级类目</span> </td> </tr> <tr> <td width="147">序号</td> <td width="337"><input type="text" name="orders" id="orders" class="input_int"></td> </tr> <tr> <td>二级类目(中文)</td>
/** * 判断是否可修改 * @access private * @return true|false */ private function verify($status = '10000') { $id = get_post_value('id'); //echo $id; $m = new Hotproduct(); $m->clear(); $m->setTable('vcb_index_hot_product'); $m->setWhere('product_id', '=', $id); $m->setWhere('status', '=', $status); $data = $m->getFieldValue('COUNT(*)'); return $data > 0 ? false : true; }
public function count_re() { $id = get_post_value('id'); $field = array('id', 'survey_id'); $m = new Survey(); $m->clear(); $m->setField($field); $m->setTable('vcb_survey_issue'); $m->setWhere('survey_id', '=', $id); $data = $m->select(); var_dump($data[0]['id']); $count = count($data); $star = $data[0]['id']; $end = $data[0]['id'] + $count - 1; //echo $star."<br>"; //echo $end."<br>"; //var_dump(get_post_value('27')); for ($i = $star; $i <= $end; $i++) { if (get_post_value($i) != null) { $name = get_post_value($i); //echo $name."<br/>"; if (is_array($name)) { $co = count($name); for ($j = 0; $j < $co; $j++) { $this->count_item($name[$j]); //echo $name[$j]; } } else { $this->count_item($name); //echo $name; } } /*$field1 = array ( 'id', ); $m1 = new Survey(); $m1->clear(); $m1->setField ( $field1 ); $m1->setTable ( 'vcb_survey_item' ); $m1->setWhere('id','=',$name); $data_l = $m->select(); //var_dump($data_l);*/ } header("Location:add_success"); }
/** * 判断国定是否存在 * @access private * @param string $country_id * @return true|false */ private function verify($country_id = NULL) { $country = get_post_value('country'); $m = new Address(); $m->clear(); $m->setTable('vcb_address_country'); //设置表名 if ($country_id != null) { $m->setWhere('country_id', '!=', $country_id); //设置Where条件\ } $m->setWhere('status', '!=', '50000'); //设置Where条件 (可多个) $m->setWhere('country', '=', trim($country)); //国家 $data = $m->getFieldValue('COUNT(*)'); //直接返回单条记录 return $data > 0 ? false : true; }
/** * 判断 * @access private * @param string $Manager_id * @return true|false */ private function verify($id = NULL) { $username = get_post_value('username'); $m = new Manager(); $m->clear(); $m->setTable('vcb_manage_user'); if ($id != null) { $m->setWhere('id', '!=', $id); } $m->setWhere('status', '!=', '50000'); $m->setWhere('username', '=', trim($username)); $data = $m->getFieldValue('COUNT(*)'); return $data > 0 ? false : true; }
command.js" type="text/javascript"></script> <script src="<?php echo JS_MODULE_PATH; ?> Category2.js" type="text/javascript"></script> <form method="POST" action="add_save" name="myform" onsubmit="return verifyData()"> <table width="500" border="1"> <tr> <td width="147">一级类目:</td> <td width="337"> <select name="category_1" id="category_1" onchange="setOrders()"> <option value=""></option> <?php foreach ($category_1 as $key => $value) { if ($key == get_post_value('category_1')) { echo '<option value="' . $key . '" selected="selected">' . $value . '</option>'; } else { echo '<option value="' . $key . '">' . $value . '</option>'; } } ?> </select><span id="msg_category_1" style="display: none">请输入一级类目</span> </td> </tr> <tr> <td width="147">序号</td> <td width="337"><input type="text" name="orders" id="orders" class="input_int"></td> </tr> <tr> <td>二级类目(中文)</td>
<?php /* Register page Written by: Jay R. Kaplan BCS 350 - Semester Project 12/8/2015 */ include "session.php"; include "functions.php"; include "header.php"; include "nav.php"; $error_msg = $success_msg = ""; if (isset($_POST["submit"])) { $username = get_post_value("username"); $email = get_post_value("email"); $location = get_post_value("location"); $password = get_post_value("password"); if ($username && $email && $location && $password) { $success = add_user($username, $email, $location, $password); if ($success) { $success_msg = "You have been successfully added."; header("refresh:3; url=login.php"); } else { $error_msg = "Sorry, some error happened"; } } else { $error_msg = "Please enter required fields."; } } //post submit ?> <div class="container">