source: branches/dev/data/downloads/module/affiliate.php @ 17

Revision 17, 2.6 KB checked in by uehara, 16 years ago (diff)
Line 
1<?php
2/**
3 *
4 * @copyright   2000-2007 LOCKON CO.,LTD. All Rights Reserved.
5 * @version CVS: $Id: affiliate.php 8813 2006-12-04 05:24:35Z kakinaka $
6 * @link        http://www.lockon.co.jp/
7 *
8 */
9
10 
11 
12require_once("./require.php");
13
14$arrConversionPage = array(
15    1 => '¾¦ÉʹØÆþ´°Î»²èÌÌ',
16    2 => '²ñ°÷ÅÐÏ¿´°Î»²èÌÌ'
17);
18
19//¥Ú¡¼¥¸´ÉÍý¥¯¥é¥¹
20class LC_Page {
21    //¥³¥ó¥¹¥È¥é¥¯¥¿
22    function LC_Page() {
23        //¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È¤Î»ØÄê
24        $this->tpl_mainpage = MODULE_PATH . 'affiliate.tpl';
25        $this->tpl_subtitle = '¥¢¥Õ¥£¥ê¥¨¥¤¥È¥¿¥°Ëä¤á¹þ¤ß';
26        global $arrConversionPage;
27        $this->arrConversionPage = $arrConversionPage;
28    }
29}
30$objPage = new LC_Page();
31$objView = new SC_AdminView();
32
33// ǧ¾Ú³Îǧ
34$objSess = new SC_Session();
35sfIsSuccess($objSess);
36
37// ¥Ñ¥é¥á¡¼¥¿´ÉÍý¥¯¥é¥¹
38$objFormParam = new SC_FormParam();
39$objFormParam = lfInitParam($objFormParam);
40// POSTÃͤμèÆÀ
41$objFormParam->setParam($_POST);
42
43switch($_POST['mode']) {
44case 'edit':
45    // ÆþÎÏ¥¨¥é¡¼È½Äê
46    $objPage->arrErr = $objFormParam->checkError();
47    if(count($objPage->arrErr) == 0) {
48        $arrRet = $objQuery->select("sub_data", "dtb_module", "module_id = ?", array(AFF_TAG_MID));
49        $arrSubData = unserialize($arrRet[0]['sub_data']);
50        $arrRet = $objFormParam->getHashArray();       
51        $arrSubData[$arrRet['conv_page']] = $arrRet['aff_tag'];
52        $sqlval['sub_data'] = serialize($arrSubData);
53        $objQuery = new SC_Query();
54        $objQuery->update("dtb_module", $sqlval, "module_id = ?", array(AFF_TAG_MID));
55        // javascript¼Â¹Ô
56        $objPage->tpl_onload = "window.close();";
57    }
58    break;
59// ¥³¥ó¥Ð¡¼¥¸¥ç¥ó¥Ú¡¼¥¸¤ÎÁªÂò
60case 'select':
61    if(is_numeric($_POST['conv_page'])) {
62        // sub_data¤è¤ê¥¿¥°¾ðÊó¤òÆɤ߹þ¤à
63        $conv_page = $_POST['conv_page'];
64        $arrRet = $objQuery->select("sub_data", "dtb_module", "module_id = ?", array(AFF_TAG_MID));
65        $arrSubData = unserialize($arrRet[0]['sub_data']);
66        $aff_tag = $arrSubData[$conv_page];
67        $objFormParam->setValue('conv_page', $conv_page);
68        $objFormParam->setValue('aff_tag', $aff_tag);       
69    }
70    break;
71default:
72    break;
73}
74
75$objPage->arrForm = $objFormParam->getFormParamList();
76$objView->assignobj($objPage);                  //ÊÑ¿ô¤ò¥Æ¥ó¥×¥ì¡¼¥È¤Ë¥¢¥µ¥¤¥ó¤¹¤ë
77$objView->display($objPage->tpl_mainpage);      //¥Æ¥ó¥×¥ì¡¼¥È¤Î½ÐÎÏ
78//-------------------------------------------------------------------------------------------------------
79/* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */
80function lfInitParam($objFormParam) {
81    $objFormParam->addParam("¥³¥ó¥Ð¡¼¥¸¥ç¥ó¥Ú¡¼¥¸", "conv_page", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK"));
82    $objFormParam->addParam("¥¢¥Õ¥£¥ê¥¨¥¤¥È¥¿¥°", "aff_tag", MTEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK"));   
83    return $objFormParam;
84}
85?>
Note: See TracBrowser for help on using the repository browser.