/**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $conn = new SC_DBConn();
     $objView = new SC_AdminView();
     $objSess = new SC_Session();
     // 認証可否の判定
     SC_Utils_Ex::sfIsSuccess($objSess);
     if (!isset($_GET['mode'])) {
         $_GET['mode'] = "";
     }
     if (!isset($_GET['id'])) {
         $_GET['id'] = "";
     }
     if ($_GET['mode'] == "delete" && SC_Utils_Ex::sfCheckNumLength($_GET['id']) === true) {
         // メール担当の画像があれば削除しておく
         $sql = "SELECT charge_image FROM dtb_mailmaga_template WHERE template_id = ?";
         $result = $conn->getOne($sql, array($_GET["id"]));
         if (strlen($result) > 0) {
             @unlink(IMAGE_SAVE_DIR . $result);
         }
         // 登録削除
         $sql = "UPDATE dtb_mailmaga_template SET del_flg = 1 WHERE template_id = ?";
         $conn->query($sql, array($_GET['id']));
         $this->reload(null, true);
     }
     $sql = "SELECT *, create_date as disp_date FROM dtb_mailmaga_template WHERE del_flg = 0 ORDER BY create_date DESC";
     $this->list_data = $conn->getAll($sql);
     $this->list_data['disp_date'] = substr($this->list_data['disp_date'], 0, 19);
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
 function lfRegistData($array, $arrRegistColumn, &$objCustomer)
 {
     $objConn = new SC_DBConn();
     foreach ($arrRegistColumn as $data) {
         if (strlen($array[$data["column"]]) > 0) {
             $arrRegist[$data["column"]] = $array[$data["column"]];
         }
     }
     $arrRegist['customer_id'] = $objCustomer->getvalue('customer_id');
     //-- 編集登録実行
     $objConn->query("BEGIN");
     if ($array['other_deliv_id'] != "") {
         $objConn->autoExecute("dtb_other_deliv", $arrRegist, "other_deliv_id=" . SC_Utils_Ex::sfQuoteSmart($array["other_deliv_id"]));
     } else {
         $objConn->autoExecute("dtb_other_deliv", $arrRegist);
         $sqlse = "SELECT max(other_deliv_id) FROM dtb_other_deliv WHERE customer_id = ?";
         $array['other_deliv_id'] = $objConn->getOne($sqlse, array($arrRegist['customer_id']));
     }
     $objConn->query("COMMIT");
     return $array['other_deliv_id'];
 }