//failed $msg = "<div class='statusmsg'>Failed to activate record. Please try again.</div>"; $arr = array("msg" => $msg, "status" => 2, "batch_id" => $o->batch_id, "workflowbtn" => "none"); echo json_encode($arr); } break; case "update": $batchdate = $_POST['batchdate']; include_once "class/FinancialYearLine.php"; $fyl = new FinancialYearLine(); $allowtrans = $fyl->allowAccountTransactionInDate($defaultorganization_id, $batchdate); $o->period_id = $fyl->period_id; //$o->period_id = $o->checkPeriodID($batchdate); if ($o->period_id > 0 && $allowtrans == true) { //check period id $saveparent = $o->updateBatchAjax(); $nothingchange = strpos($o->failfeedback, "nothing"); if ($saveparent || $nothingchange !== false) { //success $msg = ""; $workflowbtn = $o->getListButton($o->batch_id); //show submit button $arr = array("msg" => $msg, "status" => 1, "batch_id" => $o->batch_id, "workflowbtn" => "{$workflowbtn}"); echo json_encode($arr); } else { //failed $msg = "<div class='statusmsg'>Failed to update record. Please try again.</div>"; $arr = array("msg" => $msg, "status" => 2, "batch_id" => $o->batch_id, "workflowbtn" => "none"); echo json_encode($arr); } } else {