Changeset 11059 for temp/branches


Ignore:
Timestamp:
2006/12/21 14:28:53 (19 years ago)
Author:
uehara
Message:
 
File:
1 edited

Legend:

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

    r11056 r11059  
    3535} else { 
    3636    $objPage->tpl_init = 'true';     
     37} 
     38 
     39switch($_POST['mode']) { 
     40 
     41case 'cart': 
     42    $objPage->arrErr = lfCheckError($_POST['product_id']); 
     43    if(count($objPage->arrErr) == 0) { 
     44        $objCartSess = new SC_CartSession(); 
     45        $classcategory_id = "classcategory_id". $_POST['product_id']; 
     46        $classcategory_id1 = $_POST[$classcategory_id. '_1']; 
     47        $classcategory_id2 = $_POST[$classcategory_id. '_2']; 
     48        $quantity = "quantity". $_POST['product_id']; 
     49        // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç 
     50        if(!$objPage->tpl_classcat_find1[$_POST['product_id']]) { 
     51            $classcategory_id1 = '0'; 
     52        } 
     53        // µ¬³Ê2¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç 
     54        if(!$objPage->tpl_classcat_find2[$_POST['product_id']]) { 
     55            $classcategory_id2 = '0'; 
     56        } 
     57        $objCartSess->setPrevURL($_SERVER['REQUEST_URI']); 
     58        $objCartSess->addProduct(array($_POST['product_id'], $classcategory_id1, $classcategory_id2), $_POST[$quantity]); 
     59        header("Location: " . URL_CART_TOP); 
     60        exit; 
     61    } 
     62    break; 
     63default : 
     64    break; 
    3765} 
    3866 
     
    251279} 
    252280 
     281/* ÆþÎÏÆâÍÆ¤Î¥Á¥§¥Ã¥¯ */ 
     282function lfCheckError($id) { 
     283    global $objPage; 
     284     
     285    // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£ 
     286    $objErr = new SC_CheckError(); 
     287     
     288    $classcategory_id1 = "classcategory_id". $id. "_1"; 
     289    $classcategory_id2 = "classcategory_id". $id. "_2"; 
     290    $quantity = "quantity". $id; 
     291    // Ê£¿ô¹àÌÜ¥Á¥§¥Ã¥¯ 
     292    if ($objPage->tpl_classcat_find1[$id]) { 
     293        $objErr->doFunc(array("µ¬³Ê1", $classcategory_id1, INT_LEN), array("EXIST_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 
     294    } 
     295    if ($objPage->tpl_classcat_find2[$id]) { 
     296        $objErr->doFunc(array("µ¬³Ê2", $classcategory_id2, INT_LEN), array("EXIST_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 
     297    } 
     298    $objErr->doFunc(array("¸Ä¿ô", $quantity, INT_LEN), array("EXIST_CHECK", "ZERO_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 
     299             
     300    return $objErr->arrErr; 
     301} 
     302 
    253303// ¹ØÆþÀ©¸Â¿ô¤ÎÀßÄê 
    254304function lfGetSaleLimit($product) { 
Note: See TracChangeset for help on using the changeset viewer.