public function edit($list_id) { $ObjQuery = new queryModel(); $ObjContacts = new contactsModel(); $loggin_user = $ObjContacts->get_loggin_user_info(); $data = $ObjQuery->array_to_data(array(), $loggin_user); if ($loggin_user == FALSE) { return Redirect::to('login'); } if ($list_id) { $ObjQuery = new queryModel(); $ObjList = new listingsModel(); $ObjListClassify = new listingsClassificationsModel(); $ObjListImage = new listingsImagesModel(); $ObjClassify = new classificationsModel(); $ObjTrades = new tradesModel(); $ObjPreQualify = new preQualifyModel(); $details_list = $ObjList->get_record_join(array('`j`.`' . $ObjList->tblid . '`=' => $list_id)); $data = $ObjQuery->array_to_data($data, $details_list); $data['listclassify_rows'] = $ObjClassify->get_records(); $records_listclassify = $ObjListClassify->get_records_join(array('`j`.`' . $ObjList->tblid . '`=' => $list_id)); $data['records_listclassify'] = $ObjQuery->array_to_data_select_key('classify_id', $records_listclassify); $data['classifications_array'] = $details_list->list_classifications ? unserialize($details_list->list_classifications) : array(); //$data['records_listvend'] = $ObjListVend->get_records( array('`'.$ObjList->tblid.'`='=>$list_id) ); $data['show_uploaded_image_slider'] = $ObjListImage->show_uploaded_image_slider($list_id); $data['trades_rows'] = $ObjTrades->get_records(); $data['trades_array'] = $details_list->list_trades ? unserialize($details_list->list_trades) : array(); $prequalify = $ObjPreQualify->get_record(array('`list_id`=' => $list_id), array('ASC' => '`lpq_id`')); $data['lpq_id'] = $prequalify->lpq_id; return View::make('listings_edit', $data); } else { return Redirect::to('listings'); } }
public function get_records_in_id($trade_id_array, $order_params = array()) { $ObjQuery = new queryModel(); $where = $ObjQuery->where_params(array('`' . $this->tblid . '` IN ' => "('" . implode("','", $trade_id_array) . "')"), 'AND', ''); $order = $ObjQuery->orberby_params($order_params); $query = "SELECT *" . " FROM `" . $this->tblname . "`" . $where . $order; $rows = DB::select($query); return $rows; }
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 edit($list_id, $lpq_id = '') { $ObjQuery = new queryModel(); $ObjPreQualify = new preQualifyModel(); $data = array('list_id' => $list_id); $details = array('lpq_id' => '', 'list_id' => $list_id, $ObjPreQualify->tblpref . 'organization_date' => '', $ObjPreQualify->tblpref . 'business_type' => '', $ObjPreQualify->tblpref . 'fed_tax_id' => '', $ObjPreQualify->tblpref . 'disadvantaged_status' => '', $ObjPreQualify->tblpref . 'financial_company_secure_bond' => '', $ObjPreQualify->tblpref . 'financial_surety_company' => '', $ObjPreQualify->tblpref . 'financial_agents_fullname' => '', $ObjPreQualify->tblpref . 'financial_agents_email' => '', $ObjPreQualify->tblpref . 'financial_available_bonding_capacity' => '', $ObjPreQualify->tblpref . 'financial_available_bonding_rate' => '', $ObjPreQualify->tblpref . 'bank' => '', $ObjPreQualify->tblpref . 'bank_agents_fullname' => '', $ObjPreQualify->tblpref . 'bank_agents_email' => '', $ObjPreQualify->tblpref . 'insurance_com' => '', $ObjPreQualify->tblpref . 'insurance_com_agents_fullname' => '', $ObjPreQualify->tblpref . 'insurance_com_agents_email' => '', $ObjPreQualify->tblpref . 'insurance_com_gen_liability_limit' => '', $ObjPreQualify->tblpref . 'insurance_com_workers_comp_limit' => '', $ObjPreQualify->tblpref . 'safety_drug_free_workplace' => '', $ObjPreQualify->tblpref . 'safety_workers_comp_experience' => '', $ObjPreQualify->tblpref . 'ref_vendors_company_name1' => '', $ObjPreQualify->tblpref . 'ref_vendors_contact_name1' => '', $ObjPreQualify->tblpref . 'ref_vendors_email1' => '', $ObjPreQualify->tblpref . 'ref_vendors_company_name2' => '', $ObjPreQualify->tblpref . 'ref_vendors_contact_name2' => '', $ObjPreQualify->tblpref . 'ref_vendors_email2' => '', $ObjPreQualify->tblpref . 'ref_vendors_company_name3' => '', $ObjPreQualify->tblpref . 'ref_vendors_contact_name3' => '', $ObjPreQualify->tblpref . 'ref_vendors_email3' => '', $ObjPreQualify->tblpref . 'ref_contractors_company_name1' => '', $ObjPreQualify->tblpref . 'ref_contractors_contact_name1' => '', $ObjPreQualify->tblpref . 'ref_contractors_email1' => '', $ObjPreQualify->tblpref . 'ref_contractors_company_name2' => '', $ObjPreQualify->tblpref . 'ref_contractors_contact_name2' => '', $ObjPreQualify->tblpref . 'ref_contractors_email2' => '', $ObjPreQualify->tblpref . 'ref_contractors_company_name3' => '', $ObjPreQualify->tblpref . 'ref_contractors_contact_name3' => '', $ObjPreQualify->tblpref . 'ref_contractors_email3' => ''); if ($lpq_id) { $details = $ObjPreQualify->get_record_join(array('`j`.`lpq_id`=' => $lpq_id)); } $data = $ObjQuery->array_to_data($data, $details); $year = FDateTime::fdate($details->lpq_organization_date, 'Y'); $month = FDateTime::fdate($details->lpq_organization_date, 'm'); $day = FDateTime::fdate($details->lpq_organization_date, 'd'); $data['select_year'] = $ObjPreQualify->select_year($year); $data['select_month'] = $ObjPreQualify->select_month($month); $data['select_day'] = $ObjPreQualify->select_day($day); return View::make('pre_qualify_form', $data); }
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); }
function queryTable_11($data) { $queryModel = new queryModel(); return $queryModel->queryTable_11($data); }
public function get($limit = 0) { $opt = $this->nav_array($limit ?: Bootstrap::$main->getConfig('merlin.search.limit')); $opt['totalPrice'] = Bootstrap::$main->session('total'); $site = Bootstrap::$main->getConfig('site'); $config = $this->getConfig(); Bootstrap::$main->system('cfg'); $cond = $this->data('q') ? $this->q2cond($this->data('q')) : []; Bootstrap::$main->system('q2c'); Bootstrap::$main->session('q', $this->data('q')); $social_url = 'http://' . $_SERVER['HTTP_HOST'] . '/'; $social_text = ''; $social_words = []; if (count($cond)) { if (isset($cond[1])) { foreach ($cond[1] as $arr) { foreach ($arr as $ar) { if (isset($social_words[$ar])) { continue; } $social_words[$ar] = true; $social_url .= str_replace(' ', '-', $ar) . '/'; $social_text .= $ar . ' '; } } } if (!isset($cond[0]['type'])) { $cond[0]['type'] = 'F'; } if (!isset($cond[0]['adt'])) { $cond[0]['adt'] = 2; } $cond[0]['total'] = $opt['totalPrice'] ? true : false; $rowattr = []; $rowattr['total'] = $opt['totalPrice']; $results = $this->results($cond, $opt['limit'], $opt['offset'], $config, $rowattr); $offers = $results['offers']; $result = $results['result']; $offers2 = $offers; $opt['next_offset'] = $opt['offset'] + $opt['limit']; $limit = $opt['limit']; $security = 20; while (count($offers2['result']) == $limit && count($result) < $opt['limit']) { $offset = $opt['next_offset']; $limit = $opt['limit'] - count($result); $opt['next_offset'] += $limit; $results = $this->results($cond, $limit, $offset, $config, $rowattr); if (count($results['result'])) { $result = array_merge($result, $results['result']); } $offers2 = $results['offers']; if (!$security--) { break; } } if (!isset($cond['memcache']) && !$this->data('debug')) { @Tools::log('query-' . $site, ['q' => $this->data('q'), 'count' => $offers['count'], 'cond' => $cond]); if (isset($cond[2]) && is_array($cond[2]) && count($cond[2])) { foreach ($cond[2] as $w) { $query = new queryModel(); $query->datetime = date('c'); $query->q = $this->data('q'); $query->site = Bootstrap::$main->getConfig('site'); $query->word = $w; $query->ip = Bootstrap::$main->ip; $query->save(); } } } } else { $offers = ['result' => [], 'count' => 0]; $result = []; $opt['next_offset'] = $opt['offset']; } Bootstrap::$main->system('mds'); $social_subject = trim(str_replace('{q}', trim($social_text), Bootstrap::$main->getConfig('mail.subject'))); $opt['f'] = 'https://www.facebook.com/sharer/sharer.php?t=' . urlencode($social_subject) . '&u=' . urlencode($social_url); $opt['m'] = 'mailto:?subject=' . urlencode($social_subject) . '&body=' . urlencode($social_url); $opt['results'] = 'Wyniki: '; if (isset($offers['count'])) { if ($offers['count'] >= 1000) { $opt['results'] .= 'ponad 1000'; } else { $opt['results'] .= $offers['count']; } } $opt['change'] = isset($cond[3]) && strlen($cond[3]) ? $cond[3] : ''; if (isset($cond[2]) && is_array($cond[2])) { foreach ($cond[2] as $unknown) { if (strstr($opt['change'], $unknown)) { $opt['change'] = str_replace($unknown, "<i>{$unknown}</i>", $opt['change']); } else { if (strlen($opt['change'])) { $opt['change'] .= ' '; } $opt['change'] .= "<i>{$unknown}</i>"; } } } if ($this->data('debug')) { $ret = ['conditions' => $cond, 'result' => $result]; if ($this->data('debug') == 2) { $ret['merlin'] = $this->merlin->debug; } mydie($ret); } return array('status' => true, 'options' => $opt, 'data' => $result); }
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 upload_image_crop($list_id, $listimg_id) { $ObjQuery = new queryModel(); $ObjListImage = new listingsImagesModel(); $details = $ObjListImage->get_image_by_listimg_id($listimg_id); $data = array(); $data = $ObjQuery->array_to_data($data, $details); //echo '<pre>'; //print_r($data); //echo '</pre>'; return View::make('listings_upload_image_crop', $data); }
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); } }