Fucking fuck fuck
This commit is contained in:
parent
0757962b8c
commit
fdee1dd0df
|
|
@ -37,6 +37,8 @@ class ShipmentsController extends AppController {
|
|||
function ajax_edit() {
|
||||
$this->layout = 'ajax';
|
||||
if(!empty($this->data)) {
|
||||
$this->Shipment->create();
|
||||
|
||||
if ($this->Shipment->save($this->data)) {
|
||||
echo "SUCCESS";
|
||||
}
|
||||
|
|
@ -48,12 +50,26 @@ class ShipmentsController extends AppController {
|
|||
}
|
||||
else {
|
||||
echo "NO-DATA";
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function ajax_add() {
|
||||
$this->layout = 'ajax';
|
||||
|
||||
|
||||
$this->Shipment->create();
|
||||
|
||||
if ($this->Shipment->save($this->data)) {
|
||||
echo "SUCCESS";
|
||||
}
|
||||
else {
|
||||
echo "FAILURE";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Moved the Views for Adding/Editing to elements. Called from the Index.
|
||||
*
|
||||
|
|
|
|||
0
views/shipments/ajax_add.ctp
Normal file
0
views/shipments/ajax_add.ctp
Normal file
|
|
@ -13,7 +13,7 @@ $(function() {
|
|||
"New Shipment": function() {
|
||||
var thisShipmentInputs = $('#ShipmentAddForm').find('input,select,textarea');
|
||||
|
||||
$.post('/shipments/ajax_edit', thisShipmentInputs, function(data) {
|
||||
$.post('/shipments/ajax_add', thisShipmentInputs, function(data) {
|
||||
$( "#dialog-form" ).dialog('close');
|
||||
//window.location.reload(); //Change this to fetch a new copy of the table and update a <div>.
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue