时间:2021-07-01 10:21:17 帮助过:23人阅读
_modelExample1=& FLEA::getSingleton('Model_Renwu_caidanguanli'); $this->_modelExample2=& FLEA::getSingleton('Model_Renwu_baoxiangguanli'); } function actiondiancai() { $this->authCheck('9-3'); $this->_edit($row); } function _edit($arr) { $title='菜品点选'; /* 执行数据库操作 */ /* 数据库查询语句 */ $sql="select * from renwu_caidanguanli where shoumaizhuangtai='出售'"; $class_info1=$this->_modelExample1->findBySql($sql); $temp= $this->_modelExample1->execute($sql); /* 显示数据 */ $smarty = & $this->_getView(); /* 后加的一句 作用不详 */ $smarty->assign('class_info1',$class_info1); /* 显示该网页模板 */ //$smarty->display("Renwu/caidanguanli.tpl"); $title='包厢点选'; /* 执行数据库操作 */ /* 数据库查询语句 */ $sql="select * from renwu_baoxiangguanli where baoxiangzhuangtai='空闲中'"; $class_info2=$this->_modelExample2->findBySql($sql); $temp= $this->_modelExample2->execute($sql); /* 显示数据 */ $smarty = & $this->_getView(); /* 后加的一句 作用不详 */ $smarty->assign('class_info2',$class_info2); /* 显示该网页模板 */ $smarty->display("Renwu/diancai.tpl"); } function actionChange(){ //根据选择菜品 $b=0; $sql="select caipindanjia from renwu_caidanguanli where id='{$_POST['isOver1']}'"; // dump($sql); //$this->_modelExample->execute($sql); $temp= $this->_modelExample1->findBySql($sql); // dump($temp);exit; $a=$temp[0]['caipindanjia']; $b=$b+$a; dump($b);exit; //临时菜品价格表 //$sql="update renwu_baoxiangguanli set jiesuan='$a' where id='{$_POST['isOver1']}'"; //$temp= $this->_modelExample1->execute($sql); $sql="update renwu_baoxiangguanli set baoxiangzhuangtai='使用中' where id='{$_POST['isOver2']}'"; //$this->_modelExample->execute($sql); $temp= $this->_modelExample2->execute($sql); //$sql="delete from renwu_caidanguanli where id='{$_POST['isDel']}'"; //$this->_modelExample->execute($sql); //$temp= $this->_modelExample->execute($sql); if($temp){ js_alert(null,"window.parent.showMsg('保存成功!')",$this->_url('diancai')); }//else die('保存失败!'); }}?>
点此菜品
菜品应能多选
查询时
$sql="select caipindanjia from renwu_caidanguanli where id in (" . join(',', $_POST['isOver1']) . ")";
包厢 似应为单选钮。
复选钮也行,但是最下面的有效。容易产生纠纷
点此菜品
菜品应能多选
查询时
$sql="select caipindanjia from renwu_caidanguanli where id in (" . join(',', $_POST['isOver1']) . ")";
包厢 似应为单选钮。
复选钮也行,但是最下面的有效。容易产生纠纷
点此菜品
菜品应能多选
查询时
$sql="select caipindanjia from renwu_caidanguanli where id in (" . join(',', $_POST['isOver1']) . ")";
包厢 似应为单选钮。
复选钮也行,但是最下面的有效。容易产生纠纷