<?php $func = new FunctionsK(); if ($res = $func->getUsedVoucher($_GET['voucher_name'])) { //dump($res); ?> <table id="table_list" class="uk-table uk-table-hover uk-table-striped uk-table-condensed"> <thead> <tr> <th><?php echo Yii::t('default', "Voucher name"); ?> </th> <th><?php echo Yii::t('default', "Customer Name"); ?> </th> <th><?php echo Yii::t('default', "Transaction Type"); ?> </th> <th><?php echo Yii::t('default', "Order No."); ?> </th> <!--<th><?php echo Yii::t('default', "Total Discount in amount"); ?> </th>--> <th><?php
echo CHtml::textField('last_name', '', array('class' => 'uk-width-1-1', 'placeholder' => Yii::t("default", "Last Name"), 'data-validation' => "required")); ?> </div> <div class="uk-form-row"> <?php echo CHtml::textField('contact_phone', '', array('class' => 'uk-width-1-1 mobile_inputs', 'placeholder' => yii::t("default", "Mobile"), 'data-validation' => "required")); ?> </div> <div class="uk-form-row"> <?php echo CHtml::textField('email_address', '', array('class' => 'uk-width-1-1', 'placeholder' => yii::t("default", "Email address"), 'data-validation' => "email")); ?> </div> <?php $FunctionsK = new FunctionsK(); $FunctionsK->clientRegistrationCustomFields(); ?> <div class="uk-form-row"> <?php echo CHtml::passwordField('password', '', array('class' => 'uk-width-1-1', 'placeholder' => Yii::t("default", "Password"), 'data-validation' => "required")); ?> </div> <p class="uk-text-muted" style="text-align: left;"> <?php echo Yii::t("default", "By creating an account, you agree to receive sms from vendor."); ?> </p>
<?php $f = new FunctionsK(); $list = $f->getFaxPackage(); ?> <div class="uk-width-1"> <a href="<?php echo Yii::app()->request->baseUrl; ?> /admin/faxpackage/Do/Add" class="uk-button"><i class="fa fa-plus"></i> <?php echo Yii::t("default", "Add New"); ?> </a> <a href="<?php echo Yii::app()->request->baseUrl; ?> /admin/faxpackage" class="uk-button"><i class="fa fa-list"></i> <?php echo Yii::t("default", "List"); ?> </a> <a href="<?php echo Yii::app()->request->baseUrl; ?> /admin/faxpackage/Do/Sort" class="uk-button"><i class="fa fa-sort-alpha-asc"></i> <?php echo Yii::t("default", "Sort"); ?> </a> </div>
public function addMerchantUser() { $merchant_id = Yii::app()->functions->getMerchantID(); $params = array('merchant_id' => $merchant_id, 'first_name' => $this->data['first_name'], 'last_name' => $this->data['last_name'], 'username' => $this->data['username'], 'user_access' => json_encode($this->data['access']), 'date_created' => date('c'), 'status' => $this->data['status'], 'ip_address' => $_SERVER['REMOTE_ADDR'], 'contact_email' => $this->data['contact_email']); if (isset($this->data['password'])) { if (!empty($this->data['password'])) { $params['password'] = md5($this->data['password']); } } /*dump($params); die(); */ $FunctionsK = new FunctionsK(); if (empty($this->data['id'])) { if (empty($params['password'])) { $this->msg = "Password is required."; return; } if ($err_msg = $FunctionsK->validateMerchantUserAccount($this->data['username'], $this->data['contact_email'])) { $this->msg = $err_msg; return; } if (!yii::app()->functions->validateMerchantUSername($this->data['username'])) { if ($this->insertData("{{merchant_user}}", $params)) { $this->details = Yii::app()->db->getLastInsertID(); $this->code = 1; $this->msg = Yii::t("default", "Successful"); } } else { $this->msg = "Sorry your username is already exist. Please choose another username."; } } else { unset($params['date_created']); $params['date_modified'] = date('c'); if (!empty($params['username'])) { if (Yii::app()->functions->validateMerchantUser($params['username'], $merchant_id)) { $this->msg = Yii::t("default", "Merchant Username is already been taken"); return; } } if ($err_msg = $FunctionsK->validateMerchantUserAccount($this->data['username'], $this->data['contact_email'], $this->data['id'])) { $this->msg = $err_msg; return; } $res = $this->updateData('{{merchant_user}}', $params, 'merchant_user_id', $this->data['id']); if ($res) { $this->code = 1; $this->msg = Yii::t("default", 'Merchant User updated.'); } else { $this->msg = Yii::t("default", "ERROR: cannot update"); } } }
<?php $ref = isset($_GET['ref']) ? $_GET['ref'] : ''; $FunctionsK = new FunctionsK(); ?> <div class="page-right-sidebar payment-option-page"> <div class="main"> <div class="inner"> <?php if ($res = $FunctionsK->getFaxTransactionByRef($ref)) { ?> <h2><?php echo Yii::t("default", "Bank Deposit verification"); ?> </h2> <p class="uk-text-muted"> <?php echo Yii::t("default", "Please enter the details of your bank deposit payment below."); ?> <br/> <?php echo Yii::t("default", "Failure to provide accurate information may cause delays in processing or invalidation of your payment."); ?> </p> <form class="uk-form uk-form-horizontal forms" id="forms"> <?php
echo CHtml::textField('last_name', isset($data['first_name']) ? $data['last_name'] : "", array('class' => "uk-form-width-large", 'data-validation' => "required")); ?> </div> <div class="uk-form-row"> <label class="uk-form-label"><?php echo Yii::t("default", "Email address"); ?> </label> <?php echo CHtml::textField('email_address', isset($data['email_address']) ? $data['email_address'] : "", array('class' => "uk-form-width-large", 'data-validation' => "required")); ?> </div> <?php $FunctionsK = new FunctionsK(); $FunctionsK->clientRegistrationCustomFields(true, $data); ?> <div class="uk-form-row"> <label class="uk-form-label"><?php echo Yii::t("default", "Password"); ?> </label> <?php echo CHtml::passwordField('password', '', array('class' => "uk-form-width-large")); ?> </div> <div class="uk-form-row"> <label class="uk-form-label"><?php
} else { ?> <!--ADD--> <div class="uk-form-row"> <label class="uk-form-label"><?php echo Yii::t("default", "Merchant Name"); ?> </label> <?php echo CHtml::dropDownList('merchant_id', '', (array) Yii::app()->functions->merchantList(true), array('class' => 'uk-form-width-large')); ?> </div> <?php $FunctionsK = new FunctionsK(); $sms_pack = $FunctionsK->getFaxPackage(); $sms_drop[] = t("Please Select"); if (is_array($sms_pack) && count($sms_pack) >= 1) { foreach ($sms_pack as $sms_val) { $sms_drop[$sms_val['fax_package_id']] = ucwords($sms_val['title']); } } ?> <div class="uk-form-row"> <label class="uk-form-label"><?php echo Yii::t("default", "SMS Package"); ?> </label> <?php
<?php $FunctionsK = new FunctionsK(); $data = $_GET; $merchant_id = Yii::app()->functions->getMerchantID(); if ($res = $FunctionsK->getPackageFaxTransByMerchant($data['id'], $merchant_id)) { ?> <h3><?php echo Yii::t("default", "Thank you."); ?> </h3> <p><?php echo Yii::t("default", 'Thank you for purchasing Fax Services. Please find your receipt details below'); ?> :</p> <div class="uk-form-row"> <label class="uk-form-label"><?php echo Yii::t("default", "Reference #"); ?> :</label> <span class="uk-text-muted"><?php echo $res['id']; ?> </span> </div> <div class="uk-form-row"> <label class="uk-form-label"><?php
$amount_to_pay = Yii::app()->functions->normalPrettyPrice2($amount_to_pay); $stripe = array("secret_key" => $secret_key, "publishable_key" => $publishable_key); Stripe::setApiKey($stripe['secret_key']); } else { $error = Yii::t("default", "Stripe payment is not properly configured on admin portal."); } if (isset($_POST)) { if (is_array($_POST) && count($_POST) >= 1) { $step2 = true; $token = isset($_POST['stripeToken']) ? $_POST['stripeToken'] : ''; try { $customer = Stripe_Customer::create(array('email' => isset($_POST['stripeEmail']) ? $_POST['stripeEmail'] : '', 'card' => $token)); $charge = Stripe_Charge::create(array('customer' => $customer->id, 'amount' => $amount_to_pay, 'currency' => Yii::app()->functions->adminCurrencyCode())); $chargeArray = $charge->__toArray(true); $db_ext = new DbExt(); $FunctionsK = new FunctionsK(); $info = $FunctionsK->getFaxPackagesById($package_id); $params = array('merchant_id' => Yii::app()->functions->getMerchantID(), 'fax_package_id' => $package_id, 'payment_type' => $payment_code, 'package_price' => $price, 'fax_limit' => $info['fax_limit'], 'date_created' => date('c'), 'ip_address' => $_SERVER['REMOTE_ADDR'], 'payment_gateway_response' => json_encode($chargeArray), 'status' => "paid"); if ($db_ext->insertData("{{fax_package_trans}}", $params)) { $merchantinfo = Yii::app()->functions->getMerchantInfo(); $FunctionsK->faxSendNotification((array) $merchantinfo[0], $package_id, "Stripe", $price); header('Location: ' . Yii::app()->request->baseUrl . "/merchant/{$redirect}/id/" . Yii::app()->db->getLastInsertID()); } else { $error = Yii::t("default", "ERROR: Cannot insert record."); } } catch (Exception $e) { $error = $e; } } } ?>
<?php Widgets::merchantPaymentList($merchant_id); ?> <!--tips section--> <?php if (Yii::app()->functions->getOption("merchant_enabled_tip", $merchant_id) == 2) { ?> <?php $merchant_tip_default = Yii::app()->functions->getOption("merchant_tip_default", $merchant_id); if (!empty($merchant_tip_default)) { echo CHtml::hiddenField('default_tip', $merchant_tip_default); } $FunctionsK = new FunctionsK(); $tips = $FunctionsK->tipsList(); ?> <h3><?php echo t("Tip Amount"); ?> (<span class="tip_percentage">0%</span>)</h3> <div class="uk-panel uk-panel-box"> <ul class="tip-wrapper"> <?php foreach ($tips as $tip_key => $tip_val) { ?> <li> <a class="tips" href="javascript:;" data-type="tip" data-tip="<?php echo $tip_key;
$stores_open_custom_text = Yii::app()->functions->getOption("stores_open_custom_text", $merchant_id); $stores_open_day = !empty($stores_open_day) ? (array) json_decode($stores_open_day) : false; $stores_open_starts = !empty($stores_open_starts) ? (array) json_decode($stores_open_starts) : false; $stores_open_ends = !empty($stores_open_ends) ? (array) json_decode($stores_open_ends) : false; $stores_open_custom_text = !empty($stores_open_custom_text) ? (array) json_decode($stores_open_custom_text) : false; $merchant_photo = Yii::app()->functions->getOption("merchant_photo", $merchant_id); $merchant_delivery_estimation = Yii::app()->functions->getOption("merchant_delivery_estimation", $merchant_id); $merchant_delivery_charges_type = Yii::app()->functions->getOption("merchant_delivery_charges_type", $merchant_id); $merchant_photo_bg = Yii::app()->functions->getOption("merchant_photo_bg", $merchant_id); $merchant_extenal = Yii::app()->functions->getOption("merchant_extenal", $merchant_id); $merchant_maximum_order = Yii::app()->functions->getOption("merchant_maximum_order", $merchant_id); $merchant_switch_master_cod = Yii::app()->functions->getOption("merchant_switch_master_cod", $merchant_id); $merchant_switch_master_ccr = Yii::app()->functions->getOption("merchant_switch_master_ccr", $merchant_id); $merchant_minimum_order_pickup = Yii::app()->functions->getOption("merchant_minimum_order_pickup", $merchant_id); $merchant_maximum_order_pickup = Yii::app()->functions->getOption("merchant_maximum_order_pickup", $merchant_id); $FunctionsK = new FunctionsK(); $tips_list = $FunctionsK->tipsList(true); ?> <div id="error-message-wrapper"></div> <form class="uk-form uk-form-horizontal forms" id="forms"> <?php echo CHtml::hiddenField('action', 'merchantSettings'); ?> <div class="uk-form-row"> <label class="uk-form-label"><?php echo Yii::t('default', "Merchant Logo"); ?> </label>
<?php $FunctionsK = new FunctionsK(); $merchant_id = Yii::app()->functions->getMerchantID(); ?> <div class="earnings-wrap"> <div class="table"> <ul> <li> <div class="rounded-box rounded"> <p><?php echo t("Total Send Fax"); ?> :</p> <h3><?php echo $FunctionsK->faxGetTotalSend($merchant_id); ?> </h3> </div> </li> <li> <div class="rounded-box rounded"> <p><?php echo t("Total Successful"); ?> :</p> <h3><?php echo $FunctionsK->faxGetTotalSuccesful($merchant_id);
public function actionGoogleLogin() { if (isset($_GET['error'])) { $this->redirect(Yii::app()->createUrl('/store')); } $plus = Yii::app()->GoogleApis->serviceFactory('Oauth2'); $client = Yii::app()->GoogleApis->client; try { if (!isset(Yii::app()->session['auth_token']) || is_null(Yii::app()->session['auth_token'])) { // You want to use a persistence layer like the DB for storing this along // with the current user Yii::app()->session['auth_token'] = $client->authenticate(); } else { if (isset($_SESSION['auth_token'])) { $client->setAccessToken($_SESSION['auth_token']); } } if (isset($_REQUEST['logout'])) { unset($_SESSION['auth_token']); $client->revokeToken(); } if ($token = $client->getAccessToken()) { $t = $plus->userinfo->get(); if (is_array($t) && count($t) >= 1) { $func = new FunctionsK(); if ($resp_t = $func->googleRegister($t)) { Yii::app()->functions->clientAutoLogin($t['email'], $resp_t['password'], $resp_t['password']); unset($_SESSION['auth_token']); $client->revokeToken(); if (isset($_SESSION['google_http_refferer'])) { $this->redirect($_SESSION['google_http_refferer']); } else { $this->redirect(Yii::app()->createUrl('/store')); } die; } else { echo t("ERROR: Something went wrong"); } } else { echo t("ERROR: Something went wrong"); } } else { $authUrl = $client->createAuthUrl(); } if (isset($authUrl)) { print "<a class='login' href='{$authUrl}'>Connect Me!</a>"; } else { print "<a class='logout' href='?logout'>Logout</a>"; } } catch (Exception $e) { Yii::app()->session['auth_token'] = null; throw $e; } }
echo Yii::t("default", "List"); ?> </a> <a href="<?php echo Yii::app()->request->baseUrl; ?> /admin/faxpackage/Do/Sort" class="uk-button"><i class="fa fa-sort-alpha-asc"></i> <?php echo Yii::t("default", "Sort"); ?> </a> </div> <?php $FunctionsK = new FunctionsK(); if (isset($_GET['id'])) { if (!($data = $FunctionsK->getSMSPackagesById($_GET['id']))) { echo "<div class=\"uk-alert uk-alert-danger\">" . Yii::t("default", "Sorry but we cannot find what your are looking for.") . "</div>"; return; } } ?> <div class="spacer"></div> <form class="uk-form uk-form-horizontal forms" id="forms"> <?php echo CHtml::hiddenField('action', 'FaxPackageAdd'); echo CHtml::hiddenField('id', isset($_GET['id']) ? $_GET['id'] : "");
<?php $FunctionsK = new FunctionsK(); ?> <form class="uk-form uk-form-horizontal forms" id="forms"> <?php echo CHtml::hiddenField('action', 'initpaymentprovider'); echo CHtml::hiddenField('controller', "merchant"); echo CHtml::hiddenField('purchase', "fax_package"); echo CHtml::hiddenField('return_url', websiteUrl() . "/merchant/faxpurchase"); ?> <?php if ($res = $FunctionsK->getFaxPackage()) { ?> <div class="uk-grid sms-package-wrap"> <?php foreach ($res as $val) { ?> <div class="uk-width-1-3"> <div class="uk-panel uk-panel-box"> <h3><?php echo $val['title']; ?> </h3> <h4 class="uk-text-muted"><?php echo $val['description']; ?> </h4> <?php
echo Yii::t("default", "Delivery Distance Covered"); ?> :</span> <?php echo $mt_delivery_miles . " " . $unit_distance; ?> </p> <?php } ?> <?php //delivery rates table $_SESSION['shipping_fee'] = ''; if ($shipping_enabled == 2) { $FunctionsK = new FunctionsK(); $delivery_fee = $FunctionsK->getDeliveryChargesByDistance($merchant_id, $use_distance1, $unit, $delivery_fee); /*dump($use_distance1); dump($unit); dump($delivery_fee);*/ $_SESSION['shipping_fee'] = $delivery_fee; } ?> <?php if ($delivery_fee >= 1) { ?> <p class="delivery-fee-wrap"><span class="uk-text-bold"><?php echo Yii::t("default", "Delivery Fee"); ?> :</span>
public function addVoucherNew() { $functionsk = new FunctionsK(); $merchant_id = Yii::app()->functions->getMerchantID(); $params = array('voucher_name' => $this->data['voucher_name'], 'voucher_type' => $this->data['voucher_type'], 'amount' => $this->data['amount'], 'expiration' => $this->data['expiration'], 'status' => $this->data['status'], 'date_created' => date('c'), 'ip_address' => $_SERVER['REMOTE_ADDR'], 'merchant_id' => $merchant_id); /*dump($this->data); dump($params); die();*/ if (isset($this->data['voucher_owner'])) { unset($params['merchant_id']); $params['voucher_owner'] = $this->data['voucher_owner']; } if (isset($this->data['joining_merchant'])) { $params['joining_merchant'] = json_encode($this->data['joining_merchant']); } if (isset($this->data['used_once'])) { $params['used_once'] = $this->data['used_once']; } if (!empty($this->data['id'])) { if ($functionsk->checkIFVoucherCodeExisting($this->data['voucher_name'], $this->data['id'])) { $this->msg = t("Sorry but voucher name already exist!"); return; } $params['date_modified'] = date('c'); unset($params['date_created']); if ($this->updateData("{{voucher_new}}", $params, 'voucher_id', $this->data['id'])) { $this->code = 1; $this->msg = t("Successful"); } else { $this->msg = t("Failed cannot update records"); } } else { if ($functionsk->checkIFVoucherCodeExists($this->data['voucher_name'])) { $this->msg = t("Sorry but voucher name already exist!"); return; } if ($this->insertData('{{voucher_new}}', $params)) { $this->details = Yii::app()->db->getLastInsertID(); $this->code = 1; $this->msg = Yii::t("default", "Successful"); } else { $this->msg = t("ERROR: Something went wrong"); } } }