source: branches/feature-module-movilink/data/downloads/module/mdl_movilink/mdl_movilink.php @ 16606

Revision 16606, 2.6 KB checked in by naka, 14 years ago (diff)

モビル連携モジュール中間アップ

Line 
1<?php
2/**
3 *
4 * @copyright    2000-2007 LOCKON CO.,LTD. All Rights Reserved.
5 * @version CVS: $Id: 1.0 2006-06-04 06:38:01Z kakinaka $
6 * @link        http://www.lockon.co.jp/
7 *
8 */
9require_once(MODULE_PATH . "mdl_movilink/mdl_movilink.inc");
10
11//¥Ú¡¼¥¸´ÉÍý¥¯¥é¥¹
12class LC_Page {
13    //¥³¥ó¥¹¥È¥é¥¯¥¿
14    function LC_Page() {
15        //¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È¤Î»ØÄê
16        $this->tpl_mainpage = MODULE_PATH . 'mdl_movilink/mdl_movilink.tpl';
17        $this->tpl_subtitle = MODULE_NAME;
18    }
19}
20$objPage = new LC_Page();
21$objView = new SC_AdminView();
22$objQuery = new SC_Query();
23
24// ǧ¾Ú³Îǧ
25$objSess = new SC_Session();
26sfIsSuccess($objSess);
27
28// ¥Ñ¥é¥á¡¼¥¿´ÉÍý¥¯¥é¥¹
29$objFormParam = new SC_FormParam();
30$objFormParam = lfInitParam($objFormParam);
31// POSTÃͤμèÆÀ
32$objFormParam->setParam($_POST);
33
34// ÈÆÍѹàÌܤòÄɲÃ(ɬ¿Ü¡ª¡ª)
35sfAlterMemo();
36
37switch($_POST['mode']) {
38case 'edit':
39    // ÆþÎÏ¥¨¥é¡¼È½Äê
40    $objPage->arrErr = lfCheckError();
41   
42    // ¥¨¥é¡¼¤Ê¤·¤Î¾ì¹ç¤Ë¤Ï¥Ç¡¼¥¿¤ò¹¹¿·   
43    if(count($objPage->arrErr) == 0) {
44        // ¥Ç¡¼¥¿¹¹¿·
45        sfSetModuleDB();
46        // ¥«¥é¥à¤ÎÀ¸À®
47        sfMakeMoviLinkColumn();
48        // CSV¥ì¥³¡¼¥É¤ÎÀ¸À®
49        sfSetMoviLinkCSV();
50        // javascript¼Â¹Ô
51        $objPage->tpl_onload = 'alert("ÅÐÏ¿´°Î»¤·¤Þ¤·¤¿¡£"); window.close();';
52    }
53    break;
54case 'module_del':
55    // ÈÆÍѹàÌܤθºß¥Á¥§¥Ã¥¯
56    if(sfColumnExists("dtb_payment", "memo01")){
57        // ¥Ç¡¼¥¿¤Îºï½ü¥Õ¥é¥°¤ò¤¿¤Æ¤ë
58        $objQuery->query("UPDATE dtb_payment SET del_flg = 1 WHERE module_id = ?", array(MDL_MOVILINK_ID));
59    }
60    break;
61default:
62    // ¥Ç¡¼¥¿¤Î¥í¡¼¥É
63    lfLoadData();   
64    break;
65}
66
67$objPage->arrForm = $objFormParam->getFormParamList();
68
69$objView->assignobj($objPage);                    //ÊÑ¿ô¤ò¥Æ¥ó¥×¥ì¡¼¥È¤Ë¥¢¥µ¥¤¥ó¤¹¤ë
70$objView->display($objPage->tpl_mainpage);        //¥Æ¥ó¥×¥ì¡¼¥È¤Î½ÐÎÏ
71//-------------------------------------------------------------------------------------------------------
72/* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */
73function lfInitParam($objFormParam) {
74    $objFormParam->addParam("EC¥µ¥¤¥ÈID", "site_id", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "SPTAB_CHECK"));   
75    $objFormParam->addParam("¥¹¥Æ¡¼¥¿¥¹", "status", 1, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "SPTAB_CHECK"));
76    return $objFormParam;
77}
78
79// ¥¨¥é¡¼¥Á¥§¥Ã¥¯¤ò¹Ô¤¦
80function lfCheckError(){
81    global $objFormParam;
82    $arrErr = $objFormParam->checkError();
83    return $arrErr;
84}
85
86// ÅÐÏ¿¥Ç¡¼¥¿¤òÆɤ߹þ¤à
87function lfLoadData(){
88    global $objFormParam;
89    //¥Ç¡¼¥¿¤ò¼èÆÀ
90    $arrRet = sfGetModuleDB();
91    // Ãͤò¥»¥Ã¥È
92    $objFormParam->setParam($arrRet);
93}
94?>
Note: See TracBrowser for help on using the repository browser.