?
Current Path : /home1/savoy/public_html/savoyglobal.net/sec/application/controllers/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/public_html/savoyglobal.net/sec/application/controllers/franchisee.php |
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Franchisee extends MY_Controller { public function __construct() { parent::__construct(); $this->load->model('mastermodel'); $this->load->model('franchiseemodel'); $this->load->helper('to_pdf'); $this->load->model('inventorymodel'); } function get_post_values() { $data = array(); foreach ($_POST as $key => $value) { if ($key != "submit") { $data[$key] = $this->input->post($key); } } return $data; } function viewinfranchiseesearch($modelfunction, $page, $pagenum) { $output = $this->franchiseemodel->$modelfunction($pagenum); $data['viewinfo'] = $output['results']; $this->load->view('franchisee/' . $page . '', $data); } function addformdisplay($page, $directory, $return_page = '') { $data = array(); $data['return_page'] = $return_page; $perm = $this->franchiseemodel->check_user_permission($_SESSION['current_mode'], $_SESSION['user_id'], 1); if (!$perm) { $data['msg'] = "Access is restricted"; $this->load->view('message', $data); } else { $this->load->view('' . $directory . '/' . $page . '', $data); } } function addinfranchisee($modelfunction, $page) { $data = array(); $postdata = $this->get_post_values(); $data = $this->franchiseemodel->$modelfunction($postdata); $this->viewinfranchiseesearch($data['resfunction'], $page, $_SESSION['pagenum']); $this->load->view('message', $data); } function deletedata($table, $id, $field) { $data = array(); $perm = $this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['user_id'], 3); if (!$perm) $data['msg'] = "Access is restricted"; else $data = $this->mastermodel->deletedata($table, $id, $field); $arr = array('msg' => $data['msg'], 'res' => $data['res']); echo json_encode($arr); } function edit_page($id, $table, $field, $page) { if ($_SESSION['current_mode'] != "") { $perm = $this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['user_id'], 2); } else { $perm = 1; } if (!$perm) { $data['msg'] = "Access is restricted"; $this->load->view('message', $data); } else { $data['viewinfo'] = $this->mastermodel->get_data_srow($table, $id, $field); $data['id'] = $id; $this->load->view('franchisee/' . $page, $data); } } function edit_franchisee($id, $table, $field, $page) { if ($_SESSION['current_mode'] != "") { $perm = $this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['user_id'], 2); } else { $perm = 1; } if (!$perm) { $data['msg'] = "Access is restricted"; $this->load->view('message', $data); } else { $data['viewinfo'] = $this->mastermodel->get_data_srow($table, $id, $field); $data['contact'] = $this->mastermodel->get_data('franchisee_contact', $id, 'franchisee_id'); $data['cours'] = $this->mastermodel->get_data('franchisee_course', $id, 'franchisee_id'); $data['id'] = $id; $this->load->view('franchisee/' . $page, $data); } } function single_page($id, $table, $field, $page) { if ($_SESSION['current_mode'] != "") { $perm = $this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['user_id'], 0); } else { $perm = 1; } if (!$perm) { $data['msg'] = "Access is restricted"; $this->load->view('message', $data); } else { $data['viewinfo'] = $this->mastermodel->get_data_srow($table, $id, $field); $data['id'] = $id; $this->load->view('franchisee/' . $page, $data); } } function single_franchisee($id, $table, $field, $page) { if ($_SESSION['current_mode'] != "") { $perm = $this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['user_id'], 0); } else { $perm = 1; } if (!$perm) { $data['msg'] = "Access is restricted"; $this->load->view('message', $data); } else { $data['viewinfo'] = $this->mastermodel->get_data_srow($table, $id, $field); $data['contact'] = $this->mastermodel->get_data('franchisee_contact', $id, 'franchisee_id'); $data['cours'] = $this->mastermodel->get_data('franchisee_course', $id, 'franchisee_id'); $data['id'] = $id; $this->load->view('franchisee/' . $page, $data); } } function add_franchisee_fee($id, $table, $field, $page) { if ($_SESSION['current_mode'] != "") { $perm = $this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['user_id'], 2); } else { $perm = 1; } if (!$perm) { $data['msg'] = "Access is restricted"; $this->load->view('message', $data); } else { $data['student_list'] = $this->franchiseemodel->get_student_batch($id); $data['viewinfo'] = $this->franchiseemodel->get_franchisee_details($id); $data['id'] = $id; $this->load->view('franchisee/' . $page, $data); } } function edit_franchisee_fee($id, $table, $field, $page) { if ($_SESSION['current_mode'] != "") { $perm = $this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['user_id'], 2); } else { $perm = 1; } if (!$perm) { $data['msg'] = "Access is restricted"; $this->load->view('message', $data); } else { $data['student_list'] = $this->franchiseemodel->get_student_batch($id); $data['viewinfo'] = $this->franchiseemodel->get_franchisee_details($id); $data['franchisee'] = $this->franchiseemodel->get_franchisee_details_for_edit($id); $data['id'] = $id; $this->load->view('franchisee/' . $page, $data); } } function edit_franchisee_fee_seperate($id, $table, $field, $page) { if ($_SESSION['current_mode'] != "") { $perm = $this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['user_id'], 2); } else { $perm = 1; } if (!$perm) { $data['msg'] = "Access is restricted"; $this->load->view('message', $data); } else { $data['batch_franchisee'] = $this->franchiseemodel->get_franchisee_batch_details($id); $this->load->view('franchisee/' . $page, $data); } } function single_franchisee_fee($id, $table, $field, $page, $return_page = '') { if ($_SESSION['current_mode'] != "") { $perm = $this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['user_id'], 0); } else { $perm = 1; } if (!$perm) { $data['msg'] = "Access is restricted"; $this->load->view('message', $data); } else { $data['student_list'] = $this->franchiseemodel->get_student_batch($id); $data['viewinfo'] = $this->franchiseemodel->get_franchisee_details($id); $data['franchisee'] = $this->franchiseemodel->get_franchisee_details_for_edit($id); $data['id'] = $id; $data['return_page'] = $return_page; $this->load->view('franchisee/' . $page, $data); } } function pdf_franchisee($id, $page = '') { $data['franchisee_details'] = $this->franchiseemodel->get_all_deatils_for_pdf_franchisee($id); $html1 = $this->load->view('franchisee/franchisee_pdf', $data); } function xls_franchisee_royality($id) { $data['student_list'] = $this->franchiseemodel->get_student_batch($id); $data['viewinfo'] = $this->franchiseemodel->get_franchisee_details($id); $data['id'] = $id; header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=Royalty.xls"); header("Pragma: no-cache"); header("Expires: 0"); $this->load->view('franchisee/franchisee_xls', $data); } function edit_franchisee_fee_pv($id, $table, $field, $page) { if ($_SESSION['current_mode'] != "") { $perm = $this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['user_id'], 2); } else { $perm = 1; } if (!$perm) { $data['msg'] = "Access is restricted"; $this->load->view('message', $data); } else { // $data['student_list'] = $this->franchiseemodel->get_student_batch($id); // $data['viewinfo'] = $this->franchiseemodel->get_franchisee_details($id); // $data['franchisee'] = $this->franchiseemodel->get_franchisee_details_for_edit($id); $data['franchisee_details'] = $this->franchiseemodel->get_all_deatils_for_pdf_franchisee($id); $data['id'] = $id; $this->load->view('franchisee/' . $page, $data); } } } /* End of file master.php */ /* Location: ./application/controllers/master.php */