Home > Mobile >  Form an array of problems
Form an array of problems

Time:12-01

 








The function tijiao (type) {
$(' # z_price). Val ($(' # s_z_price). Val ());
Var t=$(' # form22). SerializeArray ();

For (var item of t) {
The if (item name==="name" & amp; & Item. The value. Length & lt;=0) {
Alert (' the consignee can't be empty! ')
Return
} else if (item name==="mobile" & amp; & Item. The value. Length & lt;=0) {
Alert (' phone number can't for empty! ')
Return
} else if (item name==="address" & amp; & Item. The value. Length & lt;=0) {
Alert (' shipping address cannot be empty! ')
Return
}
}

$. Ajax ({
Url: "index.php? The module=orderslist& Action=the Modify,
"Type: "post",
Data: t,
Success: the function (res) {
Res=JSON. Parse (res)

If (res) status===0) {
Alert (res. Err)
} else {
Alert (" modify success!" );
Window. The history. The go (1);

}
}
});

}





The public function the execute () {
$db=DBAction: : getInstance ();
$request=$this - & gt; GetContext () - & gt; GetRequest ();
$m=$request - & gt; The getParameter (' m ');//order id
If ($m) {
$this - & gt; $m ();
}
$admin_id=$this - & gt; GetContext () - & gt; GetStorage () - & gt; Read (' admin_id ');
$name=addslashes (trim ($request - & gt; The getParameter (' name ')));
Mobile=$addslashes (trim ($request - & gt; The getParameter (" mobile ")));
$num=addslashes (trim ($request - & gt; The getParameter (' num)));

$size_bz=99;
$iddd=addslashes (trim ($request - & gt; The getParameter (" proid ")));
$sheng=addslashes (trim ($request - & gt; The getParameter (' Select1 ')));
$shi=addslashes (trim ($request - & gt; The getParameter (' Select2)));
$xian=addslashes (trim ($request - & gt; The getParameter (' Select3)));
$address=addslashes (trim ($request - & gt; The getParameter (" address ")));
$z_price=addslashes (trim ($request - & gt; The getParameter (' z_price)));
$r1=$db - & gt; Selectarray (' select G_CName from admin_cg_group where the GroupID='. $sheng);
$r1=$r1 [0] [' G_CName];
$r2=$db - & gt; Selectarray (' select G_CName from admin_cg_group where the GroupID='. $shi);
R2=$r2 [0] [' G_CName];
$r3=$db - & gt; Selectarray (' select G_CName from admin_cg_group where the GroupID='. $xian).
$r3=$r3 [0] [' G_CName];
$address=$r1. $r2. $r3. $address;
$sNo=addslashes (trim ($request - & gt; The getParameter (" id ")));
$sid=addslashes (trim ($request - & gt; The getParameter (' sid)));

$SQL=='. 'the update order set z_price $z_price.', name="'. $name. '," mobile="'. $mobile. '", address="'. $address. '" the where sNo="'. $sNo. '"';
$up=$db - & gt; The update ($SQL);


SQL=$' update order_details set size_bz='. $size_bz. ', num="'. $num. '" the where id="'. $iddd. '"';
$up=$db - & gt; The update ($SQL);




If ($up & gt;=0) {
$db - & gt; Admin_record ($admin_id, 'change order number for'. $sNo. 'information', 2);
Echo json_encode (array (' status'=& gt; 1, 'err=& gt; 'success'));
exit();
} else {
$db - & gt; Admin_record ($admin_id, 'change order number for'. $sNo. 'information' failure, 2);

Echo json_encode (array (' status'=& gt; 0, 'err=& gt; 'change failed! '));
exit();
}
}



Consult everybody, this why I enter can only be updated to one of the INPUT values, I want to update the,
Trouble to help see, should be how to write

CodePudding user response:

request bosses

CodePudding user response:

The name written knum []

CodePudding user response:

careful,,,
  • Related