| 1 | <?php |
|---|
| 2 | /** |
|---|
| 3 | * ¥â¥Ð¥¤¥ë¥µ¥¤¥È/¤´ÍøÍѵ¬Ìó |
|---|
| 4 | */ |
|---|
| 5 | |
|---|
| 6 | require_once('../require.php'); |
|---|
| 7 | |
|---|
| 8 | class LC_Page { |
|---|
| 9 | function LC_Page() { |
|---|
| 10 | /** ɬ¤ºÊѹ¹¤¹¤ë **/ |
|---|
| 11 | $this->tpl_mainpage = 'guide/kiyaku.tpl'; // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È |
|---|
| 12 | $this->tpl_title = '¤´ÍøÍѵ¬Ìó'; |
|---|
| 13 | } |
|---|
| 14 | } |
|---|
| 15 | |
|---|
| 16 | $objPage = new LC_Page(); |
|---|
| 17 | |
|---|
| 18 | // ¥ì¥¤¥¢¥¦¥È¥Ç¥¶¥¤¥ó¤ò¼èÆÀ |
|---|
| 19 | $objPage = sfGetPageLayout($objPage, false, DEF_LAYOUT); |
|---|
| 20 | |
|---|
| 21 | // ÍøÍѵ¬Ìó¤ò¼èÆÀ¤¹¤ë¡£ |
|---|
| 22 | lfGetKiyaku(intval(@$_GET['page']), $objPage); |
|---|
| 23 | |
|---|
| 24 | $objView = new SC_SiteView(); |
|---|
| 25 | $objView->assignobj($objPage); |
|---|
| 26 | $objView->display(SITE_FRAME); |
|---|
| 27 | |
|---|
| 28 | //----------------------------------------------------------------------------------------------------------------------------------- |
|---|
| 29 | |
|---|
| 30 | /** |
|---|
| 31 | * ÍøÍѵ¬Ìó¤ò¼èÆÀ¤·¡¢¥Ú¡¼¥¸¥ª¥Ö¥¸¥§¥¯¥È¤Ë³ÊǼ¤¹¤ë¡£ |
|---|
| 32 | * |
|---|
| 33 | * @param integer $index µ¬Ìó¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹ |
|---|
| 34 | * @param object &$objPage ¥Ú¡¼¥¸¥ª¥Ö¥¸¥§¥¯¥È |
|---|
| 35 | * @return void |
|---|
| 36 | */ |
|---|
| 37 | function lfGetKiyaku($index, &$objPage) |
|---|
| 38 | { |
|---|
| 39 | $objQuery = new SC_Query(); |
|---|
| 40 | $objQuery->setorder('rank DESC'); |
|---|
| 41 | $arrRet = $objQuery->select('kiyaku_title, kiyaku_text', 'dtb_kiyaku', 'del_flg <> 1'); |
|---|
| 42 | |
|---|
| 43 | $number = count($arrRet); |
|---|
| 44 | if ($number > 0) { |
|---|
| 45 | $last = $number - 1; |
|---|
| 46 | } else { |
|---|
| 47 | $last = 0; |
|---|
| 48 | } |
|---|
| 49 | |
|---|
| 50 | if ($index < 0) { |
|---|
| 51 | $index = 0; |
|---|
| 52 | } elseif ($index > $last) { |
|---|
| 53 | $index = $last; |
|---|
| 54 | } |
|---|
| 55 | |
|---|
| 56 | $objPage->tpl_kiyaku_title = @$arrRet[$index]['kiyaku_title']; |
|---|
| 57 | $objPage->tpl_kiyaku_text = @$arrRet[$index]['kiyaku_text']; |
|---|
| 58 | $objPage->tpl_kiyaku_index = $index; |
|---|
| 59 | $objPage->tpl_kiyaku_last_index = $last; |
|---|
| 60 | $objPage->tpl_kiyaku_is_first = $index <= 0; |
|---|
| 61 | $objPage->tpl_kiyaku_is_last = $index >= $last; |
|---|
| 62 | } |
|---|
| 63 | ?> |
|---|