diff --git a/application/controllers/Reports.php b/application/controllers/Reports.php index 14b8458c1..c2e46dc3f 100644 --- a/application/controllers/Reports.php +++ b/application/controllers/Reports.php @@ -2,8 +2,6 @@ require_once ("Secure_area.php"); require_once (APPPATH."libraries/ofc-library/Open-flash-chart.php"); -define("FORM_WIDTH", "400"); - class Reports extends Secure_area { @@ -69,9 +67,9 @@ class Reports extends Secure_area $report_data = $model->getDataByReceivingId($receiving_id); - $summary_data = array(anchor('receivings/edit/'.$report_data['receiving_id'] . '/width:'.FORM_WIDTH, + $summary_data = array(anchor('receivings/edit/'.$report_data['receiving_id'], 'RECV '.$report_data['receiving_id'], - array('class' => 'modal')), + array('class' => 'modal-dlg modal-btn-submit')), $report_data['receiving_date'], $report_data['items_purchased'], $report_data['employee_name'], diff --git a/application/views/receivings/form.php b/application/views/receivings/form.php index 660bccb87..ac8ce3f17 100755 --- a/application/views/receivings/form.php +++ b/application/views/receivings/form.php @@ -47,17 +47,10 @@ 'comment','value'=>$receiving_info['comment'], 'id'=>'comment', 'class'=>'form-control input-sm'));?> - 'recvs_delete_form')); ?> - 'submit', - 'value'=>$this->lang->line('recvs_delete_entire_sale'), - 'class'=>'btn btn-danger btn-sm pull-right') - ); - ?> @@ -114,7 +107,8 @@ $(document).ready(function() // declare submitHandler as an object.. will be reused var submit_form = function() { - $(this).ajaxSubmit({ + $(this).ajaxSubmit( + { success:function(response) { dialog_support.hide(); @@ -126,6 +120,7 @@ $(document).ready(function() dataType:'json' }); }; + $('#recvs_edit_form').validate($.extend( { submitHandler : function(form) @@ -156,15 +151,14 @@ $(document).ready(function() invoice_number: 'lang->line("recvs_invoice_number_duplicate"); ?>' } }, dialog_support.error)); - + $('#recvs_delete_form').submit(function() { - var id = $("input[name='receiving_id']").val(); - $(this).ajaxSubmit( + if (confirm('lang->line("recvs_delete_confirmation"); ?>')) { - success:function(response) - { - if (confirm('lang->line("recvs_delete_confirmation"); ?>')) + var id = $("input[name='receiving_id']").val(); + $(this).ajaxSubmit({ + success: function(response) { dialog_support.hide(); set_feedback(response.message, 'alert alert-dismissible alert-success', false); @@ -177,14 +171,13 @@ $(document).ready(function() //Re-init sortable table as we removed a row update_sortable_table(); }); - } - return false; - }, - error: function(jqXHR, textStatus, errorThrown) { - set_feedback(textStatus, 'alert alert-dismissible alert-danger', true); - }, - dataType:'json' - }); + }, + error: function(jqXHR, textStatus, errorThrown) { + set_feedback(textStatus, 'alert alert-dismissible alert-danger', true); + }, + dataType:'json' + }); + } return false; }); });