예제 #1
0
 public function index()
 {
     $ObjContacts = new contactsModel();
     $loggin_user = $ObjContacts->get_loggin_user_info();
     if ($loggin_user) {
         /*$cont_status = $loggin_user->cont_status;
         		if( $cont_status == 'Contact Temp' ){
         			print_r($loggin_user);
         			$data = array(
         				'email'=>$email,
         				'password'=>$password,
         			);
         		} else {
         			$email = Session::get('contact_email');
         			$password = Session::get('contact_password');
         		
         			$data = array(
         				'email'=>$email,
         				'password'=>$password,
         			);
         		}*/
     } else {
         $email = Session::get('contact_email');
         $password = Session::get('contact_password');
         $data = array('email' => $email, 'password' => $password);
     }
     return View::make('register', $data);
 }
예제 #2
0
 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');
     }
 }
예제 #3
0
 public function extract_delete()
 {
     $ObjCFDT = new contactsFileDataTempModel();
     $ObjContacts = new contactsModel();
     $loggin_user = $ObjContacts->get_loggin_user_info();
     $ObjCFDT->delete_data(array('`contact_id`=' => $loggin_user->contact_id));
     return Redirect::to('upload_contacts');
 }
예제 #4
0
 public function update_profile()
 {
     $ObjContactsTemp = new contactsTempModel();
     $ObjContacts = new contactsModel();
     $loggin_user = $ObjContacts->get_loggin_user_info();
     $contact_id = $loggin_user->contact_id;
     $status = isset($loggin_user->cont_status) ? $loggin_user->cont_status : '';
     $company_id = Input::get('company_id');
     $firstname = Input::get('firstname');
     $lastname = Input::get('lastname');
     $midini = Input::get('midini');
     $email = Input::get('email');
     $address1 = Input::get('address1');
     $address2 = Input::get('address2');
     $city = Input::get('city');
     $zipcode = Input::get('zipcode');
     $secret_question = Input::get('secret_question');
     $secret_answer = Input::get('secret_answer');
     $phone = Input::get('phone');
     $use_company_address = Input::get('use_company_address');
     $password = Input::get('password');
     $password_confirm = Input::get('password_confirm');
     $data = array('first_name' => $firstname, 'last_name' => $lastname, 'midini' => $midini, 'address1' => $address1, 'address2' => $address2, 'city' => $city, 'zipcode' => $zipcode, 'secret_question' => $secret_question, 'secret_answer' => $secret_answer, 'office_phone' => $phone, 'use_company_address' => $use_company_address);
     if ($password && $password_confirm) {
         if ($password != $password_confirm) {
             $error_msg = 'Confirm password must equal to Password';
         } else {
             $data['password'] = $password;
         }
     }
     //$contact_status = Session::get('contact_status');
     //if( $contact_status == 'Contact Temp' ){
     if ($status == 'Contact Temp') {
         $result = $ObjContactsTemp->update_data($data, $contact_id);
     } else {
         $result = $ObjContacts->update_data($data, $contact_id);
     }
     if ($result) {
         $message = 'Update Contact profile successful.';
     } else {
         $message = 'Update Contact profile not successful.';
     }
     //if( $contact_status == 'Contact Temp'  && $company_id != ''&& $firstname != '' && $lastname != '' && $email != '' && $city != '' && $zipcode != '' && $phone != '' ){
     if ($status == 'Contact Temp' && $company_id != '' && $firstname != '' && $lastname != '' && $email != '' && $city != '' && $zipcode != '' && $phone != '') {
         $contcol = $ObjContactsTemp->get_record_by_id($contact_id);
         $data = array('paskr_company_id' => $contcol->company_id, 'company_id' => $contcol->company_id, 'email_address' => $contcol->email_address, 'first_name' => $contcol->first_name, 'last_name' => $contcol->last_name, 'midini' => $contcol->midini, 'address1' => $contcol->address1, 'address2' => $contcol->address2, 'city' => $contcol->city, 'zipcode' => $contcol->zipcode, 'secret_question' => $contcol->secret_question, 'secret_answer' => $contcol->secret_answer, 'office_phone' => $contcol->office_phone, 'use_company_address' => $contcol->use_company_address);
         $new_contact_id = $ObjContacts->insert_data($data);
         if ($new_contact_id) {
             $result = $ObjContactsTemp->delete_data(array('`contact_id`=' => $contact_id));
             Session::put('contact_id', $new_contact_id);
             //Session::put('contact_status','Contact Final');
             $message = 'Update Contact profile successful.';
             return Redirect::to('upload_contacts')->with('message', $message);
         }
     }
     return Redirect::to('profile')->with('message', $message);
 }
예제 #5
0
 public function index()
 {
     $ObjContacts = new contactsModel();
     $loggin_user = $ObjContacts->get_loggin_user_info();
     if ($loggin_user == FALSE) {
         return View::make('login');
     } else {
         return Redirect::to($this->default_login_page);
     }
 }
예제 #6
0
 public function index()
 {
     $ObjContacts = new contactsModel();
     $loggin_user = $ObjContacts->get_loggin_user_info();
     if ($loggin_user == FALSE) {
         return Redirect::to('login');
     } else {
         $ObjList = new listingsModel();
         $data = array();
         return View::make('contact_profile', $data);
     }
 }
예제 #7
0
 public function index($list_id)
 {
     $ObjContacts = new contactsModel();
     $loggin_user = $ObjContacts->get_loggin_user_info();
     if ($loggin_user == FALSE) {
         return Redirect::to('login');
     } else {
         $ObjList = new listingsModel();
         $data['record_rows'] = $ObjList->get_records_join();
         return View::make('listings', $data);
     }
 }
예제 #8
0
 public function uploaded_contacts_save()
 {
     $ObjCUF = new contactsUploadedFileModel();
     $ObjCUFF = new contactsUploadedFileFieldsModel();
     $ObjContacts = new contactsModel();
     $loggin_user = $ObjContacts->get_loggin_user_info();
     $contact_id = $loggin_user->contact_id;
     $ObjCUT = new contactsUploadedTempModel();
     $cuf_id = Input::get('cuf_id');
     //$ObjCUT->uploaded_contacts_update_value( $cuf_id );
     $result = $ObjCUT->uploaded_contacts_save($cuf_id);
     if ($result) {
         $ObjCUF->delete_data(array('`cuf_id`=' => $cuf_id));
         $ObjCUFF->delete_data(array('`cuf_id`=' => $cuf_id));
         return Redirect::to('upload_contacts');
     } else {
         return Redirect::to('upload_contacts/' . $cuf_id);
     }
 }