Revonzy Mini Shell

Revonzy Mini Shell

Şuanki Dizin: /home/wwwdreamtechnolo/public_html/swamipolytechnic.org/old/grievance/admin/lib/
Dosya Yükle :
Şuanki Dosya : /home/wwwdreamtechnolo/public_html/swamipolytechnic.org/old/grievance/admin/lib/functions.php

<?php
	$application_title = "Grievance Manager";
	header( 'Content-Type: text/html; charset=utf-8');
	session_start();
	
	
	class db_functions
	{
		private $con;
		
		function __construct()
		{
			$this->con = new mysqli("localhost","swamipolytechnic_grv_admin","*q[*HLO28VWh","swamipolytechnic_grievance");
			//$this->con = new mysqli("localhost","root","","swamipol_grievance");
			mysqli_set_charset($this->con, 'utf8');
		}
		
		function get_admin_password($email)
		{
			if($stmt = $this->con->prepare("SELECT `password` FROM `admin` WHERE `user_id` = ?"))
			{
				$stmt->bind_param("s",$email);
				
				$stmt->bind_result($res_password);
				
				if($stmt->execute())
				{
					if($stmt->fetch())
					{
						return $res_password;
					}
					return False;
				}
			}
		}
		function get_student_password($email)
		{
			if($stmt = $this->con->prepare("SELECT `password` FROM `student_details` WHERE `user_id` = ?"))
			{
				$stmt->bind_param("s",$email);
				
				$stmt->bind_result($res_password);
				
				if($stmt->execute())
				{
					if($stmt->fetch())
					{
						return $res_password;
					}
					return False;
				}
			}
		}
		function get_parents_password($email)
		{
			if($stmt = $this->con->prepare("SELECT `parent_password` FROM `student_details` WHERE `parent_userid` = ?"))
			{
				$stmt->bind_param("s",$email);
				
				$stmt->bind_result($res_password);
				
				if($stmt->execute())
				{
					if($stmt->fetch())
					{
						return $res_password;
					}
					return False;
				}
			}
		}
		function get_faculty_password($email)
		{
			if($stmt = $this->con->prepare("SELECT `password` FROM `faculty_information` WHERE `user_id` = ?"))
			{
				$stmt->bind_param("s",$email);
				
				$stmt->bind_result($res_password);
				
				if($stmt->execute())
				{
					if($stmt->fetch())
					{
						return $res_password;
					}
					return False;
				}
			}
		}
		function get_grievance_password($email)
		{
			if($stmt = $this->con->prepare("SELECT `password` FROM `faculty_information` WHERE `user_id` = ? AND `in_grivance`='yes' "))
			{
				$stmt->bind_param("s",$email);
				
				$stmt->bind_result($res_password);
				
				if($stmt->execute())
				{
					if($stmt->fetch())
					{
						return $res_password;
					}
					return False;
				}
			}
		}
		function get_management_password($email)
		{
			if($stmt = $this->con->prepare("SELECT `password` FROM `faculty_information` WHERE `user_id` = ? AND `in_management`='yes'"))
			{
				$stmt->bind_param("s",$email);
				
				$stmt->bind_result($res_password);
				
				if($stmt->execute())
				{
					if($stmt->fetch())
					{
						return $res_password;
					}
					return False;
				}
			}
		}
		function get_non_teaching_password($email)
		{
			if($stmt = $this->con->prepare("SELECT `password` FROM `faculty_information` WHERE `user_id` = ? AND `staff` = 'non-teaching' "))
			{
				$stmt->bind_param("s",$email);
				
				$stmt->bind_result($res_password);
				
				if($stmt->execute())
				{
					if($stmt->fetch())
					{
						return $res_password;
					}
					return False;
				}
			}
		}
		function update_new_password($new_password,$email_id)
		{
			if($stmt = $this->con->prepare("UPDATE `admin` SET `password`= ? WHERE `user_id` = ?"))
			{
				$stmt->bind_param("ss",$new_password,$email_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		function update_staff_password($new_password,$email_id)
		{
			if($stmt = $this->con->prepare("UPDATE `faculty_information` SET `password`=? WHERE `user_id`=?"))
			{
				$stmt->bind_param("ss",$new_password,$email_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		function update_student_password($new_password,$email_id)
		{
			if($stmt = $this->con->prepare("UPDATE `student_details` SET `password`=? WHERE `user_id`=?"))
			{
				$stmt->bind_param("ss",$new_password,$email_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		function update_parent_password($new_password,$email_id)
		{
			if($stmt = $this->con->prepare("UPDATE `student_details` SET `parent_password`=? WHERE `parent_userid`=?"))
			{
				$stmt->bind_param("ss",$new_password,$email_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		function update_grievance_password($new_password,$email_id)
		{
			if($stmt = $this->con->prepare("UPDATE `faculty_information` SET `password`=? WHERE `user_id`=? AND `in_grivance`='yes'"))
			{
				$stmt->bind_param("ss",$new_password,$email_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		function update_nonteaching_password($new_password,$email_id)
		{
			if($stmt = $this->con->prepare("UPDATE `faculty_information` SET `password`=? WHERE `user_id`=? AND `staff`='non-teaching'"))
			{
				$stmt->bind_param("ss",$new_password,$email_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		function update_management_password($new_password,$email_id)
		{
			if($stmt = $this->con->prepare("UPDATE `faculty_information` SET `password`=? WHERE `user_id`=? AND `in_management`='yes'"))
			{
				$stmt->bind_param("ss",$new_password,$email_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		
		function get_division_master_id_from_title($division)
		{
			if($stmt = $this->con->prepare("SELECT `id` FROM `division_master` WHERE `division` = ?"))
			{
				$stmt->bind_param("s",$division);
				
				$stmt->bind_result($res_id);
				
				if($stmt->execute())
				{
					if($stmt->fetch())
					{
						return $res_id;
					}
					return False;
				}
			}
		}
		
		function save_division_master_details($division)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("INSERT INTO `division_master`(`division`, `date`, `time`) VALUES (?,?,?)"))
			{
				$stmt->bind_param("sss",$division,$date,$time);
				if($stmt->execute())
				{
					return true;
				}
				return false;
			}
		}
		
		function delete_division_master_data($delete_id)
		{
			if($stmt = $this->con->prepare("DELETE FROM `division_master` WHERE `id` = ?"))
			{
				$stmt->bind_param("i",$delete_id);
				
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function get_all_division_master_data()
		{
			if($stmt = $this->con->prepare("SELECT `id`, `division`, `date` FROM `division_master`"))
			{ 
				$stmt->bind_result($res_id,$res_division,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$res_division;
						$data[$row_counter][2]	=	$res_date;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function get_student_id($class,$medium,$division,$surname,$stud_name,$father_name,$father_contact)
		{
			if($stmt = $this->con->prepare("SELECT `id` FROM `student_details` WHERE `class`=? AND `medium`=? AND `division`=? AND `surname`=? AND `student_name`=? AND `father_name`=? AND `father_cont_no`=?"))
			{
				$stmt->bind_param("sssssss",$class,$medium,$division,$surname,$stud_name,$father_name,$father_contact);
				
				$stmt->bind_result($res_id);
				
				if($stmt->execute())
				{
					if($stmt->fetch())
					{
						return $res_id;
					}
					return False;
				}
			}
		}
		
		function save_student_record($class,$medium,$division,$roll_no,$surname,$stud_name,$father_name,$mother_name,$stud_contact,$father_contact,$mother_contact,$residential_no,$address,$cor_address,$child_desc,$email,$aadhar_number,$religion,$caste,$category,$mother_tongue,$nationality,$birth_place,$birth_date,$gender,$last_school,$admission_date,$blood_group,$height,$weight,$actual_image_name,$actual_image_name1,$actual_image_name2,$advertising_board,$news_paper,$teachers,$friends,$ex_students,$pre_class,$other,$remarks,$no_of_pupil,$stud_id_for_lc,$g_r_no,$qualification,$occupation,$monthly_income,$office_add,$residential_add,$mother_qualifi,$mother_occupation,$mother_income,$mother_office_add,$mother_resident_add,$user_id,$password,$parents_user_id,$parents_password)
		{ 
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("INSERT INTO `student_details`(`class`, `medium`, `division`, `roll_no`, `surname`, `student_name`, `father_name`, `mother_name`, `stud_cont_no`, `father_cont_no`, `mother_cont_no`, `residential_no`, `address`, `corres_address`, `child_desc`, `email`, `aadhar_number`, `religion`, `caste`, `category`, `mother_tongue`, `nationality`, `place_of_birth`, `birth_date`, `gender`, `last_school`, `admission_date`, `blood_group`, `height`, `weight`, `student_image`, `birth_certificate`, `caste_certificate`, `advertising_board`, `news_paper`, `teachers`, `friends`, `ex_students`, `pre_class_student`, `other`, `remarks`, `no_of_pupil`, `stud_id_for_lc`, `g-r-no`, `father_qualification`, `father_occupation`, `father_monthly_income`, `father_office_add`, `father_resident_add`, `mother_qualifi`, `mother_occupation`, `mother_income`, `mother_office_add`, `mother_resident_add`, `date`, `time`,`user_id`,`password`,`parent_userid`,`parent_password`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"))
			{echo 12345;
				$stmt->bind_param("ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss",$class,$medium,$division,$roll_no,$surname,$stud_name,$father_name,$mother_name,$stud_contact,$father_contact,$mother_contact,$residential_no,$address,$cor_address,$child_desc,$email,$aadhar_number,$religion,$caste,$category,$mother_tongue,$nationality,$birth_place,$birth_date,$gender,$last_school,$admission_date,$blood_group,$height,$weight,$actual_image_name,$actual_image_name1,$actual_image_name2,$advertising_board,$news_paper,$teachers,$friends,$ex_students,$pre_class,$other,$remarks,$no_of_pupil,$stud_id_for_lc,$g_r_no,$qualification,$occupation,$monthly_income,$office_add,$residential_add,$mother_qualifi,$mother_occupation,$mother_income,$mother_office_add,$mother_resident_add,$date,$time,$user_id,$password,$parents_user_id,$parents_password);
				if($stmt->execute())
				{
					return true;
				}
				return false;
			}
		}
		
		function get_all_student_data()
		{
			if($stmt = $this->con->prepare("SELECT `id`, `class`, `medium`, `division`, `roll_no`, `surname`, `student_name`, `father_name`, `mother_name`, `stud_cont_no`, `father_cont_no`, `mother_cont_no`, `residential_no`, `address`, `corres_address`, `child_desc`, `email`, `aadhar_number`, `religion`, `caste`, `category`, `mother_tongue`, `nationality`, `place_of_birth`, `birth_date`, `gender`, `last_school`, `admission_date`, `blood_group`, `height`, `weight`, `student_image`, `birth_certificate`, `caste_certificate`, `advertising_board`, `news_paper`, `teachers`, `friends`, `ex_students`, `pre_class_student`, `other`, `remarks`, `no_of_pupil`, `stud_id_for_lc`, `g-r-no`, `father_qualification`, `father_occupation`, `father_monthly_income`, `father_office_add`, `father_resident_add`, `mother_qualifi`, `mother_occupation`, `mother_income`, `mother_office_add`, `mother_resident_add`, `date` FROM `student_details` WHERE `status`!= 'Cancelled'"))
			{ 
				$stmt->bind_result($res_id,$res_class,$res_medium,$res_division,$res_roll_no,$res_surname,$res_stud_name,$res_father_name,$res_mother_name,$res_stud_cont,$res_father_cont,$res_mother_cont,$res_residential_no,$res_address,$res_corres_add,$res_child_desc,$res_email,$res_aadhar_no,$res_religion,$res_caste,$res_category,$res_mother_tongue,$res_nationality,$res_birth_palce,$res_birth_date,$res_gender,$res_last_school,$res_admission_date,$res_blood_group,$res_height,$res_weight,$res_student_image,$res_birth_certi,$res_caste_certi,$res_adv_board,$res_news_paper,$res_teachers,$res_friends,$res_ex_students,$res_pre_class,$res_other,$res_remarks,$res_no_of_pupil,$res_stud_id_for_lc,$res_gr_no,$res_father_quali,$res_father_occu,$res_father_income,$res_father_office_add,$res_father_resident_add,$res_mother_qualifi,$res_mother_occupa,$res_mother_income,$res_mother_office_add,$res_mother_resident_add,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$res_class;
						$data[$row_counter][2]	=	$res_medium;
						$data[$row_counter][3]	=	$res_division;
						$data[$row_counter][4]	=	$res_roll_no;
						$data[$row_counter][5]	=	$res_surname;
						$data[$row_counter][6]	=	$res_stud_name;
						$data[$row_counter][7]	=	$res_father_name;
						$data[$row_counter][8]	=	$res_mother_name;
						$data[$row_counter][9]	=	$res_stud_cont;
						$data[$row_counter][10]	=	$res_father_cont;
						$data[$row_counter][11]	=	$res_mother_cont;
						$data[$row_counter][12]	=	$res_residential_no;
						$data[$row_counter][13]	=	$res_address;
						$data[$row_counter][14]	=	$res_corres_add;
						$data[$row_counter][15]	=	$res_child_desc;
						$data[$row_counter][16]	=	$res_email;
						$data[$row_counter][17]	=	$res_aadhar_no;
						$data[$row_counter][18]	=	$res_religion;
						$data[$row_counter][19]	=	$res_caste;
						$data[$row_counter][20]	=	$res_category;
						$data[$row_counter][21]	=	$res_mother_tongue;
						$data[$row_counter][22]	=	$res_nationality;
						$data[$row_counter][23]	=	$res_birth_palce;
						$data[$row_counter][24]	=	$res_birth_date;
						$data[$row_counter][25]	=	$res_gender;
						$data[$row_counter][26]	=	$res_last_school;
						$data[$row_counter][27]	=	$res_admission_date;
						$data[$row_counter][28]	=	$res_blood_group;
						$data[$row_counter][29]	=	$res_height;
						$data[$row_counter][30]	=	$res_weight;
						$data[$row_counter][31]	=	$res_student_image;
						$data[$row_counter][32]	=	$res_birth_certi;
						$data[$row_counter][33]	=	$res_caste_certi;
						$data[$row_counter][34]	=	$res_remarks;
						$data[$row_counter][35]	=	$res_no_of_pupil;
						$data[$row_counter][36]	=	$res_stud_id_for_lc;
						$data[$row_counter][37]	=	$res_father_quali;
						$data[$row_counter][38]	=	$res_father_occu;
						$data[$row_counter][39]	=	$res_father_income;
						$data[$row_counter][40]	=	$res_father_office_add;
						$data[$row_counter][41]	=	$res_father_resident_add;
						$data[$row_counter][42]	=	$res_mother_qualifi;
						$data[$row_counter][43]	=	$res_mother_occupa;
						$data[$row_counter][44]	=	$res_mother_income;
						$data[$row_counter][45]	=	$res_mother_office_add;
						$data[$row_counter][46]	=	$res_mother_resident_add;
						$data[$row_counter][47]	=	$res_date;
						$data[$row_counter][48]	=	$res_adv_board;
						$data[$row_counter][49]	=	$res_news_paper;
						$data[$row_counter][50]	=	$res_teachers;
						$data[$row_counter][51]	=	$res_friends;
						$data[$row_counter][52]	=	$res_ex_students;
						$data[$row_counter][53]	=	$res_pre_class;
						$data[$row_counter][54]	=	$res_other;
						$data[$row_counter][55]	=	$res_gr_no;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function get_student_record_from_date($from_date,$to_date)
		{
			if($stmt = $this->con->prepare("SELECT `id`, `class`, `medium`, `division`, `roll_no`, `surname`, `student_name`, `father_name`, `mother_name`, `stud_cont_no`, `father_cont_no`, `mother_cont_no`, `residential_no`, `address`, `corres_address`, `child_desc`, `email`, `aadhar_number`, `religion`, `caste`, `category`, `mother_tongue`, `nationality`, `place_of_birth`, `birth_date`, `gender`, `last_school`, `admission_date`, `blood_group`, `height`, `weight`, `student_image`, `birth_certificate`, `caste_certificate`, `advertising_board`, `news_paper`, `teachers`, `friends`, `ex_students`, `pre_class_student`, `other`, `remarks`, `no_of_pupil`, `stud_id_for_lc`, `g-r-no`, `father_qualification`, `father_occupation`, `father_monthly_income`, `father_office_add`, `father_resident_add`, `mother_qualifi`, `mother_occupation`, `mother_income`, `mother_office_add`, `mother_resident_add`, `date` FROM `student_details` WHERE (`date` BETWEEN ? AND ?) AND `status`!= 'Cancelled'"))
			{
				$stmt->bind_param("ss",$from_date,$to_date);
				
				$stmt->bind_result($res_id,$res_class,$res_medium,$res_division,$res_roll_no,$res_surname,$res_stud_name,$res_father_name,$res_mother_name,$res_stud_cont,$res_father_cont,$res_mother_cont,$res_residential_no,$res_address,$res_corres_add,$res_child_desc,$res_email,$res_aadhar_no,$res_religion,$res_caste,$res_category,$res_mother_tongue,$res_nationality,$res_birth_palce,$res_birth_date,$res_gender,$res_last_school,$res_admission_date,$res_blood_group,$res_height,$res_weight,$res_student_image,$res_birth_certi,$res_caste_certi,$res_adv_board,$res_news_paper,$res_teachers,$res_friends,$res_ex_students,$res_pre_class,$res_other,$res_remarks,$res_no_of_pupil,$res_stud_id_for_lc,$res_gr_no,$res_father_quali,$res_father_occu,$res_father_income,$res_father_office_add,$res_father_resident_add,$res_mother_qualifi,$res_mother_occupa,$res_mother_income,$res_mother_office_add,$res_mother_resident_add,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$res_class;
						$data[$row_counter][2]	=	$res_medium;
						$data[$row_counter][3]	=	$res_division;
						$data[$row_counter][4]	=	$res_roll_no;
						$data[$row_counter][5]	=	$res_surname;
						$data[$row_counter][6]	=	$res_stud_name;
						$data[$row_counter][7]	=	$res_father_name;
						$data[$row_counter][8]	=	$res_mother_name;
						$data[$row_counter][9]	=	$res_stud_cont;
						$data[$row_counter][10]	=	$res_father_cont;
						$data[$row_counter][11]	=	$res_mother_cont;
						$data[$row_counter][12]	=	$res_residential_no;
						$data[$row_counter][13]	=	$res_address;
						$data[$row_counter][14]	=	$res_corres_add;
						$data[$row_counter][15]	=	$res_child_desc;
						$data[$row_counter][16]	=	$res_email;
						$data[$row_counter][17]	=	$res_aadhar_no;
						$data[$row_counter][18]	=	$res_religion;
						$data[$row_counter][19]	=	$res_caste;
						$data[$row_counter][20]	=	$res_category;
						$data[$row_counter][21]	=	$res_mother_tongue;
						$data[$row_counter][22]	=	$res_nationality;
						$data[$row_counter][23]	=	$res_birth_palce;
						$data[$row_counter][24]	=	$res_birth_date;
						$data[$row_counter][25]	=	$res_gender;
						$data[$row_counter][26]	=	$res_last_school;
						$data[$row_counter][27]	=	$res_admission_date;
						$data[$row_counter][28]	=	$res_blood_group;
						$data[$row_counter][29]	=	$res_height;
						$data[$row_counter][30]	=	$res_weight;
						$data[$row_counter][31]	=	$res_student_image;
						$data[$row_counter][32]	=	$res_birth_certi;
						$data[$row_counter][33]	=	$res_caste_certi;
						$data[$row_counter][34]	=	$res_remarks;
						$data[$row_counter][35]	=	$res_no_of_pupil;
						$data[$row_counter][36]	=	$res_stud_id_for_lc;
						$data[$row_counter][37]	=	$res_father_quali;
						$data[$row_counter][38]	=	$res_father_occu;
						$data[$row_counter][39]	=	$res_father_income;
						$data[$row_counter][40]	=	$res_father_office_add;
						$data[$row_counter][41]	=	$res_father_resident_add;
						$data[$row_counter][42]	=	$res_mother_qualifi;
						$data[$row_counter][43]	=	$res_mother_occupa;
						$data[$row_counter][44]	=	$res_mother_income;
						$data[$row_counter][45]	=	$res_mother_office_add;
						$data[$row_counter][46]	=	$res_mother_resident_add;
						$data[$row_counter][47]	=	$res_date;
						$data[$row_counter][48]	=	$res_adv_board;
						$data[$row_counter][49]	=	$res_news_paper;
						$data[$row_counter][50]	=	$res_teachers;
						$data[$row_counter][51]	=	$res_friends;
						$data[$row_counter][52]	=	$res_ex_students;
						$data[$row_counter][53]	=	$res_pre_class;
						$data[$row_counter][54]	=	$res_other;
						$data[$row_counter][55]	=	$res_gr_no;
						
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function delete_student_record($del_id)
		{
			if($stmt = $this->con->prepare("DELETE FROM `student_details` WHERE `id` = ?"))
			{
				$stmt->bind_param("i",$del_id);
				
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function set_student_image_blank($delete_id)
		{
			if($stmt = $this->con->prepare("UPDATE `student_details` SET `student_image`= '' WHERE `id` = ?"))
			{
				$stmt->bind_param("i",$delete_id);
				
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function set_birth_certificate_blank($delete_id)
		{
			if($stmt = $this->con->prepare("UPDATE `student_details` SET `birth_certificate`= '' WHERE `id` = ?"))
			{
				$stmt->bind_param("i",$delete_id);
				
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function set_caste_certificate_blank($delete_id)
		{
			if($stmt = $this->con->prepare("UPDATE `student_details` SET `caste_certificate`= '' WHERE `id` = ?"))
			{
				$stmt->bind_param("i",$delete_id);
				
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		
		}
		
		function update_student_information($class,$medium,$division,$roll_no,$surname,$stud_name,$father_name,$mother_name,$stud_contact,$father_contact,$mother_contact,$residential_no,$address,$cor_address,$child_desc,$email,$aadhar_number,$religion,$caste,$category,$mother_tongue,$nationality,$birth_place,$birth_date,$gender,$last_school,$admission_date,$blood_group,$height,$weight,$advertising_board,$news_paper,$teachers,$friends,$ex_students,$pre_class,$other,$remarks,$no_of_pupil,$stud_id_for_lc,$g_r_no,$qualification,$occupation,$monthly_income,$office_add,$residential_add,$mother_qualifi,$mother_occupation,$mother_income,$mother_office_add,$mother_resident_add,$certifi_no,$progress,$conduct,$leaving_school_date,$standard_sinse_when,$leaving_school_reason,$edit_id)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s A");
					
			if($stmt_select = $this->con->prepare("UPDATE `student_details` SET `class`=?,`medium`=?,`division`=?,`roll_no`=?,`surname`=?,`student_name`=?,`father_name`=?,`mother_name`=?,`stud_cont_no`=?,`father_cont_no`=?,`mother_cont_no`=?,`residential_no`=?,`address`=?,`corres_address`=?,`child_desc`=?,`email`=?,`aadhar_number`=?,`religion`=?,`caste`=?,`category`=?,`mother_tongue`=?,`nationality`=?,`place_of_birth`=?,`birth_date`=?,`gender`=?,`last_school`=?,`admission_date`=?,`blood_group`=?,`height`=?,`weight`=?,`advertising_board`=?,`news_paper`=?,`teachers`=?,`friends`=?,`ex_students`=?,`pre_class_student`=?,`other`=?,`remarks`=?,`no_of_pupil`=?,`stud_id_for_lc`=?,`g-r-no`=?,`father_qualification`=?,`father_occupation`=?,`father_monthly_income`=?,`father_office_add`=?,`father_resident_add`=?,`mother_qualifi`=?,`mother_occupation`=?,`mother_income`=?,`mother_office_add`=?,`mother_resident_add`=?,`certificate_no`=?,`progress`=?,`conduct`=?,`leaving_school_date`=?,`standard_sinse_when`=?,`leaving_school_reason`=?,`date`=?,`time`=? WHERE `id`=?"))
			{
				$stmt_select->bind_param("sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssi",$class,$medium,$division,$roll_no,$surname,$stud_name,$father_name,$mother_name,$stud_contact,$father_contact,$mother_contact,$residential_no,$address,$cor_address,$child_desc,$email,$aadhar_number,$religion,$caste,$category,$mother_tongue,$nationality,$birth_place,$birth_date,$gender,$last_school,$admission_date,$blood_group,$height,$weight,$advertising_board,$news_paper,$teachers,$friends,$ex_students,$pre_class,$other,$remarks,$no_of_pupil,$stud_id_for_lc,$g_r_no,$qualification,$occupation,$monthly_income,$office_add,$residential_add,$mother_qualifi,$mother_occupation,$mother_income,$mother_office_add,$mother_resident_add,$certifi_no,$progress,$conduct,$leaving_school_date,$standard_sinse_when,$leaving_school_reason,$date,$time,$edit_id);				
						
				if($stmt_select->execute())
				{					
					return true;
				}
				return false;
			}
		}
		
		function get_student_image_icon($edit_id)
		{
			if($stmt = $this->con->prepare("SELECT `student_image` FROM `student_details` WHERE `id` = ?"))
			{
				$stmt->bind_param("i",$edit_id);
				
				$stmt->bind_result($res_image);
				
				if($stmt->execute())
				{
					$data	=	array();
					
					if($stmt->fetch())
					{
						return $res_image;
					}
					return false;
				}
			}
		}
		
		function update_student_image($actual_image_name,$edit_id)
		{
			if($stmt = $this->con->prepare("UPDATE `student_details` SET `student_image`= ? WHERE `id` = ?"))
			{
				$stmt->bind_param("si",$actual_image_name,$edit_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function get_birth_certificate_image($edit_id)
		{
			if($stmt = $this->con->prepare("SELECT `birth_certificate` FROM `student_details` WHERE `id` = ?"))
			{
				$stmt->bind_param("i",$edit_id);
				
				$stmt->bind_result($res_image);
				
				if($stmt->execute())
				{
					$data	=	array();
					
					if($stmt->fetch())
					{
						return $res_image;
					}
					return false;
				}
			}
		}
		
		function update_birth_certificate_image($actual_image_name1,$edit_id)
		{
			if($stmt = $this->con->prepare("UPDATE `student_details` SET `birth_certificate`= ? WHERE `id` = ?"))
			{
				$stmt->bind_param("si",$actual_image_name1,$edit_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function get_caste_certificate_image($edit_id)
		{
			if($stmt = $this->con->prepare("SELECT `caste_certificate` FROM `student_details` WHERE `id` = ?"))
			{
				$stmt->bind_param("i",$edit_id);
				
				$stmt->bind_result($res_image);
				
				if($stmt->execute())
				{
					$data	=	array();
					
					if($stmt->fetch())
					{
						return $res_image;
					}
					return false;
				}
			}
		}
		
		function update_caste_certificate_image($actual_image_name2,$edit_id)
		{
			if($stmt = $this->con->prepare("UPDATE `student_details` SET `caste_certificate`= ? WHERE `id` = ?"))
			{
				$stmt->bind_param("si",$actual_image_name2,$edit_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function get_all_student_info($edit_id)
		{
			if($stmt = $this->con->prepare("SELECT `id`, `class`, `medium`, `division`, `roll_no`, `surname`, `student_name`, `father_name`, `mother_name`, `stud_cont_no`, `father_cont_no`, `mother_cont_no`, `residential_no`, `address`, `corres_address`, `child_desc`, `email`, `aadhar_number`, `religion`, `caste`, `category`, `mother_tongue`, `nationality`, `place_of_birth`, `birth_date`, `gender`, `last_school`, `admission_date`, `blood_group`, `height`, `weight`, `student_image`, `birth_certificate`, `caste_certificate`, `advertising_board`, `news_paper`, `teachers`, `friends`, `ex_students`, `pre_class_student`, `other`, `remarks`, `no_of_pupil`, `stud_id_for_lc`, `g-r-no`, `father_qualification`, `father_occupation`, `father_monthly_income`, `father_office_add`, `father_resident_add`, `mother_qualifi`, `mother_occupation`, `mother_income`, `mother_office_add`, `mother_resident_add`, `date` FROM `student_details` WHERE `id`=?"))
			{ 
				$stmt->bind_param("i",$edit_id);
				
				$stmt->bind_result($res_id,$res_class,$res_medium,$res_division,$res_roll_no,$res_surname,$res_stud_name,$res_father_name,$res_mother_name,$res_stud_cont,$res_father_cont,$res_mother_cont,$res_residential_no,$res_address,$res_corres_add,$res_child_desc,$res_email,$res_aadhar_no,$res_religion,$res_caste,$res_category,$res_mother_tongue,$res_nationality,$res_birth_palce,$res_birth_date,$res_gender,$res_last_school,$res_admission_date,$res_blood_group,$res_height,$res_weight,$res_student_image,$res_birth_certi,$res_caste_certi,$res_adv_board,$res_news_paper,$res_teachers,$res_friends,$res_ex_students,$res_pre_class,$res_other,$res_remarks,$res_no_of_pupil,$res_stud_id_for_lc,$res_gr_no,$res_father_quali,$res_father_occu,$res_father_income,$res_father_office_add,$res_father_resident_add,$res_mother_qualifi,$res_mother_occupa,$res_mother_income,$res_mother_office_add,$res_mother_resident_add,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					
					while($stmt->fetch())
					{
						$data[0]	=	$res_id;
						$data[1]	=	$res_class;
						$data[2]	=	$res_medium;
						$data[3]	=	$res_division;
						$data[4]	=	$res_roll_no;
						$data[5]	=	$res_surname;
						$data[6]	=	$res_stud_name;
						$data[7]	=	$res_father_name;
						$data[8]	=	$res_mother_name;
						$data[9]	=	$res_stud_cont;
						$data[10]	=	$res_father_cont;
						$data[11]	=	$res_mother_cont;
						$data[12]	=	$res_residential_no;
						$data[13]	=	$res_address;
						$data[14]	=	$res_corres_add;
						$data[15]	=	$res_child_desc;
						$data[16]	=	$res_email;
						$data[17]	=	$res_aadhar_no;
						$data[18]	=	$res_religion;
						$data[19]	=	$res_caste;
						$data[20]	=	$res_category;
						$data[21]	=	$res_mother_tongue;
						$data[22]	=	$res_nationality;
						$data[23]	=	$res_birth_palce;
						$data[24]	=	$res_birth_date;
						$data[25]	=	$res_gender;
						$data[26]	=	$res_last_school;
						$data[27]	=	$res_admission_date;
						$data[28]	=	$res_blood_group;
						$data[29]	=	$res_height;
						$data[30]	=	$res_weight;
						$data[31]	=	$res_student_image;
						$data[32]	=	$res_birth_certi;
						$data[33]	=	$res_caste_certi;
						$data[34]	=	$res_adv_board;
						$data[35]	=	$res_news_paper;
						$data[36]	=	$res_teachers;
						$data[37]	=	$res_friends;
						$data[38]	=	$res_ex_students;
						$data[39]	=	$res_pre_class;
						$data[40]	=	$res_other;
						$data[41]	=	$res_remarks;
						$data[42]	=	$res_no_of_pupil;
						$data[43]	=	$res_stud_id_for_lc;
						$data[44]	=	$res_father_quali;
						$data[45]	=	$res_father_occu;
						$data[46]	=	$res_father_income;
						$data[47]	=	$res_father_office_add;
						$data[48]	=	$res_father_resident_add;
						$data[49]	=	$res_mother_qualifi;
						$data[50]	=	$res_mother_occupa;
						$data[51]	=	$res_mother_income;
						$data[52]	=	$res_mother_office_add;
						$data[53]	=	$res_mother_resident_add;
						$data[54]	=	$res_date;
						$data[55]	=	$res_gr_no;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function get_all_student_info_for_certificate($res_id)
		{
			if($stmt = $this->con->prepare("SELECT `id`, `class`, `medium`, `division`, `roll_no`, `surname`, `student_name`, `father_name`, `mother_name`, `stud_cont_no`, `father_cont_no`, `mother_cont_no`, `residential_no`, `address`, `corres_address`, `child_desc`, `email`, `aadhar_number`, `religion`, `caste`, `category`, `mother_tongue`, `nationality`, `place_of_birth`, `birth_date`, `gender`, `last_school`, `admission_date`, `student_image`, `remarks`, `no_of_pupil`, `stud_id_for_lc`, `g-r-no`, `certificate_no`, `progress`, `conduct`, `leaving_school_date`, `standard_sinse_when`, `leaving_school_reason`, `date` FROM `student_details` WHERE `id`=?"))
			{ 
				$stmt->bind_param("i",$res_id);
				
				$stmt->bind_result($res_id,$res_class,$res_medium,$res_division,$res_roll_no,$res_surname,$res_stud_name,$res_father_name,$res_mother_name,$res_stud_cont,$res_father_cont,$res_mother_cont,$res_residential_no,$res_address,$res_corres_add,$res_child_desc,$res_email,$res_aadhar_no,$res_religion,$res_caste,$res_category,$res_mother_tongue,$res_nationality,$res_birth_palce,$res_birth_date,$res_gender,$res_last_school,$res_admission_date,$res_student_image,$res_remarks,$res_no_of_pupil,$res_stud_id_for_lc,$res_gr_no,$res_certifi_no,$res_progress,$res_conduct,$res_leaving_school_date,$res_standard_sinse_when,$res_leaving_school_reason,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					
					while($stmt->fetch())
					{
						$data[0]	=	$res_id;
						$data[1]	=	$res_class;
						$data[2]	=	$res_medium;
						$data[3]	=	$res_division;
						$data[4]	=	$res_roll_no;
						$data[5]	=	$res_surname;
						$data[6]	=	$res_stud_name;
						$data[7]	=	$res_father_name;
						$data[8]	=	$res_mother_name;
						$data[9]	=	$res_stud_cont;
						$data[10]	=	$res_father_cont;
						$data[11]	=	$res_mother_cont;
						$data[12]	=	$res_residential_no;
						$data[13]	=	$res_address;
						$data[14]	=	$res_corres_add;
						$data[15]	=	$res_child_desc;
						$data[16]	=	$res_email;
						$data[17]	=	$res_aadhar_no;
						$data[18]	=	$res_religion;
						$data[19]	=	$res_caste;
						$data[20]	=	$res_category;
						$data[21]	=	$res_mother_tongue;
						$data[22]	=	$res_nationality;
						$data[23]	=	$res_birth_palce;
						$data[24]	=	$res_birth_date;
						$data[25]	=	$res_gender;
						$data[26]	=	$res_last_school;
						$data[27]	=	$res_admission_date;
						$data[28]	=	$res_student_image;
						$data[29]	=	$res_remarks;
						$data[30]	=	$res_no_of_pupil;
						$data[31]	=	$res_stud_id_for_lc;
						$data[32]	=	$res_gr_no;
						$data[33]	=	$res_certifi_no;
						$data[34]	=	$res_progress;
						$data[35]	=	$res_conduct;
						$data[36]	=	$res_leaving_school_date;
						$data[37]	=	$res_standard_sinse_when;
						$data[38]	=	$res_leaving_school_reason;
						$data[39]	=	$res_date;
						
						
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		function get_all_student_data_for_certificates()
		{
			if($stmt = $this->con->prepare("SELECT `id`, `class`, `medium`, `division`, `roll_no`, `surname`, `student_name`, `father_name`, `email`, `aadhar_number`,`admission_date`, `student_image`, `no_of_pupil`, `stud_id_for_lc`, `g-r-no`, `date` FROM `student_details` WHERE `status`!= 'Cancelled'"))
			{ 
				$stmt->bind_result($res_id,$res_class,$res_medium,$res_division,$res_roll_no,$res_surname,$res_stud_name,$res_father_name,$res_email,$res_aadhar_no,$res_admission_date,$res_student_image,$res_no_of_pupil,$res_stud_id_for_lc,$res_gr_no,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$res_class;
						$data[$row_counter][2]	=	$res_medium;
						$data[$row_counter][3]	=	$res_division;
						$data[$row_counter][4]	=	$res_roll_no;
						$data[$row_counter][5]	=	$res_surname;
						$data[$row_counter][6]	=	$res_stud_name;
						$data[$row_counter][7]	=	$res_father_name;
						$data[$row_counter][8]	=	$res_email;
						$data[$row_counter][9]	=	$res_aadhar_no;
						$data[$row_counter][10]	=	$res_admission_date;
						$data[$row_counter][11]	=	$res_no_of_pupil;
						$data[$row_counter][12]	=	$res_stud_id_for_lc;
						$data[$row_counter][13]	=	$res_gr_no;
						$data[$row_counter][14]	=	$res_date;
						$data[$row_counter][15]	=	$res_student_image;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function get_all_settings_data()
		{
			if($stmt = $this->con->prepare("SELECT `id`, `sanstha_center`, `school_clg_name`, `address`, `phone_no`, `email_id`, `recognition_no`, `udise_no`, `board`, `medium`, `index_no`, `clg_logo`, `date` FROM `setting`"))
			{ 
				$stmt->bind_result($res_id,$res_sanstha_center,$res_school_clg_name,$res_address,$res_phone_no,$res_email_id,$res_recognition_no,$res_udise_no,$res_board,$res_medium,$res_index_no,$res_clg_logo,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$res_sanstha_center;
						$data[$row_counter][2]	=	$res_school_clg_name;
						$data[$row_counter][3]	=	$res_address;
						$data[$row_counter][4]	=	$res_phone_no;
						$data[$row_counter][5]	=	$res_email_id;
						$data[$row_counter][6]	=	$res_recognition_no;
						$data[$row_counter][7]	=	$res_udise_no;
						$data[$row_counter][8]	=	$res_board;
						$data[$row_counter][9]	=	$res_medium;
						$data[$row_counter][10]	=	$res_index_no;
						$data[$row_counter][11]	=	$res_clg_logo;
						$data[$row_counter][12]	=	$res_date;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function update_setting_details($sanstha_center,$school_clg_name,$address,$phone_no,$email_id,$recognition_no,$udise_no,$board,$index_no,$medium)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("UPDATE `setting` SET `sanstha_center`=?,`school_clg_name`=?,`address`=?,`phone_no`=?,`email_id`=?,`recognition_no`=?,`udise_no`=?,`board`=?,`medium`=?,`index_no`=?,`date`=?,`time`=?"))
			{
				$stmt->bind_param("ssssssssssss",$sanstha_center,$school_clg_name,$address,$phone_no,$email_id,$recognition_no,$udise_no,$board,$medium,$index_no,$date,$time);
				if($stmt->execute())
				{
					return true;
				}
				return false;
			}
		}
		
		function update_clg_logo($actual_image_name)
		{
			if($stmt = $this->con->prepare("UPDATE `setting` SET `clg_logo`= ?"))
			{
				$stmt->bind_param("s",$actual_image_name);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		
		}
		
		function set_clg_logo_name_blank($delete_id)
		{
			if($stmt = $this->con->prepare("UPDATE `setting` SET `clg_logo`= '' WHERE `id` = ?"))
			{
				$stmt->bind_param("i",$delete_id);
				
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function get_clg_logo_icon($res_id)
		{
			if($stmt = $this->con->prepare("SELECT `clg_logo` FROM `setting` WHERE `id` = ?"))
			{
				$stmt->bind_param("i",$res_id);
				
				$stmt->bind_result($res_image);
				
				if($stmt->execute())
				{
					$data	=	array();
					
					if($stmt->fetch())
					{
						return $res_image;
					}
					return false;
				}
			}
		}
		
		function get_fees_title_id_from_title($fee_title)
		{
			if($stmt = $this->con->prepare("SELECT `id` FROM `fees_title_master` WHERE `fee_title`=?"))
			{
				$stmt->bind_param("s",$fee_title);
				
				$stmt->bind_result($res_id);
				
				if($stmt->execute())
				{
					if($stmt->fetch())
					{
						return $res_id;
					}
					return False;
				}
			}
		}
		
		function save_fees_title_master_details($fee_title)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("INSERT INTO `fees_title_master`(`fee_title`, `date`, `time`) VALUES (?,?,?)"))
			{
				$stmt->bind_param("sss",$fee_title,$date,$time);
				if($stmt->execute())
				{
					return true;
				}
				return false;
			}
		}
		
		function get_all_fee_title_master_data()
		{
			if($stmt = $this->con->prepare("SELECT `id`, `fee_title`, `date` FROM `fees_title_master`"))
			{ 
				$stmt->bind_result($res_id,$res_fee_title,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$res_fee_title;
						$data[$row_counter][2]	=	$res_date;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function delete_fee_title_master_data($delete_id)
		{
			if($stmt = $this->con->prepare("DELETE FROM `fees_title_master` WHERE `id`=?"))
			{
				$stmt->bind_param("i",$delete_id);
				
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function update_fees_title_master_details($fee_title,$edit_id)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("UPDATE `fees_title_master` SET `fee_title`=?,`date`=?,`time`=? WHERE `id`=?"))
			{
				$stmt->bind_param("sssi",$fee_title,$date,$time,$edit_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function get_fee_title_master_details($edit_id)
		{
		  if($stmt = $this->con->prepare("SELECT `id`, `fee_title`, `date` FROM `fees_title_master` WHERE `id`=?"))
			{ 
			   $stmt->bind_param("i",$edit_id);
				$stmt->bind_result($res_id,$res_fee_title,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					if($stmt->fetch())
					{
						$data[0]	=	$res_id;
						$data[1]	=	$res_fee_title;
					    $data[2]	=	$res_date;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function update_division_master_details($division,$edit_id)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("UPDATE `division_master` SET `division`=?,`date`=?,`time`=? WHERE `id`=?"))
			{
				$stmt->bind_param("sssi",$division,$date,$time,$edit_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function get_division_master_details($edit_id)
		{
			if($stmt = $this->con->prepare("SELECT `id`, `division`, `date` FROM `division_master` WHERE `id`=?"))
			{ 
			   $stmt->bind_param("i",$edit_id);
				$stmt->bind_result($res_id,$res_division,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					if($stmt->fetch())
					{
						$data[0]	=	$res_id;
						$data[1]	=	$res_division;
					    $data[2]	=	$res_date;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function get_fee_attribute_id_from_title($fee_type,$title)
		{
			if($stmt = $this->con->prepare("SELECT `id` FROM `fee_attributes` WHERE `fee_type`=? AND `title`=?"))
			{
				$stmt->bind_param("ss",$fee_type,$title);
				
				$stmt->bind_result($res_id);
				
				if($stmt->execute())
				{
					if($stmt->fetch())
					{
						return $res_id;
					}
					return False;
				}
			}
		}
		
		function save_fee_attributes($fee_type,$title,$amount)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("INSERT INTO `fee_attributes`(`fee_type`, `title`, `amount`, `date`, `time`) VALUES (?,?,?,?,?)"))
			{
				$stmt->bind_param("sssss",$fee_type,$title,$amount,$date,$time);
				if($stmt->execute())
				{
					return true;
				}
				return false;
			}
		}
		
		function get_all_fee_attribute_data()
		{
			if($stmt = $this->con->prepare("SELECT `id`, `fee_type`, `title`, `amount`, `date` FROM `fee_attributes`"))
			{
				$stmt->bind_result($res_id,$res_fee_type,$res_title,$res_amount,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$res_fee_type;
						$data[$row_counter][2]	=	$res_title;
						$data[$row_counter][3]	=	$res_amount;
						$data[$row_counter][4]	=	$res_date;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function delete_fee_attribution_record($delete_id)
		{
			if($stmt = $this->con->prepare("DELETE FROM `fee_attributes` WHERE `id`=?"))
			{
				$stmt->bind_param("i",$delete_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function update_fee_attribution_record($fee_type,$title,$amount,$edit_id)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("UPDATE `fee_attributes` SET `fee_type`=?,`title`=?,`amount`=?,`date`=?,`time`=? WHERE `id`=?"))
			{
				$stmt->bind_param("sssssi",$fee_type,$title,$amount,$date,$time,$edit_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function get_fee_attribute_data_from_id($edit_id)
		{
			if($stmt = $this->con->prepare("SELECT `fee_type`, `title`, `amount`, `date` FROM `fee_attributes` WHERE `id`=?"))
			{
				$stmt->bind_param("i",$edit_id);
				
				$stmt->bind_result($res_fee_type,$res_title,$res_amount,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					
					if($stmt->fetch())
					{
						$data[0]	=	$res_fee_type;
						$data[1]	=	$res_title;
						$data[2]	=	$res_amount;
						$data[3]	=	$res_date;
						
						return $data;
					}
					return false;
				}
			}
		}
		
		function get_student_name_from_id($stud_id)
		{
			if($stmt = $this->con->prepare("SELECT `student_name` FROM `student_details` WHERE `id`=?"))
			{
				$stmt->bind_param("i",$stud_id);
				
				$stmt->bind_result($res_stud_name);
				
				if($stmt->execute())
				{
					if($stmt->fetch())
					{
						return $res_stud_name;
					}
					return False;
				}
			}
		}
		
		function get_fee_receipt_data($fee_type)
		{
			if($stmt = $this->con->prepare("SELECT `title`, `amount` FROM `fee_attributes` WHERE `fee_type`=?"))
			{
				$stmt->bind_param("s",$fee_type);
				
				$stmt->bind_result($res_title,$res_amount);
				
				if($stmt->execute())
				{
					
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						
						$data[$row_counter][0]	=	$res_title;
						$data[$row_counter][1]	=	$res_amount;
					
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function save_receipt_data($fee_type,$student_insert_id,$paid_amount,$balance_amount,$receipt_no)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("INSERT INTO `receipt`(`fee_type`, `stud_id`, `paid_amount`, `balance_amount`, `receipt_id`, `date`, `time`) VALUES (?,?,?,?,?,?,?)"))
			{
				$stmt->bind_param("sssssss",$fee_type,$student_insert_id,$paid_amount,$balance_amount,$receipt_no,$date,$time);
				
				if($stmt->execute())
				{
					return $stmt->insert_id;
				}
				return false;
			}
		}
		
		function get_student_record_from_class_and_division($stud_inserted_class,$stud_inserted_division)
		{
			if($stmt = $this->con->prepare("SELECT `id`, `class`, `medium`, `division`, `roll_no`, `surname`, `student_name`, `father_name`, `mother_name`, `stud_cont_no`, `father_cont_no`, `address`, `student_image` FROM `student_details` WHERE `class`=? AND `division`=?"))
			{
				$stmt->bind_param("ss",$stud_inserted_class,$stud_inserted_division);
				
				$stmt->bind_result($res_id,$res_class,$res_medium,$res_division,$res_roll_no,$res_surname,$res_stud_name,$res_father_name,$res_mother_name,$res_stud_cont,$res_father_cont,$res_address,$res_student_image);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$res_class;
						$data[$row_counter][2]	=	$res_medium;
						$data[$row_counter][3]	=	$res_division;
						$data[$row_counter][4]	=	$res_roll_no;
						$data[$row_counter][5]	=	$res_surname;
						$data[$row_counter][6]	=	$res_stud_name;
						$data[$row_counter][7]	=	$res_father_name;
						$data[$row_counter][8]	=	$res_mother_name;
						$data[$row_counter][9]	=	$res_stud_cont;
						$data[$row_counter][10]	=	$res_father_cont;
						$data[$row_counter][11]	=	$res_address;
						$data[$row_counter][12]	=	$res_student_image;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function get_student_record_from_id($admission_receipt_id)
		{ 
			if($stmt = $this->con->prepare("SELECT `paid_amount`, `balance_amount`, `receipt_id`, `date` FROM `receipt` WHERE `id`=?"))
			{ 
				$stmt->bind_param("i",$admission_receipt_id);
				
				$stmt->bind_result($res_paid_amount,$res_balance_amount,$res_receipt_no,$date);
				
				if($stmt->execute())
				{
					$data	=	array();
					
					if($stmt->fetch())
					{
						$data[1]	=	$res_paid_amount;
						$data[2]	=	$res_balance_amount;
						$data[3]	=	$res_receipt_no;
						$data[4]	=	$date;
						
						
						return $data;
					}
					return false;
				}
			}
		}
		
		function get_previous_paid_fees($admission_repay_receipt_id,$res_stud_id)
		{
			if($stmt = $this->con->prepare("SELECT SUM(`paid_amount`) FROM `receipt` WHERE `stud_id` = ? AND `id`!=?"))
			{
				$stmt->bind_param("si",$res_stud_id,$admission_repay_receipt_id);
				
				$stmt->bind_result($res_paid_amount);
				
				if($stmt->execute())
				{
					if($stmt->fetch())
					{
						return $res_paid_amount;
					}
					return False;
				}
			}
		}
		
		function get_receipt_no_from_fee_type($fee_type)
		{
			if($stmt = $this->con->prepare("SELECT `receipt_id` FROM `receipt` WHERE `fee_type`=? order by `id` DESC"))
			{
				$stmt->bind_param("s",$fee_type);
				
				$stmt->bind_result($res_receipt_id);
				
				if($stmt->execute())
				{
					if($stmt->fetch())
					{
						return $res_receipt_id;
					}
					return False;
				}
			}
		}
		
		function get_fee_receipt_data_from_date($from_date,$to_date,$searched_fee_type)
		{
			if($stmt = $this->con->prepare("SELECT A.`id`, A.`fee_type`, A.`stud_id`, A.`paid_amount`, A.`balance_amount`, A.`date`, A.`time` FROM `receipt` AS A INNER JOIN `student_details` AS B ON A.`stud_id`= B.`id` where A.`id` IN (Select MAX(`id`) from `receipt` GROUP BY `stud_id`) AND (A.`date` BETWEEN ? AND ?) AND A.`fee_type` LIKE '%$searched_fee_type%' AND A.`status` != 'Cancelled' "))
			{	
				$stmt->bind_param("ss",$from_date,$to_date);
				
				$stmt->bind_result($res_id,$res_fee_type,$res_stud_id,$res_paid_amount,$res_balance_amount,$res_date,$res_time);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						 $data[$row_counter][0]	=	$res_id;
						 $data[$row_counter][1]	=	$res_fee_type;
						 $data[$row_counter][2]	=	$res_stud_id;
						$data[$row_counter][3]	=	$res_paid_amount;
						$data[$row_counter][4]	=	$res_balance_amount;
						$data[$row_counter][5]	=	$res_date;
						$data[$row_counter][6]	=	$res_time;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			
			}
		}
		
		function get_receipt_data()
		{
			if($stmt = $this->con->prepare("SELECT `id`, `fee_type`, `stud_id`, `paid_amount`, `balance_amount`, `date`, `time` FROM `receipt` where `status` != 'Cancelled'"))
			{	
				$stmt->bind_result($res_id,$res_fee_type,$res_stud_id,$res_paid_amount,$res_balance_amount,$res_date,$res_time);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$res_fee_type;
						$data[$row_counter][2]	=	$res_stud_id;
						$data[$row_counter][3]	=	$res_paid_amount;
						$data[$row_counter][4]	=	$res_balance_amount;
						$data[$row_counter][5]	=	$res_date;
						$data[$row_counter][6]	=	$res_time;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}			
			}
		}
		
		function get_student_data_from_id($res_stud_id)
		{
			if($stmt = $this->con->prepare("SELECT `class`, `medium`, `division`, `roll_no`, `surname`, `student_name`, `father_name`, `student_image` FROM `student_details` WHERE `id`=?"))
			{
				$stmt->bind_param("i",$res_stud_id);
				
				$stmt->bind_result($res_class,$res_medium,$res_division,$res_roll_no,$res_surname,$res_stud_name,$res_father_name,$res_stud_img);
				
				if($stmt->execute())
				{
					$data	=	array();
					
					if($stmt->fetch())
					{
						$data[0]	=	$res_class;
						$data[1]	=	$res_medium;
						$data[2]	=	$res_division;
						$data[3]	=	$res_roll_no;
						$data[4]	=	$res_surname;
						$data[5]	=	$res_stud_name;
						$data[6]	=	$res_father_name;
						$data[7]	=	$res_stud_img;
						return $data;
					}
					return false;
				}
			}
		}
		
		function get_receipt_data_from_id($edit_id)
		{
			if($stmt = $this->con->prepare("SELECT `fee_type`, `stud_id`, `paid_amount`, `balance_amount`, `receipt_id`, `date` FROM `receipt` WHERE `id`=?"))
			{
				$stmt->bind_param("i",$edit_id);
				
				$stmt->bind_result($res_fee_type,$res_stud_id,$res_paid_amount,$res_balance_amount,$res_receipt,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					
					if($stmt->fetch())
					{
						$data[0]	=	$res_fee_type;
						$data[1]	=	$res_stud_id;
						$data[2]	=	$res_paid_amount;
						$data[3]	=	$res_balance_amount;
						$data[4]	=	$res_receipt;
						$data[5]	=	$res_date;
						
						return $data;
					}
					return false;
				}
			}
		}
		
		function update_fee_receipt_data($paid_amount,$balance_amount,$edit_id)
		{
			if($stmt = $this->con->prepare("UPDATE `receipt` SET `paid_amount`=?,`balance_amount`=? WHERE `id`=?"))
			{
				$stmt->bind_param("ssi",$paid_amount,$balance_amount,$edit_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		
		}
		
		function update_fee_receipt_status($cancel_id,$cancel_fee_type)
		{
			if($stmt = $this->con->prepare("UPDATE `receipt` SET `status`= 'Cancelled'  WHERE `stud_id` = ? AND `fee_type`=?"))
			{
				$stmt->bind_param("ss",$cancel_id,$cancel_fee_type);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function get_admisssion_balance_data_from_date($from_date,$to_date,$searched_fee_type,$searched_class,$searched_medium,$searched_division)
		{
			if($stmt = $this->con->prepare("SELECT A.`id`, A.`fee_type`, A.`stud_id`, A.`paid_amount`, A.`balance_amount`, A.`date`, A.`time` FROM `receipt` AS A INNER JOIN `student_details` AS B ON A.`stud_id`= B.`id` WHERE A.`balance_amount` > 0 AND (A.`date` BETWEEN ? AND ?) AND A.`fee_type` LIKE '%$searched_fee_type%' AND B.`class` LIKE '%$searched_class%' AND B.`medium` LIKE '%$searched_medium%' AND B.`division` LIKE '%$searched_division%' AND A.`id` IN(Select MAX(`id`) FROM `receipt` GROUP BY `stud_id`) AND A.`status` != 'Cancelled'"))
			{	
				$stmt->bind_param("ss",$from_date,$to_date);
				
				$stmt->bind_result($res_id,$res_fee_type,$res_stud_id,$res_paid_amount,$res_balance_amount,$res_date,$res_time);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$res_fee_type;
						$data[$row_counter][2]	=	$res_stud_id;
						$data[$row_counter][3]	=	$res_paid_amount;
						$data[$row_counter][4]	=	$res_balance_amount;
						$data[$row_counter][5]	=	$res_date;
						$data[$row_counter][6]	=	$res_time;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		
		}
		
		function get_admisssion_balance_data()
		{
			if($stmt = $this->con->prepare("SELECT `id`, `fee_type`, `stud_id`, `paid_amount`, `balance_amount`, `date`, `time` FROM `receipt` WHERE `balance_amount` > 0 AND `id` IN (Select MAX(`id`) from `receipt` GROUP BY `stud_id`)"))
			{	
				$stmt->bind_result($res_id,$res_fee_type,$res_stud_id,$res_paid_amount,$res_balance_amount,$res_date,$res_time);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$res_fee_type;
						$data[$row_counter][2]	=	$res_stud_id;
						$data[$row_counter][3]	=	$res_paid_amount;
						$data[$row_counter][4]	=	$res_balance_amount;
						$data[$row_counter][5]	=	$res_date;
						$data[$row_counter][6]	=	$res_time;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function get_admission_data_from_id($repay_id)
		{
			if($stmt = $this->con->prepare("SELECT `fee_type`, `stud_id`, `paid_amount`, `balance_amount`, `date` FROM `receipt` WHERE `id`=? AND `status`!='Cancelled' ORDER By `id` DESC"))
			{
				$stmt->bind_param("i",$repay_id);
				
				$stmt->bind_result($res_fee_type,$res_stud_id,$res_paid_amount,$res_balance_amount,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					
					if($stmt->fetch())
					{
						$data[0]	=	$res_fee_type;
						$data[1]	=	$res_stud_id;
						$data[2]	=	$res_paid_amount;
						$data[3]	=	$res_balance_amount;
						$data[4]	=	$res_date;
						
						return $data;
					}
					return false;
				}
			}
		}
		
		function get_sum_of_total_paid_amount($res_stud_id)
		{
			if($stmt = $this->con->prepare("SELECT SUM(`paid_amount`) FROM `receipt` WHERE `stud_id`=?"))
			{
				$stmt->bind_param("s",$res_stud_id);
				
				$stmt->bind_result($res_paid_amount);
				
				if($stmt->execute())
				{
					if($stmt->fetch())
					{
						return $res_paid_amount;
					}
					return False;
				}
			}
		}
		
		function get_all_admission_cancelled_receipts()
		{
			if($stmt = $this->con->prepare("SELECT A.`id`, A.`fee_type`, A.`stud_id`, A.`paid_amount`, A.`balance_amount`, A.`returned_amount`, A.`kept_amount`, A.`date` FROM `receipt` AS A INNER JOIN `student_details` AS B ON A.`stud_id`= B.`id` where A.`status` = 'Cancelled' AND A.`id` IN (Select MAX(`id`) from `receipt` GROUP BY `stud_id`)"))
			{	
				$stmt->bind_result($res_id,$res_fee_type,$res_stud_id,$res_paid_amount,$res_balance_amount,$res_returned_amount,$res_kept_amount,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$res_stud_id;
						$data[$row_counter][2]	=	$res_paid_amount;
						$data[$row_counter][3]	=	$res_balance_amount;
						$data[$row_counter][4]	=	$res_returned_amount;
						$data[$row_counter][5]	=	$res_kept_amount;
						$data[$row_counter][6]	=	$res_date;
						$data[$row_counter][7]	=	$res_fee_type;
						
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		
		function get_admission_cancelled_receipts($searched_fee_type,$searched_class,$searched_medium,$searched_division)
		{
			if($stmt = $this->con->prepare("SELECT A.`id`, A.`fee_type`, A.`stud_id`, A.`paid_amount`, A.`balance_amount`, A.`returned_amount`, A.`kept_amount`, A.`date` FROM `receipt` AS A INNER JOIN `student_details` AS B ON A.`stud_id`= B.`id` where A.`status` = 'Cancelled' AND A.`fee_type` LIKE '%$searched_fee_type%' AND B.`class` LIKE '%$searched_class%' AND B.`medium` LIKE '%$searched_medium%' AND B.`division` LIKE '%$searched_division%' AND A.`id` IN (Select MAX(`id`) from `receipt` GROUP BY `stud_id`)"))
			{	
				$stmt->bind_result($res_id,$res_fee_type,$res_stud_id,$res_paid_amount,$res_balance_amount,$res_returned_amount,$res_kept_amount,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$res_stud_id;
						$data[$row_counter][2]	=	$res_paid_amount;
						$data[$row_counter][3]	=	$res_balance_amount;
						$data[$row_counter][4]	=	$res_returned_amount;
						$data[$row_counter][5]	=	$res_kept_amount;
						$data[$row_counter][6]	=	$res_date;
						$data[$row_counter][7]	=	$res_fee_type;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function get_admission_cancelled_receipts_details_from_id($cancelled_admission_id)
		{
			if($stmt = $this->con->prepare("SELECT `id`, `fee_type`, `stud_id`, SUM(`paid_amount`), `balance_amount` FROM `receipt` WHERE `stud_id`=?"))
			{	
				$stmt->bind_param("i",$cancelled_admission_id);
				
				$stmt->bind_result($res_id,$res_fee_type,$res_stud_id,$res_paid_amount,$res_balance_amount);
				
				if($stmt->execute())
				{
					$data	=	array();
					
					if($stmt->fetch())
					{
						$data[0]	=	$res_id;
						$data[1]	=	$res_fee_type;
						$data[2]	=	$res_stud_id;
						$data[3]	=	$res_paid_amount;
						$data[4]	=	$res_balance_amount;
						
						return $data;
					}
					
					return false;
				}
			}
		}
		
		function update_cancel_fee_attributes($retuned_amount,$kept_amount,$cancelled_admission_id)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("UPDATE `receipt` SET `returned_amount`=?,`kept_amount`=?,`date`=?,`time`=? WHERE `stud_id`=?"))
			{
				$stmt->bind_param("ssssi",$retuned_amount,$kept_amount,$date,$time,$cancelled_admission_id);
				
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function get_cancelled_adms_receipt_data_from_id($res_id)
		{
			if($stmt = $this->con->prepare("SELECT A.`id`, A.`fee_type`, A.`stud_id`, A.`paid_amount`, A.`balance_amount`, A.`receipt_id`, A.`returned_amount`, A.`kept_amount`, A.`date` FROM `receipt` AS A INNER JOIN `student_details` AS B ON A.`stud_id`= B.`id` where A.`status` = 'Cancelled' AND A.`id` = ? AND A.`id` IN (Select MAX(`id`) from `receipt` GROUP BY `stud_id`)"))
			{	
				$stmt->bind_param("i",$res_id);
				
				$stmt->bind_result($res_id,$res_fee_type,$res_stud_id,$res_paid_amount,$res_balance_amount,$res_receipt,$res_returned_amount,$res_kept_amount,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					
					if($stmt->fetch())
					{
						$data[0]	=	$res_id;
						$data[1]	=	$res_fee_type;
						$data[2]	=	$res_stud_id;
						$data[3]	=	$res_paid_amount;
						$data[4]	=	$res_balance_amount;
						$data[5]	=	$res_returned_amount;
						$data[6]	=	$res_kept_amount;
						$data[7]	=	$res_date;
						$data[8]	=	$res_receipt;
						
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function update_student_status($cancel_id)
		{
			if($stmt = $this->con->prepare("UPDATE `student_details` SET `status`='Cancelled' WHERE `id`=?"))
			{
				$stmt->bind_param("i",$cancel_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function get_type_master_id_from_title($type)
		{
			if($stmt = $this->con->prepare("SELECT `id` FROM `type_master` WHERE `title`=?"))
			{
				$stmt->bind_param("s",$type);
				
				$stmt->bind_result($res_id);
				
				if($stmt->execute())
				{
					if($stmt->fetch())
					{
						return $res_id;
					}
					return False;
				}
			}
		}
		
		function save_type_master_details($type)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("INSERT INTO `type_master`(`title`, `date`, `time`) VALUES (?,?,?)"))
			{
				$stmt->bind_param("sss",$type,$date,$time);
				if($stmt->execute())
				{
					return true;
				}
				return false;
			}
		}
		
		function delete_type_master_data($delete_id)
		{
			if($stmt = $this->con->prepare("DELETE FROM `type_master` WHERE `id`=?"))
			{
				$stmt->bind_param("i",$delete_id);
				
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		
		}
		
		function get_all_type_master_data()
		{
			if($stmt = $this->con->prepare("SELECT `id`, `title`, `date` FROM `type_master`"))
			{ 
				$stmt->bind_result($res_id,$res_title,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$res_title;
						$data[$row_counter][2]	=	$res_date;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function update_type_master_details($type,$edit_id)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("UPDATE `type_master` SET `title`=?,`date`=?,`time`=? WHERE `id`=?"))
			{
				$stmt->bind_param("sssi",$type,$date,$time,$edit_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		
		}
		
		function get_type_master_details($edit_id)
		{
			if($stmt = $this->con->prepare("SELECT `id`, `title`, `date` FROM `type_master` WHERE `id`=?"))
			{ 
			   $stmt->bind_param("i",$edit_id);
				$stmt->bind_result($res_id,$res_title,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					if($stmt->fetch())
					{
						$data[0]	=	$res_id;
						$data[1]	=	$res_title;
					    $data[2]	=	$res_date;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function get_language_master_id_from_title($language)
		{
			if($stmt = $this->con->prepare("SELECT `id` FROM `language_master` WHERE `title`=?"))
			{
				$stmt->bind_param("s",$language);
				
				$stmt->bind_result($res_id);
				
				if($stmt->execute())
				{
					if($stmt->fetch())
					{
						return $res_id;
					}
					return False;
				}
			}
		}
		
		function save_language_master_details($language)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("INSERT INTO `language_master`(`title`, `date`, `time`) VALUES (?,?,?)"))
			{
				$stmt->bind_param("sss",$language,$date,$time);
				if($stmt->execute())
				{
					return true;
				}
				return false;
			}
		}
		
		function delete_language_master_data($delete_id)
		{
			if($stmt = $this->con->prepare("DELETE FROM `language_master` WHERE `id`=?"))
			{
				$stmt->bind_param("i",$delete_id);
				
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function get_all_language_master_data()
		{
			if($stmt = $this->con->prepare("SELECT `id`, `title`, `date` FROM `language_master`"))
			{ 
				$stmt->bind_result($res_id,$res_title,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$res_title;
						$data[$row_counter][2]	=	$res_date;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function update_language_master_details($language,$edit_id)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("UPDATE `language_master` SET `title`=?,`date`=?,`time`=? WHERE `id`=?"))
			{
				$stmt->bind_param("sssi",$language,$date,$time,$edit_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function get_language_master_details($edit_id)
		{
			if($stmt = $this->con->prepare("SELECT `id`, `title`, `date` FROM `language_master` WHERE `id`=?"))
			{ 
			   $stmt->bind_param("i",$edit_id);
				$stmt->bind_result($res_id,$res_title,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					if($stmt->fetch())
					{
						$data[0]	=	$res_id;
						$data[1]	=	$res_title;
					    $data[2]	=	$res_date;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function save_book_details_tmp($language,$book_isbn,$book_title,$book_type,$author_name,$edition,$quantity,$purchase_date,$price,$pages,$publisher,$res_id)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("INSERT INTO `tmp_book_details`(`language`, `isbn_no`, `book_title`, `book_type`, `author_name`, `edition`, `publisher`, `quantity`, `price`, `pages`, `purchase_date`, `date`, `time`, `book_id`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)"))
			{
				$stmt->bind_param("ssssssssssssss",$language,$book_isbn,$book_title,$book_type,$author_name,$edition,$publisher,$quantity,$price,$pages,$purchase_date,$date,$time,$res_id);
				if($stmt->execute())
				{
					return $stmt->insert_id;
				}
				return false;
			}
		
		}
		
		function get_book_details_from_permanent($language,$book_isbn,$book_title,$book_type,$author_name,$edition,$publisher)
		{
			if($stmt = $this->con->prepare("SELECT `id`, `total_quantity` FROM `book_details` WHERE `language`=? AND `isbn_no`=? AND `book_title`=? AND `book_type`=? AND `author_name`=? AND `edition`=? AND `publisher`=?"))
			{
				$stmt->bind_param("sssssss",$language,$book_isbn,$book_title,$book_type,$author_name,$edition,$publisher);
				
				$stmt->bind_result($res_id,$res_quantity);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					if($stmt->fetch())
					{
						$data[0]	=	$res_id;
						$data[1]	=	$res_quantity;
					   
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function save_book_details_into_permanent($language,$book_isbn,$book_title,$book_type,$author_name,$edition,$publisher,$total_quantity,$issued_quantity)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("INSERT INTO `book_details`(`language`, `isbn_no`, `book_title`, `book_type`, `author_name`, `edition`, `publisher`, `total_quantity`, `issued_book`, `date`, `time`) VALUES (?,?,?,?,?,?,?,?,?,?,?)"))
			{
				$stmt->bind_param("sssssssssss",$language,$book_isbn,$book_title,$book_type,$author_name,$edition,$publisher,$total_quantity,$issued_quantity,$date,$time);
				if($stmt->execute())
				{
					return $stmt->insert_id;
				}
				return false;
			}
		}
		
		function updates_book_details_into_permanent($language,$book_isbn,$book_title,$book_type,$author_name,$edition,$publisher,$total_quantity,$issued_quantity,$res_id)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("UPDATE `book_details` SET `language`=?,`isbn_no`=?,`book_title`=?,`book_type`=?,`author_name`=?,`edition`=?,`publisher`=?,`total_quantity`=?,`issued_book`=?,`date`=?,`time`=? WHERE `id`=?"))
			{
				$stmt->bind_param("sssssssssssi",$language,$book_isbn,$book_title,$book_type,$author_name,$edition,$publisher,$total_quantity,$issued_quantity,$date,$time,$res_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function get_all_book_details_form_permanent()
		{
			if($stmt = $this->con->prepare("SELECT `id`, `language`, `isbn_no`, `book_title`, `book_type`, `author_name`, `edition`, `publisher`, `total_quantity`, `issued_book`, `date` FROM `book_details`"))
			{
				$stmt->bind_result($res_id,$res_language,$res_isbn_no,$res_book_title,$res_book_type,$res_anthor_name,$res_edition,$res_publisher,$res_total_quantity,$res_issued_book,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$res_language;
						$data[$row_counter][2]	=	$res_isbn_no;
						$data[$row_counter][3]	=	$res_book_title;
						$data[$row_counter][4]	=	$res_book_type;
						$data[$row_counter][5]	=	$res_anthor_name;
						$data[$row_counter][6]	=	$res_edition;
						$data[$row_counter][7]	=	$res_publisher;
						$data[$row_counter][8]	=	$res_total_quantity;
						$data[$row_counter][9]	=	$res_issued_book;
						$data[$row_counter][10]	=	$res_date;
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function get_all_book_details_form_temp()
		{
			if($stmt = $this->con->prepare("SELECT `id`, `language`, `isbn_no`, `book_title`, `book_type`, `author_name`, `edition`, `publisher`, `quantity`, `price`, `pages`, `purchase_date`, `date`, `book_id` FROM `tmp_book_details`"))
			{
				$stmt->bind_result($res_id,$res_language,$res_isbn_no,$res_book_title,$res_book_type,$res_anthor_name,$res_edition,$res_publisher,$res_quantity,$res_price,$res_pages,$res_purchase_date,$res_date,$res_book_id);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$res_language;
						$data[$row_counter][2]	=	$res_isbn_no;
						$data[$row_counter][3]	=	$res_book_title;
						$data[$row_counter][4]	=	$res_book_type;
						$data[$row_counter][5]	=	$res_anthor_name;
						$data[$row_counter][6]	=	$res_edition;
						$data[$row_counter][7]	=	$res_publisher;
						$data[$row_counter][8]	=	$res_quantity;
						$data[$row_counter][9]	=	$res_price;
						$data[$row_counter][10]	=	$res_pages;
						$data[$row_counter][11]	=	$res_purchase_date;
						$data[$row_counter][12]	=	$res_date;
						$data[$row_counter][13]	=	$res_book_id;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function delete_book_details_record_from_temp($delete_id)
		{
			if($stmt = $this->con->prepare("DELETE FROM `tmp_book_details` WHERE `id`=?"))
			{
				$stmt->bind_param("i",$delete_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function upadate_book_details_into_tmp($inserted_id,$tmp_insert_id)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("UPDATE `tmp_book_details` SET `book_id`=? WHERE `id`=?"))
			{
				$stmt->bind_param("si",$inserted_id,$tmp_insert_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function get_book_deleted_quantity_from_tmp($delete_id)
		{
			if($stmt = $this->con->prepare("SELECT `quantity` FROM `tmp_book_details` WHERE `id`=?"))
			{
				$stmt->bind_param("i",$delete_id);
				
				$stmt->bind_result($res_quantity);
				
				if($stmt->execute())
				{
					if($stmt->fetch())
					{
						return $res_quantity;
					}
					return False;
				}
			}
		}
		
		function update_book_quantity_into_permanent($current_quantity,$book_id)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("UPDATE `book_details` SET `total_quantity`=`total_quantity` - '$current_quantity' WHERE `id`=?"))
			{
				$stmt->bind_param("i",$book_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		
		}
		
		function save_magazine_master_title_details($language,$type,$name)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("INSERT INTO `magazine-master`( `language`, `type`, `name`, `date`, `time`) VALUES (?,?,?,?,?)"))
			{
				$stmt->bind_param("sssss",$language,$type,$name,$date,$time);
				if($stmt->execute())
				{
					return true;
				}
				return false;
			}
		}
		
		function delete_magazine_master_data($delete_id)
		{
			if($stmt = $this->con->prepare("DELETE FROM `magazine-master` WHERE `id`=?"))
			{
				$stmt->bind_param("i",$delete_id);
				
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function get_all_magazine_master_data()
		{
			if($stmt = $this->con->prepare("SELECT `id`, `language`, `type`, `name`, `date` FROM `magazine-master`"))
			{ 
				$stmt->bind_result($res_id,$language,$type,$name,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$language;
						$data[$row_counter][2]	=	$type;
						$data[$row_counter][3]	=	$name;
						$data[$row_counter][4]	=	$res_date;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function save_magazine_details($m_n_id,$dateofreceipt,$publishdate,$pages,$pricepublisher,$quantity)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("INSERT INTO `magazine`( `m_n_id`, `dateofreceipt`, `publishdate`, `pages`, `pricepublisher`, `quantity`, `date`, `time`) VALUES (?,?,?,?,?,?,?,?)"))
			{
				$stmt->bind_param("ssssssss",$m_n_id,$dateofreceipt,$publishdate,$pages,$pricepublisher,$quantity,$date,$time);
				
				if($stmt->execute())
				{
					return true;
				}
				return false;
			}
		}
		
		function delete_magazine_data($delete_id)
		{
			if($stmt = $this->con->prepare("DELETE FROM `magazine` WHERE `id`=?"))
			{
				$stmt->bind_param("i",$delete_id);
				
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function get_all_magazine_data()
		{
			if($stmt = $this->con->prepare("SELECT `id`, `m_n_id`, `dateofreceipt`, `publishdate`, `pages`, `pricepublisher`, `quantity`, `date` FROM `magazine`"))
			{ 
				$stmt->bind_result($res_id,$m_n_id,$dateofreceipt,$publishdate,$pages,$pricepublisher,$quantity,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=    $m_n_id;
						$data[$row_counter][2]	=	$dateofreceipt;
						$data[$row_counter][3]	=	$publishdate;
						$data[$row_counter][4]	=	$pages;
						$data[$row_counter][5]	=	$pricepublisher;
						$data[$row_counter][6]	=	$quantity;
						$data[$row_counter][7]	=	$res_date;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function update_magazine_master_details($language,$type,$name,$edit_id)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("UPDATE `magazine-master` SET `language`=?,`type`=?,`name`=?,`date`=?,`time`=? WHERE `id`=?"))
			{
				$stmt->bind_param("sssssi",$language,$type,$name,$date,$time,$edit_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function get_magazine_master_details($edit_id)
		{
		  if($stmt = $this->con->prepare("SELECT `id`, `language`, `type`, `name`, `date`  FROM `magazine-master` WHERE `id`=?"))
			{ 
			   $stmt->bind_param("i",$edit_id);
				$stmt->bind_result($res_id,$language,$type,$name,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					if($stmt->fetch())
					{
						$data[0]	=	$res_id;
						$data[1]	=	$language;
						$data[2]	=	$type;
						$data[3]	=	$name;
					    $data[4]	=	$res_date;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		function update_magazine_details($m_n_id,$dateofreceipt,$publishdate,$pages,$pricepublisher,$quantity,$edit_id)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			if($stmt = $this->con->prepare("UPDATE `magazine` SET `m_n_id`=?,`dateofreceipt`=?,`publishdate`=?,`pages`=?,`pricepublisher`=?,`quantity`=?,`date`=?,`time`=? WHERE `id`=?"))
			{
				$stmt->bind_param("ssssssssi",$m_n_id,$dateofreceipt,$publishdate,$pages,$pricepublisher,$quantity,$date,$time,$edit_id);
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		
		function get_magazine_details($edit_id)
		{
		  if($stmt = $this->con->prepare("SELECT `id`,`m_n_id`, `dateofreceipt`, `publishdate`, `pages`, `pricepublisher`, `quantity`, `date`  FROM `magazine` WHERE `id`=?"))
			{ 
			   $stmt->bind_param("i",$edit_id);
				$stmt->bind_result($res_id,$m_n_id,$dateofreceipt,$publishdate,$pages,$pricepublisher,$quantity,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					if($stmt->fetch())
					{
						$data[0]	=	$res_id;
						$data[1]	=	$m_n_id;
						$data[2]	=	$dateofreceipt;
						$data[3]	=	$publishdate;
						$data[4]	=	$pages;
						$data[5]	=	$pricepublisher;
						$data[6]	=	$quantity;
					    $data[7]	=	$res_date;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		
		
		
		
		function add_faculty($full_name,$designation,$qualification,$subject,$experience,$email,$department,$staff,$actual_image_name,$user_id,$password)
			{							
				$date = date("Y-m-d");
				$time = date("H-i-s A");
				if($stmt_insert = $this->con->prepare("INSERT INTO `faculty_information`(`full_name`, `designation`, `qualification`, `subject`, `experience`, `email`, `department`, `staff`, `profile`, `date`, `time`, `user_id`, `password`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)"))
				{
					$stmt_insert->bind_param("sssssssssssss",$full_name,$designation,$qualification,$subject,$experience,$email,$department,$staff,$actual_image_name,$date,$time,$user_id,$password);
					
					if($stmt_insert->execute())
					{
						return true;
					}
						return false;
				} 	
			}
			function get_all_faculty_info()
			{	
				if($stmt_insert = $this->con->prepare("SELECT `id`, `full_name`, `designation`, `qualification`, `subject`, `experience`, `email`, `department`, `staff`, `profile` FROM `faculty_information`"))
				{	
					$stmt_insert->bind_result($id,$full_name,$designation,$qualification,$subject,$experience,$email,$department,$staff,$profile);
					
					if($stmt_insert->execute())
					{ 
							$counter	=	0;
							$details	=	array();
						while($stmt_insert->fetch())
						{
							$details[$counter][0]	=	$id;
							$details[$counter][1]	=	$full_name;
							$details[$counter][2]	=	$designation;
							$details[$counter][3]	=	$qualification;
							$details[$counter][4]	=	$subject;
							$details[$counter][5]	=	$experience;
							$details[$counter][6]	=	$email;
							$details[$counter][7]	=	$department;
							$details[$counter][8]	=	$staff;
							$details[$counter][9]	=	$profile;
						
							$counter++;
						}
						if(!empty($details))	
						{
							return $details;
						}
						return false;
					}	
				}
			}
			function delete_faculty_info($del_id)
			{
				if($stmt_select = $this->con->prepare("DELETE FROM `faculty_information` WHERE `id`=?"))
				{
					$stmt_select->bind_param("i",$del_id);
				
					if($stmt_select->execute())
					{					
							return true;
					}
						return false;
				}
			}
			
			function get_all_faculty_info_by_id($up_id)
			{	
				if($stmt_insert = $this->con->prepare("SELECT `id`, `full_name`, `designation`, `qualification`, `subject`, `experience`, `email`, `department`, `staff`, `profile` FROM `faculty_information` WHERE `id`=?"))
				{	
					$stmt_insert->bind_param("i",$up_id);
					
					$stmt_insert->bind_result($id,$full_name,$designation,$qualification,$subject,$experience,$email,$department,$staff,$profile);
					
					if($stmt_insert->execute())
					{
							$counter	=	0;
							$details	=	array();
						while($stmt_insert->fetch())
						{
							$details[$counter][0]	=	$id;
							$details[$counter][1]	=	$full_name;
							$details[$counter][2]	=	$designation;
							$details[$counter][3]	=	$qualification;
							$details[$counter][4]	=	$subject;
							$details[$counter][5]	=	$experience;
							$details[$counter][6]	=	$email;
							$details[$counter][7]	=	$department;
							$details[$counter][8]	=	$staff;
							$details[$counter][9]	=	$profile;
						
							$counter++;
						}
						if(!empty($details))	
						{
							return $details;
						}
						return false;
					}	
				}
			}
			
			function update_faculty_profile($up_id)
			{	
				$actual_image_name="";
				
				if($stmt_insert = $this->con->prepare("UPDATE `faculty_information` set `profile` = ? Where `id`=?"))
				{
					$stmt_insert->bind_param("si",$actual_image_name,$up_id);
					
					if($stmt_insert->execute())
					{
						return true;
					}
						return false;
				} 	
			}
			function get_faculty_image_name_by_id($id)
			{
				if($stmt_select = $this->con->prepare("Select `profile` from `faculty_information` where `id` = ? "))
				{	
					$stmt_select->bind_param("i",$id);
				
					$stmt_select->bind_result($result_password);
				
					if($stmt_select->execute())
					{
						if($stmt_select->fetch())
						{
							return $result_password;
						}
					}
							return false;
				}
			}
			function update_faculty_image_info($up_id,$image)
			{	
				if($stmt_insert = $this->con->prepare("UPDATE `faculty_information` set `profile` = ? Where `id`=?"))
				{
					$stmt_insert->bind_param("si",$image,$up_id);
					
					if($stmt_insert->execute())
					{
						return true;
					}
						return false;
				} 	
			}
			function update_faculty($up_id,$full_name,$designation,$qualification,$subject,$experience,$email,$department,$staff)
			{							
				$date = date("Y-m-d");
				$time = date("H-i-s A");
				if($stmt_insert = $this->con->prepare("UPDATE `faculty_information` set `full_name`=?,`designation`=?,`qualification`=?,`subject`=?,`experience`=?,`email`=?,`department`=?,`staff`=? Where `id`=?"))
				{
					$stmt_insert->bind_param("ssssssssi",$full_name,$designation,$qualification,$subject,$experience,$email,$department,$staff,$up_id);
					
					if($stmt_insert->execute())
					{
						return true;
					}
						return false;
				} 	
			}
			
			
			function save_complaint_title_detail($title)
			{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			    if($stmt = $this->con->prepare("INSERT INTO `complaint-master`(`title`, `date`, `time`) VALUES (?,?,?)"))
						{
						$stmt->bind_param("sss",$title,$date,$time);
						if($stmt->execute())
						{
							return true;
						}
						return false;
						}
			}
		function get_complaint_title_detail($title)
		{
			if($stmt = $this->con->prepare("SELECT `id` FROM `complaint-master` WHERE `title`=?"))
			{
				$stmt->bind_param("s",$title);
				
				$stmt->bind_result($res_id);
				
				if($stmt->execute())
				{
					if($stmt->fetch())
					{
						return $res_id;
					}
					return False;
				}
			}
		}
		function get_all_complaint_title_data()
		{ 
			if($stmt = $this->con->prepare("SELECT `id`, `title`, `date` FROM `complaint-master` "))
			{ 
				$stmt->bind_result($res_id,$res_title,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$res_title;
						$data[$row_counter][2]	=	$res_date;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
			}
		function delete_complaint_title_data($delete_id)
		{
			if($stmt = $this->con->prepare("DELETE FROM `complaint-master` WHERE `id`=?"))
			{
				$stmt->bind_param("i",$delete_id);
				
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		function update_complaint_master($title,$edit_id)
		{ 
			if($stmt = $this->con->prepare("UPDATE `complaint-master` SET `title`=? WHERE `id`=?"))
			{
				$stmt->bind_param("si",$title,$edit_id);
				if($stmt->execute())
				{
					return true;
				}
				return false;
			}
		}
		function get_complaint_master($edit_id)
		{ 
		  if($stmt = $this->con->prepare("SELECT `title` FROM `complaint-master` WHERE `id`=?"))
			{ echo $edit_id;
			   $stmt->bind_param("i",$edit_id);
				$stmt->bind_result($title);
				
				if($stmt->execute())
				{ 
					if($stmt->fetch())
					{
					  echo $title;
						return	$title;
					
					}
					
						return false;
					
				}
			}
		}
		function save_post_complaint_title_detail($complaint_title,$subject,$descriptive)
			{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			
			    if($stmt = $this->con->prepare("INSERT INTO `post_compaint`(`complaint_title`, `subject`, `descriptive`, `date`, `time`) VALUES (?,?,?,?,?)"))
						{
						$stmt->bind_param("sssss",$complaint_title,$subject,$descriptive,$date,$time);
						if($stmt->execute())
						{
							return true;
						}
						return false;
						}
			}
		
		function get_all_post_complaint_title_data()
		{ 
			if($stmt = $this->con->prepare("SELECT `id`, `complaint_title`, `subject`, `descriptive`, `date` FROM `post_compaint`"))
			{ 
				$stmt->bind_result($res_id,$complaint_title,$subject,$descriptive,$res_date);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$complaint_title;
						$data[$row_counter][2]	=	$subject;
						$data[$row_counter][3]	=	$descriptive;
						$data[$row_counter][4]	=	$res_date;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
			function get_all_report_post_title_data($complaint_title,$subject,$descriptive)
	    	{ 
				if($stmt = $this->con->prepare("SELECT `id`, `complaint_title`, `subject`, `descriptive`, `date` FROM `post_compaint` WHERE `complaint_title`=? AND `date` BETWEEN ? AND ?"))
				{ 
					$stmt->bind_param("s",$complaint_title);
					$stmt->bind_result($res_id,$complaint_title,$subject,$descriptive,$res_date);
					
					if($stmt->execute())
					{
						$data	=	array();
						$row_counter	=	0;
						
						while($stmt->fetch())
						{
							$data[$row_counter][0]	=	$res_id;
							$data[$row_counter][1]	=	$complaint_title;
							$data[$row_counter][2]	=	$subject;
							$data[$row_counter][3]	=	$descriptive;
							$data[$row_counter][4]	=	$res_date;
							
							$row_counter++;
						}
						if(!empty($data))
						{
							return $data;
						
						}
						else
						{
							return false;
						}
					}
				}
			}
		function delete_post_complaint_title_data($delete_id)
		{
			if($stmt = $this->con->prepare("DELETE FROM `post_compaint` WHERE `id`=?"))
			{
				$stmt->bind_param("i",$delete_id);
				
				if($stmt->execute())
				{
					return true;
				}
				return False;
			}
		}
		function update_post_complaint_master($complaint_title,$subject,$descriptive,$edit_id)
		{ 
			if($stmt = $this->con->prepare("UPDATE `post_compaint` SET `complaint_title`=?,`subject`=?,`descriptive`=? WHERE `id`=?"))
			{
				$stmt->bind_param("sssi",$complaint_title,$subject,$descriptive,$edit_id);
				if($stmt->execute())
				{
					return true;
				}
				return false;
			}
		}
		function get_post_complaint_details($edit_id)
		{
		  if($stmt = $this->con->prepare("SELECT `id`, `complaint_title`, `subject`, `descriptive`, `date`, `time` FROM `post_compaint` WHERE `id`=?"))
			{ 
			   $stmt->bind_param("i",$edit_id);
				$stmt->bind_result($res_id,$complaint_title,$subject,$descriptive,$res_date,$res_time);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					if($stmt->fetch())
					{
						$data[0]	=	$res_id;
						$data[1]	=	$complaint_title;
						$data[2]	=	$subject;
						$data[3]	=	$descriptive;
					    $data[4]	=	$res_date;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		function get_post_complaint_title($complaint_id)
				{
				  if($stmt = $this->con->prepare("SELECT `title` FROM `complaint-master` WHERE `id`=?"))
					{ 
						$stmt->bind_param("i",$complaint_id);
					   
						$stmt->bind_result($title);
						
						if($stmt->execute())
						{
							if($stmt->fetch())
							{
							   return 	$title;
							}
							return false;
						}
					}
				}	
		function get_all_post_complain_report_data($from_date,$to_date,$comp_id)
			{  
			if($stmt = $this->con->prepare("SELECT `id`, `complaint_title`, `subject`, `descriptive`, `date` FROM `post_compaint` WHERE `complaint_title`=? AND `date` BETWEEN ? AND ?"))
			{ 
				$stmt->bind_param("sss",$comp_id,$from_date,$to_date);
				
				$stmt->bind_result($res_id,$complaint_title,$subject,$descriptive,$res_date);
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$complaint_title;
						$data[$row_counter][2]	=	$subject;
						$data[$row_counter][3]	=	$descriptive;
						$data[$row_counter][4]	=	$res_date;
						
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}	
				
		function add_member_info($grievance_id)	
		{ 
		    $in_grivance="yes";
			if($stmt = $this->con->prepare("UPDATE `faculty_information` SET `in_grivance`=? WHERE `id`=?"))
			{
				$stmt->bind_param("si",$in_grivance,$grievance_id);
				if($stmt->execute())
				{
					return true;
				}
				return false;
			}
		}
		function remove_member_info($grvre_id)	
		{ 
		    $in_grivance="No";
			if($stmt = $this->con->prepare("UPDATE `faculty_information` SET `in_grivance`=? WHERE `id`=?"))
			{
				$stmt->bind_param("si",$in_grivance,$grvre_id);
				if($stmt->execute())
				{
					return true;
				}
				return false;
			}
		}
		function add_manage_member_info($manage_id)	
		{ 
		    $in_management="yes";
			if($stmt = $this->con->prepare("UPDATE `faculty_information` SET `in_management`=? WHERE `id`=?"))
			{
				$stmt->bind_param("si",$in_management,$manage_id);
				if($stmt->execute())
				{
					return true;
				}
				return false;
			}
		}
		function remove_manage_member_info($management_id)	
		{ 
		     $in_management="No";
			if($stmt = $this->con->prepare("UPDATE `faculty_information` SET `in_management`=? WHERE `id`=?"))
			{
				$stmt->bind_param("si", $in_management,$management_id);
				if($stmt->execute())
				{
					return true;
				}
				return false;
			}
		}
		 function get_all_grv_member_info()
			{	
				if($stmt_insert = $this->con->prepare("SELECT `id`, `full_name`, `designation`, `qualification`, `subject`, `experience`, `email`, `department`, `staff`, `profile`, `date`, `time`, `in_grivance` FROM `faculty_information` WHERE `in_grivance`='yes'"))
				{	
					$stmt_insert->bind_result($id,$full_name,$designation,$qualification,$subject,$experience,$email,$department,$staff,$profile,$date,$time,$in_grivance);
					
					if($stmt_insert->execute())
					{ 
							$counter	=	0;
							$details	=	array();
						while($stmt_insert->fetch())
						{
							$details[$counter][0]	=	$id;
							$details[$counter][1]	=	$full_name;
							$details[$counter][2]	=	$designation;
							$details[$counter][3]	=	$qualification;
							$details[$counter][4]	=	$subject;
							$details[$counter][5]	=	$experience;
							$details[$counter][6]	=	$email;
							$details[$counter][7]	=	$department;
							$details[$counter][8]	=	$staff;
							$details[$counter][9]	=	$profile;
						
							$counter++;
						}
						if(!empty($details))	
						{
							return $details;
						}
						return false;
					}	
				}
			}
		
		function get_grievance_user_status($user_id)
		{
			if($stmt = $this->con->prepare("SELECT  `user_id`, `password` FROM `faculty_information` WHERE `in_grivance`='yes'"))
			{ 
				$stmt->bind_param("s",$user_id);
				
				$stmt->bind_result($res_id,$password,$res_date);
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$user_id;
						$data[$row_counter][2]	=	$password;
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}	
		
		function save_my_post_complaint($complaint_title,$subject,$descriptive,$type,$email_id)
		{
			$date = date("Y-m-d");
			$time = date("H:i:s t");
			if($stmt = $this->con->prepare("INSERT INTO `post_compaint`(`complaint_title`, `subject`, `descriptive`, `date`, `time`, `type`, `email_id`) VALUES (?,?,?,?,?,?,?)"))
				{
				$stmt->bind_param("sssssss",$complaint_title,$subject,$descriptive,$date,$time,$type,$email_id);
				if($stmt->execute())
				{
					return true;
				}
				return false;
				}
		}
		function get_all_post_complaint_title_data_with_id($type,$email_id)
		{ 
			if($stmt = $this->con->prepare("SELECT `id`, `complaint_title`, `subject`, `descriptive`, `date`,`reply` FROM `post_compaint` WHERE `type`=? AND `email_id`=?"))
			{ 
				$stmt->bind_param("ss",$type,$email_id);
				$stmt->bind_result($res_id,$complaint_title,$subject,$descriptive,$res_date,$reply);
				
				if($stmt->execute())
				{
					$data	=	array();
					$row_counter	=	0;
					
					while($stmt->fetch())
					{
						$data[$row_counter][0]	=	$res_id;
						$data[$row_counter][1]	=	$complaint_title;
						$data[$row_counter][2]	=	$subject;
						$data[$row_counter][3]	=	$descriptive;
						$data[$row_counter][4]	=	$res_date;
						$data[$row_counter][5]	=	$reply;
						$row_counter++;
					}
					if(!empty($data))
					{
						return $data;
					
					}
					else
					{
						return false;
					}
				}
			}
		}
		function update_reply($reply,$reply_id)
		{
			if($stmt = $this->con->prepare("UPDATE `post_compaint` SET `reply`=? WHERE `id`=?"))
			{
				$stmt->bind_param("si",$reply,$reply_id);
				if($stmt->execute())
				{
					return true;
				}
				return false;
			}
		}
			
	}//End class
	
?>

EliteHackz.ORG
Revonzy Mini Shell
root@revonzy.com

Linux 65-254-81-4.cprapid.com 5.14.0-284.11.1.el9_2.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 9 05:49:00 EDT 2023 x86_64
Apache
65.254.81.4