load->database(); date_default_timezone_set('Asia/Kolkata'); } /***** School photo gallery ********/ function getPhotos($schoolid) { $this->db->select('PhotoTitle,PhotoPath,PhotoId'); $this->db->where('RegistrationId' ,$schoolid); $query = $this->db->get('tblphotogallery'); return $query->result(); } function insertPhoto($information) { if ($this->db->insert('tblphotogallery',$information)) return $this->db->insert_id(); else return 0; } function deleteSchoolPhoto($photoid, $schoolid) { $this->db->where("RegistrationId", $schoolid); $this->db->where("PhotoId", $photoid); if ($this->db->delete('tblphotogallery')) return 1; else return 0; } function getPhotoPath($photoid, $schoolid) { $this->db->select('PhotoPath'); $this->db->where("RegistrationId", $schoolid); $this->db->where("PhotoId", $photoid); $query = $this->db->get('tblphotogallery'); return $query->row('PhotoPath'); } function getSchoolPhotoCount($schoolid) { $this->db->where('RegistrationId' ,$schoolid); return $this->db->count_all_results('tblphotogallery'); } /***** School photo gallery ********/ function getTeacher() { $this->db->where('active',0); $query= $this->db->get('tblteachingstaff'); return $query->result(); } function insertInformation($tbl,$info) { if ($this->db->insert($tbl,$info)) return $this->db->insert_id(); else return 0; } function updateTeachingstaff($information) { $this->db->where('id', $information['id']); if ($this->db->update('tblteachingstaff', $information)) return 1; else return 0; } function gstInformation($id) { $this->db->select('*,DATE_FORMAT(dob, "%d/%m/%Y") as ndob, DATE_FORMAT(dojoin, "%d/%m/%Y") as ndojoin', FALSE); //$this->db->select("DATE_FORMAT(dod, '%d/%m/%Y') as ndob",FALSE); //$this->db->select("DATE_FORMAT(dojoin, '%d/%m/%Y') as ndojoin",FALSE); $this->db->where('id',$id); $query=$this->db->get('tblteachingstaff'); return $query->result(); } function deleteStaff($id) { $this->db->where("id", $id); if ($this->db->delete('tblteachingstaff')) return 1; else return 0; } function getNotice() { $query= $this->db->get('tblnotice'); return $query->result(); } function updateNotice($information) { $this->db->where('id', $information['id']); if ($this->db->update('tblnotice', $information)) return 1; else return 0; } function getnoticinfo($id) { $this->db->where('id',$id); $query=$this->db->get('tblnotice'); return $query->result(); } function deleteNotice($id) { $this->db->where("id", $id); if ($this->db->delete('tblnotice')) return 1; else return 0; } function getTcinfo() { $query= $this->db->get('tbltc'); return $query->result(); } function insertTcfile($information) { if ($this->db->insert('tbltc',$information)) return $this->db->insert_id(); else return 0; } function deleteStudenttc($id) { $this->db->where("id", $id); if ($this->db->delete('tbltc')) return 1; else return 0; } function getTcPath($id) { $this->db->select('tcpath'); $this->db->where("id", $id); $query = $this->db->get('tbltc'); return $query->row('tcpath'); } function getStudentTcCount() { return $this->db->count_all_results('tbltc'); } function getStudentTc($id) { $this->db->select('tcpath'); $this->db->where("enrollnment", $id); $query = $this->db->get('tbltc'); return $query->row('tcpath'); } function getgalleryimage($id,$last=0) { if($id != 0) { $this->db->where('PhotoTitle',$id); } if($last != 0) { $this->db->where('PhotoId >',$last); } $this->db->order_by('PhotoId desc'); $query = $this->db->get('tblphotogallery',9); return $query->result(); } function getgalleryimageCount($id,$last=0) { if($id != 0) { $this->db->where('PhotoTitle',$id); } if($last != 0) { $this->db->where('PhotoId >',$last); } return $this->db->count_all_results('tblphotogallery'); } function getNoticeNews() { $this->db->order_by('id desc'); $query= $this->db->get('tblnotice'); return $query->result(); } function getnoticeimage($id) { if($id != 0) { $this->db->where('PhotoTitle',$id); } $this->db->order_by('PhotoId desc'); $query = $this->db->get('tblphotogallery'); return $query->result(); } function getContact() { $this->db->order_by('id desc'); $query= $this->db->get('tblcontact'); return $query->result(); } function deleteContact($id) { $this->db->where("id", $id); if ($this->db->delete('tblcontact')) return 1; else return 0; } }