application/controllers/Institute.php
/**********MANAGE TRANSPORT / VEHICLES / ROUTES********************/
MANAGE TRANSPORT / VEHICLES / ROUTES
MANAGE TRANSPORT / VEHICLES / ROUTES
function transport($param1 = '', $param2 = '', $param3 = '')
    {
        if ($this->session->userdata('institute_login') != 1)
            redirect('login', 'refresh');
						$Idint=  $this->session->userdata('institute_id');
        if ($param1 == 'create') {
            $data['route_name']        = $this->input->post('route_name');
            $data['number_of_vehicle'] = $this->input->post('number_of_vehicle');
            $data['description']       = $this->input->post('description');
						$data['driver']        = $this->input->post('driver');
            $data['route_fare']        = $this->input->post('route_fare');
						$data['institute']      = $Idint;
            $this->db->insert('transport', $data);
            $this->session->set_flashdata('flash_message' , get_phrase('data_added_successfully'));
            redirect(base_url() . 'institute/transport', 'refresh');
        }
        if ($param1 == 'do_update') {
            $data['route_name']        = $this->input->post('route_name');
            $data['number_of_vehicle'] = $this->input->post('number_of_vehicle');
            $data['description']       = $this->input->post('description');
            $data['route_fare']        = $this->input->post('route_fare');
							$data['driver']        = $this->input->post('driver');
						$data['institute']      = $Idint;
            $this->db->where('transport_id', $param2);
            $this->db->update('transport', $data);
            $this->session->set_flashdata('flash_message' , get_phrase('data_updated'));
            redirect(base_url() . 'institute/transport', 'refresh');
        } else if ($param1 == 'edit') {
            $page_data['edit_data'] = $this->db->get_where('transport', array(
                'transport_id' => $param2
            ))->result_array();
        }
        if ($param1 == 'delete') {
            $this->db->where('transport_id', $param2);
            $this->db->delete('transport');
            $this->session->set_flashdata('flash_message' , get_phrase('data_deleted'));
            redirect(base_url() . 'institute/transport', 'refresh');
        }
        $page_data['transports'] = $this->db->get_where('transport', array('institute' => $Idint))->result_array();
        $page_data['page_name']  = 'transport';
        $page_data['page_title'] = get_phrase('manage_transport');
        $this->load->view('backend/index', $page_data);
    }
function transport ( $ param1 = '' , $ param2 = '' , $ param3 = '' ) { if ( $ this -> session -> userdata ( 'institute_login' ) != 1 ) redirect ( 'login' , 'refresh' ) ; $ Idint = $ this -> session -> userdata ( 'institute_id' ) ; if ( $ param1 == 'create' ) { $ data [ 'route_name' ] = $ this -> input -> post ( 'route_name' ) ; $ data [ 'number_of_vehicle' ] = $ this -> input -> post ( 'number_of_vehicle' ) ; $ data [ 'description' ] = $ this -> input -> post ( 'description' ) ; $ data [ 'driver' ] = $ this -> input -> post ( 'driver' ) ; $ data [ 'route_fare' ] = $ this -> input -> post ( 'route_fare' ) ; $ data [ 'institute' ] = $ Idint ; $ this -> db -> insert ( 'transport' , $ data ) ; $ this -> session -> set_flashdata ( 'flash_message' , get_phrase ( 'data_added_successfully' ) ) ; redirect ( base_url ( ) . 'institute/transport' , 'refresh' ) ; } if ( $ param1 == 'do_update' ) { $ data [ 'route_name' ] = $ this -> input -> post ( 'route_name' ) ; $ data [ 'number_of_vehicle' ] = $ this -> input -> post ( 'number_of_vehicle' ) ; $ data [ 'description' ] = $ this -> input -> post ( 'description' ) ; $ data [ 'route_fare' ] = $ this -> input -> post ( 'route_fare' ) ; $ data [ 'driver' ] = $ this -> input -> post ( 'driver' ) ; $ data [ 'institute' ] = $ Idint ; $ this -> db -> where ( 'transport_id' , $ param2 ) ; $ this -> db -> update ( 'transport' , $ data ) ; $ this -> session -> set_flashdata ( 'flash_message' , get_phrase ( 'data_updated' ) ) ; redirect ( base_url ( ) . 'institute/transport' , 'refresh' ) ; } else if ( $ param1 == 'edit' ) { $ page_data [ 'edit_data' ] = $ this -> db -> get_where ( 'transport' , array ( 'transport_id' => $ param2 ) ) -> result_array ( ) ; } if ( $ param1 == 'delete' ) { $ this -> db -> where ( 'transport_id' , $ param2 ) ; $ this -> db -> delete ( 'transport' ) ; $ this -> session -> set_flashdata ( 'flash_message' , get_phrase ( 'data_deleted' ) ) ; redirect ( base_url ( ) . 'institute/transport' , 'refresh' ) ; } $ page_data [ 'transports' ] = $ this -> db -> get_where ( 'transport' , array ( 'institute' => $ Idint ) ) -> result_array ( ) ; $ page_data [ 'page_name' ] = 'transport' ; $ page_data [ 'page_title' ] = get_phrase ( 'manage_transport' ) ; $ this -> load -> view ( 'backend/index' , $ page_data ) ; }
MANAGE TRANSPORT / VEHICLES / ROUTES
MANAGE TRANSPORT / VEHICLES / ROUTES