public function update_company() { $ObjContactsTemp = new contactsTempModel(); $ObjCompanies = new companiesModel(); $contact_id = Input::get('contact_id'); $company_id = Input::get('company_id'); $company_name = Input::get('company_name'); $address1 = Input::get('address1'); $address2 = Input::get('address2'); $city = Input::get('city'); $state = Input::get('state'); $zipcode = Input::get('zipcode'); $data = array('company_name' => $company_name, 'address1' => $address1, 'address2' => $address2, 'city' => $city, 'state_code' => $state, 'zipcode' => $zipcode); if ($company_id) { $result = $ObjCompanies->update_data($data, $company_id); if ($result) { $message = 'Update Company profile successful.'; } else { $message = 'Update Company profile not successful.'; } } else { $company_id = $ObjCompanies->save_company_if_company_dont_exist($company_name, $address1, $city, $state, $zipcode, $address2); if ($company_id) { $data = array('company_id' => $company_id); $result = $ObjContactsTemp->update_data($data, $contact_id); if ($result) { $message = 'Update Company profile company id successful.'; } else { $message = 'Update Company profile company id not successful.'; } } else { $message = 'Add new Company not successful.'; } } return Redirect::to('profile')->with('message', $message); }
public function register_confirm($confirmation) { $ObjQuery = new queryModel(); $ObjContactsTemp = new contactsTempModel(); $where_params = array('`cont_confirmation`=' => $confirmation); $contcol = $ObjContactsTemp->get_record($where_params); if ($contcol) { $data = $ObjQuery->object_to_array($contcol); $update_data = array('cont_confirmation' => 'yes'); $ObjContactsTemp->update_data($update_data, $contcol->contact_id); return View::make('register_confirm', $data); } else { $message = 'Something wrong with your confirmation URL. Please re-send again the registration confirmation.'; return Redirect::to('forgot_password')->with('message', $message); } }