<?php 
require "commonincludefiles.php";

if($_SESSION["VedantnrCollegeId"]!="" && isset($_SESSION["VedantnrCollegeId"]))
{
 	$objTTstandard = new TTStandardMgmt();

	$objTTstandard->school_id       = $_SESSION["VedantnrCollegeId"] ;
	$objTTstandard->working_days		= $_POST['tt_working_days'] ;

	$objTTstandard->periods_per_day = $_POST['tt_periods_per_day'] ;
	$objTTstandard->periods_lastday= $_POST['tt_periods_lastday'] ;

  $out = 	$objTTstandard->getAllRecords($limit=0,$start=0,$condition="",$order_field="",$order_type="");
  if(@dbRows($out)>0){
  	$objTTstandard -> edit();
  }
  else
  {

  	$objTTstandard -> add();
  }
  
	echo '{"success":"true"}';
}	         
?>