public function index() { if (isAdmin()) { if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') { $todo_with_post = $this->input->post('todo'); if ($todo_with_post == 'udeast003') { $this->Mdl_email_settings->setData('update', $this->input->post()); if ($this->Mdl_email_settings->update()) { setInformUser('success', 'Email settings updated successfully.'); redirect('Email_settings', 'refresh'); } else { setInformUser('error', 'Some error occured'); redirect('Email_settings', 'refresh'); } } } else { $data['active'] = 2; $data['email_settings'] = $this->Mdl_email_settings->toArray(); $this->load->view('admin/header', $data); $this->load->view('index', $data); $this->load->view('admin/footer'); } } else { setInformUser('error', 'You don\'t have the permission [\'access email settings \'].'); redirect(base_url('users')); } }
private function _insert($data) { $this->Mdl_banks_details->setData('insert', 1, $data['bank_name'], $data['ifsc_code'], $data['ac_no']); if ($this->Mdl_banks_details->insert('insert')) { setInformUser('success', 'your bank account details successful add.'); redirect('sellers'); } }
public function _insertCategories() { $data = $this->input->post(); $this->Mdl_categories->setData('insert', $data['categories']); if ($this->Mdl_categories->insertCategories()) { setInformUser('success', 'Added Categories successfully'); redirect('categories'); } setInformUser('error', 'Added Categories Not successfully'); redirect('categories'); }
public function approval($id) { $commission = $this->input->post(); /*print_r($commission);*/ if ($this->Mdl_admin->approval($id, $commission['commission'])) { setInformUser('success', 'Products Approved successfully'); redirect('admin/showProducts'); } else { setInformUser('error', 'Products not Approved successfully'); redirect('admin/showProducts'); } }
public function index() { if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') { $todo_with_post = $this->input->post('todo'); if ($todo_with_post == 'udeast003') { $this->Mdl_email_settings->setData('update', $this->input->post()); if ($this->Mdl_email_settings->update()) { setInformUser('success', 'Email settings updated successfully.'); redirect('email_settings', 'refresh'); } else { setInformUser('error', 'Some error occured'); redirect('email_settings', 'refresh'); } } } else { $data['email_settings'] = $this->Mdl_email_settings->toArray(); $this->load->view('index', $data); } }
public function contactInsert() { $data = $this->input->post(); $todo = $data['todo']; $this->Mdl_users->setData('contact', $data['name'], $data['email'], $data['query']); if ($this->Mdl_users->contact() and $this->contactMail()) { if ($todo == 'buyer') { setInformUser('success', 'Your message has been sent to us'); redirect(base_url() . 'users/buyerHome'); } elseif ($todo == 'sellers') { setInformUser('success', 'Your message has been sent to us'); redirect(base_url() . 'sellers/homeSeller'); } else { setInformUser('success', 'Your message has been sent to us'); redirect(base_url()); } } elseif ($todo == 'sellers') { setInformUser('error', 'There was an error sending your message'); redirect(base_url() . 'sellers/homeSeller'); } elseif ($todo == 'buyer') { setInformUser('error', 'There was an error sending your message'); redirect(base_url() . 'users/buyerHome'); } else { setInformUser('error', 'There was an error sending your message'); redirect(base_url()); } }
public function inActivateSeller($id) { if ($this->Mdl_admin->inActivateSeller($id)) { setInformUser('success', 'Sellers successfully InActivated'); redirect(base_url() . 'admin/selles'); } else { setInformUser('error', 'Sellers not InActivated'); redirect(base_url() . 'admin/selles'); } }
public function orderCancel($id) { if ($this->Mdl_products->orderCancel($id)) { setInformUser('success', "Product Cancel Successfully "); redirect('products/showOrder'); } else { setInformUser('error', "Some error Occurred! Kindly retry "); redirect('products/showOrder'); } }
public function cancel($id) { if ($this->Mdl_sellers->cancel($id)) { setInformUser('success', 'Products Successfully Cancelled .'); redirect(base_url() . 'sellers/manageOrder'); } else { setInformUser('error', 'Some Error Occur . Kindly try Again'); redirect(base_url() . 'sellers/manageOrder'); } }
public function placeOrder() { setInformUser('success', "Your order place successfully please check email. "); redirect('products/showOrder'); // // $data['approvel']= $this->Mdl_products->approvel(); // $data['conform']= $this->Mdl_products->pending(); // $data['cancel']= $this->Mdl_products->cancel(); // $this->load->view('users/header/header_buyer'); // $this->load->view('order_table',$data); // $this->load->view('users/header/footer'); }
public function enable($id) { if (islogin()) { if ($this->Mdl_admin->enable($id)) { setInformUser('success', 'user successfully enabled '); redirect(base_url('admin/getUsers')); } else { setInformUser('error', 'Some error Occurred '); redirect(base_url('admin/getUsers')); } } else { redirect(base_url('users')); } }
public function contactUs() { if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') { $data = $this->input->post(); /* print_r($data);die;*/ $message = $this->load->view('contact_us', $data, TRUE); /*$admin_mail='*****@*****.**';*/ $this->email->from(setEmail(), 'Eduworkers'); $this->email->to($this->adminEmail()); $this->email->subject('Contact Us'); $this->email->message($message); /* echo $data['subject']; die; */ if ($this->email->send()) { setInformUser('success', " successfully Send Query"); redirect(base_url('users/contactUs')); } else { setInformUser('error', "Some Error Occurred."); redirect(base_url('users/contactUs')); } } else { $this->load->view('header/header'); $this->load->view('contact'); $this->load->view('header/footer'); } }
public function doFacebookLogin() { //$fb=Facebook::getFb(); $fb = new Facebook\Facebook(['app_id' => '1659779297592952', 'app_secret' => '12f070df1d8ba88fded6413b8b7d0b3d', 'default_graph_version' => 'v2.2']); $helper = $fb->getRedirectLoginHelper(); try { $accessToken = $helper->getAccessToken(); } catch (Facebook\Exceptions\FacebookResponseException $e) { // When Graph returns an error echo 'Graph returned an error: ' . $e->getMessage(); exit; } catch (Facebook\Exceptions\FacebookSDKException $e) { // When validation fails or other local issues echo 'Facebook SDK returned an error: ' . $e->getMessage(); exit; } if (!isset($accessToken)) { if ($helper->getError()) { header('HTTP/1.0 401 Unauthorized'); echo "Error: " . $helper->getError() . "\n"; echo "Error Code: " . $helper->getErrorCode() . "\n"; echo "Error Reason: " . $helper->getErrorReason() . "\n"; echo "Error Description: " . $helper->getErrorDescription() . "\n"; } else { header('HTTP/1.0 400 Bad Request'); echo 'Bad request'; } exit; } // The OAuth 2.0 client handler helps us manage access tokens $oAuth2Client = $fb->getOAuth2Client(); // Get the access token metadata from /debug_token $tokenMetadata = $oAuth2Client->debugToken($accessToken); // Validation (these will throw FacebookSDKException's when they fail) $tokenMetadata->validateAppId("1659779297592952"); // If you know the user ID this access token belongs to, you can validate it here //$tokenMetadata->validateUserId('123'); $tokenMetadata->validateExpiration(); if (!$accessToken->isLongLived()) { // Exchanges a short-lived access token for a long-lived one try { $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken); } catch (Facebook\Exceptions\FacebookSDKException $e) { echo "<p>Error getting long-lived access token: " . $helper->getMessage() . "</p>\n\n"; exit; } } if ($accessToken != null) { $user_token = $accessToken->getValue(); $_SESSION['fb_access_token'] = (string) $accessToken; if ($this->_shareWithFacebook($fb, $user_token)) { $this->_callUpdateOffers(); try { // Returns a `Facebook\FacebookResponse` object $response = $fb->get('/me?fields=id,name,email', $accessToken); } catch (Facebook\Exceptions\FacebookResponseException $e) { echo 'Graph returned an error: ' . $e->getMessage(); exit; } catch (Facebook\Exceptions\FacebookSDKException $e) { echo 'Facebook SDK returned an error: ' . $e->getMessage(); exit; } $user = $response->getGraphUser(); if ($this->Mdl_social_accounts->getId() != '') { $this->Mdl_social_accounts->setData('update_facebook', $user, 'facebook'); if ($this->Mdl_social_accounts->update()) { setInformUser('success', 'Link Post succdessfully and your facebook details is saved successfully'); redirect('social_accounts'); } else { setInformUser('error', 'Some error occurred'); redirect('social_accounts'); } } else { $this->Mdl_social_accounts->setData('update_facebook', $user, 'facebook'); if ($this->Mdl_social_accounts->insert()) { setInformUser('success', 'Link Post succdessfully and your facebook details is saved successfully'); redirect('social_accounts'); } else { setInformUser('error', 'Some error occurred'); redirect('social_accounts'); } } } } }
public function uploadReceipt($id = null) { if ($this->session->userdata['user_data'][0]['role'] == 'buyer') { if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') { /*$config['upload_path'] = APPPATH.'modules/sellers/upload/'; $config['allowed_types'] = 'png|jpeg|gif|jpg|pdf'; $config['max_size'] = '2048000'; print_r($_FILES); die; $attached=time().$_FILES['attached']['name']; $config['upload_path']; /* echo 'dkljlkfjd'; die(); */ /*$_FILES['attached']['name']=$attached; $this->upload->initialize($config); $this->upload->do_upload('attached');*/ $file = null; $ci = CI::get_instance(); $config['upload_path'] = 'uploads/'; $config['allowed_types'] = 'gif|jpg|png|txt|pdf'; $config['max_size'] = 1000; $config['max_width'] = 1920; $config['max_height'] = 768; $config['encrypt_name'] = TRUE; //$ci->load->library('upload', $config); /* echo "inside uploads"; print_r($config);*/ //die; $this->upload->initialize($config); if (!$ci->upload->do_upload('attached')) { $error = array('error' => $ci->upload->display_errors()); print_r($error); /* die;*/ return null; } else { $data = array('upload_data' => $ci->upload->data()); $file = $data['upload_data']['file_name']; $order_id = $this->input->post(); $id = $order_id['order_id']; $this->Mdl_users->setData('bank_details', $file, $id); if ($this->Mdl_users->uploadReceipt($id)) { setInformUser('success', 'Receipt Upload Successfully'); redirect(base_url('users/home')); } else { setInformUser('error', 'Some error occurred. Try Again'); redirect(base_url('users/home')); } /*echo $file; echo "<pre/>"; echo $id; print_r($_SESSION); die();*/ } /* print_r($file);*/ // echo 'dkljlkfjd'; /*die();*/ } else { //$_SESSION['abcd']=$id; /* print_r($id); die();*/ // echo "<br/>"; $this->load->view('header/header_buyer'); $this->load->view('bank_details', ['id' => $id]); $this->load->view('header/footer'); } } else { redirect('users/home'); } }
public function extenstion($id) { $data = $this->input->post(); $this->Mdl_products->setData('extension', $data['extension'], $data['date'], $id); if ($this->Mdl_products->extension()) { setInformUser('success', "Extension inserted Successfully. "); redirect(base_url() . 'sellers/manageProducts'); } else { setInformUser('error', "Some error Occurred! Kindly retry "); redirect(base_url() . 'sellers/manageProducts'); } }