Changeset 13452


Ignore:
Timestamp:
2007/05/25 15:17:41 (17 years ago)
Author:
kakinaka
Message:

GDライブラリがインストールされていない場合はグラフ出力を行わないように修正。

Location:
branches/rel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/rel/data/Smarty/templates/admin/total/index.tpl

    r12157 r13452  
    170170                                <table width="740" border="0" cellspacing="0" cellpadding="0" summary=" "> 
    171171                                    <tr><td height="15"></td></tr> 
     172                                    <!--{if $install_GD}--> 
    172173                                    <tr> 
    173174                                        <td align="center"> 
     
    177178                                    </tr> 
    178179                                    <tr><td height="15"></td></tr> 
    179                                 </table> 
    180                                 <!--{* ¥°¥é¥Õɽ¼¨ *}-->      
     180                                    <!--{/if}--> 
     181                                </table> 
     182                                <!--{* ¥°¥é¥Õɽ¼¨ *}-->          
    181183                                <table width="840" border="0" cellspacing="0" cellpadding="0" summary=" "> 
    182184                                    <tr> 
  • branches/rel/html/admin/total/index.php

    r13449 r13452  
    1212require_once("./class/SC_GraphLine.php"); 
    1313require_once("./class/SC_GraphBar.php"); 
     14 
     15// GD¥é¥¤¥Ö¥é¥ê¤Î¥¤¥ó¥¹¥È¡¼¥ëȽÄê 
     16$install_GD = (function_exists("gd_info"))?true:false; 
    1417 
    1518class LC_Page { 
     
    104107                 
    105108        $page = $objFormParam->getValue('page'); 
     109         
    106110        switch($page) { 
    107111        // ¾¦ÉÊÊ̽¸·× 
     
    116120            } 
    117121            // ¸¡º÷·ë²Ì¤Î¼èÆÀ 
    118             $objPage = lfGetOrderProducts($type, $sdate, $edate, $objPage, true, $mode); 
     122            $objPage = lfGetOrderProducts($type, $sdate, $edate, $objPage, $install_GD, $mode); 
    119123            break; 
    120124        // ¿¦¶ÈÊ̽¸·× 
     
    129133            } 
    130134            // ¸¡º÷·ë²Ì¤Î¼èÆÀ 
    131             $objPage = lfGetOrderJob($type, $sdate, $edate, $objPage); 
     135            $objPage = lfGetOrderJob($type, $sdate, $edate, $objPage, $install_GD); 
    132136            break; 
    133137        // ²ñ°÷Ê̽¸·× 
     
    142146            } 
    143147            // ¸¡º÷·ë²Ì¤Î¼èÆÀ 
    144             $objPage = lfGetOrderMember($type, $sdate, $edate, $objPage); 
     148            $objPage = lfGetOrderMember($type, $sdate, $edate, $objPage, $install_GD); 
    145149            break; 
    146150        // ǯÂåÊ̽¸·× 
     
    156160            } 
    157161            // ¸¡º÷·ë²Ì¤Î¼èÆÀ 
    158             $objPage = lfGetOrderAge($type, $sdate, $edate, $objPage); 
     162            $objPage = lfGetOrderAge($type, $sdate, $edate, $objPage, $install_GD); 
    159163            break; 
    160164        // ´ü´ÖÊ̽¸·× 
     
    169173            } 
    170174            // ¸¡º÷·ë²Ì¤Î¼èÆÀ 
    171             $objPage = lfGetOrderTerm($type, $sdate, $edate, $objPage); 
     175            $objPage = lfGetOrderTerm($type, $sdate, $edate, $objPage, $install_GD); 
    172176             
    173177            break; 
     
    198202default: 
    199203    if(count($_GET) == 0) { 
    200         // ¥Ð¥Ã¥Á¥â¡¼¥É¤Î¾ì¹ç¤Î¤ß¼Â¹Ô¤¹¤ë 
     204        // ¥Ð¥Ã¥Á¥â¡¼¥É¤Î¾ì¹ç¤Î¤ß¼Â¹Ô¤¹¤ë¡ÊÅöÆü¤Î½¸·×¤ò¹Ô¤¦¤¿¤á¡Ë 
    201205        if(DAILY_BATCH_MODE) { 
    202206            // 3ÆüÁ°¤Þ¤Ç¤Î½¸·× 
     
    206210    break; 
    207211} 
     212 
     213 
     214$objPage->install_GD = $install_GD; 
    208215 
    209216// ÅÐÏ¿¡¦¹¹¿·Æü¸¡º÷ÍÑ 
     
    616623function lfGetOrderProducts($type, $sdate, $edate, $objPage, $graph = true, $mode = "") { 
    617624    list($where, $arrval) = lfGetWhereMember('create_date', $sdate, $edate, $type); 
    618      
     625     
    619626    $where .= " and del_flg=0 and status <> " . ORDER_CANCEL; 
    620      
    621     $sql = "SELECT T1.product_id, T1.product_code, T1.product_name, T1.products_count, T1.order_count, T1.price, T1.total "; 
     627     
     628    $sql = "SELECT T1.product_id, T1.product_code, T1.product_name as name, T1.products_count, T1.order_count, T1.price, T1.total "; 
    622629    $sql.= "FROM ( "; 
    623630    $sql.= "SELECT product_id, product_name, product_code, price, "; 
     
    653660     
    654661    $sql = "SELECT job, count(*) AS order_count, SUM(total) AS total, (AVG(total)) AS total_average "; 
    655     $sql.= "FROM dtb_customer AS T1 LEFT JOIN dtb_order AS T2 USING ( customer_id ) WHERE $where AND T2.del_flg = 0 and T2.status <> " . ORDER_CANCEL; 
     662    $sql.= "FROM dtb_customer AS T1 LEFT JOIN dtb_order AS T2 USING ( customer_id ) WHERE $where AND T2.del_flg = 0 and T2.status <> " . ORDER_CANCEL; 
    656663    $sql.= " GROUP BY job ORDER BY total DESC"; 
    657664     
    658665    $objQuery = new SC_Query(); 
    659666    $objPage->arrResults = $objQuery->getall($sql, $arrval); 
    660              
     667     
    661668    $max = count($objPage->arrResults); 
    662669    for($i = 0; $i < $max; $i++) { 
Note: See TracChangeset for help on using the changeset viewer.