break; // gets info about requested period with period stats (done/not done) // gets info about requested period with period stats (done/not done) case 'set_period': $oper = $_REQUEST['oper']; $id = isset($_REQUEST['id']) ? $_REQUEST['id'] : -1; if ($oper == "edit") { if (isset($_REQUEST['budget'])) { // Campaign periods update $title = $_REQUEST['title']; $budget = $_REQUEST['budget']; $start_date = $_REQUEST['start_date']; $end_date = $_REQUEST['end_date']; $status = isset($_REQUEST['status']) ? $_REQUEST['status'] : 0; echo json_encode($periods->updateCampaignPeriod($id, $title, $budget, $start_date, $end_date, $status, $campaign)); } else { // Review period update, currently, only the edit of period title is available $title = $_REQUEST['title']; echo json_encode($periods->setTitle($id, $title)); } } break; case 'getLastPeriodClosureDate': $grid_type = $_REQUEST['grid_type']; $typeRC = "C"; if ($grid_type == "review") { $typeRC = "R"; } echo json_encode(array('max_end_date' => $periods->getLastPeriodClosureDate($typeRC))); break; }