function index() { $this->load->model('cms/Pagemodel'); $this->load->library('form_validation'); $this->load->library('email'); $this->load->library('parser'); $this->load->helper('form'); $this->load->helper('text'); //validation check $this->form_validation->set_rules('name', 'Name', 'trim|required'); $this->form_validation->set_rules('number', 'Phone Number', 'trim|required'); $this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email'); $this->form_validation->set_rules('message', 'Message', 'trim'); $this->form_validation->set_error_delimiters('<li>', '</li>'); if ($this->form_validation->run() == FALSE) { $shell = array(); $shell['contents'] = $this->load->view('contact-form', $inner, true); $this->load->view("themes/" . THEME . "/templates/{$page['template_alias']}", $shell); } else { $emailData = array(); $emailData['DATE'] = date("jS F, Y"); $emailData['NAME'] = $this->input->post('name', TRUE); $emailData['EMAIL'] = $this->input->post('email', TRUE); $emailData['PHONE'] = $this->input->post('number', TRUE); $emailData['COMMENTS'] = nl2br($this->input->post('message', TRUE)); $emailBody = $this->parser->parse('contact/emails/contactus', $emailData, TRUE); $this->db->insert('enquery', array('name' => gParam('name'), 'email' => gParam('email'), 'number' => gParam('number'), 'message' => gParam('message'))); $config = array(); $emlarray = $this->config->item('EMAIL_CONFIG'); unset($emlarray['mailtype']); $this->email->initialize($emlarray); $this->email->from(DWS_EMAIL_NOREPLY, DWS_EMAIL_FROM); $this->email->reply_to(DWS_EMAIL_REPLY_TO); // $this->email->to(DWS_EMAIL_ADMIN); // e($this->config->item('EMAIL_CONFIG')); // The message $subject = 'Landlord Contact us'; $headers = "From: " . strip_tags(DWS_EMAIL_FROM) . "\r\n"; $headers .= "Reply-To: " . strip_tags(DWS_EMAIL_FROM) . "\r\n"; $headers .= "CC: susan@example.com\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; mail(DWS_EMAIL_ADMIN, $subject, $emailBody, $headers); redirect('/contact/thankyou'); exit; //$this->email->to(gParam('email')); //$this->email->subject('Contact Us'); //$this->email->message($emailBody); // $status = $this->email->send(); // $status = true; // e( $this->email->print_debugger()); // if ($status == TRUE) { // redirect('/contact/thankyou'); // exit(); // } // redirect('/contact-us/error'); // exit(); } }
function index() { //print_r($this->session->all_userdata()); $this->load->library('user_agent'); $referred_from_url = $this->agent->referrer(); $this->load->model('Customermodel'); $this->load->library('form_validation'); $this->load->library('email'); $this->load->library('parser'); $this->load->helper('form'); $this->load->helper('text'); //Get Page Details //validation check if (count($_POST)) { $this->session->set_flashdata('error', '<h1 style="color:red">Wrong email id or password</h1>'); } $this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email'); $this->form_validation->set_rules('password', 'Password', 'trim|required|callback_login_check'); $this->form_validation->set_error_delimiters('<li>', '</li>'); if ($this->form_validation->run() == FALSE) { $inner = array(); $shell = array(); $shell['contents'] = $this->load->view('login-page', $inner, true); $this->load->view("themes/" . THEME . "/templates/subpage", $shell); } else { $email = gParam('email'); $password = gParam('password'); if (!$email || !$password) { return false; } $this->db->from('applicants'); $this->db->where('email', $email); $this->db->where('password', md5($password)); $result = $this->db->get()->row_array(); if (!count($result)) { redirect("/customer/login/"); } else { //e($this->session->all_userdata()); $result['isAdmin'] = 0; $result['isCompany'] = 0; $result['isUser'] = 0; $result['isCustomer'] = 1; $this->session->set_userdata($result); //echo $referred_from; redirect('/'); // if($redirect!=''){ // redirect($redirect, 'refresh'); // // $shortlist = $this->session->userdata('referred_from'); // unset($shortlist[0]); // // } // else{ // redirect('/'); // } //redirect(''); } } }
function getGrpOpt($elementId = null, $grp = null, $internal = false) { $grp; if (!$grp) { $grp = gParam('grp'); } if (!$grp && !$internal) { $selectRes = array(); echo json_encode(array('success' => 0, 'msg' => 'Please choose group')); exit; } else { if (!$grp && $internal) { return ''; } } $rule_grp_row = array(); if ($grp == 'allgrp') { $result = $this->aauth->list_groups(true); $rule_row = $this->Notificationmodel->getRow($elementId); $rule_grp_row = explode(',', $rule_row['for_group']); } else { $result = $this->usermodel->listAllAsGrp(False, false, 'id, name', array('where' => 'group_id = ' . $grp)); } $datamsg = null; $selectRes = array(); if ($result) { foreach ($result as $key => $kval) { if (count($rule_grp_row) && !in_array($kval['id'], $rule_grp_row)) { continue; } $selectRes[$kval['id']] = $kval['name']; } } $selectedArr = array(); if (isset($internal['assignTo'])) { $selectedArr = explode(',', $internal['assignTo']); } $js = 'id="assigne-' . $elementId . '" multiple class="assigne form-control" data-id="' . $elementId . '"'; $retHtml = form_dropdown('assigne[' . $elementId . '][]', $selectRes, $selectedArr, $js); $retHtml .= '<script> $(document).ready( function () { $(".assigne").multiselect({ includeSelectAllOption: true, enableFiltering:true }); } ); </script>'; if ($internal) { return $retHtml; } $datamsg = array('success' => 1, 'msg' => $retHtml); echo json_encode($datamsg); exit; }
function login_check($str) { $this->aauth->login(gParam('username'), gParam('passwd'), true); $data = $this->aauth->get_user(); if ($data) { setcookie('user_id', $data->id, time() + 86400 * 30, "/"); return true; } $this->form_validation->set_message('login_check', 'Login failed'); return false; }
function rSF($tableName) { $fields = tableFields($tableName); $new_array = array(); foreach ($fields as $field) { if (!gParam($field)) { continue; } $new_array[$field] = gParam($field); } return $new_array; }
function indexOld() { $return['success'] = false; if (!gParam('email') || !gParam('password')) { echo json_encode($return); } $this->aauth->login(gParam('email'), gParam('password')); $ar = array(); $ar = $this->aauth->get_user(); if (isset($ar->id)) { $group = $this->aauth->get_user_groups($ar->id); if ($group['group_id'] == 6) { $return['success'] = true; } else { $this->aauth->logout(); } } echo json_encode($return); }
function index() { $this->load->library('form_validation'); $this->load->helper('form'); $this->load->library('encrypt'); //validation check $this->form_validation->set_rules('username', 'Username', 'trim|required'); $this->form_validation->set_rules('passwd', 'Password', 'trim|required|callback_login_check'); $this->form_validation->set_error_delimiters('<li>', '</li>'); if ($this->form_validation->run() == FALSE && !isset($this->session->userdata['loggedin'])) { // print_r($_POST); if (gParam('username') && gParam('passwd')) { self::checkApplicantLogin(gParam('username'), gParam('passwd')); } $data = array(); $this->load->view(THEME . 'login', $data); } else { redirect(createUrl('user/dashboard')); } }
function add($id = null) { $table_name = 'franchise_testimonials'; if (gParam('content') && gParam('name')) { $data = rSF($table_name); $data['user_id'] = curUsrId(); if (!$id) { $result = $this->commonmodel->insertRecord($data, $table_name); } else { $result = $this->commonmodel->updateRecord($data, $id, $table_name); } if ($result) { redirect(createUrl('frontend/testimonials')); } } $model = $this->commonmodel->getByPk($id, $table_name); $inner = $page = array(); $inner['model'] = $model; $page['content'] = $this->load->view('addtestimonials', $inner, true); $this->load->view($this->default, $page); }
function save() { $data = rSF('units_attributes'); $id = gParam('id'); if ($id) { if (isset($_POST['deldrop'])) { $ids = array_filter($_POST['deldrop']); foreach ($ids as $delIds) { if (trim($delIds) != "") { $this->db->where('id', $delIds); $this->db->delete('units_attributes_dropdown'); } } } if (isset($_POST['drop'])) { foreach (array_filter($_POST['drop']) as $dropdwn) { if (trim($dropdwn) != "") { $this->db->insert('units_attributes_dropdown', array('dropdown_id' => $id, 'value' => $dropdwn, 'sort' => 0)); } } } //e($_POST); $this->db->where('id', $id); $this->db->update('units_attributes', $data); $this->session->set_flashdata('SUCCESS', 'attribute_updated'); } else { $this->db->insert('units_attributes', $data); $lastDrodown = $this->db->insert_id(); if ($data['type'] == "dropdown") { foreach (array_filter($_POST['drop']) as $dropdwn) { if (trim($dropdwn) != "") { $this->db->insert('units_attributes_dropdown', array('dropdown_id' => $lastDrodown, 'value' => $dropdwn, 'sort' => 0)); } } } $this->session->set_flashdata('SUCCESS', 'attribute_added'); } }
function addsidelinks($id = null) { $model = $this->commonmodel->getByPk($id, 'front_events'); $inner = $page = array(); if (gParam('color')) { // gAParams(); $data = rSF('front_events'); $data['user_id'] = curUsrId(); if (isset($_FILES['image']['name'])) { $data['pic'] = self::uploadImage(); } if (!$id) { $result = $this->commonmodel->insertRecord($data, 'front_events'); } else { $result = $this->commonmodel->updateRecord($data, $id, 'front_events'); } if ($result) { redirect(createUrl('frontend/sideEventsLinks')); } } $inner['model'] = $model; $page['content'] = $this->load->view('addsidelinks', $inner, true); $this->load->view($this->default, $page); }
function csvdownload($offet = 0) { $this->load->model('propertymodel'); $perpage = 500; $attributes = gParam('attributes', array()); $property = $this->propertymodel->listCsvAll($attributes, $perpage, $offet); echo count($property); $html = "<table border='1'>"; $array = array('unit_number', 'post_code', 'county', 'property_type', 'street', 'city', 'amount'); $html .= '<tr>'; foreach ($array as $key) { $html .= '<td>' . $key . '</td>'; } $html .= '</tr>'; foreach ($property as $pro) { $html .= '<tr>' . '<td>' . $pro['unit_number'] . '</td>' . '<td>' . $pro['post_code'] . '</td>' . '<td>' . $pro['county'] . '</td>' . '<td>' . $pro['property_type'] . '</td>' . '<td>' . $pro['street'] . '</td>' . '<td>' . $pro['city'] . '</td>' . '<td>' . $pro['amount'] . '</td>' . '</tr>'; } $html .= "</table>"; echo $html; //print_r($property); }
function updateRecord($uid) { $group = current(gParam('group')); if ($this->aauth->getUserGroup($uid) != $group) { $this->aauth->remove_member($uid, $this->aauth->getUserGroup()); $this->aauth->add_member($uid, $group); } $this->aauth->update_user($uid, gParam('email'), gParam('pass'), gParam('name'), self::uploadImage()); $data = array(); $data['fname'] = $this->input->post('firstname', TRUE); $data['lname'] = $this->input->post('lastname', TRUE); $data['home_address'] = $this->input->post('address', TRUE); $data['qualification'] = $this->input->post('qualifications', TRUE); $data['city'] = $this->input->post('city', TRUE); $data['county'] = $this->input->post('county', TRUE); $data['post_code'] = $this->input->post('post_code', TRUE); $data['telephone'] = $this->input->post('phone', TRUE); $data['about_txt'] = $this->input->post('about_description'); $data['services_txt'] = $this->input->post('service_description'); $data['contact_txt'] = $this->input->post('contact_description'); $data['lat'] = $this->input->post('lat', TRUE); $data['log'] = $this->input->post('lng', TRUE); unset($data['id']); $this->db->where('id', $uid); $row = $this->db->get('user_extra_detail'); $row = $row->num_rows(); if ($row) { unset($data['start_date']); $this->db->where('id', $uid); $this->db->update('user_extra_detail', $data); } else { $data['id'] = $uid; $this->db->insert('user_extra_detail', $data); } }
function updateQuestion() { $surveyId = gParam('survey_id'); if (!$surveyId) { $surveyId = $_POST['survey_id']; } if (!$surveyId) { return false; } $data[$this->is_active] = '0'; $on = array('fld' => $this->survey_id, 'fldval' => $surveyId); $this->recordUpdate($on, $data); $data = array(); foreach ($_POST as $postkey => $postval) { if (is_array($postval)) { if (!is_numeric($postkey)) { continue; } if (isset($postval['dbid'])) { $questionArr = $this->getQuestionInsertArray($postval); $questionArr['survey_id'] = $surveyId; $questionArr[$this->is_active] = '1'; $questionArr[$this->update_date] = date('Y-m-d H:i:s'); $on = array('fld' => $this->id, 'fldval' => $postval['dbid']); $this->recordUpdate($on, $questionArr); } else { $questionArr = $this->getQuestionInsertArray($postval); $questionArr['survey_id'] = $surveyId; $questionArr[$this->is_active] = '1'; $questionArr[$this->update_date] = date('Y-m-d H:i:s'); $questionArr[$this->creation_date] = date('Y-m-d H:i:s'); $this->db->insert('survey_question', $questionArr); } } } $data = array('survey_id' => $surveyId, $this->is_active => 0); $this->deleteUpdate($data); }
function booking($id) { $user_id = $this->session->userdata('user_id'); if (gParam('book_event')) { $result = self::saveUserToEvent(gParam('event_id'), gParam('qty'), $user_id); $this->session->set_flashdata('SUCCESS', 'booking_done'); redirect(createUrl('classes/booking/' . $id)); } $this->load->model('classesmodel'); if (!$user_id) { redirect(base_url()); } $inner = $page = array(); $inner['event'] = $this->classesmodel->getOneEvent($id); $page['contents'] = $this->load->view('booking', $inner, true); $this->load->view("themes/" . THEME . "/templates/onlycontent", $page); }
function deletefile($fileId = null) { if (!$fileId) { $fileId = gParam('fileid', false, true); } $fileDet = $this->VirtualCabinetmodel->fetchByID($fileId); if ($fileDet) { $ext = $fileDet[$this->VirtualCabinetmodel->filetype]; $virCabPath = $this->config->item('UPLOAD_PATH_VIRCAB_MISC'); if (in_array($ext, $this->imgArray)) { $virCabPath = $this->config->item('UPLOAD_PATH_VIRCAB_IMG'); } else { if (in_array($ext, $this->docArray)) { $virCabPath = $this->config->item('UPLOAD_PATH_VIRCAB_DOC'); } } $file = $virCabPath . $fileDet[$this->VirtualCabinetmodel->visible_name]; $this->VirtualCabinetmodel->deleteByID($fileDet['id']); if (file_exists($file) && unlink($file)) { } echo json_encode(array('success' => 1)); } else { echo json_encode(array('success' => 1, 'msg' => 'File Not Exist')); } exit; }
function updateRecord($id) { if (isset($_POST['deleteImage'])) { foreach ($_POST['deleteImage'] as $delImg) { $imgar = $this->getImageName($delImg); @unlink($this->config->item('UNIT_IMAGE_PATH') . $imgar['image']); $this->db->where('image_id', $delImg); $this->db->delete('unit_image'); } } $data = array(); $config['upload_path'] = $this->config->item('UNIT_IMAGE_PATH'); $config['allowed_types'] = 'gif|jpg|png'; $config['overwrite'] = FALSE; $this->load->library('upload', $config); $config_slug = array('field' => 'uri', 'table' => 'units', 'id' => 'id'); $this->load->library('slug', $config_slug); $data_slug = array('title' => $this->input->post('unit_number')); $data['uri'] = $this->slug->create_uri($data_slug, $id); $map_img = $_FILES['map_image']['name']; if ($map_img != '') { $mainimage = $this->getUnitDetails($id); @unlink($this->config->item('UNIT_IMAGE_PATH') . $mainimage['map_image']); if ($_FILES['map_image']['error'] == UPLOAD_ERR_OK && is_uploaded_file($_FILES['map_image']['tmp_name'])) { if (!$this->upload->do_upload('map_image')) { show_error($this->upload->display_errors('<p class="err">', '</p>')); return FALSE; } else { $upload_data = $this->upload->data(); $data['map_image'] = $upload_data['file_name']; } } } if (!empty($_FILES['photo']['name'])) { // e($this->config->item('UNIT_IMAGE_PATH') . $mainimage['unit_image']); $mainimage = $this->getUnitDetails($id); @unlink($this->config->item('UNIT_IMAGE_PATH') . $mainimage['unit_image']); if (count($_FILES) > 0) { if ($_FILES['photo']['error'] == UPLOAD_ERR_OK && is_uploaded_file($_FILES['photo']['tmp_name'])) { if (!$this->upload->do_upload('photo')) { show_error($this->upload->display_errors('<p class="err">', '</p>')); return FALSE; } else { $upload_data = $this->upload->data(); $data['unit_image'] = $upload_data['file_name']; } } } } $data['unit_number'] = $this->input->post('unit_number'); // $data['property_type'] = $this->input->post('ptype'); $data['owner'] = $this->input->post('owner'); $data['owner'] = $this->input->post('owner'); $data['flat_no'] = $this->input->post('flat_no'); $data['street'] = $this->input->post('street'); $data['city'] = $this->input->post('city'); $data['country'] = $this->input->post('country'); $data['status'] = $this->input->post('status'); $data['amount'] = $this->input->post('amount'); $data['amount_type'] = $this->input->post('amount_type'); $data['unit_type'] = $this->input->post('unit_type'); $data['is_active'] = $this->input->post('active'); $data['description'] = $this->input->post('description'); $data['is_featured'] = $this->input->post('is_featured'); $data['post_code'] = $this->input->post('post_code'); $data['county'] = $this->input->post('county'); $data['ptenure'] = $this->input->post('ptenure'); if (!empty($_POST['features'])) { $data['features'] = implode($_POST['features'], '|'); } $this->db->where('id', $id); $status = $this->db->update('units', $data); if ($status) { $unit_id = $id; if ($unit_id) { $this->db->where('unit_id', $unit_id); $this->db->delete('units_attributes_value'); $attributes = gParam('attributes') ? gParam('attributes') : array(); foreach ($attributes as $key => $value) { $data = array(); $data['unit_id'] = $unit_id; $data['attribute_id'] = $key; $data['value'] = $value; $this->db->insert('units_attributes_value', $data); } } } $this->load->library('upload', $config); $this->upload->initialize(array("upload_path" => $this->config->item('UNIT_IMAGE_PATH'), 'allowed_types' => 'gif|jpg|png')); if ($this->upload->do_multi_upload("galleryImages")) { //Print data for all uploaded files. foreach ($this->upload->get_multi_upload_data() as $images) { $this->db->insert('unit_image', array('image' => $images['file_name'], 'unit_id' => $id)); } } }
function saveTargetColor() { $precentages = gParam('percentage'); $colors = gParam('color'); $this->load->model('usermodel'); $this->db->empty_table('target_color'); foreach ($precentages as $key => $precentage) { $this->usermodel->saveTargetColor($precentage, arrIndex($colors, $key)); } }
function franchiseClass() { $inner = array(); $inner['eventType'] = null; $custom_groupby = false; $type = gParam('type'); // $type = 'CLASS__income'; $franchise = gParam('franchise'); $ids = $franchise ? array($franchise) : array(); $arr = explode('__', $type); $eventType[] = Event::$types[$arr[0]]; if (Event::$types[$arr[0]] == 9) { $eventType = Event::$types; $inner['eventType'] = Event::$types1[9]; } else { $inner['eventType'] = $type; } $syear = $this->session->userdata('syear'); $eyear = $this->session->userdata('eyear'); $inner['models'] = $this->usermodel->dashboardEventFilter($syear, $eyear, $ids, $eventType, $this->ids); $inner['display'] = $arr[1]; // e($inner['models']); if (!count($inner['models'])) { return false; } $page['content'] = $this->load->view("dashboard/franchisesRegions", $inner); }
function index() { $this->load->helper('url'); $this->load->helper('text'); $this->load->library('Cart'); $this->load->model('Pagemodel'); $this->load->helper('cms_helper'); //$this->load->model('news/Newsmodel'); $this->load->model('slideshow/Slidemodel'); $this->load->model('property/Propertymodel'); //Language $lang = 'en'; $lang_trigger = false; $lang_uri = $this->uri->uri_string(); if ($lang_uri) { $lang_arr = explode('/', $lang_uri); if (count($lang_arr) > 1) { $lang_code = $lang_arr[0]; $this->db->where('language_code', $lang_code); $rs = $this->db->get('language'); if ($rs->num_rows() == 1) { $lang = $lang_code; $lang_trigger = true; } } } // echo 'here'; exit(); //Page Alias $alias = 'homepage'; $segment_1 = $this->uri->uri_string(); if ($segment_1) { if (!$lang_trigger) { $alias = str_replace('/', '', $segment_1); } else { $lang_arr = explode('/', $lang_uri); $lang_arr = array_slice($lang_arr, 1); $alias = implode('/', $lang_arr); } } //$this->setLanguage($lang); //Get Page Details $page = array(); $page = $this->Pagemodel->getDetails($alias, $lang); // print_r($page); exit(); if (!$page) { $this->http->show404(); return; } $this->setPage($page); //Compiled blocks $compiled_blocks = array(); $compiled_blocks = $this->Pagemodel->compiledBlocks($page); // print_r($compiled_blocks); // exit; //fetch page languages $languages = array(); $languages = $this->Pagemodel->getAllLanguages($page, $lang); // $company = array(); // $company = $this->COMPANY; $breadcrumbs = array(); $breadcrumbs = $this->Pagemodel->breadcrumbs($page['page_id']); $slides = array(); $slides = $this->Slidemodel->listAll(); $attributes = gParam('attributes', array()); $property = array(); $property = $this->Propertymodel->listAll($attributes, 4); //Get all news // $news = array(); // $news = $this->Newsmodel->listAll(0 ,2); //Variables $shell = array(); $inner = array(); $inner['page'] = $page; $inner['breadcrumbs'] = $breadcrumbs; $inner['languages'] = $languages; $inner['slides'] = $slides; $inner['property'] = $property; // $inner['news'] = $news; if ($page['frontend_modules']) { $modules = explode(',', $page['frontend_modules']); foreach ($modules as $page_module) { $this->load->library("page_modules/" . $page_module, array('page' => $page)); $module_name = "module_{$page_module}"; $inner[$module_name] = $this->{$module_name}; } } $compiledblocks = array(); foreach ($compiled_blocks as $key => $val) { $compiledblocks[] = $val; $inner[$key] = $val; } $inner['compiledblocks'] = $compiledblocks; // $inner['comapny'] = $company; foreach ($inner as $key => $val) { $shell[$key] = $val; } //File Name & File Path $file_name = str_replace('/', '_', $page['page_uri']); $file_path = "application/views/themes/" . THEME . "/cms/" . $file_name . ".php"; //echo $file_path; //Meta $meta_file = "application/views/themes/" . THEME . "/meta/" . $file_name . ".php"; if (file_exists($meta_file)) { $this->html->addMeta($this->load->view("themes/" . THEME . "/meta/cms/" . $file_name, array('page' => $page), TRUE)); } else { //echo "themes/" . THEME . "/meta/default"; $this->html->addMeta($this->load->view("themes/" . THEME . "/meta/default", array('page' => $page), TRUE)); } //Assets // if (file_exists("application/views/themes/" . THEME . "/headers/cms/" . $file_name . ".php")) { // $this->assets->loadFromFile("themes/" . THEME . "/headers/cms/" . $file_name); // } // if (file_exists($file_path)) { $shell['contents'] = $this->load->view("themes/" . THEME . "/cms/" . $file_name, $inner, true); } else { if ($this->COMPANY == TRUE && $inner['page']['template_alias'] == 'homepage') { $shell['contents'] = $this->load->view("themes/" . THEME . "/cms/" . 'default', $inner, true); } else { if ($this->COMPANY == FALSE && $inner['page']['template_alias'] == 'homepage') { $inner['page']['page_contents'] = ''; $shell['contents'] = $this->load->view("themes/" . THEME . "/cms/" . 'homepage-global.php', $inner, true); } else { if ($this->COMPANY == FALSE && isset($inner['page']['template_alias'])) { $shell['contents'] = $page['page_contents']; } else { $this->load->view("themes/" . THEME . "/cms/" . 'pages', $inner, true); } } } } if ($this->COMPANY == TRUE && $page['page_uri'] == 'homepage') { $this->load->view("themes/" . THEME . "/templates/default-subpage", $shell); } else { if ($page['page_uri'] == 'homepage-global' || $page['page_uri'] == 'homepage') { $this->load->view("themes/" . THEME . "/templates/default-homepage", $shell); } else { $this->load->view("themes/" . THEME . "/templates/" . $page['template_alias'], $shell); } } }
function getGrpOpt($grp = null, $internal = false) { $grp; if (!$grp) { $grp = gParam('grp'); } if (!$grp && !$internal) { return json_encode(array('succcess' => 0, 'msg' => 'Nothing Find')); } else { if (!$grp && $internal) { return ''; } } $result = $this->usermodel->listAllAsGrp(False, false, 'id, name', array('where' => 'group_id = ' . $grp)); $datamsg = null; $selectRes = array(); if ($result) { foreach ($result as $key => $kval) { $selectRes[$kval['id']] = $kval['name']; } } $selectedArr = array(); if (isset($internal['assignTo'])) { $selectedArr = explode(',', $internal['assignTo']); } $js = 'id="assigne_id" multiple'; $retHtml = '<div>' . form_dropdown('assigne_id[]', $selectRes, $selectedArr, $js) . '</div>'; $retHtml .= '<script> $(document).ready( function () { $("#assigne_id").multiselect({ includeSelectAllOption: true, enableFiltering:true }); } ); </script> '; if ($internal) { return $retHtml; } $datamsg = array('success' => 1, 'msg' => $retHtml); echo json_encode($datamsg); exit; }
function updateProfileRecord($uid) { $group = current(gParam('group')); if ($this->aauth->getUserGroup($uid) != $group) { $this->aauth->remove_member($uid, $this->aauth->getUserGroup()); $this->aauth->add_member($uid, $group); } $banner_img = self::uploadBanner(); // self::uploadImage(); $this->aauth->update_user($uid, gParam('email'), gParam('pass'), gParam('name'), self::uploadImage(), $banner_img); $data = array(); $data['fname'] = $this->input->post('firstname', TRUE); $data['lname'] = $this->input->post('lastname', TRUE); $data['home_address'] = $this->input->post('address', TRUE); $data['qualification'] = $this->input->post('qualifications', TRUE); $data['city'] = $this->input->post('city', TRUE); $data['county'] = $this->input->post('county', TRUE); $data['post_code'] = $this->input->post('post_code', TRUE); $data['telephone'] = $this->input->post('phone', TRUE); $data['about_txt'] = $this->input->post('about_description'); $data['services_txt'] = implode('#', $_REQUEST['tlist']); $data['contact_txt'] = $this->input->post('contact_description'); $data['open_time'] = $this->input->post('open_time', TRUE); $data['close_time'] = $this->input->post('close_time', TRUE); // $data['lat'] = $this->input->post('lat', TRUE); // $data['log'] = $this->input->post('lng', TRUE); $data['website'] = $this->input->post('website', TRUE); $data['app_fees'] = $this->input->post('app_fees', TRUE); $data['fees'] = $this->input->post('fees', TRUE); // $data['facebook'] = $this->input->post('facebook', TRUE); // $data['twitter'] = $this->input->post('twitter', TRUE); // $data['google'] = $this->input->post('googlep', TRUE); // $data['pinterest'] = $this->input->post('pinterest', TRUE); // $data['paypal'] = $this->input->post('paypal', TRUE); $data['clinics'] = $this->input->post('clinic'); $count_files = count($_REQUEST['uploaddocuments']); if ($count_files > 0) { $uploaddoc['auth_userid'] = $uid; $uploaddoc['datetime'] = date('Y-m-d h:i:s'); foreach ($_REQUEST['uploaddocuments'] as $file_name) { $uploaddoc['document_name'] = $file_name; $this->db->insert('upload_documents', $uploaddoc); } } // e($data); $config = array('field' => 'uri', 'table' => 'aauth_users', 'id' => 'id'); $fullname = $data['fname'] . " " . $data['lname']; $this->load->library('slug', $config); $aauth_data['uri'] = $this->slug->create_uri(array('title' => $fullname), $uid); $aauth_data['is_approved'] = 'A'; $this->db->where('id', $uid); $this->db->update('aauth_users', $aauth_data); unset($data['id']); $this->db->where('id', $uid); $row = $this->db->get('user_extra_detail'); $row = $row->num_rows(); if ($row) { unset($data['start_date']); $this->db->where('id', $uid); $this->db->update('user_extra_detail', $data); } else { $data['id'] = $uid; $this->db->insert('user_extra_detail', $data); } }
function updateRecord($uid) { if ($this->input->post('pass') != "") { if ($this->input->post('pass') != $this->input->post('pass1')) { $this->session->set_flashdata('ERROR', 'pass_invalid'); redirect(createUrl('user/edit/' . $uid)); } } $this->aauth->update_user($uid, gParam('email'), gParam('pass'), gParam('name'), 0, 0); $data = array(); $data['contact_person'] = trim($this->input->post('name')); $data['address'] = $this->input->post('address'); $data['city'] = $this->input->post('city'); $data['state'] = $this->input->post('state'); $data['country'] = $this->input->post('country'); $data['phone'] = $this->input->post('phone'); $data['mobile'] = $this->input->post('mobile'); $this->db->where('id', $uid); $this->db->update('user_extra_detail', $data); // $data[''] }
function customdate() { ini_set('display_errors', 'On'); // print_r($_POST); if (gParam('customdate')) { $date = explode(' - ', gParam('customdate')); $syear = date('Y-m-d', strtotime($date[0])); $eyear = date('Y-m-d', strtotime($date[1])); // e($syear,0); // e($eyear); $inner = $page = array(); $notification = $this->load->model('usermodel'); $notification = $this->load->model('calender/event'); $inner['loadContent'] = true; $inner['dasbBoardData'] = $this->usermodel->dasbBoardCustomdate($syear, $eyear, $this->ids); $inner['franchises'] = $this->usermodel->getAllFranchise(); $inner['regions'] = $this->db->get('franchise_region')->result_array(); $inner['magentoDashboardData'] = self::loadmagentodata(); $page['content'] = $this->load->view('dashboard/customdate', $inner, TRUE); // $page['content'] = $this->load->view('user/dashboard', $inner, TRUE); } else { $inner = $page = array(); $inner['loadContent'] = false; $page['content'] = $this->load->view('dashboard/customdate', $inner, TRUE); } $this->load->view($this->dashboard, $page); }
function add($id = null) { if (!$id) { return false; } if (gParam('auth_user_id')) { $image = $_FILES['image']['name']; if ($image) { $image = $this->usermodel->uploadImage(); } else { $image = false; } $data = rSF('customer'); $password = gParam('passwd'); $this->aauth->update_user($id, gParam('email'), $password, gParam('firstname'), false, $image); $this->commonmodel->updateRecord($data, gParam('auth_user_id'), 'customer', 'auth_user_id'); } $inner = array(); $inner['model'] = $this->commonmodel->getByPk($id, 'customer', 'auth_user_id'); $inner['model'] = (array) $inner['model']; $page['content'] = $this->load->view('customer/add', $inner, TRUE); // $this->load->view($this->dashboard, $page); $this->load->view('themes/default/templates/customerlogin', $page); }
function pay($code) { // echo '<pre>'; // print_r($_POST); // exit; // echo base_url() . 'classes/pay/' . $code . '?action=ipn'; // exit; ini_set('display_errors', 'On'); $this->load->model('classesmodel'); $event = $this->classesmodel->getOneEvent($code); $this->load->library('paypal_class'); $desc = $this->input->post('desc', TRUE); $p = new paypal_class(); // initiate an instance of the class //$p->paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; // testing paypal url $p->paypal_url = 'https://www.paypal.com/cgi-bin/webscr'; // paypal url $this_script = createUrl('classes/pay/' . $code); $ipn_url = 'http://www.sew2it.co.uk/classes/pay/' . $code; $qty = gParam('qty'); if (empty($_GET['action'])) { $_GET['action'] = 'process'; } switch ($_GET['action']) { case 'process': // Process and order... // e($invoice); // $paypal_id = getConfig('PAYPAL_MERCHENT_EMAIL'); $paypal_id = getConfig('PAYPAL_ID'); $p->add_field('business', $paypal_id); $p->add_field('return', $this_script . '?action=success'); $p->add_field('cancel_return', $this_script . '?action=cancel'); $p->add_field('notify_url', base_url() . 'classes/pay/' . $code . '?action=ipn&qty=' . $qty . '&user_id=' . curUsrId() . '&id=' . $code); // $p->add_field('ipn_notification_url', $ipn_url); $p->add_field('amount', $event['price']); $p->add_field('item_name', $desc); $p->add_field('quantity', $qty); $p->add_field('currency_code', 'GBP'); $p->add_field('custom', $code); $p->add_field('event_id', $event['id']); // echo '<pre>'; // print_r($p); // exit; $p->submit_paypal_post(); // submit the fields to paypal //$p->dump_fields(); // for debugging, output a table of all the fields break; case 'success': // Order was successful... $shell = array(); $shell['contents'] = $this->load->view('classes-index', array(), true); $this->load->view("themes/" . THEME . "/templates/subpage", $shell); // foreach ($_POST as $key => $value) { // echo "$key: $value<br>"; // } break; case 'cancel': // Order was canceled... // The order was canceled before being completed. // echo "This is Cancelled"; redirect(base_url() . "booking-cancelled"); exit; //header("Location:http://wwww.sew2it.co.uk/booking-cancelled"); // echo "<html><head><title>Canceled</title></head><body><h3>The order was canceled.</h3>"; // echo "</body></html>"; break; case 'ipn': // Paypal is calling page for IPN validation... //error_log(json_encode($_REQUEST),3,'mytest.log'); if ($p->validate_ipn()) { // mail('*****@*****.**', 'subject', 'this is message'); $in_code = $this->input->get('id', TRUE); $user_id = $this->input->get('user_id', TRUE); $qty = $this->input->get('qty', TRUE); $this->db->insert('order', array('response' => json_encode($_REQUEST), 'status' => 'Active', 'event_id' => $in_code, 'user_id' => $user_id, 'qty' => $qty)); // echo $this->db->last_query(); } else { // $this->db->insert('test', array('value' => json_encode($_REQUEST))); } break; } }
function updateRecord($uid) { $group = current('3'); if ($this->aauth->getUserGroup($uid) != $group) { $this->aauth->remove_member($uid, $this->aauth->getUserGroup()); $this->aauth->add_member($uid, $group); } $this->aauth->update_user($uid, gParam('email'), gParam('pass'), gParam('name'), gParam('package'), gParam('store_id'), self::uploadImage()); $data = array(); // $data = rSF('user_extra_detail'); // e($data); $data1['company_name'] = $this->input->post('company_name'); $data1['contact_person'] = $this->input->post('contact_person'); $data1['phone'] = $this->input->post('phone'); $data1['mobile'] = $this->input->post('mobile'); $data1['address'] = $this->input->post('address'); $data1['city'] = $this->input->post('city'); $data1['state'] = $this->input->post('state'); $data1['country'] = $this->input->post('country'); $data1['id'] = $uid; unset($data['id']); $this->db->where('id', $uid); $row = $this->db->get('user_extra_detail'); $row = $row->num_rows(); if ($row) { unset($data['start_date']); $this->db->where('id', $uid); $this->db->update('user_extra_detail', $data1); } else { $data1['id'] = $uid; //$data['start_date'] = time(); $this->db->insert('user_extra_detail', $data1); } }
function getAttributeValueByFields() { $unit_id = gParam('val'); $type = gParam('type'); $return['success'] = false; if ($unit_id || $type) { $return['data'] = $this->attributesmodel->getAttributeValueByFields($unit_id, $type); if (count($return['data'])) { $return['success'] = true; } } echo json_encode($return); }