Ignore:
Timestamp:
2007/09/05 09:29:00 (17 years ago)
Author:
adachi
Message:

クラス化対応

Location:
branches/feature-module-update
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/Smarty/templates/admin/system/input.tpl

    r15079 r15602  
    66 */ 
    77*}--> 
    8 <!-- --> 
    98<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    109<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja"> 
     
    3736<!--★★メインコンテンツ★★--> 
    3837<table width="500" border="0" cellspacing="0" cellpadding="0" summary=" "> 
    39 <form name="form1" id="form1" method="post" action="<!--{$tpl_recv}-->" onsubmit="return fnRegistMember();"> 
    40 <input type="hidden" name="mode" value="<!--{$tpl_mode}-->"> 
    41 <input type="hidden" name="member_id" value="<!--{$tpl_member_id}-->"> 
    42 <input type="hidden" name="pageno" value="<!--{$tpl_pageno}-->"> 
    43 <input type="hidden" name="old_login_id" value="<!--{$tpl_old_login_id}-->"> 
    44 <input type="hidden" name="uniqid" value="<!--{$tpl_uniqid}-->"> 
    45     <tr valign="top"> 
    46         <td class="mainbg"> 
    47             <!--▼登録テーブルここから--> 
    48             <table width="500" border="0" cellspacing="0" cellpadding="0" summary=" "> 
    49                 <!--メインエリア--> 
    50                 <tr> 
    51                     <td align="center"> 
    52                         <table width="470" border="0" cellspacing="0" cellpadding="0" summary=" "> 
    53                             <tr><td height="14"></td></tr> 
    54                             <tr> 
    55                                 <td colspan="3"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/main_top.jpg" width="470" height="14" alt=""></td> 
    56                             </tr> 
    57                             <tr> 
    58                                 <td background="<!--{$smarty.const.URL_DIR}-->img/contents/main_left.jpg"><img src="<!--{$smarty.const.URL_DIR}-->img/common/_.gif" width="14" height="1" alt=""></td> 
    59                                 <td bgcolor="#cccccc"> 
    60                                      
    61                                     <table width="440" border="0" cellspacing="0" cellpadding="0" summary=" "> 
    62                                         <tr> 
    63                                             <td colspan="3"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/contents_title_top.gif" width="440" height="7" alt=""></td> 
    64                                         </tr> 
    65                                         <tr> 
    66                                             <td background="<!--{$smarty.const.URL_DIR}-->img/contents/contents_title_left_bg.gif"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/contents_title_left.gif" width="22" height="12" alt=""></td> 
    67                                             <td bgcolor="#636469" width="400" class="fs14n"><span class="white"><!--コンテンツタイトル-->メンバー登録/編集</span></td> 
    68                                             <td background="<!--{$smarty.const.URL_DIR}-->img/contents/contents_title_right_bg.gif"><img src="<!--{$smarty.const.URL_DIR}-->img/common/_.gif" width="18" height="1" alt=""></td> 
    69                                         </tr> 
    70                                         <tr> 
    71                                             <td colspan="3"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/contents_title_bottom.gif" width="440" height="7" alt=""></td> 
    72                                         </tr> 
    73                                         <tr> 
    74                                             <td colspan="3"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/main_bar.jpg" width="440" height="10" alt=""></td> 
    75                                         </tr> 
    76                                     </table> 
    77                                      
    78                                     <table width="440" border="0" cellspacing="1" cellpadding="8" summary=" "> 
    79                                         <tr class="fs12n"> 
    80                                             <td width="90" bgcolor="#f3f3f3">名前</td> 
    81                                             <td width="337" bgcolor="#ffffff"><!--{if $arrErr.name}--><span class="red"><!--{$arrErr.name}--></span><!--{/if}--><input type="text" name="name" size="30" class="box30" value="<!--{$arrForm.name}-->" maxlength="<!--{$smarty.const.STEXT_LEN}-->"/> <span class="red">※必須入力</span> 
    82                                             </td> 
    83                                         </tr> 
    84                                         <tr class="fs12n"> 
    85                                             <td width="90" bgcolor="#f3f3f3">所属</td> 
    86                                             <td width="337" bgcolor="#ffffff"><!--{if $arrErr.department}--><span class="red"><!--{$arrErr.department}--></span><!--{/if}--><input type="text" name="department" size="30" class="box30" value="<!--{$arrForm.department}-->" maxlength="<!--{$smarty.const.STEXT_LEN}-->"/> 
    87                                             </td> 
    88                                         </tr> 
    89                                         <tr class="fs12"> 
    90                                             <td width="90" bgcolor="#f3f3f3">ログインID</td> 
    91                                             <td width="337" bgcolor="#ffffff"><!--{if $arrErr.login_id}--><span class="red"><!--{$arrErr.login_id}--></span><!--{/if}--><input type="text" name="login_id" size="20" class="box20"  value="<!--{$arrForm.login_id}-->" maxlength="<!--{$smarty.const.STEXT_LEN}-->"/> <span class="red">※必須入力</span><br /> 
    92                                             ※半角英数字・15文字以内</td> 
    93                                         </tr> 
    94                                         <tr class="fs12"> 
    95                                             <td width="90" bgcolor="#f3f3f3">パスワード</td> 
    96                                             <td width="337" bgcolor="#ffffff"><!--{if $arrErr.password}--><span class="red"><!--{$arrErr.password}--></span><!--{/if}--><input type="password" name="password" size="20" class="box20" value="<!--{$arrForm.password}-->" onfocus="<!--{$tpl_onfocus}-->" maxlength="<!--{$smarty.const.STEXT_LEN}-->"/> <span class="red">※必須入力</span><br /> 
    97                                             ※半角英数字・15文字以内</td> 
    98                                         </tr> 
    99                                         <tr class="fs12n"> 
    100                                             <td width="90" bgcolor="#f3f3f3">管理権限</td> 
    101                                             <td width="337" bgcolor="#ffffff"><!--{if $arrErr.authority}--><span class="red"><!--{$arrErr.authority}--></span><!--{/if}--><select name="authority"> 
    102                                             <option value="" >選択してください</option> 
    103                                             <!--{html_options options=$arrAUTHORITY selected=$arrForm.authority}--> 
    104                                             </select> <span class="red">※必須入力</span></td> 
    105                                         </tr> 
    106                                     </table> 
     38<form name="form1" id="form1" method="post" action="" onsubmit="return fnRegistMember();"> 
     39<input type="hidden" name="mode" value="<!--{$tpl_mode|escape}-->"> 
     40<input type="hidden" name="member_id" value="<!--{$tpl_member_id|escape}-->"> 
     41<input type="hidden" name="pageno" value="<!--{$tpl_pageno|escape}-->"> 
     42<input type="hidden" name="old_login_id" value="<!--{$tpl_old_login_id|escape}-->"> 
     43<input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid|escape}-->"> 
     44    <tr valign="top"> 
     45        <td class="mainbg"> 
     46            <!--▼登録テーブルここから--> 
     47            <table width="500" border="0" cellspacing="0" cellpadding="0" summary=" "> 
     48                <!--メインエリア--> 
     49                <tr> 
     50                    <td align="center"> 
     51                        <table width="470" border="0" cellspacing="0" cellpadding="0" summary=" "> 
     52                            <tr><td height="14"></td></tr> 
     53                            <tr> 
     54                                <td colspan="3"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/main_top.jpg" width="470" height="14" alt=""></td> 
     55                            </tr> 
     56                            <tr> 
     57                                <td background="<!--{$smarty.const.URL_DIR}-->img/contents/main_left.jpg"><img src="<!--{$smarty.const.URL_DIR}-->img/common/_.gif" width="14" height="1" alt=""></td> 
     58                                <td bgcolor="#cccccc"> 
    10759 
    108                                     <table width="440" border="0" cellspacing="0" cellpadding="0" summary=" "> 
    109                                         <tr> 
    110                                             <td bgcolor="#cccccc"><img src="<!--{$smarty.const.URL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td> 
    111                                             <td><img src="<!--{$smarty.const.URL_DIR}-->img/contents/tbl_top.gif" width="438" height="7" alt=""></td> 
    112                                             <td bgcolor="#cccccc"><img src="<!--{$smarty.const.URL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td> 
    113                                         </tr> 
    114                                         <tr> 
    115                                             <td bgcolor="#cccccc"><img src="<!--{$smarty.const.URL_DIR}-->img/common/_.gif" width="1" height="10" alt=""></td> 
    116                                             <td bgcolor="#e9e7de" align="center"> 
    117                                             <table border="0" cellspacing="0" cellpadding="0" summary=" "> 
    118                                                 <tr> 
    119                                                     <td><input type="image" onMouseover="chgImgImageSubmit('<!--{$smarty.const.URL_DIR}-->img/contents/btn_regist_on.jpg',this)" onMouseout="chgImgImageSubmit('<!--{$smarty.const.URL_DIR}-->img/contents/btn_regist.jpg',this)" src="<!--{$smarty.const.URL_DIR}-->img/contents/btn_regist.jpg" width="123" height="24" alt="この内容で登録する" border="0" name="subm" ></td> 
    120                                                 </tr> 
    121                                             </table> 
    122                                             </td> 
    123                                             <td bgcolor="#cccccc"><img src="<!--{$smarty.const.URL_DIR}-->img/common/_.gif" width="1" height="10" alt=""></td> 
    124                                         </tr> 
    125                                         <tr> 
    126                                             <td colspan="3"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/tbl_bottom.gif" width="440" height="8" alt=""></td> 
    127                                         </tr> 
    128                                     </table> 
    129                                 </td> 
    130                                 <td background="<!--{$smarty.const.URL_DIR}-->img/contents/main_right.jpg"><img src="<!--{$smarty.const.URL_DIR}-->img/common/_.gif" width="14" height="1" alt=""></td> 
    131                             </tr> 
    132                             <tr> 
    133                                 <td colspan="3"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/main_bottom.jpg" width="470" height="14" alt=""></td> 
    134                             </tr> 
    135                             <tr><td height="30"></td></tr> 
    136                         </table> 
    137                     </td> 
    138                 </tr> 
    139                 <!--メインエリア--> 
    140             </table> 
    141             <!--▲登録テーブルここまで--> 
    142         </td> 
    143     </tr> 
     60                                    <table width="440" border="0" cellspacing="0" cellpadding="0" summary=" "> 
     61                                        <tr> 
     62                                            <td colspan="3"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/contents_title_top.gif" width="440" height="7" alt=""></td> 
     63                                        </tr> 
     64                                        <tr> 
     65                                            <td background="<!--{$smarty.const.URL_DIR}-->img/contents/contents_title_left_bg.gif"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/contents_title_left.gif" width="22" height="12" alt=""></td> 
     66                                            <td bgcolor="#636469" width="400" class="fs14n"><span class="white"><!--コンテンツタイトル-->メンバー登録/編集</span></td> 
     67                                            <td background="<!--{$smarty.const.URL_DIR}-->img/contents/contents_title_right_bg.gif"><img src="<!--{$smarty.const.URL_DIR}-->img/common/_.gif" width="18" height="1" alt=""></td> 
     68                                        </tr> 
     69                                        <tr> 
     70                                            <td colspan="3"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/contents_title_bottom.gif" width="440" height="7" alt=""></td> 
     71                                        </tr> 
     72                                        <tr> 
     73                                            <td colspan="3"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/main_bar.jpg" width="440" height="10" alt=""></td> 
     74                                        </tr> 
     75                                    </table> 
     76 
     77                                    <table width="440" border="0" cellspacing="1" cellpadding="8" summary=" "> 
     78                                        <tr class="fs12n"> 
     79                                            <td width="90" bgcolor="#f3f3f3">名前</td> 
     80                                            <td width="337" bgcolor="#ffffff"><!--{if $arrErr.name}--><span class="red"><!--{$arrErr.name}--></span><!--{/if}--><input type="text" name="name" size="30" class="box30" value="<!--{$arrForm.name}-->" maxlength="<!--{$smarty.const.STEXT_LEN}-->"/> <span class="red">※必須入力</span> 
     81                                            </td> 
     82                                        </tr> 
     83                                        <tr class="fs12n"> 
     84                                            <td width="90" bgcolor="#f3f3f3">所属</td> 
     85                                            <td width="337" bgcolor="#ffffff"><!--{if $arrErr.department}--><span class="red"><!--{$arrErr.department}--></span><!--{/if}--><input type="text" name="department" size="30" class="box30" value="<!--{$arrForm.department}-->" maxlength="<!--{$smarty.const.STEXT_LEN}-->"/> 
     86                                            </td> 
     87                                        </tr> 
     88                                        <tr class="fs12"> 
     89                                            <td width="90" bgcolor="#f3f3f3">ログインID</td> 
     90                                            <td width="337" bgcolor="#ffffff"><!--{if $arrErr.login_id}--><span class="red"><!--{$arrErr.login_id}--></span><!--{/if}--><input type="text" name="login_id" size="20" class="box20"  value="<!--{$arrForm.login_id}-->" maxlength="<!--{$smarty.const.STEXT_LEN}-->"/> <span class="red">※必須入力</span><br /> 
     91                                            ※半角英数字・15文字以内</td> 
     92                                        </tr> 
     93                                        <tr class="fs12"> 
     94                                            <td width="90" bgcolor="#f3f3f3">パスワード</td> 
     95                                            <td width="337" bgcolor="#ffffff"><!--{if $arrErr.password}--><span class="red"><!--{$arrErr.password}--></span><!--{/if}--><input type="password" name="password" size="20" class="box20" value="<!--{$arrForm.password}-->" onfocus="<!--{$tpl_onfocus}-->" maxlength="<!--{$smarty.const.STEXT_LEN}-->"/> <span class="red">※必須入力</span><br /> 
     96                                            ※半角英数字・15文字以内</td> 
     97                                        </tr> 
     98                                        <tr class="fs12n"> 
     99                                            <td width="90" bgcolor="#f3f3f3">管理権限</td> 
     100                                            <td width="337" bgcolor="#ffffff"><!--{if $arrErr.authority}--><span class="red"><!--{$arrErr.authority}--></span><!--{/if}--><select name="authority"> 
     101                                            <option value="" >選択してください</option> 
     102                                            <!--{html_options options=$arrAUTHORITY selected=$arrForm.authority}--> 
     103                                            </select> <span class="red">※必須入力</span></td> 
     104                                        </tr> 
     105                                    </table> 
     106 
     107                                    <table width="440" border="0" cellspacing="0" cellpadding="0" summary=" "> 
     108                                        <tr> 
     109                                            <td bgcolor="#cccccc"><img src="<!--{$smarty.const.URL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td> 
     110                                            <td><img src="<!--{$smarty.const.URL_DIR}-->img/contents/tbl_top.gif" width="438" height="7" alt=""></td> 
     111                                            <td bgcolor="#cccccc"><img src="<!--{$smarty.const.URL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td> 
     112                                        </tr> 
     113                                        <tr> 
     114                                            <td bgcolor="#cccccc"><img src="<!--{$smarty.const.URL_DIR}-->img/common/_.gif" width="1" height="10" alt=""></td> 
     115                                            <td bgcolor="#e9e7de" align="center"> 
     116                                            <table border="0" cellspacing="0" cellpadding="0" summary=" "> 
     117                                                <tr> 
     118                                                    <td><input type="image" onMouseover="chgImgImageSubmit('<!--{$smarty.const.URL_DIR}-->img/contents/btn_regist_on.jpg',this)" onMouseout="chgImgImageSubmit('<!--{$smarty.const.URL_DIR}-->img/contents/btn_regist.jpg',this)" src="<!--{$smarty.const.URL_DIR}-->img/contents/btn_regist.jpg" width="123" height="24" alt="この内容で登録する" border="0" name="subm" ></td> 
     119                                                </tr> 
     120                                            </table> 
     121                                            </td> 
     122                                            <td bgcolor="#cccccc"><img src="<!--{$smarty.const.URL_DIR}-->img/common/_.gif" width="1" height="10" alt=""></td> 
     123                                        </tr> 
     124                                        <tr> 
     125                                            <td colspan="3"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/tbl_bottom.gif" width="440" height="8" alt=""></td> 
     126                                        </tr> 
     127                                    </table> 
     128                                </td> 
     129                                <td background="<!--{$smarty.const.URL_DIR}-->img/contents/main_right.jpg"><img src="<!--{$smarty.const.URL_DIR}-->img/common/_.gif" width="14" height="1" alt=""></td> 
     130                            </tr> 
     131                            <tr> 
     132                                <td colspan="3"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/main_bottom.jpg" width="470" height="14" alt=""></td> 
     133                            </tr> 
     134                            <tr><td height="30"></td></tr> 
     135                        </table> 
     136                    </td> 
     137                </tr> 
     138                <!--メインエリア--> 
     139            </table> 
     140            <!--▲登録テーブルここまで--> 
     141        </td> 
     142    </tr> 
    144143</form> 
    145144</table> 
  • branches/feature-module-update/html/admin/system/input.php

    r15532 r15602  
    55 * http://www.lockon.co.jp/ 
    66 */ 
     7 
     8// {{{ requires 
    79require_once("../require.php"); 
     10require_once(CLASS_PATH . "page_extends/admin/system/LC_Page_Admin_System_Input_Ex.php"); 
    811 
    9 class LC_Page { 
    10     var $arrErr;        // エラーメッセージ出力用 
    11     var $tpl_recv;      // 入力情報POST先 
    12     var $tpl_onload;    // ページ読み込み時のイベント 
    13     var $arrForm;       // フォーム出力用 
    14     var $tpl_mode;      // 新規作成:new or 編集:edit 
    15     var $tpl_member_id; // 編集時に使用する。 
    16     var $tpl_pageno; 
    17     var $tpl_onfocus;   // パスワード項目選択時のイベント用 
    18     var $tpl_old_login_id; 
    19     function LC_Page() { 
    20         $this->tpl_recv =  'input.php'; 
    21         $this->tpl_pageno = $_REQUEST['pageno']; 
    22         $this->SHORTTEXT_MAX = STEXT_LEN; 
    23         $this->MIDDLETEXT_MAX = MTEXT_LEN; 
    24         $this->LONGTEXT_MAX = LTEXT_LEN; 
    25         global $arrAUTHORITY; 
    26         $this->arrAUTHORITY = $arrAUTHORITY; 
    27     } 
    28 } 
     12// }}} 
     13// {{{ generate page 
    2914 
    30 $conn = new SC_DbConn(); 
    31 $objPage = new LC_Page(); 
    32 $objView = new SC_AdminView(); 
    33  
    34 // 認証可否の判定 
    35 $objSess = new SC_Session(); 
    36 sfIsSuccess($objSess); 
    37  
    38 // member_idが指定されていた場合、編集モードとする。 
    39 if(sfIsInt($_GET['id'])) { 
    40     $objPage->tpl_mode = 'edit'; 
    41     $objPage->tpl_member_id = $_GET['id']; 
    42     $objPage->tpl_onfocus = "fnClearText(this.name);"; 
    43     // DBのメンバー情報を読み出す 
    44     $data_list = fnGetMember($conn, $_GET['id']); 
    45     // 該当ユーザを表示させる 
    46     $objPage->arrForm = $data_list[0]; 
    47     // ダミーのパスワードをセットしておく。 
    48     $objPage->arrForm['password'] = DUMMY_PASS; 
    49     // ログインIDを保管しておく。 
    50     $objPage->tpl_old_login_id = $data_list[0]['login_id']; 
    51      
    52     $objPage->tpl_uniqid = $objSess->getUniqId(); 
    53 } else { 
    54     // 新規作成モード 
    55     $objPage->tpl_mode = "new"; 
    56     $objPage->arrForm['authority'] = -1; 
    57 } 
    58  
    59 // 新規作成モード or 編集モード 
    60 if( $_POST['mode'] == 'new' || $_POST['mode'] == 'edit') { 
    61     // 画面遷移の正当性チェック 
    62     if (sfIsValidTransition($objSess) == false) { 
    63         sfDispError(INVALID_MOVE_ERRORR); 
    64     } 
    65     // 入力エラーチェック 
    66     $objPage->arrErr = fnErrorCheck($conn); 
    67      
    68     // 入力が正常であった場合は、DBに書き込む 
    69     if(count($objPage->arrErr) == 0) { 
    70         if($_POST['mode'] == 'new') { 
    71             // メンバーの追加 
    72             fnInsertMember(); 
    73             // リロードによる二重登録対策のため、同じページに飛ばす。 
    74             header("Location: ". $_SERVER['PHP_SELF'] . "?mode=reload");     
    75             exit; 
    76         } 
    77         if($_POST['mode'] == 'edit') { 
    78             // メンバーの追加 
    79             if(fnUpdateMember($_POST['member_id'])) { 
    80                 // 親ウィンドウを更新後、自ウィンドウを閉じる。 
    81                 $url = URL_SYSTEM_TOP . "?pageno=".$_POST['pageno']; 
    82                 $objPage->tpl_onload="fnUpdateParent('".$url."'); window.close();"; 
    83             } 
    84         } 
    85     // 入力エラーが発生した場合 
    86     } else { 
    87         // モードの設定 
    88         $objPage->tpl_mode = $_POST['mode']; 
    89         $objPage->tpl_member_id = $_POST['member_id']; 
    90         $objPage->tpl_old_login_id = $_POST['old_login_id']; 
    91         // すでに入力した値を表示する。 
    92         $objPage->arrForm = $_POST; 
    93         // 通常入力のパスワードは引き継がない。 
    94         if($objPage->arrForm['password'] != DUMMY_PASS) { 
    95             $objPage->arrForm['password'] = ''; 
    96         } 
    97     } 
    98 } 
    99  
    100 // リロードの指定があった場合 
    101 if( $_GET['mode'] == 'reload') { 
    102     // 親ウィンドウを更新するようにセットする。 
    103     $url = URL_SYSTEM_TOP; 
    104     $objPage->tpl_onload="fnUpdateParent('".$url."')"; 
    105 } 
    106  
    107 // 画面遷移の正当性チェック用にuniqidを埋め込む 
    108 $objPage->tpl_uniqid = $objSess->getUniqId(); 
    109  
    110 // テンプレート用変数の割り当て 
    111 $objView->assignobj($objPage); 
    112 $objView->display('system/input.tpl'); 
    113  
    114 /* 入力エラーのチェック */ 
    115 function fnErrorCheck($conn) { 
    116      
    117     $objErr = new SC_CheckError(); 
    118      
    119     $_POST["name"] = mb_convert_kana($_POST["name"] ,"KV"); 
    120     $_POST["department"] = mb_convert_kana($_POST["department"] ,"KV"); 
    121      
    122     // 名前チェック 
    123     $objErr->doFunc(array("名前",'name'), array("EXIST_CHECK")); 
    124     $objErr->doFunc(array("名前",'name',STEXT_LEN,"BIG"), array("MAX_LENGTH_CHECK")); 
    125      
    126     // 編集モードでない場合は、重複チェック 
    127     if (!isset($objErr->arrErr['name']) && $_POST['mode'] != 'edit') { 
    128         $sql = "SELECT name FROM dtb_member WHERE del_flg <> 1 AND name = ?"; 
    129         $result = $conn->getOne($sql, array($_POST['name']));  
    130         if ( $result ) { 
    131             $objErr->arrErr['name'] = "既に登録されている名前なので利用できません。<br>"; 
    132         } 
    133     } 
    134          
    135     // ログインIDチェック 
    136     $objErr->doFunc(array("ログインID",'login_id'), array("EXIST_CHECK", "ALNUM_CHECK")); 
    137     $objErr->doFunc(array("ログインID",'login_id',ID_MIN_LEN , ID_MAX_LEN) ,array("NUM_RANGE_CHECK")); 
    138  
    139     // 新規モードもしくは、編集モードでログインIDが変更されている場合はチェックする。 
    140     if (!isset($objErr->arrErr['login_id']) && $_POST['mode'] != 'edit' || ($_POST['mode'] == 'edit' && $_POST['login_id'] != $_POST['old_login_id'])) { 
    141         $sql = "SELECT login_id FROM dtb_member WHERE del_flg <> 1 AND login_id = ?"; 
    142         $result = $conn->getOne($sql, array($_POST['login_id']));  
    143         if ( $result != "" ) { 
    144             $objErr->arrErr['login_id'] = "既に登録されているIDなので利用できません。<br>"; 
    145         } 
    146     } 
    147      
    148     // パスワードチェック(編集モードでDUMMY_PASSが入力されている場合は、スルーする) 
    149     if(!($_POST['mode'] == 'edit' && $_POST['password'] == DUMMY_PASS)) {  
    150         $objErr->doFunc(array("パスワード",'password'), array("EXIST_CHECK", "ALNUM_CHECK")); 
    151         if (!$arrErr['password']) { 
    152             // パスワードのチェック 
    153             $objErr->doFunc( array("パスワード",'password',4 ,15 ) ,array( "NUM_RANGE_CHECK" ) );     
    154         } 
    155     } 
    156      
    157     // 権限チェック 
    158     $objErr->doFunc(array("権限",'authority'),array("EXIST_CHECK")); 
    159     return $objErr->arrErr; 
    160 } 
    161  
    162 /* DBへのデータ挿入 */ 
    163 function fnInsertMember() { 
    164     // クエリークラスの宣言 
    165     $oquery = new SC_Query(); 
    166     // INSERTする値を作成する。 
    167     $sqlval['name'] = $_POST['name']; 
    168     $sqlval['department'] = $_POST['department']; 
    169     $sqlval['login_id'] = $_POST['login_id']; 
    170     $sqlval['password'] = sha1($_POST['password'] . ":" . AUTH_MAGIC); 
    171     $sqlval['authority'] = $_POST['authority']; 
    172     $sqlval['rank']=  $oquery->max("dtb_member", "rank") + 1; 
    173     $sqlval['work'] = "1"; // 稼働に設定 
    174     $sqlval['del_flg'] = "0";   // 削除フラグをOFFに設定 
    175     $sqlval['creator_id'] = $_SESSION['member_id']; 
    176     $sqlval['create_date'] = "now()"; 
    177     $sqlval['update_date'] = "now()"; 
    178     // INSERTの実行 
    179     $ret = $oquery->insert("dtb_member", $sqlval); 
    180     return $ret; 
    181 } 
    182  
    183 /* DBへのデータ更新 */ 
    184 function fnUpdateMember($id) { 
    185     // クエリークラスの宣言 
    186     $oquery = new SC_Query(); 
    187     // INSERTする値を作成する。 
    188     $sqlval['name'] = $_POST['name']; 
    189     $sqlval['department'] = $_POST['department']; 
    190     $sqlval['login_id'] = $_POST['login_id']; 
    191     if($_POST['password'] != DUMMY_PASS) { 
    192         $sqlval['password'] = sha1($_POST['password'] . ":" . AUTH_MAGIC); 
    193     } 
    194     $sqlval['authority'] = $_POST['authority']; 
    195     $sqlval['update_date'] = "now()"; 
    196     // UPDATEの実行 
    197     $where = "member_id = " . $id; 
    198     $ret = $oquery->update("dtb_member", $sqlval, $where); 
    199     return $ret; 
    200 } 
    201  
    202 /* DBからデータの読み込み */ 
    203 function fnGetMember($conn, $id) { 
    204     $sqlse = "SELECT name,department,login_id,authority FROM dtb_member WHERE member_id = ?"; 
    205     $ret = $conn->getAll($sqlse, Array($id)); 
    206     return $ret; 
    207 } 
     15$objPage = new LC_Page_Admin_System_Input_Ex(); 
     16$objPage->init(); 
     17$objPage->process(); 
     18register_shutdown_function(array($objPage, "destroy")); 
    20819?> 
Note: See TracChangeset for help on using the changeset viewer.