Changeset 7943 for temp/trunk/data


Ignore:
Timestamp:
2006/11/09 09:55:22 (20 years ago)
Author:
kakinaka
Message:

blank

File:
1 edited

Legend:

Unmodified
Added
Removed
  • temp/trunk/data/downloads/module/mdl_epsilon/mdl_epsilon.php

    r7942 r7943  
    7171        } 
    7272         
    73         // DEL/INS¤ÇÅÐÏ¿¤¹¤ë¡£ 
    74         //$delsql = "DELETE FROM dtb_payment WHERE module_id = ?"; 
    75         //$objQuery->query($delsql, array(MDL_EPSILON_ID)); 
    76          
    7773        foreach($_POST["payment"] as $key => $val){ 
    78              
    7974            // ¥é¥ó¥¯¤ÎºÇÂçÃͤò¼èÆÀ¤¹¤ë 
    8075            $max_rank = $objQuery->getone("SELECT max(rank) FROM dtb_payment"); 
     
    124119            } 
    125120             
    126             $objQuery->update("dtb_payment", $arrData, " module_id = " . MDL_EPSILON_ID); 
     121            $arrData = lfGetPaymentDB(); 
     122            if(count($arrData) > 0){ 
     123                $objQuery->update("dtb_payment", $arrData, " module_id = " . MDL_EPSILON_ID); 
     124            }else{ 
     125                $objQuery->insert("dtb_payment", $arrData); 
     126            } 
    127127        } 
    128128     
     
    186186    global $objFormParam; 
    187187     
     188    //¥Ç¡¼¥¿¤ò¼èÆÀ 
     189    $arrRet = lfGetPaymentDB(); 
     190     
     191    // Ãͤò¥»¥Ã¥È 
     192    $objFormParam->setParam($arrRet[0]); 
     193 
     194    // ²èÌÌɽ¼¨ÍѤ˥ǡ¼¥¿¤òÊÑ´¹ 
     195    $arrDisp = array(); 
     196    foreach($arrRet as $key => $val){ 
     197        // ÍøÍÑ·èºÑ¤òɽ¼¨ÍѤËÊÑ´¹ 
     198        $arrDisp["payment"][$key] = $val["payment"]; 
     199         
     200        // ¥¯¥ì¥¸¥Ã¥È¤Î·èºÑ¶èʬ¤ò¼èÆÀ 
     201        if($val["payment"] == 1) $credit = $val["payment_code"]; 
     202         
     203        // ¥³¥ó¥Ó¥Ë 
     204        if($val["payment"] == 2) $arrDisp["convenience"] = $val["convenience"]; 
     205    } 
     206    $objFormParam->setParam($arrDisp); 
     207    $objFormParam->splitParamCheckBoxes("convenience"); 
     208     
     209    // ¥¯¥ì¥¸¥Ã¥È 
     210    if(substr($credit, 0, 1)) $arrCredit["credit"][] = 1; 
     211    if(substr($credit, 1, 1)) $arrCredit["credit"][] = 2; 
     212    $objFormParam->setParam($arrCredit); 
     213} 
     214 
     215// DB¤«¤é¥Ç¡¼¥¿¤ò¼èÆÀ¤¹¤ë 
     216function lfGetPaymentDB(){ 
     217    global $objQuery; 
     218     
     219    $arrRet = array(); 
    188220    $sql = "SELECT  
    189221                module_id,  
     
    196228    $arrRet = $objQuery->getall($sql, array(MDL_EPSILON_ID)); 
    197229     
    198     $objFormParam->setParam($arrRet[0]); 
    199  
    200     // ²èÌÌɽ¼¨ÍѤ˥ǡ¼¥¿¤òÊÑ´¹ 
    201     $arrDisp = array(); 
    202     foreach($arrRet as $key => $val){ 
    203         // ÍøÍÑ·èºÑ¤òɽ¼¨ÍѤËÊÑ´¹ 
    204         $arrDisp["payment"][$key] = $val["payment"]; 
    205          
    206         // ¥¯¥ì¥¸¥Ã¥È¤Î·èºÑ¶èʬ¤ò¼èÆÀ 
    207         if($val["payment"] == 1) $credit = $val["payment_code"]; 
    208          
    209         // ¥³¥ó¥Ó¥Ë 
    210         if($val["payment"] == 2) $arrDisp["convenience"] = $val["convenience"]; 
    211     } 
    212     $objFormParam->setParam($arrDisp); 
    213     $objFormParam->splitParamCheckBoxes("convenience"); 
    214      
    215     // ¥¯¥ì¥¸¥Ã¥È 
    216     if(substr($credit, 0, 1)) $arrCredit["credit"][] = 1; 
    217     if(substr($credit, 1, 1)) $arrCredit["credit"][] = 2; 
    218     $objFormParam->setParam($arrCredit); 
     230    return $arrRet; 
    219231} 
    220232 
Note: See TracChangeset for help on using the changeset viewer.