| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | require_once("../require.php"); |
|---|
| 4 | |
|---|
| 5 | class LC_Page{ |
|---|
| 6 | function LC_Page(){ |
|---|
| 7 | $this->tpl_mainpage = "mypage/delivery.tpl"; |
|---|
| 8 | $this->tpl_css = "/css/layout/mypage/delivery.css"; |
|---|
| 9 | $this->tpl_rightnavi = "frontparts/rightnavi.tpl"; |
|---|
| 10 | $this->tpl_title = "MY¥Ú¡¼¥¸/¤ªÆÏ¤±ÀèÄɲåÊѹ¹"; |
|---|
| 11 | $this->tpl_navi = 'mypage/navi.tpl'; |
|---|
| 12 | $this->tpl_mainno = 'mypage'; |
|---|
| 13 | $this->tpl_mypageno = 'delivery'; |
|---|
| 14 | global $arrPref; |
|---|
| 15 | $this->arrPref= $arrPref; |
|---|
| 16 | session_cache_limiter('private-no-expire'); |
|---|
| 17 | } |
|---|
| 18 | } |
|---|
| 19 | |
|---|
| 20 | $objPage = new LC_Page(); |
|---|
| 21 | $objView = new SC_SiteView(); |
|---|
| 22 | $objCustomer = new SC_Customer(); |
|---|
| 23 | $objQuery = new SC_Query(); |
|---|
| 24 | $objConn = new SC_DBConn(); |
|---|
| 25 | |
|---|
| 26 | //¥í¥°¥¤¥óȽÄê |
|---|
| 27 | if(!$objCustomer->isLoginSuccess()) { |
|---|
| 28 | sfDispSiteError(CUSTOMER_ERROR); |
|---|
| 29 | }else { |
|---|
| 30 | //¥Þ¥¤¥Ú¡¼¥¸¥È¥Ã¥×¸ÜµÒ¾ðÊóɽ¼¨ÍÑ |
|---|
| 31 | $objPage->CustomerName1 = $objCustomer->getvalue('name01'); |
|---|
| 32 | $objPage->CustomerName2 = $objCustomer->getvalue('name02'); |
|---|
| 33 | $objPage->CustomerPoint = $objCustomer->getvalue('point'); |
|---|
| 34 | } |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | // ¥ì¥¤¥¢¥¦¥È¥Ç¥¶¥¤¥ó¤ò¼èÆÀ |
|---|
| 38 | $objPage = sfGetPageLayout($objPage, false, "mypage/index.php"); |
|---|
| 39 | |
|---|
| 40 | //ºï½ü |
|---|
| 41 | if($_POST['mode'] == 'delete') { |
|---|
| 42 | //ÉÔÀµ¥¢¥¯¥»¥¹È½Äê |
|---|
| 43 | $flag = $objQuery->count("dtb_other_deliv", "customer_id=? AND other_deliv_id=?", array($objCustomer->getValue('customer_id'), $_POST['other_deliv_id'])); |
|---|
| 44 | if($flag > 0) { |
|---|
| 45 | //ºï½ü |
|---|
| 46 | $objQuery->delete("dtb_other_deliv", "other_deliv_id=?", array($_POST['other_deliv_id'])); |
|---|
| 47 | } else { |
|---|
| 48 | sfDispSiteError(CUSTOMER_ERROR); |
|---|
| 49 | } |
|---|
| 50 | } |
|---|
| 51 | |
|---|
| 52 | $objPage->tpl_pageno = $_POST['pageno']; |
|---|
| 53 | |
|---|
| 54 | $from = "dtb_other_deliv"; |
|---|
| 55 | $where = "customer_id=?"; |
|---|
| 56 | $arrval = array($objCustomer->getValue('customer_id')); |
|---|
| 57 | $order = "other_deliv_id DESC"; |
|---|
| 58 | |
|---|
| 59 | // ¥Ú¡¼¥¸Á÷¤ê¤Î½èÍý |
|---|
| 60 | //$page_max = SEARCH_PMAX; |
|---|
| 61 | |
|---|
| 62 | //¤ªÆÏ¤±ÀèÅÐÏ¿·ï¿ô¼èÆÀ |
|---|
| 63 | $linemax = $objQuery->count($from, $where, $arrval); |
|---|
| 64 | $objQuery->getlastquery(true); |
|---|
| 65 | |
|---|
| 66 | $objPage->tpl_linemax = $linemax; |
|---|
| 67 | /* |
|---|
| 68 | // ¥Ú¡¼¥¸Á÷¤ê¤Î¼èÆÀ |
|---|
| 69 | $objNavi = new SC_PageNavi($_POST['pageno'], $linemax, $page_max, "fnSearchPageNavi", NAVI_PMAX); |
|---|
| 70 | $objPage->tpl_strnavi = $objNavi->strnavi; // ɽ¼¨Ê¸»úÎó |
|---|
| 71 | $startno = $objNavi->start_row; |
|---|
| 72 | |
|---|
| 73 | // ¼èÆÀÈϰϤλØÄê(³«»Ï¹ÔÈֹ桢¹Ô¿ô¤Î¥»¥Ã¥È) |
|---|
| 74 | $objQuery->setlimitoffset($page_max, $startno); |
|---|
| 75 | */ |
|---|
| 76 | // ɽ¼¨½ç½ø |
|---|
| 77 | $objQuery->setorder($order); |
|---|
| 78 | |
|---|
| 79 | //Ê̤ΤªÆÏ¤±Àè¾ðÊóɽ¼¨ |
|---|
| 80 | $objPage->arrOtherDeliv = $objQuery->select("*", $from, $where, $arrval); |
|---|
| 81 | |
|---|
| 82 | $objQuery->getlastquery(true); |
|---|
| 83 | |
|---|
| 84 | //¤ªÆÏ¤±ÀèÅÐÏ¿¿ô¤ò¥Æ¥ó¥×¥ì¡¼¥È¤ËÅϤ¹ |
|---|
| 85 | $objPge->deliv_cnt = count($objPage->arrOtherDeliv); |
|---|
| 86 | |
|---|
| 87 | $objView->assignobj($objPage); |
|---|
| 88 | $objView->display(SITE_FRAME); |
|---|
| 89 | |
|---|
| 90 | //----------------------------------------------------------------------------------------------------------------------------------- |
|---|
| 91 | |
|---|
| 92 | ?> |
|---|