source: tags/mdl_zaikorobot-1.0/mdl_zaikorobot.php @ 17531

Revision 17531, 3.0 KB checked in by adachi, 13 years ago (diff)

zaikorobot1.0

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-httpd-php
Line 
1<?php
2/**
3 * This file is part of EC-CUBE
4 *
5 * Copyright(c) 2000-2008 LOCKON CO.,LTD. All Rights Reserved.
6 *
7 * http://www.lockon.co.jp/
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22 */
23/*
24 * ¥â¥¸¥å¡¼¥ë¥Ð¡¼¥¸¥ç¥óɽµ­
25 * @version ### ### 1.0
26 */
27require_once(MODULE_PATH . "mdl_zaikorobot/mdl_zaikorobot.inc");
28
29//¥Ú¡¼¥¸´ÉÍý¥¯¥é¥¹
30class LC_Page {
31    //¥³¥ó¥¹¥È¥é¥¯¥¿
32    function LC_Page() {
33        //¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È¤Î»ØÄê
34        $this->tpl_mainpage = MODULE_PATH . 'mdl_zaikorobot/mdl_zaikorobot.tpl';
35        $this->tpl_subtitle = 'zaiko robotÏ¢·È¥â¥¸¥å¡¼¥ë';
36    }
37}
38$objPage = new LC_Page();
39$objView = new SC_AdminView();
40$objQuery = new SC_Query();
41
42// ǧ¾Ú³Îǧ
43$objSess = new SC_Session();
44sfIsSuccess($objSess);
45
46// ¥Ñ¥é¥á¡¼¥¿´ÉÍý¥¯¥é¥¹
47$objFormParam = new SC_FormParam();
48$objFormParam = lfInitParam($objFormParam);
49// POSTÃͤμèÆÀ
50$objFormParam->setParam($_POST);
51
52// ÈÆÍѹàÌܤòÄɲÃ(ɬ¿Ü¡ª¡ª)
53sfAlterMemo();
54
55switch($_POST['mode']) {
56case 'edit':
57    // ÆþÎÏ¥¨¥é¡¼È½Äê
58    $objPage->arrErr = lfCheckError();
59    // ¥¨¥é¡¼¤Ê¤·¤Î¾ì¹ç
60    if(count($objPage->arrErr) == 0) {
61        // ¥Ç¡¼¥¿¹¹¿·
62        sfZaikoSetModuleDB(MDL_ZAIKOROBOT_ID, $objFormParam);
63        // ·èºÑ·ë²Ì¼õÉÕ¥Õ¥¡¥¤¥ë¤Î¥³¥Ô¡¼
64        copy(MODULE_PATH. "mdl_zaikorobot/hunglead_stock.php", HTML_PATH. "user_data/hunglead_stock.php");
65        // ´°Î»ÄÌÃÎ
66        $objPage->tpl_onload = 'alert("ÅÐÏ¿´°Î»¤·¤Þ¤·¤¿¡£");window.close();';
67    }
68    break;
69default:
70    // ¥Ç¡¼¥¿¤Î¥í¡¼¥É
71    lfLoadData();   
72    break;
73}
74
75$objPage->arrForm = $objFormParam->getFormParamList();
76
77$objView->assignobj($objPage);
78$objView->display($objPage->tpl_mainpage);
79
80//-----------------------------------------------------------------------
81
82/**
83 * ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½
84 */
85function lfInitParam($objFormParam) {
86    $objFormParam->addParam("ID", "id", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK"));
87    $objFormParam->addParam("¥Ñ¥¹¥ï¡¼¥É", "pass", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK")); 
88    return $objFormParam;
89}
90
91/**
92 * ¥¨¥é¡¼¥Á¥§¥Ã¥¯
93 */
94function lfCheckError() {
95    global $objFormParam;
96    $arrErr = $objFormParam->checkError();
97    return $arrErr;
98}
99
100/**
101 * ÅÐÏ¿¥Ç¡¼¥¿¤Î¼èÆÀ
102 */
103function lfLoadData() {
104    global $objFormParam;
105    //¥Ç¡¼¥¿¤ò¼èÆÀ
106    $arrRet = sfZaikoGetModuleDB(MDL_ZAIKOROBOT_ID);
107    // Ãͤò¥»¥Ã¥È
108    $objFormParam->setParam($arrRet);
109}
110
111?>
Note: See TracBrowser for help on using the repository browser.