uawdijnntqw1x1x1
IP : 216.73.216.55
Hostname : srv913213
Kernel : Linux srv913213 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
OS : Linux
PATH:
/
var
/
www
/
yapwebtv.com
/
..
/
..
/
www
/
krcollege.co
/
application
/
controllers
/
College.php
/
/
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class College extends CI_Controller { function __construct() { parent::__construct(); isLoggedIn(); $this->load->model('college/College_model'); $this->load->model('acl/User_model'); $this->load->helper('string'); $this->load->library('ldocument'); } public function index() { if (hasPermission('college_create')) { $page_data['page_title'] = 'Manage College'; $page_data['page_name'] = 'admin/college/list'; $this->load->view('admin/template', $page_data); } else { redirect(base_url('dashboard')); } } public function add() { if (hasPermission('college_create')) { $page_data['page_title'] = 'Create College'; $page_data['page_name'] = 'admin/college/add'; $this->load->view('admin/template', $page_data); } else { redirect(base_url('dashboard')); } } public function ajax_list() { $CI = &get_instance(); $CI->load->model('college/College_table'); $lists = $this->College_table->get_datatables(); $start = $_POST['start']; $data = array(); foreach ($lists as $list) { $row = array(); $id = $list['college_id']; $college_name = $list['college_name']; $college_code = $list['college_code']; $address = $list['address']; $phone_number = $list['phone_number']; $email = $list['email']; $status = $list['status']; $status_class = ($status == 1) ? "label label-primary" : "label label-danger"; $status_lable = ($status == 1) ? "Active" : "Inactive"; $status_title = ($status == 1) ? "Active" : "Inactive"; $status_padding = ($status == 1) ? "padding-left: 10px ;padding-right: 10px;" : ""; $btn_title_change = ($status == 1) ? "Deactivate" : "Activate"; $btn_color_change = ($status == 1) ? "btn btn-danger" : "btn btn-info"; $btn_padding = ($status == 0) ? "padding-right:18px;padding-left:18px" : ""; $data_status = ($status == 1) ? '0' : '1'; $active = '<center> <span class="' . $status_class . '" title="' . $status_title . '"style="' . $status_padding . '" >' . $status_lable . '</span> </center>'; $viewUrl = base_url("college/view/$id"); $editUrl = base_url("college/edit/$id"); $delUrl = base_url("college/active"); $deleteUrl = base_url("college/delete"); $action = '<center>'; if (hasPermission('college_view')) { $action .= '<div class="col-md-6"><a href="' . $viewUrl . '"><button type="button" class="btn btn-primary btn-sm">view </button> </a> </div>'; } if (hasPermission('college_update') || hasPermission('college_status') || hasPermission('college_delete')) { $action .= '<div class="col-md-6"> <div class="dropdown "><a class="dropdown-toggle" type="button" data-toggle="dropdown"><i class="glyphicon glyphicon-option-horizontal fs-24"></i></a> <ul class="dropdown-menu dropdown-menu-right">'; if (hasPermission('college_update')) { $action .= '<li><a href="' . $editUrl . '">Edit </a> </li>'; } if (hasPermission('college_status')) { $action .= '<li><a href="javascript:void(0)" data-id="' . $id . '" data-msg="' . $college_name . '" class="active-college" data-status="' . $data_status . '" data-label="quality name" data-url="' . $delUrl . '"> ' . $btn_title_change . ' </a></li>'; } if (hasPermission('college_delete')) { $action .= '<li><a href="javascript:void(0)" data-id="' . $id . '" data-msg="' . $college_name . '" class="delete-college" data-status="2" data-label="quality name" data-url="' . $deleteUrl . '"> Delete</a></li>'; } $action .= '</ul></div>'; $action .= '</div>'; } $action .= '</center>'; $row[] = $start + 1; $row[] = $college_name; $row[] = $college_code; $row[] = $address; $row[] = $phone_number; $row[] = $email; $row[] = $active; $row[] = $action; $row['DT_RowId'] = $id; $data[] = $row; $start++; } $output = array( "draw" => $_POST['draw'], "recordsTotal" => $CI->College_table->count_all(), "recordsFiltered" => $CI->College_table->count_filtered(), "data" => $data, ); echo json_encode($output); } public function college_exist() { $c_name = $this->input->post('name'); $id = $this->input->post('id'); echo $this->College_model->college_exist($c_name, $id); } public function collegeCode_exist() { $c_code = $this->input->post('name'); $id = $this->input->post('id'); echo $this->College_model->collegeCode_exist($c_code, $id); } public function insert() { $error_type = ''; $msg = ''; $result = false; $this->form_validation->set_rules('college_name', 'College Name', 'trim|required'); $this->form_validation->set_rules('college_code', 'College Code', 'trim|required'); $this->form_validation->set_rules('address', 'Address', 'trim|required'); $this->form_validation->set_rules('phone_number', 'Phone Number', 'trim|required'); $this->form_validation->set_rules('mobile_number', 'Mobile Number', 'trim|required'); $this->form_validation->set_rules('email', 'Email', 'trim|required'); $this->form_validation->set_rules('website', 'Website', 'trim|required'); if ($this->form_validation->run() == FALSE) { $error_type = 'v'; $msg = validation_errors('<p class="error">', '</p>'); //validation_errors(); $result = false; } else { $userId = $this->session->userdata('user_id'); $college_logo = ''; $tc_watermark = ''; $tc_header = ''; $entity_first = ''; $entity_recent = ''; $university_first = ''; $university_recent = ''; if ($_FILES['college_logo']['name']) { $path = './assets/img/college/clg_logo'; if (!is_dir($path)) mkdir($path, 0655, true); $tempname = $_FILES['college_logo']['name']; $tmp = explode('.', $tempname); $file_extension = end($tmp); $random_clg = random_string('unique', FILE_UPLOAD_RANDOM_STR); $filename = $random_clg . '-' . $tempname; $filenamest = strtolower($filename); $f_name = str_replace(' ', '_', $filenamest); $config = []; $config['upload_path'] = $path; $config['allowed_types'] = 'jpg|png|jpeg|JPEG|JPG|PNG'; $config['max_size'] = "*"; $config['max_width'] = "*"; $config['max_height'] = "*"; // $config['encrypt_name'] = TRUE; $config['file_name'] = $f_name; // $this->load->library('upload', $config); $this->load->library('upload'); $this->upload->initialize($config); if (!$this->upload->do_upload('college_logo')) { $error_type = 'v'; $msg = $this->upload->display_errors(); //upload errors(); $result = false; } else { $image = $this->upload->data(); $college_logo = $f_name; } } if ($_FILES['tc_watermark']['name']) { $path = './assets/img/college/college_tcwatermark'; if (!is_dir($path)) mkdir($path, 0755, true); $tempname = $_FILES['tc_watermark']['name']; $tmp = explode('.', $tempname); $file_extension = end($tmp); $random_water = random_string('unique', FILE_UPLOAD_RANDOM_STR); $filename = $random_water . '-' . $tempname; $filenamest = strtolower($filename); $f_name = str_replace(' ', '_', $filenamest); $config = []; $config['upload_path'] = $path; $config['allowed_types'] = '*'; $config['max_size'] = "*"; $config['max_width'] = "*"; $config['max_height'] = "*"; // $config['encrypt_name'] = TRUE; $config['file_name'] = $f_name; $this->load->library('upload'); $this->upload->initialize($config); if (!$this->upload->do_upload('tc_watermark')) { $error_type = 'v'; $msg = $this->upload->display_errors(); //upload errors(); $result = false; } else { $image = $this->upload->data(); $tc_watermark = $f_name; } } if ($_FILES['tc_header']['name']) { $path = './assets/img/college/college_header'; if (!is_dir($path)) mkdir($path, 0655, true); $tempname = $_FILES['tc_header']['name']; $tmp = explode('.', $tempname); $file_extension = end($tmp); $random_header = random_string('unique', FILE_UPLOAD_RANDOM_STR); $filename = $random_header . '-' . $tempname; $filenamest = strtolower($filename); $f_name = str_replace(' ', '_', $filenamest); $config = []; $config['upload_path'] = $path; $config['allowed_types'] = '*'; $config['max_size'] = "*"; $config['max_width'] = "*"; $config['max_height'] = "*"; // $config['encrypt_name'] = TRUE; $config['file_name'] = $f_name; $this->load->library('upload'); $this->upload->initialize($config); if (!$this->upload->do_upload('tc_header')) { $error_type = 'v'; $msg = $this->upload->display_errors(); //upload errors(); $result = false; } else { $image = $this->upload->data(); $tc_header = $f_name; } } if ($_FILES['entity_first']['name']) { $path = './assets/img/college/entity_first'; if (!is_dir($path)) mkdir($path, 0655, true); $tempname = $_FILES['entity_first']['name']; $tmp = explode('.', $tempname); $file_extension = end($tmp); $random_enf = random_string('unique', FILE_UPLOAD_RANDOM_STR); $filename = $random_enf . '-' . $tempname; $filenamest = strtolower($filename); $f_name = str_replace(' ', '_', $filenamest); $config = []; $config['upload_path'] = $path; $config['allowed_types'] = '*'; $config['max_size'] = "*"; $config['max_width'] = "*"; $config['max_height'] = "*"; // $config['encrypt_name'] = TRUE; $config['file_name'] = $f_name; $this->load->library('upload'); $this->upload->initialize($config); if (!$this->upload->do_upload('entity_first')) { $error_type = 'v'; $msg = $this->upload->display_errors(); //upload errors(); $result = false; } else { $image = $this->upload->data(); $entity_first = $f_name; } } if ($_FILES['entity_recent']['name']) { $path = './assets/img/college/entity_recent'; if (!is_dir($path)) mkdir($path, 0655, true); $tempname = $_FILES['entity_recent']['name']; $tmp = explode('.', $tempname); $file_extension = end($tmp); $random_enfe = random_string('unique', FILE_UPLOAD_RANDOM_STR); $filename = $random_enfe . '-' . $tempname; $filenamest = strtolower($filename); $f_name = str_replace(' ', '_', $filenamest); $config = []; $config['upload_path'] = $path; $config['allowed_types'] = '*'; $config['max_size'] = "*"; $config['max_width'] = "*"; $config['max_height'] = "*"; // $config['encrypt_name'] = TRUE; $config['file_name'] = $f_name; $this->load->library('upload'); $this->upload->initialize($config); if (!$this->upload->do_upload('entity_recent')) { $error_type = 'v'; $msg = $this->upload->display_errors(); //upload errors(); $result = false; } else { $image = $this->upload->data(); $entity_recent = $f_name; } } if ($_FILES['university_first']['name']) { $path = './assets/img/college/university_first'; if (!is_dir($path)) mkdir($path, 0655, true); $tempname = $_FILES['university_first']['name']; $tmp = explode('.', $tempname); $file_extension = end($tmp); $random_unfe = random_string('unique', FILE_UPLOAD_RANDOM_STR); $filename = $random_unfe . '-' . $tempname; $filenamest = strtolower($filename); $f_name = str_replace(' ', '_', $filenamest); $config = []; $config['upload_path'] = $path; $config['allowed_types'] = '*'; $config['max_size'] = "*"; $config['max_width'] = "*"; $config['max_height'] = "*"; // $config['encrypt_name'] = TRUE; $config['file_name'] = $f_name; $this->load->library('upload'); $this->upload->initialize($config); if (!$this->upload->do_upload('university_first')) { $error_type = 'v'; $msg = $this->upload->display_errors(); //upload errors(); $result = false; } else { $image = $this->upload->data(); $university_first = $f_name; } } if ($_FILES['university_recent']['name']) { $path = './assets/img/college/university_recent'; if (!is_dir($path)) mkdir($path, 0655, true); $tempname = $_FILES['university_recent']['name']; $tmp = explode('.', $tempname); $file_extension = end($tmp); $random_enre = random_string('unique', FILE_UPLOAD_RANDOM_STR); $filename = $random_enre . '-' . $tempname; $filenamest = strtolower($filename); $f_name = str_replace(' ', '_', $filenamest); $config = []; $config['upload_path'] = $path; $config['allowed_types'] = '*'; $config['max_size'] = "*"; $config['max_width'] = "*"; $config['max_height'] = "*"; // $config['encrypt_name'] = TRUE; $config['file_name'] = $f_name; $this->load->library('upload'); $this->upload->initialize($config); if (!$this->upload->do_upload('university_recent')) { $error_type = 'v'; $msg = $this->upload->display_errors(); //upload errors(); $result = false; } else { $image = $this->upload->data(); $university_recent = $f_name; } } $college_name = $this->input->post('college_name'); $college_code = $this->input->post('college_code'); $address = $this->input->post('address'); $phone_number = $this->input->post('phone_number'); $mobile_number = $this->input->post('mobile_number'); $email = $this->input->post('email'); $website = $this->input->post('website'); $data = array( 'college_name' => $college_name, 'college_code' => $college_code, 'address' => $address, 'phone_number' => $phone_number, 'mobile_number' => $mobile_number, 'email' => $email, 'website' => $website, 'college_logo' => $college_logo, 'tc_watermark' => $tc_watermark, 'tc_header' => $tc_header, 'entity_first_copy' => $entity_first, 'entity_recent_copy' => $entity_recent, 'university_first_copy' => $university_first, 'university_recent_copy' => $university_recent, ); $result = $this->College_model->insert($data); $result = $this->User_model->get_username($data); set_alert('success', "College information created successfully."); $error_type = 'm'; $msg = 'College created successfully.'; $result = true; ($result) ? logActivity('College '.$college_name. 'is Created ', LOG_COLLEGE) : ''; } echo json_encode(array('rs' => $result, 'errType' => $error_type, 'msg' => $msg)); } public function update() { $error_type = ''; $msg = ''; $result = false; $this->form_validation->set_rules('college_name', 'College Name', 'trim|required'); $this->form_validation->set_rules('college_code', 'College Code', 'trim|required'); $this->form_validation->set_rules('address', 'Address', 'trim|required'); $this->form_validation->set_rules('phone_number', 'Phone Number', 'trim|required'); $this->form_validation->set_rules('mobile_number', 'Mobile Number', 'trim|required'); $this->form_validation->set_rules('email', 'Email', 'trim|required'); $this->form_validation->set_rules('website', 'Website', 'trim|required'); if ($this->form_validation->run() == FALSE) { $error_type = 'v'; $msg = validation_errors('<p class="error">', '</p>'); //validation_errors(); $result = false; } else { $userId = $this->session->userdata('user_id'); $college_logo = ''; $tc_watermark = ''; $tc_header = ''; $entity_first = ''; $entity_recent = ''; $university_first = ''; $university_recent = ''; if ($_FILES['college_logo']['name']) { $path = './assets/img/college/clg_logo'; if (!is_dir($path)) mkdir($path, 0655, true); $tempname = $_FILES['college_logo']['name']; $tmp = explode('.', $tempname); $file_extension = end($tmp); $random_clg = random_string('unique', FILE_UPLOAD_RANDOM_STR); $filename = $random_clg . '-' . $tempname; $filenamest = strtolower($filename); $f_name = str_replace(' ', '_', $filenamest); $config = []; $config['upload_path'] = $path; $config['allowed_types'] = 'jpg|png|jpeg|JPEG|JPG|PNG'; $config['max_size'] = "*"; $config['max_width'] = "*"; $config['max_height'] = "*"; // $config['encrypt_name'] = TRUE; $config['file_name'] = $f_name; // $this->load->library('upload', $config); $this->load->library('upload'); $this->upload->initialize($config); if (!$this->upload->do_upload('college_logo')) { $error_type = 'v'; $msg = $this->upload->display_errors(); //upload errors(); $result = false; } else { $image = $this->upload->data(); $college_logo = $f_name; } } if ($_FILES['tc_watermark']['name']) { $path = './assets/img/college/college_tcwatermark'; if (!is_dir($path)) mkdir($path, 0755, true); $tempname = $_FILES['tc_watermark']['name']; $tmp = explode('.', $tempname); $file_extension = end($tmp); $random_water = random_string('unique', FILE_UPLOAD_RANDOM_STR); $filename = $random_water . '-' . $tempname; $filenamest = strtolower($filename); $f_name = str_replace(' ', '_', $filenamest); $config = []; $config['upload_path'] = $path; $config['allowed_types'] = '*'; $config['max_size'] = "*"; $config['max_width'] = "*"; $config['max_height'] = "*"; // $config['encrypt_name'] = TRUE; $config['file_name'] = $f_name; $this->load->library('upload'); $this->upload->initialize($config); if (!$this->upload->do_upload('tc_watermark')) { $error_type = 'v'; $msg = $this->upload->display_errors(); //upload errors(); $result = false; } else { $image = $this->upload->data(); $tc_watermark = $f_name; } } if ($_FILES['tc_header']['name']) { $path = './assets/img/college/college_header'; if (!is_dir($path)) mkdir($path, 0655, true); $tempname = $_FILES['tc_header']['name']; $tmp = explode('.', $tempname); $file_extension = end($tmp); $random_header = random_string('unique', FILE_UPLOAD_RANDOM_STR); $filename = $random_header . '-' . $tempname; $filenamest = strtolower($filename); $f_name = str_replace(' ', '_', $filenamest); $config = []; $config['upload_path'] = $path; $config['allowed_types'] = '*'; $config['max_size'] = "*"; $config['max_width'] = "*"; $config['max_height'] = "*"; // $config['encrypt_name'] = TRUE; $config['file_name'] = $f_name; $this->load->library('upload'); $this->upload->initialize($config); if (!$this->upload->do_upload('tc_header')) { $error_type = 'v'; $msg = $this->upload->display_errors(); //upload errors(); $result = false; } else { $image = $this->upload->data(); $tc_header = $f_name; } } if ($_FILES['entity_first']['name']) { $path = './assets/img/college/entity_first'; if (!is_dir($path)) mkdir($path, 0655, true); $tempname = $_FILES['entity_first']['name']; $tmp = explode('.', $tempname); $file_extension = end($tmp); $random_enf = random_string('unique', FILE_UPLOAD_RANDOM_STR); $filename = $random_enf . '-' . $tempname; $filenamest = strtolower($filename); $f_name = str_replace(' ', '_', $filenamest); $config = []; $config['upload_path'] = $path; $config['allowed_types'] = '*'; $config['max_size'] = "*"; $config['max_width'] = "*"; $config['max_height'] = "*"; // $config['encrypt_name'] = TRUE; $config['file_name'] = $f_name; $this->load->library('upload'); $this->upload->initialize($config); if (!$this->upload->do_upload('entity_first')) { $error_type = 'v'; $msg = $this->upload->display_errors(); //upload errors(); $result = false; } else { $image = $this->upload->data(); $entity_first = $f_name; } } if ($_FILES['entity_recent']['name']) { $path = './assets/img/college/entity_recent'; if (!is_dir($path)) mkdir($path, 0655, true); $tempname = $_FILES['entity_recent']['name']; $tmp = explode('.', $tempname); $file_extension = end($tmp); $random_enfe = random_string('unique', FILE_UPLOAD_RANDOM_STR); $filename = $random_enfe . '-' . $tempname; $filenamest = strtolower($filename); $f_name = str_replace(' ', '_', $filenamest); $config = []; $config['upload_path'] = $path; $config['allowed_types'] = '*'; $config['max_size'] = "*"; $config['max_width'] = "*"; $config['max_height'] = "*"; // $config['encrypt_name'] = TRUE; $config['file_name'] = $f_name; $this->load->library('upload'); $this->upload->initialize($config); if (!$this->upload->do_upload('entity_recent')) { $error_type = 'v'; $msg = $this->upload->display_errors(); //upload errors(); $result = false; } else { $image = $this->upload->data(); $entity_recent = $f_name; } } if ($_FILES['university_first']['name']) { $path = './assets/img/college/university_first'; if (!is_dir($path)) mkdir($path, 0655, true); $tempname = $_FILES['university_first']['name']; $tmp = explode('.', $tempname); $file_extension = end($tmp); $random_unfe = random_string('unique', FILE_UPLOAD_RANDOM_STR); $filename = $random_unfe . '-' . $tempname; $filenamest = strtolower($filename); $f_name = str_replace(' ', '_', $filenamest); $config = []; $config['upload_path'] = $path; $config['allowed_types'] = '*'; $config['max_size'] = "*"; $config['max_width'] = "*"; $config['max_height'] = "*"; // $config['encrypt_name'] = TRUE; $config['file_name'] = $f_name; $this->load->library('upload'); $this->upload->initialize($config); if (!$this->upload->do_upload('university_first')) { $error_type = 'v'; $msg = $this->upload->display_errors(); //upload errors(); $result = false; } else { $image = $this->upload->data(); $university_first = $f_name; } } if ($_FILES['university_recent']['name']) { $path = './assets/img/college/university_recent'; if (!is_dir($path)) mkdir($path, 0655, true); $tempname = $_FILES['university_recent']['name']; $tmp = explode('.', $tempname); $file_extension = end($tmp); $random_enre = random_string('unique', FILE_UPLOAD_RANDOM_STR); $filename = $random_enre . '-' . $tempname; $filenamest = strtolower($filename); $f_name = str_replace(' ', '_', $filenamest); $config = []; $config['upload_path'] = $path; $config['allowed_types'] = '*'; $config['max_size'] = "*"; $config['max_width'] = "*"; $config['max_height'] = "*"; // $config['encrypt_name'] = TRUE; $config['file_name'] = $f_name; $this->load->library('upload'); $this->upload->initialize($config); if (!$this->upload->do_upload('university_recent')) { $error_type = 'v'; $msg = $this->upload->display_errors(); //upload errors(); $result = false; } else { $image = $this->upload->data(); $university_recent = $f_name; } } $college_id = $this->input->post('college_id'); $new_college_name = $this->input->post('college_name'); $result1 = $this->College_model->getCollege($college_id)->row_array(); $oldvalue = $result1['college_name']; $college_code = $this->input->post('college_code'); $address = $this->input->post('address'); $phone_number = $this->input->post('phone_number'); $mobile_number = $this->input->post('mobile_number'); $email = $this->input->post('email'); $website = $this->input->post('website'); $old_clg_logo = $this->input->post('old_clg_logo'); $update_old_clg_logo = ($college_logo) ? $college_logo : $old_clg_logo; $old_clg_header = $this->input->post('old_clg_header'); $update_old_clg_header = ($tc_header) ? $tc_header : $old_clg_header; $old_clg_water = $this->input->post('old_clg_water'); $update_old_clg_water = ($tc_watermark) ? $tc_watermark : $old_clg_water; $entity_first_old = $this->input->post('entity_first_old'); $entity_first_oldim = ($entity_first) ? $entity_first : $entity_first_old; $entity_recent_old = $this->input->post('entity_recent_old'); $entity_recent_oldim = ($entity_recent) ? $entity_recent : $entity_recent_old; $university_first_old = $this->input->post('university_first_old'); $university_first_oldim = ($university_first) ? $university_first : $university_first_old; $university_recent_old = $this->input->post('university_recent_old'); $university_recent_oldim = ($university_recent) ? $university_recent : $university_recent_old; $data = array( 'college_name' => $new_college_name, 'college_code' => $college_code, 'address' => $address, 'phone_number' => $phone_number, 'mobile_number' => $mobile_number, 'email' => $email, 'website' => $website, 'college_logo' => $update_old_clg_logo, 'tc_watermark' => $update_old_clg_water, 'tc_header' => $update_old_clg_header, 'entity_first_copy' => $entity_first_oldim, 'entity_recent_copy' => $entity_recent_oldim, 'university_first_copy' => $university_first_oldim, 'university_recent_copy' => $university_recent_oldim, ); $result = $this->College_model->update($college_id, $data); set_alert('success', "College information updated successfully."); $error_type = 'm'; $msg = 'College updated successfully.'; $result = true; ($result) ? logActivity('College has been changed from ' . $oldvalue . " " . 'to '.$new_college_name, LOG_COLLEGE) : ''; } echo json_encode(array('rs' => $result, 'errType' => $error_type, 'msg' => $msg)); } public function edit() { if (hasPermission('college_update')) { $id = $this->uri->segment(3); if ($id != '') { $qry = $this->College_model->get($id); if ($qry->num_rows() > 0) { $clg_data = $qry->row(); $entity_first_copy = $clg_data->entity_first_copy; $entity_recent_copy = $clg_data->entity_recent_copy; $university_first_copy = $clg_data->university_first_copy; $university_recent_copy = $clg_data->university_recent_copy; $entity_first_copy = $this->ldocument->getImageIcon($entity_first_copy); $entity_recent_copy = $this->ldocument->getImageIcon($entity_recent_copy); $university_first_copy = $this->ldocument->getImageIcon($university_first_copy); $university_recent_copy = $this->ldocument->getImageIcon($university_recent_copy); $data = array( 'page_title' => 'Update College', 'page_name' => 'admin/college/edit', 'entity_first_copys' => $entity_first_copy, 'entity_recent_copys' => $entity_recent_copy, 'university_first_copys' => $university_first_copy, 'university_recent_copys' => $university_recent_copy, 'college_id' => $clg_data->college_id, 'college_code' => $clg_data->college_code, 'college_name' => $clg_data->college_name, 'college_logo' => $clg_data->college_logo, 'address' => $clg_data->address, 'phone_number' => $clg_data->phone_number, 'mobile_number' => $clg_data->mobile_number, 'email' => $clg_data->email, 'website' => $clg_data->website, 'tc_watermark' => $clg_data->tc_watermark, 'tc_header' => $clg_data->tc_header, 'entity_first_copy' => $clg_data->entity_first_copy, 'entity_recent_copy' => $clg_data->entity_recent_copy, 'university_first_copy' => $clg_data->university_first_copy, 'university_recent_copy' => $clg_data->university_recent_copy, ); // print_r($data);exit; $this->load->view('admin/template', $data); } else { redirect(base_url('college')); } } } else { redirect(base_url('dashboard')); } } public function view() { if (hasPermission('college_view')) { $id = $this->uri->segment(3); if ($id != '') { $qry = $this->College_model->get($id); if ($qry->num_rows() > 0) { $clg_data = $qry->row(); $entity_first_copy = $clg_data->entity_first_copy; $entity_recent_copy = $clg_data->entity_recent_copy; $university_first_copy = $clg_data->university_first_copy; $university_recent_copy = $clg_data->university_recent_copy; $entity_first_copy = $this->ldocument->getImageIcon($entity_first_copy); $entity_recent_copy = $this->ldocument->getImageIcon($entity_recent_copy); $university_first_copy = $this->ldocument->getImageIcon($university_first_copy); $university_recent_copy = $this->ldocument->getImageIcon($university_recent_copy); $data = array( 'page_title' => 'Update College', 'page_name' => 'admin/college/view', 'entity_first_copys' => $entity_first_copy, 'entity_recent_copys' => $entity_recent_copy, 'university_first_copys' => $university_first_copy, 'university_recent_copys' => $university_recent_copy, 'college_id' => $clg_data->college_id, 'college_code' => $clg_data->college_code, 'college_name' => $clg_data->college_name, 'college_logo' => $clg_data->college_logo, 'address' => $clg_data->address, 'phone_number' => $clg_data->phone_number, 'mobile_number' => $clg_data->mobile_number, 'email' => $clg_data->email, 'website' => $clg_data->website, 'tc_watermark' => $clg_data->tc_watermark, 'tc_header' => $clg_data->tc_header, ); $this->load->view('admin/template', $data); } else { redirect(base_url('college')); } } } else { redirect(base_url('dashboard')); } } public function delete_image() { $id = $this->input->post('id'); // $res = $this->College_model->getCollege($id)->row_array(); // $c_name = $res['college_name']; $img = $this->input->post('img'); $type = $this->input->post('type'); //./assets/img/employee_images/ $imgPath = FCPATH . "/assets/img/college/clg_logo/" . $img; //print_r($imgPath); $data = array(); if ($type == "college_logo") { $data['college_logo'] = ''; } if ($type == "college_tcw") { $data['tc_watermark'] = ''; } if ($type == "college_th") { $data['tc_header'] = ''; } if ($type == "entity_firstt") { $data['entity_first_copy'] = ''; } if ($type == "entity_recentt") { $data['entity_recent_copy'] = ''; } if ($type == "university_firstt") { $data['university_first_copy'] = ''; } if ($type == "university_recent") { $data['university_recent_copy'] = ''; } $result = $this->College_model->remove_post_image($id, $data); ($result) ? logActivity('Image removed', LOG_COLLEGE) : ''; ($result > 0) ? true : false; $filePath = ($result) ? unlink($imgPath) : ''; echo json_encode(array('id' => $id, 'rs' => $result, 'path' => $imgPath)); } public function delete() { // $re = $this->User_model->get_username($id)->row_array(); // $uname = $re['Uname']; // $uemail = $re['uemail']; $id = $this->input->post('id'); $res = $this->College_model->getCollege($id)->row_array(); $c_name = $res['college_name']; $msg = $this->input->post('msg'); $status = $this->input->post('status'); $log = ($status == 2) ? 'Deleted' : 'Deleted'; $data = array(); $data['status'] = $status; $result = $this->College_model->active_update($id, $data); $result = ($result > 0) ? True : False; ($result) ? logActivity($c_name . " " . 'College is '.$log, LOG_COLLEGE) : ''; echo json_encode(array('rs' => $result, 'log' => $log, 'msg' => $msg)); } public function active() { if (hasPermission('college_create')) { $id = $this->input->post('id'); $res = $this->College_model->getCollege($id)->row_array(); $c_name = $res['college_name']; $msg = $this->input->post('msg'); $status = $this->input->post('status'); $log = ($status == 1) ? 'Activated' : 'Deactivated'; $data = array(); $data['status'] = $status; $result = $this->College_model->active_update($id, $data); //echo $this->db->last_query(); $result = ($result > 0) ? True : False; ($result) ? logActivity($c_name . " " .'College is '.$log, LOG_COLLEGE) : ''; echo json_encode(array('rs' => $result, 'log' => $log, 'msg' => $msg)); //echo $result; } else { redirect(base_url('dashboard')); } } /*collge set college session id*/ public function setCollege() { $course_id = $this->input->post('id'); $get_clg_id = $this->College_model->get_clg_idByCourseId($course_id); $c_id = $get_clg_id['college_id']; $this->session->set_userdata('college_id', $c_id); $this->session->set_userdata('course_id', $course_id); $this->session->unset_userdata('academic_id'); $msg = 'Collge session id set successfully.'; $result = true; echo json_encode(array('rs' => $result, 'msg' => $msg)); } /*collge set college session id*/ /*collge set college session id*/ public function setAcademic() { $result = false; $msg = ''; $id = $this->input->post('id'); $course_id = $this->session->userdata('course_id'); if ($course_id > 0) { $academic_id = $this->session->set_userdata('academic_id', $id); $msg = 'Academic year session id set successfully.'; $result = true; } else { set_alert('warning', "Please select the course."); $result = false; } echo json_encode(array('rs' => $result, 'msg' => $msg)); } /*collge set college session id*/ }
/var/www/yapwebtv.com/../../www/krcollege.co/application/controllers/College.php