public function subscription($newsLetterId = 0) { $this->data['title'] = 'Subscription'; $newsLetterId = id_decrypt($newsLetterId); $newsDetails = $this->customer_m->news_letter_user_details($newsLetterId); //echo "<pre>"; print_r($newsDetails); exit; if ($_POST) { //echo "<pre>"; print_r($_POST); exit; $rules = subscription_news_rules(); $this->form_validation->set_rules($rules); $this->form_validation->set_error_delimiters('<div class="error">', '</div>'); if ($this->form_validation->run()) { $arrArr = array(); $arrArr['newsLetterName'] = ''; if (!empty($newsDetails)) { $arrArr['newsLetterName'] = $newsDetails->firstName . ' ' . $newsDetails->lastName; } $arrArr['newsLetterId'] = $newsLetterId; $arrArr['email'] = $_POST['email1']; $arrArr['name'] = $_POST['name1']; $arrArr['verifiedCode'] = otp5_digit(); if (!empty($arrArr['email']) && !empty($arrArr['name'])) { $newSubId = $this->customer_m->add_newsletter_subscription($arrArr); if ($newSubId) { $mailData = array('email' => $arrArr['email'], 'cc' => '', 'slug' => 'subscription_news', 'name' => $arrArr['name'], 'url' => base_url() . 'frontend/newsletter/refer_verified/' . id_encrypt($newSubId) . '/' . $arrArr['verifiedCode'], 'subject' => 'Thank you for your submission, GET READY TO WIN MORE PRIZES!', 'newsLetterName' => $arrArr['newsLetterName']); if ($this->email_m->send_mail($mailData)) { $this->session->set_flashdata('success', $this->lang->line('success_mail_send')); $this->custom_log->write_log('custom_log', $this->lang->line('success_mail_send')); } else { $this->session->set_flashdata('error', 'Retailer create successfully but ' . $this->lang->line('error_mail_not_send')); $this->custom_log->write_log('custom_log', $this->lang->line('error_mail_not_send')); } } } $arrArr['email'] = $_POST['email2']; $arrArr['name'] = $_POST['name2']; $arrArr['verifiedCode'] = otp5_digit(); if (!empty($arrArr['email']) && !empty($arrArr['name'])) { $newSubId = $this->customer_m->add_newsletter_subscription($arrArr); if ($newSubId) { $mailData = array('email' => $arrArr['email'], 'cc' => '', 'slug' => 'subscription_news', 'name' => $arrArr['name'], 'url' => base_url() . 'frontend/newsletter/refer_verified/' . id_encrypt($newSubId) . '/' . $arrArr['verifiedCode'], 'subject' => 'Thank you for your submission, GET READY TO WIN MORE PRIZES!', 'newsLetterName' => $arrArr['newsLetterName']); if ($this->email_m->send_mail($mailData)) { $this->session->set_flashdata('success', $this->lang->line('success_mail_send')); $this->custom_log->write_log('custom_log', $this->lang->line('success_mail_send')); } else { $this->session->set_flashdata('error', 'Retailer create successfully but ' . $this->lang->line('error_mail_not_send')); $this->custom_log->write_log('custom_log', $this->lang->line('error_mail_not_send')); } } } $arrArr['email'] = $_POST['email3']; $arrArr['name'] = $_POST['name3']; $arrArr['verifiedCode'] = otp5_digit(); if (!empty($arrArr['email']) && !empty($arrArr['name'])) { $newSubId = $this->customer_m->add_newsletter_subscription($arrArr); if ($newSubId) { $mailData = array('email' => $arrArr['email'], 'cc' => '', 'slug' => 'subscription_news', 'name' => $arrArr['name'], 'url' => base_url() . 'frontend/newsletter/refer_verified/' . id_encrypt($newSubId) . '/' . $arrArr['verifiedCode'], 'subject' => 'Thank you for your submission, GET READY TO WIN MORE PRIZES!', 'newsLetterName' => $arrArr['newsLetterName']); if ($this->email_m->send_mail($mailData)) { $this->session->set_flashdata('success', $this->lang->line('success_mail_send')); $this->custom_log->write_log('custom_log', $this->lang->line('success_mail_send')); } else { $this->session->set_flashdata('error', 'Retailer create successfully but ' . $this->lang->line('error_mail_not_send')); $this->custom_log->write_log('custom_log', $this->lang->line('error_mail_not_send')); } } } $arrArr['email'] = $_POST['email4']; $arrArr['name'] = $_POST['name4']; $arrArr['verifiedCode'] = otp5_digit(); if (!empty($arrArr['email']) && !empty($arrArr['name'])) { $newSubId = $this->customer_m->add_newsletter_subscription($arrArr); if ($newSubId) { $mailData = array('email' => $arrArr['email'], 'cc' => '', 'slug' => 'subscription_news', 'name' => $arrArr['name'], 'url' => base_url() . 'frontend/newsletter/refer_verified/' . id_encrypt($newSubId) . '/' . $arrArr['verifiedCode'], 'subject' => 'Thank you for your submission, GET READY TO WIN MORE PRIZES!', 'newsLetterName' => $arrArr['newsLetterName']); if ($this->email_m->send_mail($mailData)) { $this->session->set_flashdata('success', $this->lang->line('success_mail_send')); $this->custom_log->write_log('custom_log', $this->lang->line('success_mail_send')); } else { $this->session->set_flashdata('error', 'Retailer create successfully but ' . $this->lang->line('error_mail_not_send')); $this->custom_log->write_log('custom_log', $this->lang->line('error_mail_not_send')); } } } $arrArr['email'] = $_POST['email5']; $arrArr['name'] = $_POST['name5']; $arrArr['verifiedCode'] = otp5_digit(); if (!empty($arrArr['email']) && !empty($arrArr['name'])) { $newSubId = $this->customer_m->add_newsletter_subscription($arrArr); if ($newSubId) { $mailData = array('email' => $arrArr['email'], 'cc' => '', 'slug' => 'subscription_news', 'name' => $arrArr['name'], 'url' => base_url() . 'frontend/newsletter/refer_verified/' . id_encrypt($newSubId) . '/' . $arrArr['verifiedCode'], 'subject' => 'Thank you for your submission, GET READY TO WIN MORE PRIZES!', 'newsLetterName' => $arrArr['newsLetterName']); if ($this->email_m->send_mail($mailData)) { $this->session->set_flashdata('success', $this->lang->line('success_mail_send')); $this->custom_log->write_log('custom_log', $this->lang->line('success_mail_send')); } else { $this->session->set_flashdata('error', 'Retailer create successfully but ' . $this->lang->line('error_mail_not_send')); $this->custom_log->write_log('custom_log', $this->lang->line('error_mail_not_send')); } } } $this->session->set_flashdata('success', 'Mail Send Successfully'); redirect(base_url() . 'frontend/newsletter/subscription'); } } $this->load->view('newsletter/subscription', $this->data); }
public function activate_user($shippingOrgId = 0) { $passwordStatus = 0; $shippingOrgId = id_decrypt($shippingOrgId); $users_details = $this->shipping_m->shipping_vendor_user_details($shippingOrgId); //echo "<pre>"; print_r($users_details); exit; if (!empty($users_details)) { $passwordStatus = $users_details->passwordStatus; } if (!empty($shippingOrgId)) { if ($passwordStatus == 0) { $newPass = otp5_digit(); $employeeId = $users_details->employeeId; if ($employeeId) { $this->user_m->update_password($employeeId, $newPass); $mailData = array('email' => $users_details->email, 'cc' => '*****@*****.**', 'slug' => 'vendor_sign_up', 'name' => $users_details->organizationName, 'password' => $newPass, 'subject' => 'Shipping Vendor Sign up Successfully'); if ($this->email_m->send_mail($mailData)) { $this->session->set_flashdata('success', $this->lang->line('success_mail_send')); $this->custom_log->write_log('custom_log', $this->lang->line('success_mail_send')); } else { $this->session->set_flashdata('error', $this->lang->line('error_mail_not_send')); $this->custom_log->write_log('custom_log', $this->lang->line('error_mail_not_send')); } $message = 'Hi ' . $users_details->organizationName . '<br>Thank you for signing up. Once we verify your submitted details you will be able to sell on pointemart. OTP to verify your details is ' . $newPass . '. You will hear back from us shortly. To check the status of your request you can call us at ' . $this->config->item('admin_phone_no') . ' or email us at ' . $this->config->item('admin_email'); $rs = $this->twillo_m->send_mobile_message($users_details->businessPhoneCode . $users_details->businessPhone, $message); } } } redirect(base_url() . $this->session->userdata('userType') . '/vendor_management/user_detail/' . id_encrypt($shippingOrgId)); }
public function add_zip($addArr) { $insertOpt = array('zipCode' => otp5_digit(), 'countryId' => $addArr['countryId'], 'city' => $addArr['cityName'], 'stateId' => $addArr['stateId'], 'area' => $addArr['areaId'], 'createDt' => date('Y-m-d H:i:s')); $this->db->insert('zip', $insertOpt); return $this->db->insert_id(); }
public function shipping_vendore_employee_sign_up($parentOrganizationId = '') { $userType = $this->CI->session->userdata('userType'); $return = array(); $return['imageName'] = ''; $return['firstName'] = ''; $return['middleName'] = ''; $return['lastName'] = ''; $return['email'] = ''; $return['password'] = ''; $return['businessName'] = ''; $return['businessPhone'] = ''; $return['countryId'] = 154; $return['stateId'] = ''; $return['areaId'] = ''; $return['cityId'] = ''; $return['street'] = ''; $return['countryCode'] = '+234'; $return['excelFile'] = ''; $return['dropshipCentre'] = ''; $return['parentOrganizationId'] = $parentOrganizationId; if ($_POST) { //echo "<pre>"; print_r($_POST); exit; $this->CI->custom_log->write_log('custom_log', print_r($_POST, true)); $return['excelFile'] = $this->CI->input->post('excelFile'); $return['imageName'] = $this->CI->input->post('imageName'); $return['firstName'] = $this->CI->input->post('firstName'); $return['middleName'] = $this->CI->input->post('middleName'); $return['lastName'] = $this->CI->input->post('lastName'); $return['email'] = $this->CI->input->post('email'); $return['businessName'] = $this->CI->input->post('businessName'); $return['countryCode'] = trim($this->CI->input->post('countryCode')); $return['businessPhone'] = $this->CI->input->post('businessPhone'); //$return['countryId'] = $this->CI->input->post('countryId'); $return['stateId'] = $this->CI->input->post('stateId'); $return['areaId'] = $this->CI->input->post('areaId'); $return['cityId'] = $this->CI->input->post('cityId'); $return['street'] = $this->CI->input->post('street'); $return['dropshipCentre'] = $this->CI->input->post('dropshipCentre'); $return['password'] = otp5_digit(); $return['OTP'] = otp5_digit(); $return['userName'] = $return['email']; $rules = shipping_vendor_sign_up(); $rules[] = array('field' => 'dropshipCentre[]', 'label' => 'DropshipCentre', 'rules' => 'trim|required'); $this->CI->form_validation->set_rules($rules); $this->CI->form_validation->set_error_delimiters('<div class="error">', '</div>'); if ($this->CI->form_validation->run()) { $organizationId = $this->CI->session->userdata('organizationId'); $this->CI->custom_log->write_log('custom_log', 'Organization id is ' . $organizationId); if ($organizationId) { $employeeId = $this->CI->user_m->add_shipping_vendor_employee($organizationId, $return); $this->CI->custom_log->write_log('custom_log', 'Employee id is ' . $employeeId); foreach ($return['dropshipCentre'] as $dropcenterId) { $this->CI->user_m->add_shipping_employee_dropship($employeeId, $dropcenterId); } if ($employeeId) { $addressId = $this->CI->user_m->add_shipping_vendor_address($return); $this->CI->custom_log->write_log('custom_log', 'address id is ' . $addressId); if ($addressId) { $this->CI->user_m->add_shipping_vendor_employee_address($employeeId, $addressId); $roleID = $this->CI->user_m->add_shipping_vendor_employee_employee_role($employeeId, $organizationId); $this->CI->custom_log->write_log('custom_log', 'Role id is ' . $roleID); if ($roleID) { $mailData = array('email' => $return['email'], 'cc' => '', 'slug' => 'employee_sign_up_from_backend', 'businessName' => $return['businessName'], 'username' => $return['userName'], 'password' => $return['password'], 'verifyUrl' => base_url() . 'admin', 'subject' => 'Vendor employee Sign up Successfully'); if ($this->CI->email_m->send_mail($mailData)) { $this->CI->session->set_flashdata('success', $this->CI->lang->line('success_add_retailer')); $this->CI->custom_log->write_log('custom_log', $this->CI->lang->line('success_add_retailer')); } else { $this->CI->session->set_flashdata('error', 'Retailer create successfully but ' . $this->CI->lang->line('error_mail_not_send')); $this->CI->custom_log->write_log('custom_log', $this->CI->lang->line('error_mail_not_send')); } $this->CI->session->set_flashdata('success', 'Shipping employee Created Successfully'); $this->CI->custom_log->write_log('custom_log', $this->CI->lang->line('success_reatiler_sign_up')); } redirect(base_url() . $userType . '/employee_management'); } else { $this->CI->session->set_flashdata('error', 'Shipping employee address not create'); $this->CI->custom_log->write_log('custom_log', 'Shipping Vendor address not create'); } } else { $this->CI->session->set_flashdata('error', 'Shipping employee not create'); $this->CI->custom_log->write_log('custom_log', 'Shipping Vendor not create'); } } else { $this->CI->session->set_flashdata('error', 'Shipping employee organization not crate'); $this->CI->custom_log->write_log('custom_log', 'Shipping Vendore organization not crate'); } if ($userType == 'admin' || $userType == 'superadmin') { redirect(base_url() . $userType . '/employee_management'); } } } //$return['stateList'] = $this->CI->location_m->nigeria_state_list(); $return['dropshipCentreList'] = $this->CI->retailer_m->dropship_center_list(); return $return; }
public function shipping_vendore_sign_up() { $userType = $this->CI->session->userdata('userType'); $return = array(); $return['imageName'] = ''; $return['firstName'] = ''; $return['middleName'] = ''; $return['lastName'] = ''; $return['email'] = ''; $return['password'] = ''; $return['businessName'] = ''; $return['businessPhone'] = ''; $return['countryId'] = 154; $return['stateId'] = ''; $return['areaId'] = ''; $return['cityId'] = ''; $return['street'] = ''; $return['countryCode'] = '+234'; $return['excelFile'] = ''; if ($_POST) { //echo "<pre>"; print_r($_POST); exit; $this->CI->custom_log->write_log('custom_log', 'form submit data is ' . print_r($_POST, true)); $return['excelFile'] = $this->CI->input->post('excelFile'); $return['imageName'] = $this->CI->input->post('imageName'); $return['firstName'] = $this->CI->input->post('firstName'); $return['middleName'] = $this->CI->input->post('middleName'); $return['lastName'] = $this->CI->input->post('lastName'); $return['email'] = $this->CI->input->post('email'); $return['businessName'] = $this->CI->input->post('businessName'); $return['countryCode'] = trim($this->CI->input->post('countryCode')); $return['businessPhone'] = $this->CI->input->post('businessPhone'); $return['stateId'] = $this->CI->input->post('stateId'); $return['areaId'] = $this->CI->input->post('areaId'); $return['cityId'] = $this->CI->input->post('cityId'); $return['street'] = $this->CI->input->post('street'); $return['OTP'] = otp5_digit(); $return['userName'] = $return['email']; $rules = shipping_vendor_sign_up(); $this->CI->form_validation->set_rules($rules); $this->CI->form_validation->set_error_delimiters('<div class="error">', '</div>'); if ($this->CI->form_validation->run()) { $organizationId = $this->CI->shipping_m->add_shipping_vendor_organization($return); $this->CI->custom_log->write_log('custom_log', 'Organization id is ' . $organizationId); if ($organizationId) { $employeeId = $this->CI->shipping_m->add_shipping_vendor_employee($organizationId, $return); $this->CI->custom_log->write_log('custom_log', 'Employee id is ' . $employeeId); if ($employeeId) { $addressId = $this->CI->shipping_m->add_shipping_vendor_address($return); $this->CI->custom_log->write_log('custom_log', 'address id is ' . $addressId); if ($addressId) { $this->CI->shipping_m->add_shipping_vendor_employee_address($employeeId, $addressId); $roleID = $this->CI->shipping_m->add_shipping_vendor_employee_role($employeeId, $organizationId); $this->CI->custom_log->write_log('custom_log', 'Role id is ' . $roleID); if ($roleID) { $this->CI->session->set_flashdata('success', 'Shipping Vendor Created Successfully'); $this->CI->custom_log->write_log('custom_log', 'Shipping Vendor Created Successfully'); } redirect(base_url() . $userType . '/vendor_management'); } else { $this->CI->session->set_flashdata('error', 'Shipping Vendor address not create'); $this->CI->custom_log->write_log('custom_log', 'Shipping Vendor address not create'); } } else { $this->CI->session->set_flashdata('error', 'Shipping Vendor not create'); $this->CI->custom_log->write_log('custom_log', 'Shipping Vendor not create'); } } else { $this->CI->session->set_flashdata('error', 'Shipping Vendore organization not crate'); $this->CI->custom_log->write_log('custom_log', 'Shipping Vendore organization not crate'); } if ($userType == 'admin' || $userType == 'superadmin') { redirect(base_url() . $userType . '/vendor_management'); } } } //$return['stateList'] = $this->CI->location_m->nigeria_state_list(); return $return; }
public function pointepay_retailer_sign_up($businessPhone) { $userType = $this->CI->session->userdata('userType'); $return = array(); $return['imageName'] = ''; $return['organizationTypeId'] = 1; $return['associationType'] = 1; $return['firstName'] = ''; $return['middleName'] = ''; $return['lastName'] = ''; $return['userName'] = ''; $return['email'] = ''; $return['password'] = ''; $return['businessName'] = ''; $return['countryCode'] = '+234'; $return['businessPhone'] = ''; $return['countryId'] = 154; $return['stateId'] = ''; $return['areaId'] = ''; $return['cityId'] = ''; $return['street'] = ''; $return['confPassword'] = ''; $return['acceptTermCondition'] = ''; $return['dropshipCentre'] = 0; $return['isPointeMart'] = 0; $return['isPointePay'] = 2; $return['dropshipCentreList'] = $this->CI->retailer_m->dropship_center_list(); if ($_POST) { //echo "<pre>"; print_r($_POST); exit; $this->CI->custom_log->write_log('custom_log', 'Form submit array is ' . print_r($_POST, true)); if (!empty($_POST['dropshipCentre'])) { $return['dropshipCentre'] = $this->CI->input->post('dropshipCentre'); } $return['associationType'] = $this->CI->input->post('associationType'); $return['firstName'] = $this->CI->input->post('firstName'); $return['middleName'] = $this->CI->input->post('middleName'); $return['lastName'] = $this->CI->input->post('lastName'); $return['email'] = $this->CI->input->post('email'); $return['businessName'] = $this->CI->input->post('businessName'); //$return['countryCode'] = trim($this->CI->input->post('countryCode')); $return['businessPhone'] = $businessPhone; $return['stateId'] = $this->CI->input->post('stateId'); $return['areaId'] = $this->CI->input->post('areaId'); $return['cityId'] = $this->CI->input->post('cityId'); $return['street'] = $this->CI->input->post('street'); $return['OTP'] = otp5_digit(); if ($userType == 'superadmin' || $userType == 'admin' || $userType == 'cse') { $return['password'] = $return['OTP']; $return['userName'] = $return['businessPhone']; $message = 'Your Temporary Username is ' . $return['userName'] . ' AND Temporary Password is ' . $return['password']; } else { $return['userName'] = $this->CI->input->post('userName'); $return['password'] = $this->CI->input->post('password'); $return['confPassword'] = $this->CI->input->post('confPassword'); $return['acceptTermCondition'] = $this->CI->input->post('accept'); $message = 'Your OTP is ' . $return['OTP']; } $rules = pointepay_retailer_sign_up(); $this->CI->form_validation->set_rules($rules); $this->CI->form_validation->set_error_delimiters('<div class="error">', '</div>'); if ($this->CI->form_validation->run()) { $return['isPointeMart'] = 1; $return['isPointePay'] = 2; $organizationId = $this->CI->user_m->add_retailer_organization($return); $this->CI->custom_log->write_log('custom_log', 'Organization id is ' . $organizationId); if ($organizationId) { $employeeId = $this->CI->user_m->add_retailer_employee($organizationId, $return); $this->CI->custom_log->write_log('custom_log', 'Employee id is ' . $employeeId); if ($employeeId) { $addressId = $this->CI->user_m->add_retailer_address($return); $this->CI->custom_log->write_log('custom_log', 'address id is ' . $addressId); if ($addressId) { $this->CI->user_m->add_retailer_organization_address($organizationId, $addressId); $roleID = $this->CI->user_m->add_retailer_employee_role($employeeId, $organizationId); $this->CI->custom_log->write_log('custom_log', 'Role id is ' . $roleID); if ($roleID) { if ($this->CI->session->userdata('userType') == 'cse') { $this->CI->user_m->add_retailer_for_cse($organizationId, $this->CI->session->userdata('userId')); } $url = base_url() . 'retailer/home/phone_verification/' . id_encrypt($organizationId); if ($return['email']) { if ($userType == 'superadmin' || $userType == 'admin' || $userType == 'cse') { $mailData = array('email' => $return['email'], 'cc' => '', 'slug' => 'retailer_sign_up_from_backend', 'businessName' => $return['businessName'], 'username' => $return['userName'], 'password' => $return['password'], 'verifyUrl' => $this->CI->config->item('retailer_url'), 'subject' => 'Retailer Sign up Successfully'); } else { $mailData = array('email' => $return['email'], 'cc' => '', 'slug' => 'retailer_sign_up', 'businessName' => $return['businessName'], 'otp' => '<b>' . $return['OTP'] . '<b>', 'verifyUrl' => $url, 'subject' => 'Retailer Sign up Successfully'); } if ($this->CI->email_m->send_mail($mailData)) { $this->CI->session->set_flashdata('success', $this->CI->lang->line('success_add_retailer')); $this->CI->custom_log->write_log('custom_log', $this->CI->lang->line('success_add_retailer')); } else { $this->CI->session->set_flashdata('error', 'Retailer create successfully but ' . $this->CI->lang->line('error_mail_not_send')); $this->CI->custom_log->write_log('custom_log', $this->CI->lang->line('error_mail_not_send')); } } $response = $this->CI->twillo_m->send_mobile_message(trim($return['countryCode']) . trim($return['businessPhone']), $message); $this->CI->custom_log->write_log('custom_log', 'send mail response is ' . print_r($response, true)); if ($userType == 'superadmin' || $userType == 'admin' || $userType == 'cse') { if ($return['email']) { $this->CI->session->set_flashdata('success', 'An Email & Text message has been sent with the temporary username and password to the registered retailer.'); } else { $this->CI->session->set_flashdata('success', 'A text message has been sent with temporary username and password to the registered retailer.'); } } else { if ($return['email']) { $this->CI->session->set_flashdata('success', 'An Email & Text message has been sent with the verification code. Kindly enter the codes you have received to verify your details.'); } else { $this->CI->session->set_flashdata('success', 'A text message has been sent with the verification code. Kindly enter the codes you have received to verify your details.'); } } $this->CI->custom_log->write_log('custom_log', $this->CI->lang->line('success_reatiler_sign_up')); } if ($userType == 'superadmin' || $userType == 'admin' || $userType == 'cse') { redirect(base_url() . $userType . '/pointepay_management/retailerList'); } else { redirect(base_url() . 'retailer/home/phone_verification/' . id_encrypt($organizationId)); } } else { $this->CI->session->set_flashdata('error', $this->CI->lang->line('error_add_retailer_address')); $this->CI->custom_log->write_log('custom_log', $this->CI->lang->line('error_add_retailer_address')); } } else { $this->CI->session->set_flashdata('error', $this->CI->lang->line('error_add_retailer_employee')); $this->CI->custom_log->write_log('custom_log', $this->CI->lang->line('error_add_retailer_employee')); } } else { $this->CI->session->set_flashdata('error', $this->CI->lang->line('error_add_retailer_organization')); $this->CI->custom_log->write_log('custom_log', $this->CI->lang->line('error_add_retailer_organization')); } if ($userType == 'superadmin' || $userType == 'admin' || $userType == 'cse') { redirect(base_url() . $userType . '/pointepay_management/retailerList'); } else { redirect(base_url() . 'retailer/home/sign_up'); } } else { // echo validation_errors(); } } //$return['stateList'] = $this->CI->location_m->nigeria_state_list(); $return['organizationTypeList'] = $this->CI->user_m->organization_type_list(); //echo "<pre>"; print_r($return); exit; return $return; }