版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、.網(wǎng)站代碼開(kāi)發(fā)文檔一.建立適當(dāng)?shù)臄?shù)據(jù)庫(kù)表,屬性和制約因素1.全部表:詳細(xì)表功能請(qǐng)參考數(shù)據(jù)表說(shuō)明文檔ecs_account_log ecs_ad ecs_admin_action ecs_admin_log ecs_admin_message ecs_admin_user ecs_adsense ecs_ad_position ecs_affiliate_log ecs_agency ecs_area_region ecs_article ecs_article_cat ecs_attribute ecs_auction_log ecs_auto_manage ecs_bonus_type ec
2、s_booking_goods ecs_brand ecs_card ecs_cart ecs_category ecs_cat_recommend ecs_collect_goods ecs_comment ecs_crons ecs_email_list ecs_email_sendlist ecs_error_log ecs_favourable_activity ecs_feedback ecs_friend_link ecs_goods ecs_goods_activity ecs_goods_article ecs_goods_attr ecs_goods_cat ecs_good
3、s_gallery ecs_goods_type ecs_group_goods ecs_keywords ecs_link_goods ecs_mail_templates ecs_member_price ecs_nav ecs_order_action ecs_order_goods ecs_order_info ecs_pack ecs_payment ecs_pay_log ecs_plugins ecs_region ecs_searchengine ecs_sessions ecs_sessions_data ecs_shipping ecs_shipping_area ecs_
4、shop_config ecs_snatch_log ecs_stats ecs_tag ecs_template ecs_topic ecs_users ecs_user_account ecs_user_address ecs_user_bonus ecs_user_feed ecs_user_rank ecs_virtual_card ecs_vote ecs_vote_log ecs_vote_option ecs_wholesale表間關(guān)系部分表間關(guān)系2. 客戶(hù)注冊(cè)和登錄核心代碼:/ 不需要登錄的操作或自己驗(yàn)證是否登錄(如ajax處理)的act$not_login_arr =arra
5、y(login,act_login,register,act_register,act_edit_password,get_password,send_pwd_email,password, signin, add_tag, collect, return_to_cart, logout, email_list, validate_email, send_hash_mail, order_query, is_registered, check_email);/* 顯示頁(yè)面的action列表 */$ui_arr = array(register, login, profile, order_li
6、st, order_detail, address_list, collection_list,message_list, tag_list, get_password, reset_password, booking_list, add_booking, account_raply,account_deposit, account_log, account_detail, act_account, pay, default, bonus, group_buy, group_buy_detail, affiliate, comment_list,validate_email,track_pac
7、kages, transform_points);/* 未登錄處理 */if (empty($_SESSIONuser_id) if (!in_array($action, $not_login_arr) if (in_array($action, $ui_arr) /* 如果需要登錄,并是顯示頁(yè)面的操作,記錄當(dāng)前操作,用于登錄后跳轉(zhuǎn)到相應(yīng)操作 if ($action = login) if (isset($_REQUESTback_act) $back_act = trim($_REQUESTback_act); else */ if (!empty($_SERVERQUERY_STRING
8、) $back_act = user.php? . $_SERVERQUERY_STRING; $action = login; else /未登錄提交數(shù)據(jù)。非正常途徑提交數(shù)據(jù)! die($_LANGrequire_login); /* 如果是顯示頁(yè)面,對(duì)頁(yè)面進(jìn)行相應(yīng)賦值 */if (in_array($action, $ui_arr) assign_template(); $position = assign_ur_here(0, $_LANGuser_center); $smarty-assign(page_title, $positiontitle); / 頁(yè)面標(biāo)題$smarty-ass
9、ign(ur_here, $positionur_here);表單部分:/用戶(hù)中心歡迎頁(yè)if ($action = default) include_once(ROOT_PATH .includes/lib_clips.php); if ($rank = get_rank_info() $smarty-assign(rank_name, sprintf($_LANGyour_level, $rankrank_name); if (!empty($ranknext_rank_name) $smarty-assign(next_rank_name, sprintf($_LANGnext_level
10、, $ranknext_rank ,$ranknext_rank_name); $smarty-assign(info, get_user_default($user_id); $smarty-assign(user_notice, $_CFGuser_notice); $smarty-assign(prompt, get_user_prompt($user_id); $smarty-display(user_clips.dwt);/* 顯示會(huì)員注冊(cè)界面 */if ($action = register) /* 驗(yàn)證碼相關(guān)設(shè)置 */ if (intval($_CFGcaptcha) & CAP
11、TCHA_REGISTER) & gd_version() 0) $smarty-assign(enabled_captcha, 1); $smarty-assign(rand, mt_rand(); /* 增加是否關(guān)閉注冊(cè) */ $smarty-assign(shop_reg_closed, $_CFGshop_reg_closed); $smarty-display(user_passport.dwt);/* 注冊(cè)會(huì)員的處理 */elseif ($action = act_register) /* 增加是否關(guān)閉注冊(cè) */ if ($_CFGshop_reg_closed) $smarty-
12、assign(action, register); $smarty-assign(shop_reg_closed, $_CFGshop_reg_closed); $smarty-display(user_passport.dwt); else include_once(ROOT_PATH . includes/lib_passport.php); $username = isset($_POSTusername) ? trim($_POSTusername) : ; $password = isset($_POSTpassword) ? trim($_POSTpassword) : ; $em
13、ail = isset($_POSTemail) ? trim($_POSTemail) : ; $other = isset($_POSTother) ? $_POSTother : array(); if(empty($_POSTagreement) show_message($_LANGpassport_jsagreement); if (strlen($username) 3) show_message($_LANGpassport_jsusername_shorter); if (strlen($password) 0) if (empty($_POSTcaptcha) show_m
14、essage($_LANGinvalid_captcha, $_LANGsign_up, user.php?act=register, error); /* 檢查驗(yàn)證碼 */ include_once(includes/cls_captcha.php); $validator = new captcha(); if (!$validator-check_word($_POSTcaptcha) show_message($_LANGinvalid_captcha, $_LANGsign_up, user.php?act=register, error); if (register($userna
15、me, $password, $email, $other) != false) show_message(sprintf($_LANGregister_success, $username . $user-ucdata), $_LANGprofile_lnk, user.php, info, true); else $err-show($_LANGsign_up, user.php?act=register); /* 驗(yàn)證用戶(hù)注冊(cè)郵件 */elseif ($action = validate_email) $hash = empty($_GEThash) ? : trim($_GEThash
16、); if ($hash) include_once(ROOT_PATH . includes/lib_passport.php); $id = register_hash(decode, $hash); if ($id 0) $sql = UPDATE . $ecs-table(users) . SET is_validated = 1 WHERE user_id=$id; $db-query($sql); $sql = SELECT user_name, email FROM . $ecs-table(users) . WHERE user_id = $id; $row = $db-get
17、Row($sql); show_message(sprintf($_LANGvalidate_ok, $rowuser_name, $rowemail),$_LANGprofile_lnk, user.php); show_message($_LANGvalidate_fail);/* 驗(yàn)證用戶(hù)注冊(cè)用戶(hù)名是否可以注冊(cè) */elseif ($action = is_registered) include_once(ROOT_PATH . includes/lib_passport.php); $username = trim($_GETusername); $username = json_st
18、r_iconv($username); if ($user-check_user($username) | admin_registered($username) echo false; else echo true; /* 驗(yàn)證用戶(hù)郵箱地址是否被注冊(cè) */elseif($action = check_email) $email = trim($_GETemail); if ($user-check_email($email) echo false; else echo ok; /* 用戶(hù)登錄界面 */elseif ($action = login) if (!isset($back_act)
19、 $back_act = ; $captcha = intval($_CFGcaptcha); if ($captcha & CAPTCHA_LOGIN) & (!($captcha & CAPTCHA_LOGIN_FAIL) | ($captcha & CAPTCHA_LOGIN_FAIL) & $_SESSIONlogin_fail 2) & gd_version() 0) $GLOBALSsmarty-assign(enabled_captcha, 1); $GLOBALSsmarty-assign(rand, mt_rand(); $smarty-assign(back_act, $b
20、ack_act); $smarty-display(user_passport.dwt);/* 處理會(huì)員的登錄 */elseif ($action = act_login) $username = isset($_POSTusername) ? trim($_POSTusername) : ; $password = isset($_POSTpassword) ? trim($_POSTpassword) : ; $back_act = isset($_POSTback_act) ? trim($_POSTback_act) : ; if (empty($back_act) $url = us
21、er.php; else $url = $back_act; $captcha = intval($_CFGcaptcha); if ($captcha & CAPTCHA_LOGIN) & (!($captcha & CAPTCHA_LOGIN_FAIL) | ($captcha & CAPTCHA_LOGIN_FAIL) & $_SESSIONlogin_fail 2) & gd_version() 0) if (empty($_POSTcaptcha) show_message($_LANGinvalid_captcha, $_LANGrelogin_lnk, $url, error);
22、 /* 檢查驗(yàn)證碼 */ include_once(includes/cls_captcha.php); $validator = new captcha(); $validator-session_word = captcha_login; if (!$validator-check_word($_POSTcaptcha) show_message($_LANGinvalid_captcha, $_LANGrelogin_lnk, $url, error); if ($user-login($username, $password) update_user_info(); recalcula
23、te_price(); if ($url = user.php) /默認(rèn)登錄提示 $ucdata = isset($user-ucdata)?$user-ucdata:; show_message($_LANGlogin_success . $ucdata , $_LANGprofile_lnk, user.php); else /有鏈接直接跳轉(zhuǎn) ecs_header(Location: .$url. n); exit; else $_SESSIONlogin_fail + ; show_message($_LANGlogin_failure, $_LANGrelogin_lnk, $url,
24、 error); 3. 處理客戶(hù)注冊(cè)和登錄信息/* 退出會(huì)員中心 */elseif ($action = logout) $user-logout(); show_message($_LANGlogout . $user-ucdata, $_LANGback_home_lnk, index.php, info, true);/* 個(gè)人資料頁(yè)面 */elseif ($action = profile) include_once(ROOT_PATH . includes/lib_transaction.php); $smarty-assign(profile, get_profile($user_
25、id); $smarty-display(user_transaction.dwt);/* 修改個(gè)人資料的處理 */elseif ($action = act_edit_profile) include_once(ROOT_PATH . includes/lib_transaction.php); $birthday = trim($_POSTbirthdayYear) .-. trim($_POSTbirthdayMonth) .-. trim($_POSTbirthdayDay); $email = trim($_POSTemail); $msn = trim($_POSTothermsn
26、); $qq = trim($_POSTotherqq); $mobile_phone = trim($_POSTothermobile_phone); $office_phone = $_POSTotheroffice_phone; $home_phone = $_POSTotherhome_phone; if (!empty($office_phone) & !preg_match( /d|_|-|s+$/, $office_phone ) ) show_message($_LANGpassport_jsoffice_phone_invalid); if (!empty($home_pho
27、ne) & !preg_match( /d|_|-|s+$/, $home_phone) ) show_message($_LANGpassport_jshome_phone_invalid); if (!is_email($email) show_message($_LANGmsg_email_format); if (!empty($msn) & !is_email($msn) show_message($_LANGpassport_jsmsn_invalid); if (!empty($qq) & !preg_match(/d+$/, $qq) show_message($_LANGpa
28、ssport_jsqq_invalid); if (!empty($mobile_phone) & !preg_match(/d+$/, $mobile_phone) show_message($_LANGpassport_jsmobile_phone_invalid); $profile = array( user_id = $user_id, email = isset($_POSTemail) ? trim($_POSTemail) : , sex = isset($_POSTsex) ? intval($_POSTsex) : 0, birthday = $birthday, othe
29、r=isset($_POSTother) ? $_POSTother : array() ); if (edit_profile($profile) show_message($_LANGedit_profile_success, $_LANGprofile_lnk, user.php?act=profile, info); else if ($user-error = ERR_EMAIL_EXISTS) $msg = sprintf($_LANGemail_exist, $profileemail); else $msg = $_LANGedit_profile_failed; show_m
30、essage($msg, , , info); /* 密碼找回-修改密碼界面 */elseif ($action = get_password) include_once(ROOT_PATH . includes/lib_passport.php); if (isset($_GETcode) & isset($_GETuid) /從郵件處獲得的act $code = trim($_GETcode); $uid = intval($_GETuid); /* 判斷鏈接的合法性 */ $user_info = $user-get_profile_by_id($uid); if (empty($use
31、r_info) | ($user_info & md5($user_infouser_id . $_CFGhash_code . $user_inforeg_time) != $code) show_message($_LANGparm_error, $_LANGback_home_lnk, ./, info); $smarty-assign(uid, $uid); $smarty-assign(code, $code); $smarty-assign(action, reset_password); $smarty-display(user_passport.dwt); else /顯示用戶(hù)
32、名和email表單 $smarty-display(user_passport.dwt); /* 發(fā)送密碼修改確認(rèn)郵件 */elseif ($action = send_pwd_email) include_once(ROOT_PATH . includes/lib_passport.php); /* 初始化會(huì)員用戶(hù)名和郵件地址 */ $user_name = !empty($_POSTuser_name) ? trim($_POSTuser_name) : ; $email = !empty($_POSTemail) ? trim($_POSTemail) : ; /用戶(hù)名和郵件地址是否匹配
33、 $user_info = $user-get_user_info($user_name); if ($user_info & $user_infoemail = $email) /生成code /$code = md5($user_info0 . $user_info1); $code = md5($user_infouser_id . $_CFGhash_code . $user_inforeg_time); /發(fā)送郵件的函數(shù) if (send_pwd_email($user_infouser_id, $user_name, $email, $code) show_message($_LA
34、NGsend_success . $email, $_LANGback_home_lnk, ./, info); else /發(fā)送郵件出錯(cuò) show_message($_LANGfail_send_password, $_LANGback_page_up, ./, info); else /用戶(hù)名與郵件地址不匹配 show_message($_LANGusername_no_email, $_LANGback_page_up, , info); /* 重置新密碼 */elseif ($action = reset_password) /顯示重置密碼的表單 $smarty-display(use
35、r_passport.dwt);/* 修改會(huì)員密碼 */elseif ($action = act_edit_password) include_once(ROOT_PATH . includes/lib_passport.php); $old_password = isset($_POSTold_password) ? trim($_POSTold_password) : ; $new_password = isset($_POSTnew_password) ? trim($_POSTnew_password) : ; $user_id = isset($_POSTuid) ? intval
36、($_POSTuid) : $user_id; $code = isset($_POSTcode) ? trim($_POSTcode) : ; if (strlen($new_password) get_profile_by_id($user_id); /論壇記錄 if ($user_info & (!empty($code) & md5($user_infouser_id . $_CFGhash_code . $user_inforeg_time) = $code) | ($_SESSIONuser_id0 & $_SESSIONuser_id = $user_id & $user-che
37、ck_user($_SESSIONuser_name, $old_password) if ($user-edit_user(array(username= (empty($code) ? $_SESSIONuser_name : $user_infouser_name), old_password=$old_password, password=$new_password), empty($code) ? 0 : 1) $user-logout(); show_message($_LANGedit_password_success, $_LANGrelogin_lnk, user.php?a
38、ct=login, info); else show_message($_LANGedit_password_failure, $_LANGback_page_up, , info); else show_message($_LANGedit_password_failure, $_LANGback_page_up, , info); /* 添加一個(gè)紅包 */elseif ($action = act_add_bonus) include_once(ROOT_PATH . includes/lib_transaction.php); $bouns_sn = isset($_POSTbonus_
39、sn) ? intval($_POSTbonus_sn) : ; if (add_bonus($user_id, $bouns_sn) show_message($_LANGadd_bonus_sucess, $_LANGback_up_page, user.php?act=bonus, info); else $err-show($_LANGback_up_page, user.php?act=bonus); /* 查看訂單列表 */elseif ($action = order_list) include_once(ROOT_PATH . includes/lib_transaction.
40、php); $page = isset($_REQUESTpage) ? intval($_REQUESTpage) : 1; $record_count = $db-getOne(SELECT COUNT(*) FROM .$ecs-table(order_info). WHERE user_id = $user_id); $pager = get_pager(user.php, array(act = $action), $record_count, $page); $orders = get_user_orders($user_id, $pagersize, $pagerstart); $merge = get_user_merge($user_id);
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 應(yīng)城市七年級(jí)上學(xué)期語(yǔ)文期中試題
- 四年級(jí)數(shù)學(xué)(四則混合運(yùn)算)計(jì)算題專(zhuān)項(xiàng)練習(xí)與答案匯編
- 分?jǐn)?shù)的初步認(rèn)識(shí)的說(shuō)課稿
- 蹲踞式跳遠(yuǎn)說(shuō)課稿初中
- 南京工業(yè)大學(xué)浦江學(xué)院《汽車(chē)構(gòu)造(下)》2023-2024學(xué)年第一學(xué)期期末試卷
- 《相交線(xiàn)》初中數(shù)學(xué)說(shuō)課稿
- 南京工業(yè)大學(xué)浦江學(xué)院《房屋建筑學(xué)》2021-2022學(xué)年第一學(xué)期期末試卷
- 約定工資結(jié)清協(xié)議書(shū)(2篇)
- 南京工業(yè)大學(xué)《巖體力學(xué)與工程》2023-2024學(xué)年第一學(xué)期期末試卷
- 對(duì)課件分析教學(xué)課件
- (完整版)四宮格數(shù)獨(dú)題目204道(可直接打印)及空表(一年級(jí)數(shù)獨(dú)題練習(xí))
- JIT、QR與供應(yīng)鏈管理課件
- 車(chē)輛采購(gòu)服務(wù)投標(biāo)方案(完整技術(shù)標(biāo))
- 《大學(xué)生軍事理論教程》第四章
- 光伏發(fā)電項(xiàng)目達(dá)標(biāo)投產(chǎn)實(shí)施細(xì)則之歐陽(yáng)科創(chuàng)編
- 第屆世界旅游小姐大賽中國(guó)云南總決賽招商贊助方案
- 愛(ài)立信網(wǎng)管BO操作流程
- 大學(xué)生計(jì)算與信息化素養(yǎng)-北京林業(yè)大學(xué)中國(guó)大學(xué)mooc課后章節(jié)答案期末考試題庫(kù)2023年
- 第四代篦冷機(jī)液壓系統(tǒng)的故障與維護(hù)獲獎(jiǎng)科研報(bào)告
- 人大代表為人民
- 文明之痕:流行病與公共衛(wèi)生知到章節(jié)答案智慧樹(shù)2023年四川大學(xué)
評(píng)論
0/150
提交評(píng)論