Ignore:
Timestamp:
2006/12/18 18:47:22 (20 years ago)
Author:
uehara
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • temp/branches/ec-cube-beta/html/campaign/default/index.php

    r10908 r10909  
    1717$objPage = new LC_Page(); 
    1818$objView = new SC_SiteView(false); 
     19$objQuery = new SC_Query(); 
    1920 
    2021// ¥Ç¥£¥ì¥¯¥È¥ê̾¤ò¼èÆÀ 
     
    2324$dir_name = $arrDir[count($arrDir) -1]; 
    2425 
    25 switch($_GET['status']) { 
    26     case 'active': 
    27         $status = CAMPAIGN_TEMPLATE_ACTIVE; 
    28         break; 
    29     case 'end': 
    30         $status = CAMPAIGN_TEMPLATE_END; 
    31         break; 
    32     default: 
    33         $status = CAMPAIGN_TEMPLATE_ACTIVE; 
    34         break; 
     26if(lfCheckLimitDate($dir_name)) { 
     27    $status = CAMPAIGN_TEMPLATE_ACTIVE; 
     28} else { 
     29    $status = CAMPAIGN_TEMPLATE_END; 
    3530} 
    3631 
     
    4035$objView->assignobj($objPage); 
    4136$objView->display($objPage->tpl_mainpage); 
     37 
     38 
     39//--------------------------------------------------------------------------------------------------------------------------------------------------------- 
     40/*  
     41 * ´Ø¿ô̾¡§lfCheckLimitDate() 
     42 * °ú¿ô1 ¡§¥Ç¥£¥ì¥¯¥È¥ê̾ 
     43 * ÀâÌÀ¡¡¡§¥­¥ã¥ó¥Ú¡¼¥óÃæ¤«¥Á¥§¥Ã¥¯ 
     44 * Ìá¤êÃÍ¡§¥­¥ã¥ó¥Ú¡¼¥óÃæ¤Ê¤é true ½ªÎ»¤Ê¤é false 
     45 */ 
     46function lfCheckLimitDate($directory_name) { 
     47     
     48    global $objQuery; 
     49     
     50    $col = "start_date,end_date"; 
     51    $arrRet = $objQuery->select($col, "dtb_campaign", "directory_name = ? AND del_flg = 0", array($directory_name)); 
     52 
     53    // ³«»ÏÆü»þ¡¦Ää»ßÆü»þ¤òʬ²ò 
     54    $start_date = (date("YmdHis" , strtotime($arrRet[0]['start_date']))); 
     55    $end_date = (date("YmdHis" , strtotime($arrRet[0]['end_date']))); 
     56    $now_date = (date("YmdHis")); 
     57     
     58    // ¥­¥ã¥ó¥Ú¡¼¥ó¤¬³«ºÅÃæ¤«¥Á¥§¥Ã¥¯ 
     59    if($now_date > $start_date && $now_date < $start_date) { 
     60        return true; 
     61    } 
     62         
     63    return false; 
     64} 
Note: See TracChangeset for help on using the changeset viewer.