예제 #1
0
 public function merchantOffers()
 {
     $merchant_id = Yii::app()->functions->getMerchantID();
     $slug = $this->data['slug'];
     $stmt = "SELECT * FROM\r\n\t\t\t{{offers}}\r\n\t\t\tWHERE\r\n\t\t\tmerchant_id=" . $this->q($merchant_id) . "\r\n\t\t\tORDER BY offers_id DESC\r\n\t\t\t";
     if ($res = $this->rst($stmt)) {
         foreach ($res as $val) {
             $action = "<div class=\"options\">\r\n    \t    \t\t<a href=\"{$slug}/Do/Add/?id={$val['offers_id']}\" >" . Yii::t("default", "Edit") . "</a>\r\n    \t    \t\t<a href=\"javascript:;\" class=\"row_del\" rev=\"{$val['offers_id']}\" >" . Yii::t("default", "Delete") . "</a>\r\n    \t    \t\t</div>";
             /*$date=Yii::app()->functions->prettyDate($val['date_created']);	
               $date=Yii::app()->functions->translateDate($date); */
             $date = FormatDateTime($val['date_created']);
             $feed_data['aaData'][] = array($val['offers_id'], standardPrettyFormat($val['offer_percentage']) . " %" . $action, standardPrettyFormat($val['offer_price']), FormatDateTime($val['valid_from'], false), FormatDateTime($val['valid_to'], false), $date . "<br/><div class=\"uk-badge {$class}\">" . strtoupper(Yii::t("default", $val['status'])) . "</div>");
         }
         $this->otableOutput($feed_data);
     }
     $this->otableNodata();
 }
예제 #2
0
</td>
<td width="5%"><?php 
        echo t($val['trans_type']);
        ?>
</td>
<td width="5%">
  <a href="javascript:;" class="view-receipt" data-id="<?php 
        echo $val['order_id'];
        ?>
"><?php 
        echo $val['order_id'];
        ?>
</a>
</td>
<!--<td width="5%"><?php 
        echo displayPrice(getCurrencyCode(), standardPrettyFormat($val['voucher_amount']));
        ?>
</td>-->
<td width="5%"><?php 
        echo FormatDateTime($val['date_created']);
        ?>
</td>
</tr>
<?php 
    }
    ?>
</tbody>
</table>

      
<?php 
예제 #3
0
echo Yii::t("default", "Offer Percentage");
?>
</label>
  <?php 
echo CHtml::textField('offer_percentage', isset($data['offer_percentage']) ? number_format($data['offer_percentage'], 0) : "", array('class' => 'numeric_only', 'data-validation' => "required"));
?>
 %
</div>

<div class="uk-form-row">
  <label class="uk-form-label"><?php 
echo Yii::t("default", "Orders Over");
?>
</label>
  <?php 
echo CHtml::textField('offer_price', isset($data['offer_price']) ? standardPrettyFormat($data['offer_price']) : "", array('class' => 'numeric_only', 'data-validation' => "required"));
?>
</div>

<div class="uk-form-row">
  <label class="uk-form-label"><?php 
echo Yii::t("default", "Valid From");
?>
</label>
  <?php 
echo CHtml::hiddenField('valid_from', isset($data['valid_from']) ? $data['valid_from'] : "");
?>
  <?php 
echo CHtml::textField('valid_from2', isset($data['valid_from']) ? $data['valid_from'] : "", array('class' => 'j_date', 'data-validation' => "required", 'data-id' => "valid_from"));
?>
</div>
예제 #4
0
 public function MerchantSendBankInstruction($merchant_id = '', $amount = '', $ref = '')
 {
     $amount = standardPrettyFormat($amount);
     $link = Yii::app()->getBaseUrl(true) . "/store/depositverify/?ref=" . $ref;
     $links = "<a href=\"{$link}\" target=\"_blank\" >" . Yii::t("default", "Click on this link") . "</a>";
     $sender = Yii::app()->functions->getOption('merchant_deposit_sender', $merchant_id);
     $subject = Yii::app()->functions->getOption('merchant_deposit_subject', $merchant_id);
     $instructions = Yii::app()->functions->getOption('merchant_deposit_instructions', $merchant_id);
     $instructions = smarty('amount', displayPrice(adminCurrencySymbol(), $amount), $instructions);
     $instructions = smarty('verify-payment-link', $links, $instructions);
     $client_info = Yii::app()->functions->getClientInfo(Yii::app()->functions->getClientId());
     if (is_array($client_info) && count($client_info) >= 1) {
         Yii::app()->functions->sendEmail($client_info['email_address'], '', $subject, $instructions);
     }
     return false;
 }
예제 #5
0
if (isset($_GET['renew'])) {
    $extra_params = "/renew/1/package_id/" . $package_id;
}
if ($res = Yii::app()->functions->getMerchantByToken($my_token)) {
    if (isset($_GET['renew'])) {
        if ($new_info = Yii::app()->functions->getPackagesById($package_id)) {
            $res['package_name'] = $new_info['title'];
            $res['package_price'] = $new_info['price'];
            if ($new_info['promo_price'] > 0) {
                $res['package_price'] = $new_info['promo_price'];
            }
        }
    }
    $merchant_id = $res['merchant_id'];
    $payment_description = "Membership Package - " . $res['package_name'];
    $amount_to_pay = standardPrettyFormat($res['package_price']);
    if (isset($_POST['x_card_num'])) {
        define("AUTHORIZENET_API_LOGIN_ID", $autho_api_id);
        define("AUTHORIZENET_TRANSACTION_KEY", $autho_key);
        define("AUTHORIZENET_SANDBOX", $mode_autho == "sandbox" ? true : false);
        //define("TEST_REQUEST", $mode_autho=="sandbox"?"FALSE":"TRUE");
        require_once 'anet_php_sdk/AuthorizeNet.php';
        $transaction = new AuthorizeNetAIM();
        $transaction->setSandbox(AUTHORIZENET_SANDBOX);
        $params = array('company' => $res['restaurant_name'], 'description' => $payment_description, 'amount' => $amount_to_pay, 'card_num' => $_POST['x_card_num'], 'exp_date' => $_POST['expiration_month'] . "/" . $_POST['expiration_yr'], 'first_name' => $_POST['x_first_name'], 'last_name' => $_POST['x_last_name'], 'address' => $_POST['x_address'], 'city' => $_POST['x_city'], 'state' => $_POST['x_state'], 'country' => $_POST['x_country'], 'zip' => $_POST['x_zip'], 'card_code' => $_POST['cvv']);
        //dump($params);
        //die();
        $transaction->setFields($params);
        $response = $transaction->authorizeAndCapture();
        if ($response->approved) {
            $resp_transaction = $response->transaction_id;
예제 #6
0
echo Yii::t("default", "Package Name");
?>
</label>
  <span class="uk-text-bold"><?php 
echo isset($data['package_name']) ? ucwords($data['package_name']) : "Not Available";
?>
</span>
  </div>
  
  <div class="uk-form-row">
  <label class="uk-form-label"><?php 
echo Yii::t("default", "Package Price");
?>
</label>
  <span class="uk-text-primary"><?php 
echo adminCurrencySymbol() . standardPrettyFormat($data['package_price']);
?>
</span>
  </div>
  
  <div class="uk-form-row">
  <label class="uk-form-label"><?php 
echo Yii::t("default", "Membership Expired On");
?>
</label>
  <span class="uk-text-success">
   <?php 
if ($data['membership_expired'] != "0000-00-00") {
    ?>
   <?php 
    $date = date("F d Y", strtotime($data['membership_expired']));
예제 #7
0
?>
<div class="page-right-sidebar payment-option-page">
  <div class="main">  
  
  <?php 
if (!empty($error)) {
    ?>
  <p class="uk-text-danger"><?php 
    echo $error;
    ?>
</p>  
  <?php 
} else {
    ?>
  
  <h3><?php 
    echo t("Amount") . " " . displayPrice(adminCurrencySymbol(), standardPrettyFormat($amount_to_pay));
    ?>
</h3>
    
  <?php 
    echo $forms;
    ?>
  
  <?php 
}
?>
      
  
  </div>
</div>
예제 #8
0
    echo Yii::t("default", "Package Type");
    ?>
:</label>  
  <span class="uk-text-muted"><?php 
    echo $res['title'];
    ?>
</span>
  </div>
  
  <div class="uk-form-row">
  <label class="uk-form-label"><?php 
    echo Yii::t("default", "Price");
    ?>
:</label>  
  <span class="uk-text-muted"><?php 
    echo standardPrettyFormat($res['package_price']);
    ?>
</span>
  </div>
  
  <div class="uk-form-row">
  <label class="uk-form-label"><?php 
    echo Yii::t("default", "SMS Credits");
    ?>
:</label>  
  <span class="uk-text-muted"><?php 
    echo $res['sms_limit'];
    ?>
</span>
  </div>
  
예제 #9
0
        ?>
   <?php 
        echo t("To");
        ?>
   <?php 
        echo CHtml::textField('distance_to[]', $val['distance_to'], array('class' => "numeric_only", "placeholder" => t("To")));
        ?>
   </td>
   <td class="shipping-col-2">
   <?php 
        echo CHtml::dropDownList('shipping_units[]', $val['shipping_units'], Yii::app()->functions->distanceOption());
        ?>
   </td>
   <td class="shipping-col-3">
   <?php 
        echo CHtml::textField('distance_price[]', standardPrettyFormat($val['distance_price']), array('class' => "numeric_only"));
        ?>
   </td>
   <td>
   <?php 
        if ($x != 0) {
            ?>
   <a href="javascript:;" class="shipping-remove" data-id="<?php 
            echo $x;
            ?>
"><i class="fa fa-times"></i></a>
   <?php 
        }
        ?>
   </td>
 </tr>
예제 #10
0
 public function actionProcessPayout()
 {
     $db_ext = new DbExt();
     $paypal_client_id = yii::app()->functions->getOptionAdmin('wd_paypal_client_id');
     $paypal_client_secret = yii::app()->functions->getOptionAdmin('wd_paypal_client_secret');
     $paypal_config = Yii::app()->functions->getPaypalConnectionWithdrawal();
     dump($paypal_config);
     $Paypal = new Paypal($paypal_config);
     $Paypal->debug = true;
     $website_title = yii::app()->functions->getOptionAdmin('website_title');
     $cron = new CronFunctions();
     if ($res = $cron->getPayoutToProcess()) {
         if (is_array($res) && count($res) >= 1) {
             foreach ($res as $val) {
                 $withdrawal_id = $val['withdrawal_id'];
                 $api_raw_response = '';
                 $status_msg = '';
                 dump($val);
                 switch ($val['payment_method']) {
                     case "paypal":
                         dump("Process paypal");
                         //if (!empty($paypal_client_id) && !empty($paypal_client_secret)){
                         if (is_array($paypal_config) && count($paypal_config) >= 1) {
                             if ($val['account'] != "") {
                                 $Paypal->params['RECEIVERTYPE'] = "EmailAddress";
                                 $Paypal->params['CURRENCYCODE'] = "USD";
                                 $Paypal->params['EMAILSUBJECT'] = "=You have a payment from " . $website_title;
                                 $Paypal->params['L_EMAIL0'] = $val['account'];
                                 $Paypal->params['L_AMT0'] = normalPrettyPrice($val['amount']);
                                 $Paypal->params['L_UNIQUEID0'] = str_pad($val['withdrawal_id'], 10, "0");
                                 if ($pay_resp = $Paypal->payout()) {
                                     dump($pay_resp);
                                     if ($pay_resp['ACK'] == "Success") {
                                         $status_msg = 'paid';
                                         $api_raw_response = json_encode($pay_resp);
                                     } else {
                                         $api_raw_response = json_encode($pay_resp);
                                         $status_msg = $pay_resp['L_LONGMESSAGE0'];
                                     }
                                 } else {
                                     $status_msg = $Paypal->getError();
                                 }
                             } else {
                                 $status_msg = t("Paypal account is empty");
                             }
                         } else {
                             $status_msg = t("Payout settings for paypal not yet set");
                         }
                         break;
                     case "bank":
                         $status_msg = 'paid';
                         break;
                 }
                 echo "<h3>Update status</h3>";
                 dump($api_raw_response);
                 dump($status_msg);
                 $params_update = array('date_process' => date('c'), 'api_raw_response' => $api_raw_response, 'status' => $status_msg);
                 dump($params_update);
                 if ($db_ext->updateData("{{withdrawal}}", $params_update, 'withdrawal_id', $withdrawal_id)) {
                     echo "<h2>Update ok</h2>";
                 } else {
                     echo "<h2>Update Failed</h2>";
                 }
                 if ($status_msg == "paid") {
                     // send email
                     $subject = yii::app()->functions->getOptionAdmin('wd_template_process_subject');
                     if (empty($subject)) {
                         $subject = t("Your Request for Withdrawal has been Processed");
                     }
                     if ($merchant_info = Yii::app()->functions->getMerchant($val['merchant_id'])) {
                         $merchant_email = $merchant_info['contact_email'];
                         $tpl = yii::app()->functions->getOptionAdmin('wd_template_process');
                         $tpl = smarty("merchant-name", $merchant_info['restaurant_name'], $tpl);
                         $tpl = smarty("payout-amount", standardPrettyFormat($val['amount']), $tpl);
                         $tpl = smarty("payment-method", $val['payment_method'], $tpl);
                         $tpl = smarty("acoount", $val['account'], $tpl);
                         dump($tpl);
                         if (!empty($tpl)) {
                             sendEmail($merchant_email, '', $subject, $tpl);
                         }
                     }
                 }
             }
         }
     } else {
         dump("No record to process");
     }
 }
  <h5><?php 
echo t("Commission Click here");
?>
</h5>
  <?php 
if ($commision_type == "fixed") {
    ?>
  
  <p><?php 
    echo displayPrice($currency, $percent) . " " . t("commission per order");
    ?>
.</p>
  <?php 
} else {
    ?>
  <p><?php 
    echo standardPrettyFormat($percent) . "% " . t("commission per order");
    ?>
.</p>
  <?php 
}
?>
  </a>
  </li>
  
  </div>
   
  <div class="clear"></div>
  
  </div> <!--main-->
</div> <!--page-->
예제 #12
0
function getDeliveryDistance2($from_address = '', $merchant_address = '', $country_code = '')
{
    $miles = 0;
    $miles_raw = 0;
    $kms = 0;
    if ($distance = getDistance($from_address, $merchant_address, $country_code, true)) {
        $miles = $distance->rows[0]->elements[0]->distance->text;
        $miles_raw = str_replace(array(" ", "mi"), "", $miles);
        $km = $distance->rows[0]->elements[0]->distance->value;
        //$kms=($km * 0.621371 / 1000);
        $kms = miles2kms(unPrettyPrice($miles_raw));
        $kms = standardPrettyFormat($kms);
    }
    return array('mi' => $miles_raw, 'km' => $kms);
}
예제 #13
0
    ?>
   <li class="child-li li-click2" data-id="bank" data-type="payment-method" data-minimum="<?php 
    echo $wd_bank_minimum;
    ?>
">  
     <div class="box-grey">
       <h4><?php 
    echo t("Bank");
    ?>
</h4>
       <div class="inner">
       <p><?php 
    echo t("Minimum");
    ?>
 <?php 
    echo displayPrice(baseCurrency(), standardPrettyFormat($wd_bank_minimum));
    ?>
</p>
       </div>
     </div> <!--box-->  
                    
   </li>
   <?php 
}
?>
</ul>
<div class="clear"></div>


<div class="bank-info-wrap">
예제 #14
0
  <label class="uk-form-label"><?php 
echo Yii::t("default", "Price");
?>
</label>
  <?php 
echo CHtml::textField('price', isset($data['price']) ? standardPrettyFormat($data['price']) : "", array('class' => 'uk-form-width-medium numeric_only', 'data-validation' => "required"));
?>
</div>

<div class="uk-form-row">
  <label class="uk-form-label"><?php 
echo Yii::t("default", "Promo Price");
?>
</label>
  <?php 
echo CHtml::textField('promo_price', isset($data['promo_price']) ? standardPrettyFormat($data['promo_price']) : "", array('class' => 'uk-form-width-medium numeric_only'));
?>
</div>


<div class="uk-form-row">
  <label class="uk-form-label"><?php 
echo Yii::t("default", "Fax Credit Limit");
?>
</label>
  <?php 
echo CHtml::textField('fax_limit', isset($data['fax_limit']) ? $data['fax_limit'] : "", array('class' => 'uk-form-width-medium numeric_only', 'data-validation' => "required"));
?>
</div>

예제 #15
0
       <?php 
        if ($val['promo_price'] >= 1) {
            ?>
         <p class="promo"><?php 
            echo adminCurrencySymbol() . standardPrettyFormat($val['price']);
            ?>
</p>
         <p><?php 
            echo adminCurrencySymbol() . standardPrettyFormat($val['promo_price']);
            ?>
</p>
       <?php 
        } else {
            ?>
        <p><?php 
            echo adminCurrencySymbol() . standardPrettyFormat($val['price']);
            ?>
</p>
       <?php 
        }
        ?>
       <p><?php 
        echo Yii::t("default", "Fax Credit");
        ?>
: <?php 
        echo $val['fax_limit'];
        ?>
</p>
       
       <p class="uk-text-muted"><?php 
        echo Yii::t("default", "Take this package");
예제 #16
0
    if ($res['promo_price'] >= 1) {
        ?>
       <span class="normal-price uk-text-danger">
       <?php 
        echo Yii::app()->functions->adminCurrencySymbol() . standardPrettyFormat($res['price']);
        ?>
       </span>
       <span class="uk-text-success"><?php 
        echo Yii::app()->functions->adminCurrencySymbol() . standardPrettyFormat($res['promo_price']);
        ?>
</span>
       <?php 
    } else {
        ?>
       <span class="uk-text-success"><?php 
        echo Yii::app()->functions->adminCurrencySymbol() . standardPrettyFormat($res['price']);
        ?>
</span>
       <?php 
    }
    ?>
  </div>
  
  <div class="uk-form-row">
  <label class="uk-form-label"><?php 
    echo Yii::t("default", "Membership Limit");
    ?>
</label>
  <?php 
    if ($res['expiration_type'] == "year") {
        ?>
예제 #17
0
 public function faxTransactionList()
 {
     $slug = $this->data['slug'];
     $stmt = "SELECT a.*,\n\t\t(\n\t\tselect restaurant_name\n\t\tfrom\n\t\t{{merchant}} \n\t\twhere\n\t\tmerchant_id=a.merchant_id\n\t\tlimit 0,1\n\t\t) merchant_name,\n\t\t\n\t\t(\n\t\tselect title\n\t\tfrom\n\t\t{{fax_package}}\n\t\twhere\n\t\tfax_package_id=a.fax_package_id\n\t\tlimit 0,1\n\t\t) fax_package_name\n\t\t\n\t\t FROM\n\t\t{{fax_package_trans}} a\n\t\tORDER BY id DESC\n\t\t";
     if ($res = $this->rst($stmt)) {
         foreach ($res as $val) {
             $action = "<div class=\"options\">\n\t    \t\t<a href=\"{$slug}/Do/Add/?id={$val['id']}\" >" . Yii::t("default", "Edit") . "</a>\n\t    \t\t<a href=\"javascript:;\" class=\"row_del\" rev=\"{$val['id']}\" >" . Yii::t("default", "Delete") . "</a>\n\t    \t\t</div>";
             /*$date=Yii::app()->functions->prettyDate($val['date_created']);
               $date=Yii::app()->functions->translateDate($date);   */
             $date = FormatDateTime($val['date_created']);
             $feed_data['aaData'][] = array($val['id'], ucwords($val['merchant_name']) . $action, ucwords($val['fax_package_name']), standardPrettyFormat($val['package_price']), $val['fax_limit'], strtoupper($val['payment_type']), $date . "<br/><div class=\"uk-badge {$class}\">" . strtoupper(Yii::t("default", $val['status'])) . "</div>");
         }
         $this->otableOutput($feed_data);
     }
     $this->otableNodata();
 }