1 | <?php |
---|
2 | /* |
---|
3 | * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved. |
---|
4 | * |
---|
5 | * http://www.lockon.co.jp/ |
---|
6 | */ |
---|
7 | require_once("../require.php"); |
---|
8 | |
---|
9 | class LC_Page { |
---|
10 | var $arrSession; |
---|
11 | var $body; |
---|
12 | var $list_data; |
---|
13 | |
---|
14 | function LC_Page() { |
---|
15 | $this->tpl_mainpage = 'mail/preview.tpl'; |
---|
16 | } |
---|
17 | } |
---|
18 | |
---|
19 | //---- ¥Ú¡¼¥¸½é´üÀßÄê |
---|
20 | $conn = new SC_DBConn(); |
---|
21 | $objPage = new LC_Page(); |
---|
22 | $objView = new SC_AdminView(); |
---|
23 | $objSess = new SC_Session(); |
---|
24 | $objDate = new SC_Date(); |
---|
25 | |
---|
26 | // ǧ¾Ú²ÄÈݤÎȽÄê |
---|
27 | sfIsSuccess($objSess); |
---|
28 | |
---|
29 | |
---|
30 | if ( $_POST['body'] ){ |
---|
31 | $objPage->body = $_POST['body']; |
---|
32 | |
---|
33 | // HTML¥á¡¼¥ë¥Æ¥ó¥×¥ì¡¼¥È¤Î¥×¥ì¥Ó¥å¡¼ |
---|
34 | } elseif ($_REQUEST["method"] == "template" && sfCheckNumLength($_REQUEST['id'])) { |
---|
35 | |
---|
36 | $sql = "SELECT * FROM dtb_mailmaga_template WHERE template_id = ?"; |
---|
37 | $result = $conn->getAll($sql, array($_REQUEST["id"])); |
---|
38 | $objPage->list_data = $result[0]; |
---|
39 | |
---|
40 | //¥á¡¼¥ëôÅö¼Ì¿¿¤Îɽ¼¨ |
---|
41 | $objUpFile = new SC_UploadFile(IMAGE_TEMP_URL, IMAGE_SAVE_URL); |
---|
42 | $objUpFile->addFile("¥á¡¼¥ëôÅö¼Ì¿¿", 'charge_image', array('jpg'), IMAGE_SIZE, true, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); |
---|
43 | $objUpFile->setDBFileList($objPage->list_data); |
---|
44 | // FormÍÑÇÛÎó¤òÅϤ¹¡£ |
---|
45 | $objPage->arrFile = $objUpFile->getFormFileList(IMAGE_TEMP_URL, IMAGE_SAVE_URL); |
---|
46 | |
---|
47 | // ¥á¥¤¥ó¾¦ÉʤξðÊó¼èÆÀ |
---|
48 | $sql = "SELECT name, main_image, point_rate, deliv_fee, price01_min, price01_max, price02_min, price02_max FROM vw_products_allclass AS allcls WHERE product_id = ?"; |
---|
49 | $main = $conn->getAll($sql, array($objPage->list_data["main_product_id"])); |
---|
50 | $objPage->list_data["main"] = $main[0]; |
---|
51 | |
---|
52 | // ¥µ¥Ö¾¦ÉʤξðÊó¼èÆÀ |
---|
53 | $sql = "SELECT product_id, name, main_list_image, price01_min, price01_max, price02_min, price02_max FROM vw_products_allclass WHERE product_id = ?"; |
---|
54 | $k = 0; |
---|
55 | $l = 0; |
---|
56 | for ($i = 1; $i <= 12; $i ++) { |
---|
57 | if ($l == 4) { |
---|
58 | $l = 0; |
---|
59 | $k ++; |
---|
60 | } |
---|
61 | $result = ""; |
---|
62 | $j = sprintf("%02d", $i); |
---|
63 | if ($i > 0 && $i < 5 ) $k = 0; |
---|
64 | if ($i > 4 && $i < 9 ) $k = 1; |
---|
65 | if ($i > 8 && $i < 13 ) $k = 2; |
---|
66 | |
---|
67 | if (is_numeric($objPage->list_data["sub_product_id" .$j])) { |
---|
68 | $result = $conn->getAll($sql, array($objPage->list_data["sub_product_id" .$j])); |
---|
69 | $objPage->list_data["sub"][$k][$l] = $result[0]; |
---|
70 | $objPage->list_data["sub"][$k]["data_exists"] = "OK"; //Åö³ºÃʤ˥ǡ¼¥¿¤¬£±¤Ä°Ê¾å¸ºß¤¹¤ë¥Õ¥é¥° |
---|
71 | } |
---|
72 | $l ++; |
---|
73 | } |
---|
74 | $objPage->tpl_mainpage = 'mail/html_template.tpl'; |
---|
75 | |
---|
76 | } elseif ( sfCheckNumLength($_GET['send_id']) || sfCheckNumLength($_GET['id'])){ |
---|
77 | if (is_numeric($_GET["send_id"])) { |
---|
78 | $id = $_GET["send_id"]; |
---|
79 | $sql = "SELECT body, mail_method FROM dtb_send_history WHERE send_id = ?"; |
---|
80 | } else { |
---|
81 | $sql = "SELECT body, mail_method FROM dtb_mailmaga_template WHERE template_id = ?"; |
---|
82 | $id = $_GET['id']; |
---|
83 | } |
---|
84 | $result = $conn->getAll($sql, array($id)); |
---|
85 | |
---|
86 | |
---|
87 | if ( $result ){ |
---|
88 | if ( $result[0]["mail_method"] == 2 ){ |
---|
89 | // ¥Æ¥¥¹¥È·Á¼°¤Î»þ¤Ï¥¿¥°Ê¸»ú¤ò¥¨¥¹¥±¡¼¥× |
---|
90 | $objPage->escape_flag = 1; |
---|
91 | } |
---|
92 | $objPage->body = $result[0]["body"]; |
---|
93 | } |
---|
94 | |
---|
95 | } |
---|
96 | |
---|
97 | $objView->assignobj($objPage); |
---|
98 | $objView->display($objPage->tpl_mainpage); |
---|
99 | |
---|
100 | ?> |
---|