input->ip_address(); $data['loc'] = $ip; //"38.101.241.200"; $this->load->model('combo_model'); $this->combo_model->defaultComboMessage = 'Select your Country'; $data['country_combo'] = $this->combo_model->getCountryCombo('country', $country); $terms_checked = ''; // is anybody using this email already $this->load->model('account_model'); $data['signup_error'] = ''; if ($_POST) { // post if ($data['terms'] == 'on') { $terms_checked = 'checked'; } // $data['terms'] = 1; // note terms is turned to 1 // // print_r($_POST); if ($this->account_model->verifySignupInputs($data) == true) { $email_in_use = false; $data['terms'] = 1; // $terms is interger in backend; if ($this->account_model->checkUsernameDuplicate($data) > 0) { $email_in_use = true; } if ($email_in_use == false) { $data['action'] = WRENCHBOARD_ACCOUNT_PENDING; if ($_POST) { if ($firstname !== '' && $lastname !== '') { $this->load->model('backend_model'); $out = array(); $res = $this->backend_model->wrenchboard_api($data, $out); if ($res > 0) { $data['account_email'] = strtolower($email); redirect('outmessage', $data); } else { $data['signup_error'] = "Unable to create account"; } } } } else { $data['signup_error'] = "Please use another username"; } } else { $data['signup_error'] = "Enter all required fields"; } } // if post $data['signup_error_style'] = ''; if (strlen($data['signup_error']) > 0) { $data['signup_error_style'] = "
" . $data["signup_error"] . "
"; } $data['terms'] = $terms_checked; // $this->load->view('users/view_registration', $data); // $this->load->view('users/view_external_footer', $data); } }