function insert_data($data) { $ObjQuery = new queryModel(); $constant = array('last_updated_date' => $this->datetime); $params_data = array_merge($constant, $data); $result = DB::table($this->tblname)->insert($params_data); $lastid = DB::select("SELECT LAST_INSERT_ID()"); $col = $ObjQuery->object_to_array($lastid); $result = isset($col[0]['LAST_INSERT_ID()']) ? $col[0]['LAST_INSERT_ID()'] : ''; return $result; }
public function profile() { $data = array(); $ObjQuery = new queryModel(); $ObjContactsTemp = new contactsTempModel(); $ObjContacts = new contactsModel(); $ObjCompanies = new companiesModel(); $contcol = $ObjContacts->get_loggin_user_info(); $data = $ObjQuery->object_to_array($contcol); if (isset($contcol->cont_status) && $contcol->cont_status == 'Validate Company') { $company_col = $ObjContacts->get_record_join(array('`j1`.`company_id`=' => $contcol->company_id)); $data['comp_name'] = $company_col->comp_name; $data['cont_email'] = $company_col->cont_email; $data['cont_firstname'] = $company_col->cont_firstname; $data['cont_lastname'] = $company_col->cont_lastname; } $secret_question = isset($contcol->secret_question) ? $contcol->secret_question : ''; $data['select_secret_question'] = $ObjContacts->select_secret_question($secret_question); return View::make('profile', $data); }
public function add_fileinfo_to_record($col) { $result = array(); $ObjQuery = new queryModel(); if ($col) { $listimg_filepath = $col->listimg_filepath; $filepath = $this->base_path . $listimg_filepath; $filepath_thumb = $this->base_path . str_replace('public/uploads/', 'public/uploads/thumbnail/', $listimg_filepath); $filepath_medium = $this->base_path . str_replace('public/uploads/', 'public/uploads/medium/', $listimg_filepath); $filepath_large = $this->base_path . str_replace('public/uploads/', 'public/uploads/large/', $listimg_filepath); extract(pathinfo($filepath)); $urlpath = URL::to($listimg_filepath); $urlpath_thumb = URL::to(str_replace('public/uploads/', 'public/uploads/thumbnail/', $listimg_filepath)); $urlpath_medium = URL::to(str_replace('public/uploads/', 'public/uploads/medium/', $listimg_filepath)); $urlpath_large = URL::to(str_replace('public/uploads/', 'public/uploads/large/', $listimg_filepath)); $data1 = $ObjQuery->object_to_array($col); $data2 = array('dirname' => $dirname, 'basename' => $basename, 'extension' => $extension, 'filename' => $filename, 'filepath' => $filepath, 'filepath_thumb' => $filepath_thumb, 'filepath_medium' => $filepath_medium, 'filepath_large' => $filepath_large, 'urlpath' => $urlpath, 'urlpath_thumb' => $urlpath_thumb, 'urlpath_medium' => $urlpath_medium, 'urlpath_large' => $urlpath_large); $data = array_merge($data1, $data2); $result = (object) $data; } return $result; }
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); } }