Changeset 19353


Ignore:
Timestamp:
2010/11/07 01:47:20 (13 years ago)
Author:
kishik
Message:

商品一覧での公開/非公開変更

Location:
branches/camp/camp-2_5-C/data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/camp/camp-2_5-C/data/Smarty/templates/admin/products/index.tpl

    r19350 r19353  
    222222          <!--{$arrProducts[cnt].price02_min|number_format}--><br />~ <!--{$arrProducts[cnt].price02_max|number_format}--> 
    223223        <!--{else}--> 
    224           <input type="text" name="price02_edit_<!--{$arrProducts[cnt].product_id}-->" size="8" value="<!--{$arrProducts[cnt].price02_min}-->" onchange="jQuery.post('./index.php', {'mode':'price02_edit','price02_edit_id':'<!--{$arrProducts[cnt].product_id}-->','price02_edit_value':this.value}, function(result){if(result!='ok'){alert('エラー:変更できませんでした');};});""> 
     224          <input type="text" name="price02_edit_<!--{$arrProducts[cnt].product_id}-->" size="8" value="<!--{$arrProducts[cnt].price02_min}-->" onchange="jQuery.post('./index.php', {'mode':'price02_edit','price02_edit_id':'<!--{$arrProducts[cnt].product_id}-->','price02_edit_value':this.value}, function(result){if(result!='ok'){alert('エラー:変更できませんでした');};});"> 
    225225        <!--{/if}--> 
    226226      </td> 
     
    236236            無制限 
    237237          <!--{else}--> 
    238             <input type="text" name="stock_edit_<!--{$arrProducts[cnt].product_id}-->" size="8" value="<!--{$arrProducts[cnt].stock_min}-->" onchange="jQuery.post('./index.php', {'mode':'stock_edit','stock_edit_id':'<!--{$arrProducts[cnt].product_id}-->','stock_edit_value':this.value}, function(result){if(result!='ok'){alert('エラー:変更できませんでした');};});""> 
     238            <input type="text" name="stock_edit_<!--{$arrProducts[cnt].product_id}-->" size="8" value="<!--{$arrProducts[cnt].stock_min}-->" onchange="jQuery.post('./index.php', {'mode':'stock_edit','stock_edit_id':'<!--{$arrProducts[cnt].product_id}-->','stock_edit_value':this.value}, function(result){if(result!='ok'){alert('エラー:変更できませんでした');};});"> 
    239239          <!--{/if}--> 
    240240        <!--{/if}--> 
     
    243243      <!--{assign var=key value=$arrProducts[cnt].status}--> 
    244244      <td rowspan="2"> 
    245         <select name="status"> 
     245        <select name="status" onchange="jQuery.post('./index.php', {'mode':'status_edit','status_edit_id':'<!--{$arrProducts[cnt].product_id}-->','status_edit_value':this.value}, function(result){if(result!='ok'){alert('エラー:変更できませんでした');};});"> 
    246246          <option value="1"<!--{if $arrDISP[$key]=='公開'}--> selected<!--{/if}-->>公開</option> 
    247247          <option value="2"<!--{if $arrDISP[$key]=='非公開'}--> selected<!--{/if}-->>非公開</option> 
  • branches/camp/camp-2_5-C/data/class/pages/admin/products/LC_Page_Admin_Products.php

    r19337 r19353  
    133133            $where = "product_id=" . $_POST['stock_edit_id']; 
    134134            $objQuery->update("dtb_products_class", $data, $where); 
     135            if($objQuery->isError()) 
     136            { 
     137                $err_flag = true; 
     138            } 
     139 
     140            //トランザクション終了 
     141            if($err_flag) 
     142            { 
     143                $objQuery->rollback(); 
     144                echo("error"); 
     145            } 
     146            else 
     147            { 
     148                $objQuery->commit(); 
     149                echo("ok"); 
     150            } 
     151            //戻る 
     152            exit; 
     153        } 
     154 
     155        // 商品一覧での公開/非公開変更 
     156        if($_POST['mode'] === "status_edit") { 
     157            $objQuery = new SC_Query(); 
     158 
     159            //トランザクション開始 
     160            $objQuery->begin(); 
     161            //エラーフラグ初期化 
     162            $err_flag = false; 
     163 
     164            // データ更新 
     165            $data["status"] = $_POST['status_edit_value']; 
     166            $where = "product_id=" . $_POST['status_edit_id']; 
     167            $objQuery->update("dtb_products", $data, $where); 
    135168            if($objQuery->isError()) 
    136169            { 
Note: See TracChangeset for help on using the changeset viewer.