public function update_recipient() { $this->load->library('form_validation'); $this->form_validation->set_rules('fname', 'First Name', 'trim|required|xss_clean'); $this->form_validation->set_rules('mname', 'Middle Name', 'trim|xss_clean'); $this->form_validation->set_rules('lname', 'Last Name', 'trim|xss_clean'); $this->form_validation->set_rules('gender', 'Gender', 'trim|required|xss_clean'); $this->form_validation->set_rules('phone', 'Phone', 'trim|numeric|required|xss_clean'); $this->form_validation->set_rules('refnum', 'Reference Number', 'trim|xss_clean'); $this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email|xss_clean'); $this->form_validation->set_rules('location', 'Location', 'trim|required|xss_clean'); $fname = $this->input->post('fname'); $mname = $this->input->post('mname'); $lname = $this->input->post('lname'); $phone = $this->input->post('phone'); $refnum = $this->input->post('refnum'); $email = $this->input->post('email'); $gender = $this->input->post('gender'); $location = $this->input->post('location'); //$ref_id = $this->input->post('user_id'); if (getCurrentUserSession()) { $user_session = getCurrentUserSession(); $ref_id = $user_session['user_id']; } else { die("User Not Loggedin register_recipient.php"); } $recip_id = $this->input->post('recip_id'); if ($this->form_validation->run() == FALSE) { $this->load->helper('form'); $data['recipient_id'] = $recip_id; $data['title'] = 'Create Recipients'; $data['content'] = 'reipient/edit_recipient'; $this->load->view($this->layout_transaction_initiator, $data); } else { $recip_data = array('first_name' => $fname, 'middle_name' => $mname, 'last_name' => $lname, 'gender' => $gender, 'phone' => $phone, 'ref_num' => $refnum, 'email' => $email, 'location' => $location, 'ref_id' => $ref_id); $last_insert_id = updateRecipientData($recip_data, $recip_id); if ($last_insert_id) { $this->session->set_flashdata('item', 'One Record Updated'); redirect('reipient/manage'); } else { $data['msg'] = "Recipient Not Added try Again"; $data['title'] = 'Status Info'; $data['content'] = 'client/status'; $this->load->view('layouts/status_master', $data); } } }
<div class="container-fluid" style="margin-top:20px;"> <div class="panel panel-default main-top"> <table class="table"> <thead> <tr> <th>#</th> <th>Email</th> <th>Action</th> </tr> </thead> <tbody> <?php if (getCurrentUserSession()) { $user_session = getCurrentUserSession(); $user_id = $user_session['user_id']; } if (getClientUsersDetailByRoleID($role_id, $user_id)) { foreach (getClientUsersDetailByRoleID($role_id, $user_id)->result() as $value) { ?> <tr> <td><?php echo $value->user_id; ?> </td> <td><?php echo $value->email; ?> </td> <td> <a href="#" class="btn btn-info"><i class="fa fa-check-circle"></i>View</a> </td>