Welcome Guest, Not a member yet? Register   Sign In
Easy Checkbox Update
#4

[eluser]Fielder[/eluser]
My controller:
Code:
$inputSchema = array('user_firstname' => '', 'user_lastname' => '', 'user_phone' => '', 'user_email' => '', 'user_rep' => '', 'user_coord' => '', 'user_status' => '', 'ug_id' => '');
$inputData = array_intersect_key($_POST, $inputSchema);

$this->Users->insertNewUser($inputData);

My model:
Code:
function insertNewUser($inputData)
    {
        $this->db->insert('user', $inputData);
    }


This is the part of my controller loading up the data for the user edit form, but like I mention it already displays the correct "status code" for the user to be edited.
Code:
$user_id = $this->uri->segment(3);
            
                $data['results'] = $this->Users->getUser($user_id);
                //load database query results into array for the input form
                foreach ($data['results'] as $row)
                {
                    $data['user_id'] = $row['user_id'];
                    $data['user_firstname'] = $row['user_firstname'];
                    $data['user_lastname'] = $row['user_lastname'];
                    $data['user_phone'] = $row['user_phone'];
                    $data['user_email'] = $row['user_email'];
                    $data['user_rep'] = $row['user_rep'];
                    $data['user_coord'] = $row['user_coord'];
                    $data['user_status'] = $row['user_status'];
                    $data['ug_id'] = $row['ug_id'];
                }
                
                $data['groupValueName'] = $this->Users->getGroupValue($data['ug_id']);
                
                $this->load->view('include/header.php', $data);
                $this->load->view('user_form');
                $this->load->view('include/footer.php');

I'm going to take a close look at it again.


Messages In This Thread
Easy Checkbox Update - by El Forum - 05-14-2009, 10:37 AM
Easy Checkbox Update - by El Forum - 05-14-2009, 10:43 AM
Easy Checkbox Update - by El Forum - 05-14-2009, 10:55 AM
Easy Checkbox Update - by El Forum - 05-14-2009, 12:41 PM
Easy Checkbox Update - by El Forum - 05-14-2009, 01:14 PM
Easy Checkbox Update - by El Forum - 05-14-2009, 01:28 PM
Easy Checkbox Update - by El Forum - 05-14-2009, 01:36 PM
Easy Checkbox Update - by El Forum - 05-14-2009, 08:17 PM
Easy Checkbox Update - by El Forum - 05-14-2009, 08:22 PM
Easy Checkbox Update - by El Forum - 05-14-2009, 09:15 PM
Easy Checkbox Update - by El Forum - 05-15-2009, 04:47 AM
Easy Checkbox Update - by El Forum - 05-15-2009, 07:47 AM
Easy Checkbox Update - by El Forum - 07-08-2009, 04:17 PM
Easy Checkbox Update - by El Forum - 07-08-2009, 04:22 PM



Theme © iAndrew 2016 - Forum software by © MyBB