source: branches/feature-module-update/html/mobile/magazine/cancel.php @ 15532

Revision 15532, 1.4 KB checked in by nanasess, 15 years ago (diff)

svn:mime-type 修正

  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
Line 
1<?php
2/**
3 *
4 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
5 *
6 * http://www.lockon.co.jp/
7 *
8 *
9 * メルマガ解除
10 */
11
12require_once('../require.php');
13
14class LC_Page {
15    function LC_Page() {
16        /** 必ず変更する **/
17        $this->tpl_mainpage = 'magazine/cancel.tpl';
18        $this->tpl_title .= 'メルマガ解除完了';
19    }
20}
21
22$objPage = new LC_Page();
23$objQuery = new SC_Query();
24
25// secret_keyの取得
26$key = $_GET['id'];
27
28if (empty($key) or !lfExistKey($key))  {
29    sfDispSiteError(PAGE_ERROR, "", false, "", true);
30} else {
31    lfChangeData($key);
32}
33
34$objView = new SC_MobileView();
35$objView->assignobj($objPage);
36$objView->display(SITE_FRAME);
37
38//-----------------------------------------------------------------------------------------------------------------------------------
39
40// メルマガの解除を完了させる
41function lfChangeData($key) {
42    global $objQuery;
43
44    $arrUpdate['mail_flag'] = 3;
45    $arrUpdate['secret_key'] = NULL;
46    $result = $objQuery->update("dtb_customer_mail", $arrUpdate, "secret_key = '" .addslashes($key). "'");
47}
48
49// キーが存在するかどうか
50function lfExistKey($key) {
51    global $objQuery;
52
53    $sql = "SELECT count(*) FROM dtb_customer_mail WHERE secret_key = ?";
54    $result = $objQuery->getOne($sql, array($key));
55
56    if ($result == 1) {
57        return true;
58    } else {
59        return false;
60    }
61}
62
63
64?>
Note: See TracBrowser for help on using the repository browser.