Example #1
0
    /**
     * PAGE FOR ID REQUEST ...
     * ADDED BY : MICHAEL RAFALLO
     * SINCE VERSION 2.0
     */
    function id_request()
    {
        $data['page_name'] = '<b>ID Request List</b>';
        $data['msg'] = '';
        $data['pop_up'] = '';
        $off = $this->uri->segment(4, 0);
        //echo $off;
        if ($off == 0) {
            $office_id = Session::get('office_id');
            $data['selected'] = Session::get('office_id');
        } else {
            $office_id = $off;
            $data['selected'] = $office_id;
        }
        //Use for office listbox
        $data['options'] = $this->options->office_options();
        $e = new Employee_id_request_m();
        $off = $this->uri->segment(4, 0);
        $this->load->library('mi_pagination');
        $config['base_url'] = base_url() . 'employees/id_request';
        $config['total_rows'] = $e->count();
        $config['office_id'] = $office_id;
        //add ko
        $config['per_page'] = '15';
        $config['full_tag_open'] = '<p>';
        $config['full_tag_close'] = '</p>';
        $config['next_link'] = 'Next';
        $config['prev_link'] = 'Previous';
        $data['results'] = $e->get($config['per_page'], $this->uri->segment(3));
        $this->mi_pagination->initialize($config);
        //START -- generate maker buttons -- ADDED BY : MICHAEL RAFALLO ---
        if (Input::get('cancel')) {
            $ie = new Employee_id_request_m();
            $ie->truncate();
            return Redirect::to('employees/id_request');
        }
        //cancel button
        $data['btn_cart'] = '';
        $ie = new Employee_id_request_m();
        $count_request = $ie->get()->count();
        if ($count_request >= 1) {
            $data['cart'] = 'You have <b>' . $count_request . '</b> pending request for ID!';
            $data['btn_cart'] = '<input name="generate_id" type="submit" value=" Generate ID " class="button"/> 
								  <input type="submit" name="cancel" value=" Clear " class="button">';
        } else {
            $data['cart'] = ' You have no pending request for ID!';
            $count_request = 0;
        }
        //END --- ID maker buttons -- ADDED BY : MICHAEL RAFALLO ---
        //START -- print preview -- ADDED BY : MICHAEL RAFALLO -------
        if (Input::get('generate_id')) {
            $ie = new Employee_id_request_m();
            $id_cart = $ie->get();
            $data['pop_up'] = 1;
            $preview = new Id_preview();
            $preview->back_id($id_cart);
            $preview->front_id($id_cart);
            $data['report_file'] = $preview->generated_id_preview($id_cart);
        }
        //END ----- print preview	-- ADDED BY : MICHAEL RAFALLO ---
        $data['page'] = $this->uri->segment(3, 0);
        $data['count'] = $config['total_rows'];
        $data['main_content'] = 'id_request';
        return View::make('includes/template', $data);
    }
Example #2
0
 $fname = $row['fname'];
 $mname = $row['mname'];
 $lname = $row['lname'];
 $id = $row['id'];
 $employee_id = $row['employee_id'];
 $office_id = $row['office_id'];
 $status = $row['status'];
 $pics = $row['pics'];
 $position = $row['position'];
 $office_name = $this->Office->get_office_name($office_id);
 $status = $status == 1 ? 'Active' : 'Not Active';
 if ($pics == "" || !file_exists("pics/{$pics}")) {
     $pics = 'not_available.jpg';
 }
 //START --- check if id was already existing in session --- added by : MICHAEL RAFALLO ---
 $e = new Employee_id_request_m();
 $results = $e->get();
 $office = Session::get('office_id');
 $add_to_cart = "<a href='" . base_url() . "employees/add_cart/" . $page . "/" . $id . "/" . $office . "'>Add to Request<a>";
 if ($e->count() >= '1') {
     foreach ($results as $result) {
         if ($id == $result->employee_id) {
             $add_to_cart = "<a href='" . base_url() . "employees/remove_cart/" . $page . "/" . $id . "/" . $office . "'>Remove to Request<a>";
         }
     }
 }
 if ($enable_id_maker == 'no') {
     $add_to_cart = '';
 }
 //END --- check if id was already exisiting in session --- added by : MICHAEL RAFALLO ---
 $bg = $this->Helps->set_line_colors();