Ejemplo n.º 1
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');
     }
 }
Ejemplo n.º 2
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');
 }
Ejemplo n.º 3
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);
 }
Ejemplo n.º 4
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);
     }
 }
Ejemplo n.º 5
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);
     }
 }
Ejemplo n.º 6
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);
     }
 }
Ejemplo n.º 7
0
 public function delete_uploaded_contacts_by_id($record_id)
 {
     $ObjContacts = new contactsModel();
     $where_params = array('`contact_id`=' => $record_id);
     $ObjContacts->delete_data($where_params);
     return Redirect::to('upload_contacts');
 }
Ejemplo n.º 8
0
 public function update_uploaded_contacts_value($fields, $cut_id)
 {
     $ObjContacts = new contactsModel();
     $ObjCompanies = new companiesModel();
     $error_message = '';
     $result = TRUE;
     $email_address = '';
     $last_name = '';
     $first_name = '';
     $address1 = '';
     $city = '';
     $state_code = '';
     $zipcode = '';
     $company = '';
     foreach ($fields as $col) {
         $column = $col->cuff_column;
         $fieldname = $col->cuff_fieldname;
         $status = $col->cuff_status;
         $col = Input::get($column);
         $value = $col[$cut_id];
         if ($status == 'close' && $fieldname != '') {
             ${$fieldname} = $value;
         }
     }
     $company_exist = $ObjCompanies->get_company_id_check_if_company_exist($company, $address1, $city, $state_code, $zipcode);
     if ($email_address == '') {
         $error_message = 'Email Address required';
         $result = FALSE;
     } elseif ($company == '') {
         $error_message = 'Company Name required';
         $result = FALSE;
     } elseif ($email_address) {
         $where_params = array('`j`.`email_address`=' => $email_address, '`j1`.`company_name`=' => $company, '`j1`.`address1`=' => $address1, '`j1`.`city`=' => $city, '`j1`.`state_code`=' => $state_code, '`j1`.`zipcode`=' => $zipcode);
         $check_email = $ObjContacts->get_record_join($where_params);
         if ($check_email) {
             $error_message = 'Email Address already exist.';
             $result = FALSE;
         }
     } elseif ($last_name && $first_name) {
         $where_params = array('`last_name`=' => $last_name, '`first_name`=' => $first_name);
         $check_contact = $ObjContacts->get_record($where_params);
         if ($check_contact) {
             $error_message = 'Contact Name already exist.';
             $result = FALSE;
         }
     } elseif ($company_exist != '') {
         $error_message = 'Contact Joe Smith and ask him to add you to to your companies account.';
         $result = FALSE;
     }
     foreach ($fields as $col) {
         $column = $col->cuff_column;
         $fieldname = $col->cuff_fieldname;
         $status = $col->cuff_status;
         $col = Input::get($column);
         $value = $col[$cut_id];
         if ($status == 'close' && $fieldname != '') {
             $data[$column] = $value;
         }
     }
     $data[$this->tblpref . 'error_message'] = $error_message;
     $this->update_data($data, $cut_id);
     return $result;
 }
Ejemplo n.º 9
0
 public function retrieve_password()
 {
     $ObjContacts = new contactsModel();
     $email = Input::get('email');
     $contcol = $ObjContacts->get_contact_info_by_email($email);
     if ($contcol) {
         $body_message = 'Password: <b>' . $contcol->password . '</b>, <br /><br /><a href="' . URL::to('login') . '" target="_blank">Click here to Login</a>';
         $data = array('email' => $email, 'first_name' => $contcol->first_name, 'last_name' => $contcol->last_name, 'subject' => 'Retrieve Password at Paskr Account.', 'body_message' => $body_message);
         Mail::send('emails.basic_format', $data, function ($mail) use($data) {
             $mail->to($data['email'], $data['first_name'] . ' ' . $data['last_name'])->subject($data['subject']);
         });
         $message = 'Please check your email to view your password.';
     } else {
         $message = 'Email do not exist.';
     }
     return Redirect::to('forgot_password')->with('message', $message);
 }