input->post('username'); $data['name'] = $_SESSION['name']; // = $this->input->post('username'); $data['firstname'] = $_SESSION['firstname']; // = $ret->firstname; $data['lastname'] = $_SESSION['lastname']; // = $ret->lastname; $data['email'] = $_SESSION['email']; // = $ret->email; // print_r($_SESSION); //Array ( [__ci_last_regenerate] => 1474689025 [username] => ses66181+1@gmail.com [name] => ses66181+1@gmail.com [firstname] => Olusesan [lastname] => Amey [email] => ses66181+1@gmail.com ) // if (!isset($_SESSION['username']) or $_SESSION['username'] == '') { redirect(home); } else { // $this->load->view('users/view_header_user', $data); // $this->load->view('users/view_dash', $data); // $this->load->view('users/view_footer_user', $data); redirect(dash); } } /* * Schedule account delete in the backend */ public function deleteacc(){ // echo "Please log out of your account, and you will not be able to log in anymore. "; $data = $this->getSessionArray(); $in = []; $in['member_id'] = $_SESSION['member_id']; $in['reason'] = "Not accepted in this version"; $in['action'] = WRENCHBOARD_USER_DELETEACC; if ($this->wrenchboard_api($in, $outx) == PHP_API_OK) { $data['delete_message'] = "
Your Account and Information Deleted.
"; redirect('/logout'); } else { $data['delete_message'] = "
Unable to complete account delete at this time.
"; } echo $data['delete_message']; } public function addreccipient() { $data = $this->getSessionArray(); $data['firstname'] = $data['lastname'] = $data['account_no'] = $data['account_no_repeat'] = ''; $data['state'] = $data['city'] = ''; $data['add_error'] = ''; // $this->load->model('country_model'); $data["status"] = 1; // $out = $this->country_model->loadCountry($data); // print_r($out); $data['country'] = $this->input->post('country'); $data['banks'] = $this->input->post('banks'); $data['account_type'] = $this->input->post('account_type'); $this->load->model('combo_model'); $data['country_combo'] = $this->combo_model->getCountryCombo('country', $data['country']); $data['bank_combo'] = $this->combo_model->getBankCombo('banks', $data['banks']); $data['account_type_combo'] = $this->combo_model->getAccountTypeCombo('account_type', $data['account_type']); if ($_POST) { $data['firstname'] = $this->input->post('firstname'); $data['lastname'] = $this->input->post('lastname'); $data['account_no'] = $this->input->post('account_no'); $data['account_no_repeat'] = $this->input->post('account_no_repeat'); $data['state'] = $this->input->post('state'); $data['city'] = $this->input->post('city'); // now let us verify the data $this->load->model('recipient_model'); $out = $this->recipient_model->verifyNewRecipientInfo($data, $_SESSION['member_id']); if ($out['error_state'] == true) { $data['add_error'] = "
" . $out['error'] . "
"; } else { $in = array(); $outx = array(); // $this->load->model('backend_model'); $in['action'] = WRENCHBOARD_SMONEY_ADDRECIPIENT; $in['member_id'] = $_SESSION['member_id']; $in['bank_code'] = $data['banks']; $in['firstname'] = $data['firstname']; $in['lastname'] = $data['lastname']; $in['account_no'] = $data['account_no']; $in['account_type'] = $data['account_type']; $in['country'] = $data['country']; $in['city'] = $data['city']; $in['state'] = $data['state']; $outx['error'] = ''; $recipient_id = $this->wrenchboard_api($in, $outx); if ($recipient_id > 0) { redirect('/member/recipient'); } else { $data['job_message'] = 'Unable to create recipient...'; $data['add_error'] = "
" . $outx['error'] . "
"; } } // print_r($out); } //getBankCombo /* * * * wrenchboard=> \d sendmoney_recipient Table "public.sendmoney_recipient" Column | Type | Modifiers --------------+-----------------------------+------------------------------------------------------------------ id | integer | not null default nextval('sendmoney_recipient_id_seq'::regclass) member_id | integer | bank_code | character varying(3) | firstname | character varying(50) | not null lastname | character varying(50) | not null account_no | character varying(20) | not null added | timestamp without time zone | default now() updated | timestamp without time zone | default now() status | integer | default 1 account_type | integer | default 20 Indexes: "sendmoney_recipient_id_key" UNIQUE CONSTRAINT, btree (id) Foreign-key constraints: "sendmoney_recipient_member_id_fkey" FOREIGN KEY (member_id) REFERENCES members(id) Referenced by: TABLE "money_transfer" CONSTRAINT "money_transfer_recipientid_fkey" FOREIGN KEY (recipientid) REFERENCES sendmoney_recipient(id) wrenchboard=> * $options = array( 'small' => 'Small Shirt', 'med' => 'Medium Shirt', 'large' => 'Large Shirt', 'xlarge' => 'Extra Large Shirt', ); $shirts_on_sale = array('small', 'large'); echo form_dropdown('shirts', $options, 'large'); */ //print_r($out); //stdClass Object ( [id] => 146 [code] => NG [country] => Nigeria [phone_code] => 234 [allow] => 2017-01-08 10:30:42.259079-05 [status] => 1 [created] => 2017-01-08 10:30:15.087696 [updated] => 2017-01-08 10:30:15.087696 ) $this->load->view('users/view_header_user', $data); $this->load->view('users/view_addrecipient', $data); $this->load->view('users/view_footer_user', $data); } public function paypal() { global $wrenchboard; $amount = 20; $this->load->model('backend_model'); $is_live = $this->backend_model->cfgReadChar("system.live"); $business = $this->backend_model->cfgReadChar("Paypal.business"); $no_shipping = $this->backend_model->cfgReadChar("Paypal.no_shipping"); $returnv = $this->backend_model->cfgReadChar("Paypal.return"); $cancel_return = $this->backend_model->cfgReadChar("Paypal.cancel_return"); $no_note = $this->backend_model->cfgReadChar("Paypal.no_note"); $currency_code = $this->backend_model->cfgReadChar("Paypal.currency_code"); $lc = $this->backend_model->cfgReadChar("Paypal.lc"); $bn = $this->backend_model->cfgReadChar("Paypal.bn"); $url = $this->backend_model->cfgReadChar("Paypal.url"); $item_number = rand(1000,9999)."ADDDD"; $amount= $data['amount'] = trim($this->input->post('D1')); if ($_POST) { $ITEM_SERVICE = "Reload my Account"; $item_name = $ITEM_SERVICE . sprintf("%.2f", $amount); //$url = "https://www.paypal.com/cgi-bin/webscr"; //$url = "https://www.sandbox.paypal.com/cgi-bin/webscr"; $url.= "?cmd=_xclick"; $url.= "&business=" . $business; $url.= "&item_name=" . $item_name; $url.= "&item_number=" . $item_number; $url.= "&amount=" . sprintf("%.2f", $amount); $url.= "&no_shipping=" . $no_shipping; //$url.= "&return=https://".$_SERVER["SERVER_NAME"]."/".$returnv."?item_id=".$item_number; $url.= "&cancel_return=https://" . $_SERVER["SERVER_NAME"] . "" . $cancel_return . "?item_id=" . $item_number; $url.= "&no_note=" . $no_note; $url.= "¤cy_code=" . $currency_code; $url.= "&lc=" . $lc; $url.= "&bn=" . $bn; $url.= "&HDRIMG=" . urlencode("https://" . $_SERVER["SERVER_NAME"] . "/images/peezy_paypal.gif"); header("Location: " . $url); } } public function profile() { $data = $this->getSessionArray(); $this->load->model('country_model'); $data['state'] = $_SESSION['state']; $data['city'] = $_SESSION['city']; $data['country'] = $_SESSION['country']; $data['save_message'] = ''; $data["status"] = 1; if ($_POST) { $data['firstname'] = trim($this->input->post('firstname')); $data['lastname'] = trim($this->input->post('lastname')); $data['country'] = trim($this->input->post('country')); $data['email'] = trim($this->input->post('email')); $data['state'] = trim($this->input->post('state')); $data['city'] = trim($this->input->post('city')); if ($data['firstname'] != '' && $data['lastname'] != '' && $data['country'] != '' && $data['email'] != '' && $data['state'] != '' && $data['city'] != '') { $outx = array(); $this->load->model('backend_model'); $data['action'] = WRENCHBOARD_UPDATE_PROFILE; $outx['error'] = ''; if ($this->wrenchboard_api($data, $outx) == PHP_API_OK) { $data['save_message'] = "
Profile Updated
"; } else { $data['save_message'] = "
Unable to update profile
"; } } else { $data['save_message'] = "
All fields required
"; } //print_r($data); } $this->load->model('combo_model'); $data['country_combo'] = $this->combo_model->getCountryCombo('country', $data['country']); //$out = $this->country_model->loadCountry($data); //print_r($out); //stdClass Object ( [id] => 146 [code] => NG [country] => Nigeria [phone_code] => 234 [allow] => 2017-01-08 10:30:42.259079-05 [status] => 1 [created] => 2017-01-08 10:30:15.087696 [updated] => 2017-01-08 10:30:15.087696 ) /* $this->load->view('users/view_header_user', $data); $this->load->view('users/view_profile', $data); $this->load->view('users/view_footer_user', $data);*/ $this->RenderUserPage('users/view_profile', $data); } public function picture() { global $wrenchboard; $data = $this->getSessionArray(); $data["upload_message"] = ""; $this->load->model('backend_model'); $is_live = $this->backend_model->cfgReadChar("system.live"); $x_limit = $this->backend_model->cfgReadChar("system.profile_picture_width"); //650; $y_limit = $this->backend_model->cfgReadChar("system.profile_picture_height"); //650; $size_limit = $this->backend_model->cfgReadChar("system.profile_picture_size"); $target_dir = $this->backend_model->cfgReadChar("system.profile_picture"); $data["size_limit"] = $size_limit; $uploadOk = 1; // Check if image file is a actual image or fake image if ($_SERVER["REQUEST_METHOD"] == 'POST') { $target_file = $target_dir . '/' . $_SESSION["member_id"] . '.' . pathinfo(basename($_FILES["fileToUpload"]["name"]), PATHINFO_EXTENSION); $imageFileType = strtolower(pathinfo($target_file, PATHINFO_EXTENSION)); $check = @getimagesize($_FILES["fileToUpload"]["tmp_name"]); if ($check !== false) { $data["upload_message"] = ""; //"File is an image - " . $check["mime"] . "."; if ($check[0] <= $x_limit && $check[1] <= $y_limit && $_FILES["fileToUpload"]["size"] <= $size_limit) { $uploadOk = 1; } else if ($_FILES["fileToUpload"]["size"] > $size_limit) { $data["upload_message"] = "Image size is too large, your picture should be under " . sprintf("%0.01f", $size_limit / 1024.0) . "kB"; $uploadOk = 0; } else { $data["upload_message"] = "Image should be ${x_limit}x${y_limit} pixels or less, when your image is " . $check[0] . "x" . $check[1]; $uploadOk = 0; } if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" && $imageFileType != "gif") { $data["upload_message"] = "Sorry, only JPG, JPEG, PNG & GIF files are allowed."; $uploadOk = 0; } } else { $data["upload_message"] = "File is not an image or upload failed."; $uploadOk = 0; } if ($uploadOk) { if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) { $q = "UPDATE members SET profile_pic='" . str_replace("'", "\\'", stripslashes(basename($target_file))) . "' WHERE id='" . $_SESSION["member_id"] . "'"; $query = $this->db->query($q); $data["upload_message"] = "Image uploaded!"; $_SESSION["profile_picture"] = "../smedia/" . ($is_live ? "LIVE" : "TEST") . "/profile/" . basename($target_file); } } } $this->load->view('users/view_header_user', $data); $this->load->view('users/view_picture', $data); $this->load->view('users/view_footer_user', $data); } // /* * List user bank accounts for payments */ public function recipient() { $this->load->library('table'); $this->table->set_template($this->template); $data = $this->getSessionArray(); $mysql = "select 'Bank: '||b.name||'
Account No: '||r.account_no||'
Name: '||r.firstname||' '||r.lastname,r.added::date," . "'
' AS manage " . "FROM sendmoney_recipient r LEFT JOIN bank_entity_codes b ON b.code=r.bank_code WHERE r.status = 1 AND r.member_id = " . $_SESSION['member_id'] . " ORDER BY b.name ASC"; $query = $this->db->query($mysql); $this->table->set_heading('Account', array('data' => 'Added', 'style' => 'width:120px'), array('data' => 'Action', 'style' => 'width:100px')); $data['recipient_table'] = $this->table->generate($query); $this->load->view('users/view_header_user', $data); $this->load->view('users/view_recipient', $data); $this->load->view('users/view_footer_user', $data); } /* * Delete account from back end by maeking status =0 * Email may be sent based on user preferences * Pay attention to pening transactions when del is called */ public function recipprocess() { $data = $this->getSessionArray(); $data['recipient_id'] = $this->input->get('recipient_id'); if ($this->input->get() && $data['recipient_id'] > 0) { $data['member_id'] = $_SESSION['member_id']; $data['action'] = WRENCHBOARD_DELETE_RECACC; $outx['error'] = ''; $ret = $this->wrenchboard_api($data, $outx); if ($ret == PHP_API_OK) { echo 'Deleted'; } else { echo 'Err'; } } } //
// public function addgallery() { $data = $this->getSessionArray(); $data['gallery'] = trim($this->input->get('gallery')); $this->load->model('backend_model'); echo 'Ameye ... '; if ($data['gallery'] != '') { $in['action'] = WRENCHBOARD_SAVE_GALLERY; $in['member_id'] = $_SESSION['member_id']; $in['gallery'] = $data['gallery']; $in['gallery_type'] = 1; $out = array(); $res = $this->backend_model->wrenchboard_api($in, $out); if ($res >= 0) { //echo $out['status']; echo $out['result']; } else { echo 'Error'; } } else { echo "Invalid URL "; } } public function yourpage() { $data = $this->getSessionArray(); //$data['description'] = ""; // if ($this->input->post) $data['description'] = ''; $mysql = "SELECT description FROM members_detail WHERE member_id = " . $_SESSION['member_id']; $query = $this->db->query($mysql); $data['update_message'] = ''; $row = $query->row(); if (isset($row)) { $data['description'] = $row->description; } // $data['description'] = if ($_POST and isset($_POST['your_description']) ) { $data['description'] = trim($this->input->post('description')); $outx = array(); $this->load->model('backend_model'); $data['action'] = WRENCHBOARD_ACCOUNT_MDESCRIPTION; $outx['error'] = ''; if ($this->backend_model->wrenchboard_api($data, $outx) == PHP_API_OK) { $data['update_message'] = 'Your description was updated'; } } $data['skill_combo'] = $this->getSkillGeneralCombo(); $data['skill_types'] = $this->getUserNewSkills($_SESSION['member_id']); $data['saved_skills'] = $this->getUserSavedSkills($_SESSION['member_id']); $skill_types = array(); $q = "SELECT id,category FROM skill_category ORDER BY lorder DESC"; $query = $this->db->query($q); if ($query->num_rows() > 0 ) { foreach ($query->result_array() as $row) { $skill_types[$row["id"]] = array(); } } $q = "SELECT category_id,id,skill FROM skill_types ORDER BY category_id,lorder DESC"; $query = $this->db->query($q); if ($query->num_rows() > 0 ) { foreach ($query->result_array() as $row) { $skill_types[$row["category_id"]][$row["id"]] = $row["skill"]; } } $data['skill_types_data'] = $skill_types; $data['member_skills'] = $this->buildUserSkillList(); // $member_skills; $data['page_title'] = "My Page"; $data['galery_list'] = $this->getGaleryList($_SESSION['member_id']); /* $this->load->view('users/view_header_user', $data); $this->load->view('users/view_yourpage', $data); $this->load->view('users/view_footer_user', $data); */ $data['page_title'] ="My Page"; $this->renderSecurePage('users/view_yourpage', $data); } /* $member_skills = "\n"; $member_skills_data = $this->getUserSavedSkills($_SESSION["member_id"]); foreach ($member_skills_data as $id=>$skill) { $val = $skill["category"]."-".$skill["skill"]; $member_skills.= "\n\n\n"; } $member_skills .= "
${val}
\n"; */ private function getGaleryList($member_id) { $gal_str = ""; $mysql = " SELECT g.*,t.gal_type FROM members_site_gallery g LEFT JOIN gallery_types t ON t.id = g.gallery_type WHERE g.member_id =". $member_id ; $query = $this->db->query($mysql); if ($query->num_rows() > 0) { foreach ($query->result_array() as $row) { $gal_str .= $row["gallery"]."
"; } } return $gal_str; } private function getSkillGeneralCombo() { $this->load->model('combo_model'); return $this->combo_model->getGeneralSkillCombo('skill_combo', $this->input->post('skill_combo')); } private function buildUserSkillList() { $member_skills = "\n"; $member_skills_data = $this->getUserSavedSkills($_SESSION["member_id"]); foreach ($member_skills_data as $id=>$skill) { $val = $skill["category"]."-".$skill["skill"]; $member_skills.= "\n\n\n"; } $member_skills .= "
${val}
\n"; $member_skills = ""; foreach ($member_skills_data as $id=>$skill) { $val = $skill["category"]."-".$skill["skill"]; $member_skills.= "\n
${val}
"; } return $member_skills; } private function getUserNewSkills($member_id) { $this->load->model('combo_model'); $skill_combo_selection = $this->input->post('skill_combo'); // this changes with combo selected for skill category $skill_combo_selection = 1; return $this->combo_model->getUserNewSkillCombo('skill_type_combo', $this->input->post('skill_type_combo'), $skill_combo_selection, $member_id); } private function getUserSavedSkills($member_id) { $skills = array(); $mysql =" SELECT mk.*,sc.category,st.skill " . "FROM members_skills mk " . "LEFT JOIN skill_types st ON st.id = mk.skill_id " . "LEFT JOIN skill_category sc ON sc.id = mk.category_id " . "WHERE mk.member_id = $member_id AND mk.status=1"; $query = $this->db->query($mysql); if ($query->num_rows() > 0 ) { foreach ($query->result_array() as $row) { $skills[$row["id"]] = array("category"=>$row["category"],"skill"=>$row["skill"]); } } return $skills; } public function saveuserskill() { $skill_combo_selection = $this->input->get('skill_combo'); $skill_type_combo_slection = $this->input->get('skill_type_combo'); $member_id = $_SESSION['member_id']; if ($skill_combo_selection>0 && $skill_type_combo_slection>0) { $data['category_id'] =$skill_combo_selection ; $data['skill_id'] = $skill_type_combo_slection ; $data['member_id'] = $member_id; $outx = array(); $this->load->model('backend_model'); $data['action'] = WRENCHBOARD_ACCOUNT_SAVESKILL; $outx['error'] = ''; if ($this->backend_model->wrenchboard_api($data, $outx) == PHP_API_OK) { //print_r($outx); echo "Skill added"; } else { echo "Failed to add skill"; } } else { echo "Invalid skill or skill type selection"; } echo "\n"; $data = $this->getUserSavedSkills($_SESSION["member_id"]); foreach ($data as $id=>$data) { // $val = $data["skill"]; $val = $data["category"]."-".$data["skill"]; echo "\n\n\n"; } echo "
${val}
\n"; } public function deleteskill() { $savedskill_id = $this->input->get('savedskill_id'); $member_id = $_SESSION['member_id']; if ($member_id > 0 && $savedskill_id > 0) { $data['savedskill_id'] = $savedskill_id; $data['member_id'] = $member_id; $outx = array(); $this->load->model('backend_model'); $data['action'] = WRENCHBOARD_ACCOUNT_DELSKILL; $outx['error'] = ''; if ($this->backend_model->wrenchboard_api($data, $outx) == PHP_API_OK) { //print_r($outx); echo "Del"; } else { echo "Failed"; } } //echo ""; } //
public function addfund() { $data = $this->getSessionArray(); $this->load->library('table'); $this->table->set_template($this->template); $mysql = "SELECT m.added::date AS date,m.terminatingamount*0.01 AS amount,m.fee*0.01 as fee, " . "r.firstname||' '||r.lastname||'
Acc:'||r.account_no||'-'||b.name AS Recitient,mp.confirmation," . "CASE WHEN m.status=1 THEN 'Pending' WHEN m.status=3 THEN 'Cancelled' WHEN m.status=5 THEN 'Completed' ELSE '' END AS Status " . "FROM money_transfer m " . "LEFT JOIN sendmoney_recipient r ON r.id = m.recipientid " . "LEFT JOIN bank_entity_codes b ON b.code = r.bank_code " . "LEFT JOIN members_payments mp ON mp.what_sendmoney = m.id " . "WHERE m.member_id =" . $_SESSION['member_id'] . " AND mp.confirmation IS NOT NULL ORDER BY m.id DESC LIMIT 4"; $query = $this->db->query($mysql); $this->table->set_heading('Date', 'Amount','Fee','Recipient','Confirmation', 'Status'); $data['sendmoney_table'] = $this->table->generate($query); $data['sendmoney_table_result'] = $query->result(); $data['page_key'] = 'WRB_FUND_ACCOUNT'; $data['txt_detail'] = $this->readFixedText($data['page_key']); $data['txt_detail'] = str_replace("[how-it-worked-image-1]", "", $data['txt_detail']); $data['txt_detail'] = str_replace("[how-it-worked-image-2]", "", $data['txt_detail']); $this->RenderUserPage('users/view_addfund', $data); } public function starttopup(){ $data = $this->getSessionArray(); $data['amount'] = $this->input->post('amount')+0; //https://developer.flutterwave.com/docs/collecting-payments/inline //https://oameye.work.wrenchboard.com/dash?status=successful&tx_ref=wrench-1161918567&transaction_id=3631794 //*************GET MOST OF THESE DATA FROM BACKEND */ $in=[]; $out = array(); $res = -1; $in['amount'] = $data['amount']*100; $in['member_id'] = $_SESSION['member_id']; // just maing sure $in['currency'] = "NGN"; if ($in['amount'] > 0 ){ $in['action'] = WRENCHBOARD_ACCOUNT_PREPARE_TOPUP; $this->load->model('backend_model'); $res = $this->backend_model->wrenchboard_api($in, $out); } if ($res > 0) { // prepare the fullter parameters $data['tx_ref'] = $out['tx_ref']; $data['currency'] =$out['currency']; $data['customer_email'] = $_SESSION['username']; $data['customer_phone_number'] = $out['phone']; $data['customer_name'] = $_SESSION['firstname'].' '.$_SESSION['lastname']; $data['consumer_id'] =$out['consumer_id']; $data['consumer_mac'] =$out['consumer_mac']; $data['redirect_url'] = base_url() . "fltw/complete"; //"https://oameye.work.wrenchboard.com/dash"; $data['public_key'] = $out["public_key"]; //"FLWPUBK_TEST-54c90141b028789d671067bd72f781a9-X"; } else { // very bad here redirect('member/addfund'); } //*************GET MOST OF THESE DATA FROM BACKEND */ $this->load->library('table'); $this->table->set_template($this->template); $mysql = "SELECT m.added::date AS date,m.terminatingamount*0.01 AS amount,m.fee*0.01 as fee, " . "r.firstname||' '||r.lastname||'
Acc:'||r.account_no||'-'||b.name AS Recitient,mp.confirmation," . "CASE WHEN m.status=1 THEN 'Pending' WHEN m.status=3 THEN 'Cancelled' WHEN m.status=5 THEN 'Completed' ELSE '' END AS Status " . "FROM money_transfer m " . "LEFT JOIN sendmoney_recipient r ON r.id = m.recipientid " . "LEFT JOIN bank_entity_codes b ON b.code = r.bank_code " . "LEFT JOIN members_payments mp ON mp.what_sendmoney = m.id " . "WHERE m.member_id =" . $_SESSION['member_id'] . " AND mp.confirmation IS NOT NULL ORDER BY m.id DESC LIMIT 4"; $query = $this->db->query($mysql); $this->table->set_heading('Date', 'Amount','Fee','Recipient','Confirmation', 'Status'); $data['sendmoney_table'] = $this->table->generate($query); $data['sendmoney_table_result'] = $query->result(); $data['page_key'] = 'WRB_FUND_ACCOUNT'; $data['txt_detail'] = $this->readFixedText($data['page_key']); $data['txt_detail'] = str_replace("[how-it-worked-image-1]", "", $data['txt_detail']); $data['txt_detail'] = str_replace("[how-it-worked-image-2]", "", $data['txt_detail']); $this->RenderUserPage('users/view_starttopup', $data); } public function faq() { $data = $this->getSessionArray(); $data['faq_table'] = ''; $query = $this->db->query(' SELECT * FROM faq WHERE status = 1'); $data['faq_table_row'] = $query->result(); foreach ($query->result() as $row) { $data['faq_table'] =''; // will filter categories here } $data['faq_table'] =''; $data['page_title'] = "Frequently Asked Questions"; $this->RenderUserPage('users/view_faq', $data); } public function balance() { $data = $this->getSessionArray(); $data['add_error'] = ''; $data['amount'] = 0; $this->load->model('combo_model'); $data['recipient_account'] = $this->input->post('recipient_account'); $data['recipient_account_combo'] = $this->combo_model->getUserRecipientCombo('recipient_account', $_SESSION['member_id'], $data['recipient_account']); $data['fee'] = $data['total'] =0; $data['comment'] = ''; // $data['fee'] = 0; //$data['escrow_balance'] = 0; $this->load->model('report_model'); $this->load->model('account_model'); $this->load->library('table'); $this->table->set_template($this->template); $mysql = "SELECT m.added::date AS date,m.terminatingamount*0.01 AS amount,m.fee*0.01 as fee, " . "r.firstname||' '||r.lastname||'
Acc:'||r.account_no||'-'||b.name AS Recitient,mp.confirmation," . "CASE WHEN m.status=1 THEN 'Pending' WHEN m.status=3 THEN 'Cancelled' WHEN m.status=5 THEN 'Completed' ELSE '' END AS Status " . "FROM money_transfer m " . "LEFT JOIN sendmoney_recipient r ON r.id = m.recipientid " . "LEFT JOIN bank_entity_codes b ON b.code = r.bank_code " . "LEFT JOIN members_payments mp ON mp.what_sendmoney = m.id " . "WHERE m.member_id =" . $_SESSION['member_id'] . " AND mp.confirmation IS NOT NULL ORDER BY m.id DESC LIMIT 4"; $query = $this->db->query($mysql); $this->table->set_heading('Date', 'Amount','Fee','Recipient','Confirmation', 'Status'); $data['sendmoney_table'] = $this->table->generate($query); $data['sendmoney_table_result'] = $query->result(); $data['card_payment_data_result'] = $this->report_model->getCardPurchase(6)['card_payment_data_result']; $data['card_coupon_data_result'] = $this->report_model->getRedeemCouponsList(6)['card_coupon_data_result']; $data['wallet'] = $this->account_model->getUserWallet( $_SESSION['member_id']); $data['escrow'] = $this->account_model->getUserEscrowWallet( $_SESSION['member_id']); if ($_POST) { $data['comment'] = $this->input->post('comment'); $data['amount'] = $this->input->post('amount') + 0; // must be number [still in full will be cents to go to backend latter] if ($data['amount'] == 0 || $data['amount'] < 0 || $data['amount'] == '' || $data['recipient_account'] == '') { $out['error'] = 'Amount & Recipient Account Required'; $data['add_error'] = "
" . $out['error'] . "
"; if ($data['amount'] > 0) { $outx = $this->transactionFee($data['amount'], $_SESSION['member_id']); $data['total'] = $outx['total_amount']; $data['fee'] = $outx['processing_fee']; } } else { $outx = $this->transactionFee($data['amount'], $_SESSION['member_id']); $data['total'] = $outx['total_amount']; $data['fee'] = $outx['processing_fee']; $TotalAmount = $data['total']; // now let us do initial check if you have enough money if ($_SESSION['current_balance'] < $TotalAmount) { $out['error'] = 'You do not have enough balance for this transfer'; $data['add_error'] = "
" . $out['error'] . "
"; } else { $this->session->set_flashdata('pending_sendmoney', $data); redirect('member/confirmwithdraw'); } } } $data['page_title'] ="Wallet"; $this->RenderUserPage('users/view_balance', $data); } public function smoney() { $data = $this->getSessionArray(); //var_dump($data); //exit(); $data['add_error'] = ''; $data['amount'] = 0; $this->load->model('combo_model'); $data['recipient_account'] = $this->input->post('recipient_account'); $data['recipient_account_combo'] = $this->combo_model->getUserRecipientCombo('recipient_account', $_SESSION['member_id'], $data['recipient_account']); $data['fee'] = $data['total'] =0; $data['comment'] = ''; // $data['fee'] = 0; //$data['escrow_balance'] = 0; $this->load->model('account_model'); $data['wallet'] = $this->account_model->getUserWallet($_SESSION['member_id'],$currency='NAIRA'); // $out['current_balance']; $data['current_balance'] = $data['wallet'][0]['current_balance']; if ($_POST) { $data['comment'] = $this->input->post('comment'); $data['amount'] = $this->input->post('amount') + 0; // must be number [still in full will be cents to go to backend latter] if ($data['amount'] == 0 || $data['amount'] < 0 || $data['amount'] == '' || $data['recipient_account'] == '') { $out['error'] = 'Amount & Recipient Account Required'; $data['add_error'] = "
" . $out['error'] . "
"; if ($data['amount'] > 0) { $outx = $this->transactionFee($data['amount'], $_SESSION['member_id']); $data['total'] = $outx['total_amount']; $data['fee'] = $outx['processing_fee']; } } else { $outx = $this->transactionFee($data['amount'], $_SESSION['member_id']); $data['total'] = $outx['total_amount']; $data['fee'] = $outx['processing_fee']; $TotalAmount = $data['total']; // now let us do initial check if you have enough money if ($data['current_balance'] < $TotalAmount) { $out['error'] = 'You do not have enough balance for this transfer'; $data['add_error'] = "
" . $out['error'] . "
"; } else { $this->session->set_flashdata('pending_sendmoney', $data); redirect('member/confirmwithdraw'); } } } $this->load->library('table'); $this->table->set_template($this->template); $mysql = "SELECT m.added::date AS date,m.terminatingamount*0.01 AS amount,m.fee*0.01 as fee, " . "r.firstname||' '||r.lastname||'
Acc:'||r.account_no||'-'||b.name AS Recitient,mp.confirmation," . "CASE WHEN m.status=1 THEN 'Pending' WHEN m.status=3 THEN 'Cancelled' WHEN m.status=5 THEN 'Completed' ELSE '' END AS Status " . "FROM money_transfer m " . "LEFT JOIN sendmoney_recipient r ON r.id = m.recipientid " . "LEFT JOIN bank_entity_codes b ON b.code = r.bank_code " . "LEFT JOIN members_payments mp ON mp.what_sendmoney = m.id " . "WHERE m.member_id =" . $_SESSION['member_id'] . " AND mp.confirmation IS NOT NULL ORDER BY m.id DESC LIMIT 4"; $query = $this->db->query($mysql); $this->table->set_heading('Date', 'Amount','Fee','Recipient','Confirmation', 'Status'); $data['sendmoney_table'] = $this->table->generate($query); $data['sendmoney_table_result'] = $query->result(); $data['page_title'] ="Wallet"; $this->RenderUserPage('users/view_smoney', $data); } public function fee() { $amount = $this->input->get('amount') + 0; $res = $this->transactionFee($amount, $_SESSION['member_id']); echo is_numeric($res["processing_fee"]) ? sprintf("%0.02f", 0.01 * $res["processing_fee"]) : 0; } private function transactionFee($amount, $member_id) { $in = array(); $in['amount'] = $amount * 100; $in['member_id'] = $member_id; $outx = array(); $this->load->model('backend_model'); $in['action'] = WRENCHBOARD_SMONEY_PROCFEE; $outx['error'] = ''; $this->backend_model->wrenchboard_api($in, $outx); return $outx; } public function confirmwithdraw() { $final_page = false; $data = $this->getSessionArray(); if ($_POST) { $smIn =[]; $smIn['member_id'] = $_SESSION['member_id']; $smIn['action'] = WRENCHBOARD_SMONEY_MEMBER; $smIn["senderid"] = $_SESSION['member_id']; $smIn["InitiatingEntityCode"] = "MBA"; $smIn['InitiatingAmount'] = $this->input->post('amount') * 100; $smIn['Fee'] = $this->input->post('fee') * 100; $smIn["InitiatingChannel"] = 7; $smIn["InitiatingPaymentMethodCode"] = "CA"; $smIn["InitiatingCurrencyCode"] = '566'; // 566 - NRN - Naira //$smIn["recipientid"] = $this->input->post('recipient_account'); $smIn['recipientid'] = $this->input->post('recipientid'); $smIn["transaction_id"] = "T" . rand(120000, 999999); $smIn["TerminatingPaymentMethodCode"] = "AC"; $smIn["TerminatingAmount"] = $smIn["InitiatingAmount"]; $smIn["TerminatingCurrencyCode"] = '566'; // 566 - NRN - Naira $smIn["TerminatingCountryCode"] = 'NG'; // NG - Nigeria $final_page = true; if ($smIn['recipientid'] != '' && $smIn['recipientid'] > 0 && $smIn['InitiatingAmount'] > 0 && $smIn['Fee'] >= 0) { $this->load->model('backend_model'); $out = array(); $res = $this->backend_model->wrenchboard_api($smIn, $out); // print_r($out); // exit; $data = $this->getSessionArray(); // you will need this for new balace $data["fee"] = $out["Fee"]; $data["amount"] = $out["InitiatingAmount"]; $data["total"] = $data["fee"] + $data["amount"]; $data["recipient_account_detail"] = "Recipient Account Here"; $data["comment"] = "Comment Here"; $data["rec_firstname"] = $out["firstname"]; $data["rec_lastname"] = $out["lastname"]; $data["account_no"] = $out["account_no"]; $data["bank_name"] = $out["bank_name"]; $data["confirmation"] = $out["confirmation"]; $sendmoney_message = 'Estimated delivery time is 2 to 4 Hours.'; $data['sendmoney_message'] = $sendmoney_message; } //print_r($data); // // // you are about to send money for real now - // calling the vack end takes place here now /* * //isset($_POST["InitiatingEntityCode"])?$_POST["InitiatingEntityCode"]:""; // $data["senderid"] = "1"; // isset($_POST["customerid"])?((int)$_POST["customerid"]):0; $data["InitiatingAmount"] = 120000 + rand(999, 99999); $data["Fee"] = 120; $data["TerminatingAccountNumber"] = ""; // $data["TerminatingAccountType"] = isset($_POST["TerminatingAccountType"])?$_POST["TerminatingAccountType"]:""; $data["TerminatingEntityCode"] = ""; * */ } else { $pending_sendmoney = $this->session->flashdata('pending_sendmoney'); // var_dump($pending_sendmoney); if (!isset($pending_sendmoney)){ redirect('member/balance'); } $data['amount'] = $pending_sendmoney['amount']; $data['total'] = $pending_sendmoney['total']; $data['fee'] = $pending_sendmoney['fee']; $data['recipient_account'] = $pending_sendmoney['recipient_account']; $data['comment'] = $pending_sendmoney['comment']; } if ($final_page == false) { $this->load->model('combo_model'); $this->combo_model->setReadOnly(true); $data['recipient_account_combo'] = $this->combo_model->getUserRecipientCombo('recipient_account', $_SESSION['member_id'], $data['recipient_account']); $data['sendmoney_table_result'] = $this->getSendMoneyRecent(); $this->RenderUserPage('users/view_confirmwithdraw', $data); } else { $data['sendmoney_table_result'] = $this->getSendMoneyRecent(); $this->session->set_flashdata('reciept_sendmoney', $data); redirect('member/sendMoneyReciepts'); // $data['sendmoney_table_result'] = $this->getSendMoneyRecent(); // $this->RenderUserPage('users/view_finalwithdraw', $data); } } public function sendMoneyReciepts(){ $data = $this->session->flashdata('reciept_sendmoney'); // var_dump($pending_sendmoney); if (!isset($data)){ redirect('member/balance'); } $data['sendmoney_table_result'] = $this->getSendMoneyRecent(); $this->RenderUserPage('users/view_finalwithdraw', $data); } private function getSendMoneyRecent(){ $mysql = "SELECT m.added::date AS date,m.terminatingamount*0.01 AS amount,m.fee*0.01 as fee, " . "r.firstname||' '||r.lastname||'
Acc:'||r.account_no||'-'||b.name AS Recitient,mp.confirmation," . "CASE WHEN m.status=1 THEN 'Pending' WHEN m.status=3 THEN 'Cancelled' WHEN m.status=5 THEN 'Completed' ELSE '' END AS Status " . "FROM money_transfer m " . "LEFT JOIN sendmoney_recipient r ON r.id = m.recipientid " . "LEFT JOIN bank_entity_codes b ON b.code = r.bank_code " . "LEFT JOIN members_payments mp ON mp.what_sendmoney = m.id " . "WHERE m.member_id =" . $_SESSION['member_id'] . " AND mp.confirmation IS NOT NULL ORDER BY m.id DESC LIMIT 4"; $query = $this->db->query($mysql); return $query->result(); } public function completewithdraw() { echo 'Not attached - backend implemented already'; $data = $this->getSessionArray(); } public function message() { date_default_timezone_set('UTC'); $data = $this->getSessionArray(); $this->load->library('table'); $this->table->set_template($this->template); $mysql88 = "SELECT mm.added::date AS msg_date,mm.msg,id AS msg_id ,ms.firstname AS senders_name FROM members_messages mm LEFT JOIN members ms ON mm.senders_id = ms.id WHERE mm.member_id = " . $_SESSION['member_id'] . " AND mm.reply IS NULL ORDER BY mm.id DESC LIMIT 20"; $mysql = "SELECT mm.added::date AS msg_date,mm.msg,mm.id AS msg_id ,ms.firstname AS senders_name ,mm.senders_id, mm.memo,mm.reply FROM members_messages mm LEFT JOIN members ms ON mm.senders_id = ms.id WHERE mm.member_id = " . $_SESSION['member_id'] . " UNION SELECT mm.added::date AS msg_date,mm.msg,mm.id AS msg_id ,'Me' AS senders_name ,mm.senders_id, mm.memo, mm.reply FROM members_messages mm WHERE mm.senders_id = " . $_SESSION['member_id'] . " ORDER BY msg_date DESC LIMIT 30"; $query = $this->db->query($mysql); $data['my_message_rows'] = $query->result_array(); // new implementation $myTable = ""; foreach ($query->result_array() as $row) { $myTable .= $this->mesageTableRow($row); } $myTable .="
"; $data['page_title'] ="Messages"; $data['message_table'] = $myTable; $this->RenderUserPage('users/view_message', $data); } private function mesageTableRow($row) { return "" . $row['msg_date'] . "" . substr($row['msg'], 0, 85) . "...view" . "
"; } public function setupReply(){ $message_id = trim($this->input->get('message_id')); $job_id = trim($this->input->get('job_id')); if ($message_id > 0 && $job_id !=''){ $data['job_id'] = $job_id; $data['message_id'] = $message_id; $mysql = "SELECT mm.added::date AS msg_date,mm.msg,mm.id AS msg_id ,ms.firstname AS senders_name ,mm.senders_id, mm.memo FROM members_messages mm LEFT JOIN members ms ON mm.senders_id = ms.id WHERE mm.member_id = " . $_SESSION['member_id'] . " AND mm.memo='".$job_id."' UNION SELECT mm.added::date AS msg_date,mm.msg,mm.id AS msg_id ,'Me' AS senders_name ,mm.senders_id, mm.memo FROM members_messages mm WHERE mm.senders_id = " . $_SESSION['member_id'] . " AND mm.memo='".$job_id."' ORDER BY msg_date DESC LIMIT 30"; $query = $this->db->query($mysql); $data['my_message_rows'] = $query->result_array(); // new implementation $answer_string = $this->load->view('users/sections/mgs_reply', $data, TRUE); echo $answer_string; } } public function messagedetail() { // echo 'Ameye'; $message_id = $this->input->get('message_id'); /* * wrenchboard=> SELECT * FROM members_messages WHERE id = 8; id | member_id | added | msg | status | senders_id | msg_type | memo ----+-----------+----------------------------+--------------------------------------------------------------------------+--------+------------+----------+------------ 8 | 27 | 2017-08-12 19:08:24.779765 | I am interested in this Job but would like to understand. Please clarify | 1 | 26 | JOB | 3R4836964W (1 row) */ $mysql = "SELECT * FROM members_messages WHERE id = " . $message_id . " AND member_id = " . $_SESSION['member_id']; $query = $this->db->query($mysql); $num = $query->num_rows(); if ($num > 0) { $row = $query->row_array(); $myTable = ""; $myTable .= $this->makeMesageDetailTableRow($row); $myTable .="
"; } echo $myTable; } private function makeMesageDetailTableRow($row) { return "Memo" . $row['memo'] . "" . "Message" . $row['msg'] . "" . "" . "
" . "" . "
" . "" . " "; } public function replymessage() { $data = $this->getSessionArray(); //url: "/member/replymessage?proc=REPLYMSG&message_code=" + message_code + "&message_id="+message_id+"&yourmessage=" + document.job_message.yourmessage.value $in = []; $in["message_id"] = $this->input->get('message_id'); $in["memo"] = trim($this->input->get('message_code')); $in["yourmessage"] = trim($this->input->get('yourmessage')); $in['member_id'] = $_SESSION['member_id']; if ($in["message_id"] > 0 && $in["memo"] != '' && $in["yourmessage"] != '') { $in['action'] = WRENCHBOARD_JOB_REPLY_QUESTION; $this->load->model('backend_model'); $out = array(); $res = $this->wrenchboard_api($in, $out); if ($res == PHP_API_OK) { echo 'Replied...'; } } } public function payments() { $data = $this->getSessionArray(); $this->load->library('pagination'); $config = array(); /* * * 7 | MEMBER_NEWCARD_PAYM | MNCCD | 0 8 | MEMBER_RETCARD_PAYM | MRCCD | 0 */ $this->load->library('table'); $this->table->set_template($this->template); $mysql = "SELECT added::date,(CASE WHEN code = 'OFDPS' THEN 'Job Offer Deposit' " . "WHEN code ='OFRFD' THEN 'Job Offer Refund' WHEN code='MDEPT' THEN 'Account Depoist' " . "WHEN code ='SMPAY' THEN 'Account Withdraw' " . "WHEN code ='COCNL' THEN 'Cancellation Refund' " . "WHEN code ='COPAY' THEN 'Completed Task Payment' " . "WHEN code ='MNCCD' THEN 'New Card Payment' " . "WHEN code ='MRCCD' THEN 'Repeat Card Payment' " . "ELSE '' END) AS Description,amount*0.01 AS amount,fee*0.01 as fee,confirmation " . "FROM members_payments " . "WHERE member_id = " . $_SESSION['member_id'] . " AND status = 1 ORDER BY id DESC"; $query = $this->db->query($mysql); $config["total_rows"] = $query->num_rows(); $config["base_url"] = base_url() . "/member/payments"; $config["per_page"] = 10; $config["uri_segment"] = 3; $config["num_links"] = 5; $config['full_tag_open'] = ""; $config['num_tag_open'] = '
  • '; $config['num_tag_close'] = '
  • '; $config['cur_tag_open'] = "
  • "; $config['cur_tag_close'] = "
  • "; $config['next_tag_open'] = "
  • "; $config['next_tagl_close'] = "
  • "; $config['prev_tag_open'] = "
  • "; $config['prev_tagl_close'] = "
  • "; $config['first_tag_open'] = "
  • "; $config['first_tagl_close'] = "
  • "; $config['last_tag_open'] = "
  • "; $config['last_tagl_close'] = "
  • "; $this->pagination->initialize($config); $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0; $page = is_numeric($page) ? $page : 0; $mysql = "SELECT added::date,(CASE WHEN code = 'OFDPS' THEN 'Job Offer Deposit' " . "WHEN code ='OFRFD' THEN 'Job Offer Refund' WHEN code='MDEPT' THEN 'Account Depoist' " . "WHEN code ='SMPAY' THEN 'Account Withdraw' " . "WHEN code ='COCNL' THEN 'Cancellation Refund' " . "WHEN code ='COPAY' THEN 'Completed Task Payment' " . "WHEN code ='MNCCD' THEN 'New Card Payment' " . "WHEN code ='MRCCD' THEN 'Repeat Card Payment' " . "ELSE '' END) AS Description,amount*0.01 AS amount,fee*0.01 as fee,confirmation " . "FROM members_payments " . "WHERE member_id = " . $_SESSION['member_id'] . " AND status = 1 ORDER BY id DESC LIMIT " . $config["per_page"] . " OFFSET " . $page; $query = $this->db->query($mysql); $this->table->set_heading(array('data' => 'Date', 'style' => 'width:110px'), 'Description', array('data' => 'Amount', 'style' => 'width:100px'), array('data' => 'Fee', 'style' => 'width:70px'), array('data' => 'Confirmation', 'style' => 'width:100px')); $data['payment_result'] = $this->table->generate($query); $data['payment_data_result'] = $query->result(); $data["links"] = $this->pagination->create_links(); // $this->load->view('users/view_header_user', $data); $data['page_title'] ="Payments Report"; $this->RenderUserPage('users/view_payment', $data); // $this->load->view('users/view_footer_user', $data); } public function support() { $data = $this->getSessionArray(); $message = $email = $firstname = $lastname = $your_message = ''; $data['message'] = ""; // $message; $data['email'] = $_SESSION['email']; // $data['firstname'] = $firstname; // $data['lastname'] = $lastname; $data['msg'] = $your_message; if ($_POST) { $in = []; //$email = $this->input->post('email'); // $firstname = $this->input->post('firstname'); // $lastname = $this->input->post('lastname'); $your_message = $this->input->post('msg'); $in['firstname'] = $_SESSION['firstname']; // $firstname; $in['lastname'] = $_SESSION['lastname']; // $lastname; // if ($firstname == '' || $lastname == '') { // $message = 'Both first and last name are required'; // } if ($your_message == '' || strlen($your_message) > 500) { $message = 'Message is required. Your message can be up to 500 characters long'; } // if ($email=='' || !filter_var($email, FILTER_VALIDATE_EMAIL)) { // $message = 'Invalid e-mail'; // } if ($message == '') { $in['email'] = $_SESSION['email']; // $email; $in['your_message'] = $your_message; $in['loc'] = $_SERVER['REMOTE_ADDR']; //'38.101.241.200'; $in['action'] = WRENCHBOARD_SEND_CONTACTUS; $this->load->model('backend_model'); $out = array(); $res = $this->backend_model->wrenchboard_api($in, $out); $message = "Your message was sent"; $email = $firstname = $lastname = $your_message = ""; } else { //$message = 'Invalid input'; $your_message = substr($your_message, 0, 500); } $data['message'] = "
    " . $message . "
    "; } $data['page_title'] = "Support"; // $this->load->view('users/view_header_user', $data); $this->RenderUserPage('users/view_support', $data); // $this->load->view('users/view_footer_user', $data); } public function schedule() { $data = $this->getSessionArray(); $data['current_month'] = '2017-07-12'; $ic = 0; $calendar_data = ''; $mysql = " SELECT member_id,client_id,id,contract,delivery_date::date,created::date FROM members_jobs_contract WHERE client_id=" . $_SESSION['member_id']; $query = $this->db->query($mysql); foreach ($query->result() as $row) { if ($ic > 0) { $calendar_data .= ","; } $calendar_data .= "{ title: '" . $row->contract . "', start: '" . $row->created . "', end: '" . $row->delivery_date . "', color: '#26A69A' }"; $ic++; } // DONT reset $ic to zero $mysql = " SELECT member_id,client_id,id,contract,delivery_date::date,created::date FROM members_jobs_contract WHERE member_id=" . $_SESSION['member_id']; $query = $this->db->query($mysql); foreach ($query->result() as $row) { if ($ic > 0) { $calendar_data .= ","; } $calendar_data .= "{ title: '" . $row->contract . "', start: '" . $row->created . "', end: '" . $row->delivery_date . "', color: '#546E7A' }"; $ic++; } $data["calendar_data"] = $calendar_data; // $this->load->view('users/view_header_user', $data); // $this->load->view('users/view_schedule', $data); // $this->load->view('users/view_footer_user', $data); $this->renderSecurePage('users/view_schedule', $data); } public function userlog() { $data = $this->getSessionArray(); $mysql = "SELECT mlog,loc, status, created FROM members_log WHERE member_id = " . $_SESSION['member_id'] . " ORDER BY created DESC LIMIT 40"; $query = $this->db->query($mysql); $data['log_result'] = $query->result(); // print_r($query->result()); $data['now_date'] = date('l\, F jS\, Y '); $this->load->view('users/view_header_user', $data); $this->load->view('users/view_userlog', $data); $this->load->view('users/view_footer_user', $data); } public function settings() { $data = $this->getSessionArray(); $q = "SELECT id,title,description,pref_id FROM members_settings_options ORDER BY lorder ASC"; $query = $this->db->query($q); $data['settings_option'] = $query->result_array(); $q2 = "SELECT pref_id FROM members_settings WHERE member_id = " . $_SESSION['member_id'] . " AND status = 100"; $query2 = $this->db->query($q2); $selRes = []; $sel_vals = $query2->result_array(); foreach ($sel_vals as $rw){ $selRes[] =$rw['pref_id']; } $data['selected_settings'] = $selRes; $this->RenderUserPage('users/view_settings', $data); } public function accsettings(){ $data = $this->getSessionArray(); if ($_GET) { $set_type = $this->input->get('set_type'); $seval = $this->input->get('seval'); if ( $set_type !='' && $seval !='' ){ $in = array(); $in['status'] =$seval; $in['pref_id'] =$set_type; $in['action'] = WRENCHBOARD_USER_SETTINGS; $in['sessionid'] = $_SESSION['session_id']; $in['member_id'] = $_SESSION['member_id']; $this->load->model('backend_model'); $out = array(); $res = $this->backend_model->wrenchboard_api($in, $out); if ($res != PHP_API_OK) { echo 'updated'; } } } } private function AgetSessionArray() { $data = $_SESSION['secure_data']; $data['username'] = $_SESSION['username']; // = $this->input->post('username'); $data['name'] = $_SESSION['name']; // = $this->input->post('username'); $data['firstname'] = $_SESSION['firstname']; // = $ret->firstname; $data['lastname'] = $_SESSION['lastname']; // = $ret->lastname; $data['email'] = $_SESSION['email']; // = $ret->email; $data['member_id'] = $_SESSION['member_id']; $this->load->model('dash_model'); $out = $this->dash_model->getDashData($data); $data['active_task'] = $out['active_task']; $data['active_pass_due'] = $out['active_pass_due']; $data['current_balance'] = $out['current_balance']; $data['new_message'] = $out['new_message']; $data['escrow_balance'] = $out['escrow_balance']; $data['description'] = $out["description"]; $data['member_id'] = $_SESSION['member_id']; // = $ret->email; $this->refreshAccountDetail($_SESSION['member_id']); return $data; } private function ADELETErefreshAccountDetail($member_id) { $this->load->model('account_model'); $qr = $this->account_model->loadAccountData($member_id); // print_r($qr); $_SESSION['current_balance'] = $qr[0]['balance']; $_SESSION['state'] = $qr[0]['state']; $_SESSION['city'] = $qr[0]['city']; $_SESSION['country'] = $qr[0]['country']; } private function ArefreshAccountDetail($member_id) { $this->load->model('account_model'); $qr = $this->account_model->loadAccountData($member_id); // print_r($qr); $_SESSION['current_balance'] = $qr[0]['balance']; $_SESSION['active_task'] = $this->account_model->loadActiveTaskCount($member_id); $_SESSION['state'] = $qr[0]['state']; $_SESSION['city'] = $qr[0]['city']; $_SESSION['country'] = $qr[0]['country']; $in = array(); $in['action'] = WRENCHBOARD_SESSION_VERIFY; $in['sessionid'] = $_SESSION['session_id']; $in['member_id'] = $_SESSION['member_id']; $this->load->model('backend_model'); $out = array(); $res = $this->backend_model->wrenchboard_api($in, $out); if ($res != PHP_API_OK) { redirect(home); } } }