ecshop 发货人设置 select text ajax

效果

 

html

<script type="text/ecmascript">
function setfhr(id){
var sel=document.getElementsByName("fhr")[0];
var selvalue= sel.options[sel.options.selectedIndex].value;
if(selvalue){
Ajax.call('order.php', 'act=oedit&id=' + id+'&value='+selvalue, resetfhr, 'GET', 'JSON');
}

}
function resetfhr(res){
if(res){ alert("发货人已设置好!");}
}
</script>

 

PHP 

if ($_REQUEST['act'] == 'oedit'){
include_once(ROOT_PATH . 'includes/cls_json.php');
$json = new JSON();
$id = !empty($_REQUEST['id']) ? intval($_REQUEST['id']) : '0';
$value = !empty($_REQUEST['value']) ? $_REQUEST['value'] : '';

$sql="update ".$ecs->table('order_info')." set fhr='$value' where order_id=$id";
$a=$db->query($sql);
die($json->encode($a));
}

更新精彩教程 可以去 http://www.suixinw.com 

二次开发可联系:QQ1595192997

posted @ 2013-08-26 15:48  随心^_^  阅读(260)  评论(0)    收藏  举报