<?php
//mansi
class AttachementMgmt
{
      public $student_id;
      public $college_id;
      public $last_marksheet;
      public $last_marksheetone;
      public $last_marksheettow;
      public $last_marksheetthree;
      public $twl_marksheet;
      public $twl_marksheetone;
      public $twl_marksheettwo;
      public $twl_marksheetthree;
      public $school_leaving;
      public $hsc_credit;
      public $cast_certificate;
      public $income_certi;
      public $add_proof;
      public $adhar_photo;
      public $character_certi;
      public $gap_certi;
      public $bank_passbook;
      public $graduation_marksheet;
      public $course_comp;
      public $midwifery_certi;
      public $conduct_certi;
      public $statecouncil_certi;
      public $councilrenewal_certi;
      public $sem1_marksheet;

      public $sem2_marksheet;
      public $sem3_marksheet;

      public $sem4_marksheet;
      public $sem5_marksheet;
      public $sem6_marksheet;
      public $gnm_marksheet1;
      public $gnm_marksheet2;
      public $gnm_marksheet3;
      public $gnm_marksheet4;
      public $gnm_marksheet5;
      public $gnm_marksheet6;
      public $gnm_marksheet7;
      public $gnm_marksheet8;
      public $gnm_marksheet9;
      public $gnm_marksheet10;
      public $gnm_marksheet11;
      public $gnm_marksheet12;
	  public $tenth_trial_certi;
	  public $twl_trial_certi;
	  public $addmission_order_certi;

      function getAllRecords($limit = 0, $start = 0, $condition = "", $order_field = "", $order_type = "")
      {
            $this->student_count = 0;

            $qry = "SELECT * FROM cms_attachement where 1=1 ";

            if ($condition != "") {
                  $qry .= $condition;
            }

            if ($order_field != "" && $order_type != "") {
                  $qry .= " order by $order_field $order_type";
            }

            if (intval($limit) > 0 && intval($start) >= 0) {
                  $qry .= " Limit $start , $limit";
            }

            $out = dbQuery($qry);

            if (dbRows($out) > 0) {
                  $this->student_count = dbRows($out);
				  return $out;
            }
			return $out;
      }
      function Add()
      {
            $Qry1 = "";
            $Qry1 .= "student_id ='" . Escape($this->student_id) . "',";
			$Qry1 .= "last_marksheet = '" . Escape($this->last_marksheet) . "',";
			$Qry1 .= "last_marksheetone = '" . Escape($this->last_marksheetone) . "',";
			$Qry1 .= "last_marksheettow = '" . Escape($this->last_marksheettow) . "',";
			$Qry1 .= "last_marksheetthree = '" . Escape($this->last_marksheetthree) . "',";
			$Qry1 .= "twl_marksheet = '" . Escape($this->twl_marksheet) . "',";
			$Qry1 .= "twl_marksheetone = '" . Escape($this->twl_marksheetone) . "',";
			$Qry1 .= "twl_marksheettwo = '" . Escape($this->twl_marksheettwo) . "',";
			$Qry1 .= "twl_marksheetthree = '" . Escape($this->twl_marksheetthree) . "',";
			$Qry1 .= "school_leaving = '" . Escape($this->school_leaving) . "',";
			$Qry1 .= "hsc_credit = '" . Escape($this->hsc_credit) . "',";
			$Qry1 .= "cast_certificate = '" . Escape($this->cast_certificate) . "',";
			$Qry1 .= "income_certi = '" . Escape($this->income_certi) . "',";
			$Qry1 .= "add_proof = '" . Escape($this->add_proof) . "',";
			$Qry1 .= "adhar_photo = '" . Escape($this->adhar_photo) . "',";
			$Qry1 .= "character_certi = '" . Escape($this->character_certi) . "',";
			$Qry1 .= "gap_certi = '" . Escape($this->gap_certi) . "',";
			$Qry1 .= "bank_passbook = '" . Escape($this->bank_passbook) . "',";
			$Qry1 .= "graduation_marksheet = '" . Escape($this->graduation_marksheet) . "',";
			$Qry1 .= "course_comp = '" . Escape($this->course_comp) . "',";
			$Qry1 .= "midwifery_certi = '" . Escape($this->midwifery_certi) . "',";
			$Qry1 .= "conduct_certi = '" . Escape($this->conduct_certi) . "',";
			$Qry1 .= "statecouncil_certi = '" . Escape($this->statecouncil_certi) . "',";
			$Qry1 .= "councilrenewal_certi = '" . Escape($this->councilrenewal_certi) . "',";
			$Qry1 .= "tenth_trial_certi = '" . Escape($this->tenth_trial_certi) . "',";
			$Qry1 .= "twl_trial_certi = '" . Escape($this->twl_trial_certi) . "',";
			$Qry1 .= "addmission_order_certi = '" . Escape($this->addmission_order_certi) . "',";
			
            if ($Qry1 != "") {
                  $Qry1 = substr($Qry1, 0, strlen($Qry1) - 1);
                  $qry = "INSERT INTO cms_attachement SET " . $Qry1 . " ";
				 
                  dbQuery($qry);
                  $this->student_id = dbInsertedId();
            }
      }
      function Edit()
      {
            $Qry1 = "";
            $Qry1 .= "student_id='" . Escape($this->student_id) . "',";
			$Qry1 .= "last_marksheet = '" . Escape($this->last_marksheet) . "',";
			$Qry1 .= "last_marksheetone = '" . Escape($this->last_marksheetone) . "',";
			$Qry1 .= "last_marksheettow = '" . Escape($this->last_marksheettow) . "',";
			$Qry1 .= "last_marksheetthree = '" . Escape($this->last_marksheetthree) . "',";
			$Qry1 .= "twl_marksheet = '" . Escape($this->twl_marksheet) . "',";
			$Qry1 .= "twl_marksheetone = '" . Escape($this->twl_marksheetone) . "',";
			$Qry1 .= "twl_marksheettwo = '" . Escape($this->twl_marksheettwo) . "',";
			$Qry1 .= "twl_marksheetthree = '" . Escape($this->twl_marksheetthree) . "',";
			$Qry1 .= "school_leaving = '" . Escape($this->school_leaving) . "',";
			$Qry1 .= "hsc_credit = '" . Escape($this->hsc_credit) . "',";
			$Qry1 .= "cast_certificate = '" . Escape($this->cast_certificate) . "',";
			$Qry1 .= "income_certi = '" . Escape($this->income_certi) . "',";
			$Qry1 .= "add_proof = '" . Escape($this->add_proof) . "',";
			$Qry1 .= "adhar_photo = '" . Escape($this->adhar_photo) . "',";
			$Qry1 .= "character_certi = '" . Escape($this->character_certi) . "',";
			$Qry1 .= "gap_certi = '" . Escape($this->gap_certi) . "',";
			$Qry1 .= "bank_passbook = '" . Escape($this->bank_passbook) . "',";
			$Qry1 .= "graduation_marksheet = '" . Escape($this->graduation_marksheet) . "',";
			$Qry1 .= "course_comp = '" . Escape($this->course_comp) . "',";
			$Qry1 .= "midwifery_certi = '" . Escape($this->midwifery_certi) . "',";

			$Qry1 .= "conduct_certi = '" . Escape($this->conduct_certi) . "',";
			$Qry1 .= "statecouncil_certi = '" . Escape($this->statecouncil_certi) . "',";
			$Qry1 .= "councilrenewal_certi = '" . Escape($this->councilrenewal_certi) . "',";
			$Qry1 .= "tenth_trial_certi = '" . Escape($this->tenth_trial_certi) . "',";
			$Qry1 .= "twl_trial_certi = '" . Escape($this->twl_trial_certi) . "',";
			$Qry1 .= "addmission_order_certi = '" . Escape($this->addmission_order_certi) . "',";
            if ($Qry1 != "") {
                  $Qry1 = substr($Qry1, 0, strlen($Qry1) - 1);
                  $qry = "UPDATE cms_attachement SET " . $Qry1 . " 
                              WHERE student_id ='" . Escape($this->student_id) . "' ";
							                    dbQuery($qry);
                  $this->student_id = dbInsertedId();
                  
            }
      }

    //   //Attachements
    //   function updatefile1()
    //   {
    //         $qry = "update cms_attachement 
    //                   set last_marksheet = '" . $this->last_marksheet . "'
    //                    where student_id =   '" . $this->student_id . "' ";

    //         dbQuery($qry);
    //   }

    //   function updatefile2()
    //   {
    //          $qry = "update cms_attachement 
	// 			set last_marksheetone = '" . $this->last_marksheetone . "'
    //          	where student_id =   '" . $this->student_id . "' ";

    //         dbQuery($qry);
    //   }
    //   function updatefile3()
    //   {
    //          $qry = "update cms_attachement 
	// 			set last_marksheettow = '" . $this->last_marksheettow . "'
    //          	where student_id =   '" . $this->student_id . "' ";

    //         dbQuery($qry);
    //   }
    //   function updatefile4()
    //   {
    //          $qry = "update cms_attachement 
	// 			set last_marksheetthree = '" . $this->last_marksheetthree . "'
    //          	where student_id =   '" . $this->student_id . "' ";

    //         dbQuery($qry);
    //   }
    //   function updatefile5()
    //   {
    //          $qry = "update cms_attachement 
	// 			set twl_marksheet = '" . $this->twl_marksheet . "'
    //          	where student_id =   '" . $this->student_id . "' ";

    //         dbQuery($qry);
    //   }
    //   function updatefile6()
    //   {
    //          $qry = "update cms_attachement 
	// 			set twl_marksheetone = '" . $this->twl_marksheetone . "'
    //          	where student_id =   '" . $this->student_id . "' ";

    //         dbQuery($qry);
    //   }
    //   function updatefile7()
    //   {
    //          $qry = "update cms_attachement 
	// 			set twl_marksheettwo = '" . $this->twl_marksheettwo . "'
    //          	where student_id =   '" . $this->student_id . "' ";

    //         dbQuery($qry);
    //   }
    //   function updatefile8()
    //   {
    //          $qry = "update cms_attachement 
	// 			set twl_marksheetthree = '" . $this->twl_marksheetthree . "'
    //          	where student_id =   '" . $this->student_id . "' ";

    //         dbQuery($qry);
    //   }
    //   function updatefile9()
    //   {
    //          $qry = "update cms_attachement 
	// 			set school_leaving = '" . $this->school_leaving . "'
    //          	where student_id =   '" . $this->student_id . "' ";

    //         dbQuery($qry);
    //   }
    //   function updatefile10()
    //   {
    //          $qry = "update cms_attachement 
	// 			set hsc_credit = '" . $this->hsc_credit . "'
    //          	where student_id =   '" . $this->student_id . "' ";

    //         dbQuery($qry);
    //   }
    //   function updatefile11()
	// {
	// 	$qry = "update cms_attachement 
	// 			set cast_certificate = '" . $this->cast_certificate . "'
    //          	where student_id =   '" . $this->student_id . "' ";

	// 	dbQuery($qry);
	// }
    //   function updatefile12()
	// {
	// 	$qry = "update cms_attachement 
	// 			set income_certi = '" . $this->income_certi . "'
    //          	where student_id =   '" . $this->student_id . "' ";

	// 	dbQuery($qry);
	// }
    //   function updatefile13()
	// {
	// 	$qry = "update cms_attachement 
	// 			set add_proof = '" . $this->add_proof . "'
    //          	where student_id =   '" . $this->student_id . "' ";

	// 	dbQuery($qry);
	// }
    //   function updatefile14()
	// {
	// 	$qry = "update cms_attachement 
	// 			set adhar_photo = '" . $this->adhar_photo . "'
    //          	where student_id =   '" . $this->student_id . "' ";

	// 	dbQuery($qry);
	// }
    //   function updatefile15()
	// {
	// 	$qry = "update cms_attachement 
	// 			set character_certi = '" . $this->character_certi . "'
    //          	where student_id =   '" . $this->student_id . "' ";

	// 	dbQuery($qry);
	// }
    //   function updatefile16()
	// {
	// 	$qry = "update cms_attachement 
	// 			set gap_certi = '" . $this->gap_certi . "'
    //          	where student_id =   '" . $this->student_id . "' ";

	// 	dbQuery($qry);
	// }
    //   function updatefile17()
	// {
	// 	$qry = "update cms_attachement 
	// 			set bank_passbook = '" . $this->bank_passbook . "'
    //          	where student_id =   '" . $this->student_id . "' ";

	// 	dbQuery($qry);
	// }
    //   function updatefile18()
	// {
	// 	$qry = "update cms_attachement 
	// 			set graduation_marksheet = '" . $this->graduation_marksheet . "'
    //          	where student_id =   '" . $this->student_id . "' ";

	// 	dbQuery($qry);
	// }
    //   function updatefile19()
	// {
	// 	 $qry = "update cms_attachement 
	// 			set course_comp = '" . $this->course_comp . "'
    //          	where student_id =   '" . $this->student_id . "' ";

	// 	dbQuery($qry);
	// }
    //   function updatefile20()
	// {
	// 	 $qry = "update cms_attachement 
	// 			set midwifery_certi = '" . $this->midwifery_certi . "'
    //          	where student_id =   '" . $this->student_id . "' ";

	// 	dbQuery($qry);
	// }
    //   function updatefile21()
	// {
	// 	 $qry = "update cms_attachement 
	// 			set conduct_certi = '" . $this->conduct_certi . "'
    //          	where student_id =   '" . $this->student_id . "' ";

	// 	dbQuery($qry);
	// }
    //   function updatefile22()
	// {
	// 	 $qry = "update cms_attachement 
	// 			set statecouncil_certi = '" . $this->statecouncil_certi . "'
    //          	where student_id =   '" . $this->student_id . "' ";

	// 	dbQuery($qry);
	// }
    //   function updatefile23()
	// {
	// 	 $qry = "update cms_attachement 
	// 			set councilrenewal_certi = '" . $this->councilrenewal_certi . "'
    //          	where student_id =   '" . $this->student_id . "' ";

	// 	dbQuery($qry);
	// }
      //other marksheet
      function updatefile24()
	{
		 $qry = "update cms_attachement 
				set sem1_marksheet = '" . $this->sem1_marksheet . "'
             	where student_id =   '" . $this->student_id . "' ";

		
                  dbQuery($qry);
	}
      function updatefile25()
	{
		 $qry = "update cms_attachement 
				set sem2_marksheet = '" . $this->sem2_marksheet . "'
             	where student_id =   '" . $this->student_id . "' ";

		dbQuery($qry);
	}
      function updatefile26()
	{
		 $qry = "update cms_attachement 
				set sem3_marksheet = '" . $this->sem3_marksheet . "'
             	where student_id =   '" . $this->student_id . "' ";

		dbQuery($qry);
	}
      function updatefile27()
	{
		 $qry = "update cms_attachement 
				set sem4_marksheet = '" . $this->sem4_marksheet . "'
             	where student_id =   '" . $this->student_id . "' ";

		dbQuery($qry);
	}
      function updatefile28()
	{
		 $qry = "update cms_attachement 
				set sem5_marksheet = '" . $this->sem5_marksheet . "'
             	where student_id =   '" . $this->student_id . "' ";

		dbQuery($qry);
	}
      function updatefile29()
	{
		 $qry = "update cms_attachement 
				set sem6_marksheet = '" . $this->sem6_marksheet . "'
             	where student_id =   '" . $this->student_id . "' ";

		dbQuery($qry);
	}
      //Gnm 12 marksheet
      function updatefile30()
	{
		 $qry = "update cms_attachement 
				set gnm_marksheet1 = '" . $this->gnm_marksheet1 . "'
             	where student_id =   '" . $this->student_id . "' ";

		dbQuery($qry);
	}
      function updatefile31()
	{
		 $qry = "update cms_attachement 
				set gnm_marksheet2 = '" . $this->gnm_marksheet2 . "'
             	where student_id =   '" . $this->student_id . "' ";

		dbQuery($qry);
	}
      function updatefile32()
	{
		 $qry = "update cms_attachement 
				set gnm_marksheet3 = '" . $this->gnm_marksheet3 . "'
             	where student_id =   '" . $this->student_id . "' ";

		dbQuery($qry);
	}
      function updatefile33()
	{
		 $qry = "update cms_attachement 
				set gnm_marksheet4 = '" . $this->gnm_marksheet4 . "'
             	where student_id =   '" . $this->student_id . "' ";

		dbQuery($qry);
	}
      function updatefile34()
	{
		 $qry = "update cms_attachement 
				set gnm_marksheet5 = '" . $this->gnm_marksheet5 . "'
             	where student_id =   '" . $this->student_id . "' ";

		dbQuery($qry);
	}
      function updatefile35()
	{
		 $qry = "update cms_attachement 
				set gnm_marksheet6 = '" . $this->gnm_marksheet6 . "'
             	where student_id =   '" . $this->student_id . "' ";

		dbQuery($qry);
	}
      function updatefile36()
	{
		 $qry = "update cms_attachement 
				set gnm_marksheet7 = '" . $this->gnm_marksheet7 . "'
             	where student_id =   '" . $this->student_id . "' ";

		dbQuery($qry);
	}
      function updatefile37()
	{
		 $qry = "update cms_attachement 
				set gnm_marksheet8 = '" . $this->gnm_marksheet8 . "'
             	where student_id =   '" . $this->student_id . "' ";

		dbQuery($qry);
	}
      function updatefile38()
	{
		 $qry = "update cms_attachement 
				set gnm_marksheet9 = '" . $this->gnm_marksheet9 . "'
             	where student_id =   '" . $this->student_id . "' ";

		dbQuery($qry);
	}
      function updatefile39()
	{
		 $qry = "update cms_attachement 
				set gnm_marksheet10 = '" . $this->gnm_marksheet10 . "'
             	where student_id =   '" . $this->student_id . "' ";

		dbQuery($qry);
	}
      function updatefile40()
	{
		 $qry = "update cms_attachement 
				set gnm_marksheet11 = '" . $this->gnm_marksheet11 . "'
             	where student_id =   '" . $this->student_id . "' ";

		dbQuery($qry);
	}
      function updatefile41()
	{
		 $qry = "update cms_attachement 
				set gnm_marksheet12 = '" . $this->gnm_marksheet12 . "'
             	where student_id =   '" . $this->student_id . "' ";

		dbQuery($qry);
	}
	// function updatefile42()
	// {
	// 	 $qry = "update cms_attachement 
	// 			set tenth_trial_certi = '" . $this->tenth_trial_certi . "'
    //          	where student_id =   '" . $this->student_id . "' ";

	// 	dbQuery($qry);
	// }
	// function updatefile43()
	// {
	// 	 $qry = "update cms_attachement 
	// 			set twl_trial_certi = '" . $this->twl_trial_certi . "'
    //          	where student_id =   '" . $this->student_id . "' ";

	// 	dbQuery($qry);
	// }
	// function updatefile44()
	// {
	// 	 $qry = "update cms_attachement 
	// 			set addmission_order_certi = '" . $this->addmission_order_certi . "'
    //          	where student_id =   '" . $this->student_id . "' ";

	// 	dbQuery($qry);
	// }
	
}

?>