<?php
class transportfacilityMgmt
{
	public $transport_id;
	public $student_id;
	public $transport_facility;
	public $hostel_admdate;
	public $hostel_candate;
	public $updown_strdate;
	public $updown_enddate;
	public $createdon;
	



	function Add()
	{

        global $SQLDateFormat;
		$Qry1 = "";
	//	$Qry1 .= "transport_id ='" . Escape($this->transport_id) . "',";
		$Qry1 .= "student_id ='" . Escape($this->student_id) . "',";
		$Qry1 .= "transport_facility ='" . Escape($this->transport_facility) . "',";
        $Qry1 .= "hostel_admdate = STR_TO_DATE('" . Escape($this->hostel_admdate) . "','$SQLDateFormat'),";
		$Qry1 .= "hostel_candate = STR_TO_DATE('" . Escape($this->hostel_candate) . "','$SQLDateFormat'),";
        $Qry1 .= "updown_strdate = STR_TO_DATE('" . Escape($this->updown_strdate) . "','$SQLDateFormat'),";
        $Qry1 .= "updown_enddate = STR_TO_DATE('" . Escape($this->updown_enddate) . "','$SQLDateFormat'),";
        $Qry1 .= "createdon = '" . Escape(date('Y-m-d h:i:s')) . "',";


		if ($Qry1 != "") {
			$Qry1 = substr($Qry1, 0, strlen($Qry1) - 1);
			$qry = "INSERT INTO cms_transportfacility SET " . $Qry1 . " ";
			//	echo $qry; exit;
			dbQuery($qry);
			$this->transport_id = dbInsertedId();
		}
	}

	function Edit()
	{
        global $SQLDateFormat;
		$Qry1 = "";
        $Qry1 .= "student_id ='" . Escape($this->student_id) . "',";
		$Qry1 .= "transport_facility ='" . Escape($this->transport_facility) . "',";
        $Qry1 .= "hostel_admdate = STR_TO_DATE('" . Escape($this->hostel_admdate) . "','$SQLDateFormat'),";
		$Qry1 .= "hostel_candate = STR_TO_DATE('" . Escape($this->hostel_candate) . "','$SQLDateFormat'),";
        $Qry1 .= "updown_strdate = STR_TO_DATE('" . Escape($this->updown_strdate) . "','$SQLDateFormat'),";
        $Qry1 .= "updown_enddate = STR_TO_DATE('" . Escape($this->updown_enddate) . "','$SQLDateFormat'),";
        $Qry1 .= "createdon = '" . Escape(date('Y-m-d h:i:s')) . "',";

        $Qry1 .= "createdon = '" . Escape(date('Y-m-d h:i:s')) . "',";

		if ($Qry1 != "") {
			$Qry1 = substr($Qry1, 0, strlen($Qry1) - 1);
			$qry = "UPDATE cms_transportfacility SET " . $Qry1 . " 
						WHERE student_id ='" . Escape($this->student_id) . "' ";


			dbQuery($qry);

			$this->studentdetail_id = dbInsertedId();
			//	echo  $qry; exit; 
		}
	}

	
}
?>