updated server side check item description and packaging quantity persist

This commit is contained in:
Jackk Goh
2018-03-28 12:20:47 +08:00
parent c14bb2b613
commit 5a1ade378a
16 changed files with 45 additions and 8 deletions
@@ -164,7 +164,25 @@ var TableDatatablesEditable = function() {
ignore: [],
errorElement: 'span',
errorClass: 'help-block help-block-error',
focusInvalid: false,
focusInvalid: false,
rules: {
description: {
required: true,
},
packaging_quantity: {
required: true,
},
messages: {
description: {
required: "You must choose description to proceed",
},
packaging_quantity: {
required: "You must choose package quantity to proceed",
},
},
errorPlacement: function(error, element) { // render error placement for each input type
error.insertAfter(element); // for other inputs, just perform default behavior
},
@@ -622,11 +640,18 @@ var FormWizard = function() {
}
});
} else {
$("#finish").show();
$("#wait").hide();
//$("#suksesupdate").show();
$("#gagalupdate").show();
}
else if (e.status === 403){
$("#finish").show();
$("#wait").hide();
//$("#suksesupdate").show();
alert(e.responseText);
}
else {
$("#finish").show();
$("#wait").hide();
//$("#suksesupdate").show();
$("#gagalupdate").show();
}
}
+2
View File
@@ -0,0 +1,2 @@
Time : 18:20:59
SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/Applications/AMPPS/var/mysql.sock' (2)
+2 -2
View File
@@ -315,10 +315,10 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3">Quantity <span class="required"> * </span>
<label class="control-label col-md-3">Quantity </span>
</label>
<div class="col-md-6">
<input type="number" class="form-control int" id="quantity" name="quantity" placeholder="4" required>
<input type="number" class="form-control int" id="quantity" name="quantity" placeholder="4">
</div>
</div>
<div class="form-group">
+10
View File
@@ -312,6 +312,16 @@ function the_so(){
foreach ($shippingorderitems as $key => $shippingorderitem) {
# check reqired description and quantity
if ( $shippingorderitem['description'] == "" ){
return new Response("Please make sure all your item have a description", 403);
}
if ( $shippingorderitem['packaging_quantity'] == "") {
return new Response("Please make sure all your item have a quantity", 403);
}
$db->bind("description", $shippingorderitem['description']);
$db->bind("model_no", $shippingorderitem['model_no']);
$db->bind("brand_no", $shippingorderitem['brand_no']);
Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB