当前位置: 首页>>代码示例>>PHP>>正文


PHP new_smarty函数代码示例

本文整理汇总了PHP中new_smarty函数的典型用法代码示例。如果您正苦于以下问题:PHP new_smarty函数的具体用法?PHP new_smarty怎么用?PHP new_smarty使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了new_smarty函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: do_payment

 function do_payment($payment_id, $member_id, $product_id, $price, $begin_date, $expire_date, &$vars)
 {
     global $config, $db;
     $amount = sprintf("%d", $price * 100);
     $parm = "merchant_id=" . $this->config["merchant"] . " merchant_country=fr amount={$amount} currency_code=978";
     $parm .= " pathfile=" . $this->config["pathfile"] . " transaction_id={$payment_id}";
     $parm .= " normal_return_url={$config['root_url']}/thanks.php";
     $parm .= " cancel_return_url={$config['root_url']}/cancel.php";
     $parm = "{$parm} automatic_response_url={$config['root_url']}/plugins/payment/webaffair/ipn.php";
     $result = exec($this->config["path_bin"] . " {$parm}");
     $tableau = explode("!", "{$result}");
     $code = $tableau[1];
     $error = $tableau[2];
     $message = $tableau[3];
     $t =& new_smarty();
     if ($code == "" && $error == "") {
         $output = "<BR><CENTER>erreur appel request</CENTER><BR>executable request non trouve " . $this->config["path_bin"];
     } elseif ($code != 0) {
         $output = "<center><b><h2>Erreur appel API de paiement.</h2></center></b><br><br><br>message erreur : {$error} <br>";
     } else {
         $output = "<br><br>{$error}<br>{$message} <br>";
     }
     $t->assign('output', $output);
     $t->display(dirname(__FILE__) . '/webaffair.html');
     exit;
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:26,代码来源:webaffair.inc.php

示例2: do_payment

 function do_payment($payment_id, $member_id, $product_id, $price, $begin_date, $expire_date, &$vars)
 {
     global $config, $db, $plugin_config;
     $payment = $db->get_payment($payment_id);
     $member = $db->get_user($member_id);
     $product =& get_product($product_id);
     $this_config = $plugin_config['payment']['gate2shop'];
     if ($this_config['testing']) {
         // currently HTTP POST requests use version=3.0.0 while HTTP GET requests use version=1.0.0
         $version = '1.0.0';
     } else {
         $version = '3.0.0';
     }
     $time_stamp = gmdate("Y-m-d.H:i:s");
     // current GMT time in the following format: YYYY-MM-DD.HH:MM:SS
     $vars = array('version' => $version, 'merchant_id' => $this_config['merchant_id'], 'merchant_site_id' => $this_config['site_id'], 'currency' => $product->config['gate2shop_currency'] ? $product->config['gate2shop_currency'] : 'USD', 'numberofitems' => '1', 'item_name_1' => $product->config['title'], 'item_amount_1' => $product->config['price'], 'item_quantity_1' => 1, 'total_amount' => $price, 'time_stamp' => $time_stamp, 'total_tax' => $payment['data']['TAX_AMOUNT'], 'productId' => $product_id, 'merchantLocale' => 'en_US', 'userid' => $member['member_id'], 'first_name' => $member['name_f'], 'last_name' => $member['name_l'], 'address1' => $member['street'], 'city' => $member['city'], 'state' => $member['state'], 'country' => $member['country'], 'zip' => $member['zip'], 'email' => $member['email'], 'invoice_id' => $payment['payment_id'] . "-" . $this->get_rand(3), 'customField1' => $payment['payment_id'], 'customData' => $payment['payment_id']);
     $vars['checksum'] = md5($this_config['secret'] . $vars['merchant_id'] . $vars['currency'] . $vars['total_amount'] . $vars['item_name_1'] . $vars['item_amount_1'] . $vars['item_quantity_1'] . $vars['time_stamp']);
     if ($this_config['method'] == 'GET') {
         $this->encode_and_redirect('https://secure.Gate2Shop.com/ppp/purchase.do', $vars);
         exit;
     } else {
         $t =& new_smarty();
         $t->assign('vars', $vars);
         $t->display(str_replace("c:\\", '/', dirname(__FILE__) . '/form.html'));
         exit;
     }
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:27,代码来源:gate2shop.inc.php

示例3: do_rebill

function do_rebill($vars)
{
    global $config;
    $d = strftime($config['date_format'], strtotime($vars['date']));
    $d1 = strftime($config['date_format'], strtotime($vars['date1']));
    $d2 = strftime($config['date_format'], strtotime($vars['date2']));
    $ds = date('Y-m-d', strtotime($vars['date']));
    $t = new_smarty();
    $t->display('admin/header.inc.html');
    print "<h1>Running Rebill for [{$d}], please wait patiently...</h1>";
    print "<p>Rebilling dates from [{$d1}] to [{$d2}].</p>";
    ob_end_flush();
    cc_core_rebill($vars['paysys_id'], $vars['date'], $from_cron = false);
    /// next
    $vars['date'] = date('Y-m-d', strtotime($vars['date']) + 3600 * 24);
    if ($vars['date'] > $vars['date2']) {
        print "<font size=3>Rebilling Finished! <a href='rebill.php'>Back to the form</a></font>";
        $t->display('admin/footer.inc.html');
        return;
    }
    $d = strftime($config['date_format'], strtotime($vars['date']));
    print <<<CUT
\t<form method=post>
\t<input type=submit name=confirm value="Process next date[{$d}]" />
\t<input type=hidden name=date value='{$vars['date']}' />
\t<input type=hidden name=date1 value='{$vars['date1']}' />
\t<input type=hidden name=date2 value='{$vars['date2']}' />
\t<input type=hidden name=paysys_id value='{$vars['paysys_id']}' />
\t</form>
CUT;
    $t->display('admin/footer.inc.html');
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:32,代码来源:rebill.php

示例4: do_payment

 function do_payment($payment_id, $member_id, $product_id, $price, $begin_date, $expire_date, &$vars)
 {
     global $config, $db;
     $payment = $db->get_payment($payment_id);
     $products = array();
     if (is_array($product_ids = $payment['data'][0]['BASKET_PRODUCTS'])) {
         foreach ($product_ids as $pid) {
             $pr = $db->get_product($pid);
             $pr['price'] = $payment['data'][0]['BASKET_PRICES'][$pid];
             $products[] = $pr;
         }
     } else {
         $products = array($db->get_product($product_id));
     }
     $t =& new_smarty();
     $t->template_dir = dirname(__FILE__);
     $t->assign('product', $products[0]);
     $t->assign('products', $products);
     $t->assign('payment', $payment);
     $t->assign('member', $db->get_user($member_id));
     $t->assign('price', $price);
     $t->assign('begin_date', $begin_date);
     $t->assign('expire_date', $expire_date);
     $t->assign('vars', $vars);
     $t->assign('config', $config);
     $t->display("offline.html");
     exit;
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:28,代码来源:offline.inc.php

示例5: do_payment

 function do_payment($payment_id, $member_id, $product_id, $price, $begin_date, $expire_date, &$vars)
 {
     global $db, $config, $plugin_config;
     $t =& new_smarty();
     $t->assign(array('this_config' => $this->config, 'member' => $db->get_user($member_id), 'payment' => $pm = $db->get_payment($payment_id), 'product' => $db->get_product($pm['product_id'])));
     $t->display(dirname(__FILE__) . '/paycom.html');
     exit;
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:8,代码来源:paycom.inc.php

示例6: do_bill

 function do_bill($amount, $title, $products, $member, $invoice)
 {
     global $config, $db;
     $product =& get_product($products[0]['product_id']);
     $vars = array('SITE_ID' => $this->config['site_id'], 'PRICING_ID' => $product->config['zombaio_id'], 'LANG' => $this->config['lang'], 'FirstName' => $member['name_f'], 'LastName' => $member['name_l'], 'Address' => $member['street'], 'Postal' => $member['zip'], 'City' => $member['city'], 'Email' => $member['email'], 'Username' => $member['login'], 'Password' => $member['pass'], 'INVOICE' => $invoice);
     $t =& new_smarty();
     $t->assign('vars', $vars);
     $t->display(dirname(__FILE__) . '/zombaio.html');
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:9,代码来源:zombaio.inc.php

示例7: do_payment

 function do_payment($payment_id, $member_id, $product_id, $price, $begin_date, $expire_date, &$vars)
 {
     global $config;
     global $db;
     $product =& get_product($product_id);
     $vars = array('MERCHKEY' => $this->config['merchkey'], 'TRANPAGE' => $this->config['tranpage'], 'TRANTYPE' => 'AUTHPOST', 'AMT' => sprintf("%.2f", $price), 'CURR' => $this->config['currency'], 'INVOICE' => $payment_id, 'TRANID' => "AMEMBER" . $payment_id, 'URLAPPROVED' => $config['root_url'] . "/thanks.php?member_id={$member_id}&{$product_id}={$product_id}&paysys_id=4cs&res=#RC#&fres=#FC#&ac=#APP#&ref=#REF#&tran=#TRANID#&payment_id=#INVOICE#&err=#EM#", 'URLOTHER' => $config['root_url'] . "/plugins/payment/4cs/cancel.php");
     $t =& new_smarty();
     $t->assign('vars', $vars);
     $t->display(dirname(__FILE__) . '/iframe.html');
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:10,代码来源:4cs.inc.php

示例8: do_payment

 function do_payment($payment_id, $member_id, $product_id, $price, $begin_date, $expire_date, &$vars)
 {
     global $config, $db, $plugin_config;
     $payment = $db->get_payment($payment_id);
     $member = $db->get_user($member_id);
     $product =& get_product($product_id);
     $this_config = $plugin_config['payment']['gtbill'];
     $vars = array('merchant_id' => $this_config['merchant_id'], 'site_id' => $this_config['site_id'], 'price_id' => $product->config['gtbill_price_id'], 'currency_id' => $product->config['gtbill_currency'] ? $product->config['gtbill_currency'] : 'USD', 'name_f' => $member['name_f'], 'name_l' => $member['name_l'], 'street' => $member['street'], 'city' => $member['city'], 'state' => $member['state'], 'country' => $member['country'], 'zip' => $member['zip'], 'email' => $member['email'], 'login' => $member['login'] . '-' . $this->get_rand(3), 'pass' => $member['pass'], 'payment_id' => $payment['payment_id']);
     $t =& new_smarty();
     $t->assign('vars', $vars);
     $t->display(str_replace("c:\\", '/', dirname(__FILE__) . '/form.html'));
     exit;
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:13,代码来源:gtbill.inc.php

示例9: do_payment

 function do_payment($payment_id, $member_id, $product_id, $price, $begin_date, $expire_date, &$vars)
 {
     global $db, $config, $plugin_config;
     $t =& new_smarty();
     $t->template_dir = dirname(__FILE__);
     $page_id = $this->config['page_id'];
     if (isset($vars['action']) && $vars['action'] == 'renew') {
         $page_id = $this->config['page_id2'];
     }
     $t->assign(array('header' => $config['root_dir'] . '/templates/header.html', 'footer' => $config['root_dir'] . '/templates/footer.html', 'this_config' => $this->config, 'page_id' => $page_id, 'member' => $db->get_user($member_id), 'payment' => $pm = $db->get_payment($payment_id), 'product' => $db->get_product($pm['product_id'])));
     $t->display('multicards.html');
     exit;
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:13,代码来源:multicards.inc.php

示例10: do_payment

 function do_payment($payment_id, $member_id, $product_id, $price, $begin_date, $expire_date, &$vars)
 {
     global $config;
     global $db;
     $product =& get_product($product_id);
     $member = $db->get_user($member_id);
     if (!$product->config['icepay_currency']) {
         $product->config['icepay_currency'] = "GBP";
     }
     $vars = array('merchant' => $this->config['merchkey'], 'amount' => intval($price * 100), 'currency' => $product->config['icepay_currency'], 'ic_country' => $member['country'], 'orderid' => $payment_id, 'reference' => "AMEMBER" . $payment_id, 'description' => $product->config['title'], 'visa_checksum' => sha1($this->config['secret'] . "|" . $this->config['merchkey'] . "|" . intval($price * 100) . "|" . $product->config['icepay_currency'] . "|" . $payment_id . "|CREDITCARD|VISA"), 'master_checksum' => sha1($this->config['secret'] . "|" . $this->config['merchkey'] . "|" . intval($price * 100) . "|" . $product->config['icepay_currency'] . "|" . $payment_id . "|CREDITCARD|MASTER"), 'amex_checksum' => sha1($this->config['secret'] . "|" . $this->config['merchkey'] . "|" . intval($price * 100) . "|" . $product->config['icepay_currency'] . "|" . $payment_id . "|CREDITCARD|AMEX"), 'urlcompleted' => $config['root_url'] . "/plugins/payment/icepay/thanks.php");
     $t =& new_smarty();
     $t->assign('vars', $vars);
     $t->display(dirname(__FILE__) . '/icepay.html');
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:14,代码来源:icepay.inc.php

示例11: do_payment

 function do_payment($payment_id, $member_id, $product_id, $price, $begin_date, $expire_date, &$vars)
 {
     global $config, $db;
     $product = $db->get_product($product_id);
     $vars = array('psb' => 'psb', 'biz' => $this->config['merchant_id'], 'inv' => $payment_id, 'itm' => substr($product['title'], 0, 200), 'amt' => $price, 'reqURL' => $config['root_url'] . "/plugins/payment/paysbuy/ipn.php", 'postURL' => $config['root_url'] . "/plugins/payment/paysbuy/thanks.php");
     if ($this->config['currency']) {
         $vars['currencyCode'] = $this->config['currency'];
     }
     //$db->log_error("PaySbuy SENT: " . paysbuy_get_dump($vars));
     $t =& new_smarty();
     $t->template_dir = dirname(__FILE__);
     $t->assign('vars', $vars);
     $t->display('paysbuy.html');
     exit;
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:15,代码来源:paysbuy.inc.php

示例12: do_bill

 function do_bill($amount, $title, $products, $u, $invoice)
 {
     global $config, $db, $plugin_config;
     $product = $products[0];
     $payment = $db->get_payment($invoice);
     $this_config = $plugin_config['payment']['realex_redirect'];
     $vars = array('merchant_id' => $this_config['merchant_id'], 'order_id' => $invoice, 'account' => $this_config['account'], 'amount' => $amount, 'currency' => $product['realex_redirect_currency'] ? $product['realex_redirect_currency'] : 'USD', 'timestamp' => date("YmdHis"), 'comment1' => $product['title'], 'cust_num' => $payment['member_id'], 'auto_settle_flag' => '1');
     $hash = $vars['timestamp'] . "." . $vars['merchant_id'] . "." . $vars['order_id'] . "." . $vars['amount'] . "." . $vars['currency'];
     $hash = md5($hash);
     $hash = $hash . "." . $this_config['secret'];
     $hash = md5($hash);
     $vars['md5hash'] = $hash;
     $t =& new_smarty();
     $t->assign('vars', $vars);
     $t->display(str_replace("c:\\", '/', dirname(__FILE__) . '/form.html'));
     exit;
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:17,代码来源:realex_redirect.inc.php

示例13: do_payment

 function do_payment($payment_id, $member_id, $product_id, $price, $begin_date, $expire_date, &$vars)
 {
     global $config;
     global $db;
     $orig_product_id = $product_id;
     if (is_array($product_id)) {
         $product_id = $product_id[0];
     }
     $product =& get_product($product_id);
     if (count($orig_product_id) > 1) {
         $product->config['title'] = $config['multi_title'];
     }
     $vars = array('merchant_id' => $this->config['merchant_id'], 'amount' => sprintf("%.2f", $price), 'currency' => $this->config['currency'], 'language' => 'en', 'display_text' => $product->config['title'], 'token' => md5(strtolower($this->config['merchant_id'] . ":" . sprintf("%.2f", $price) . ":" . $this->config['currency'] . ":") . $this->config['secret']), 'txt1' => $product->config['title'], 'txt2' => $payment_id, 'test_mode' => $this->config['testing']);
     $t =& new_smarty();
     $t->assign('vars', $vars);
     $t->display(dirname(__FILE__) . '/cashu.html');
     exit;
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:18,代码来源:cashu.inc.php

示例14: process_postback

 function process_postback($vars)
 {
     global $db, $t;
     $payment_id = $vars['payment_id'];
     //        if (!preg_match('/secure\.paymentclearing\.com/', $r=$_SERVER['HTTP_REFERER']))
     //            $this->postback_error("Bad Refering URL - $r");
     // process payment
     $err = $db->finish_waiting_payment($payment_id, $this->get_plugin_name(), $invoice, $amount = '', $vars);
     if ($err) {
         $this->postback_error("finish_waiting_payment error: {$err}");
     }
     $t =& new_smarty();
     $pm = $db->get_payment($payment_id);
     $t->assign('payment', $pm);
     $t->assign('product', $pr);
     $t->assign('member', $db->get_user($pm['member_id']));
     $t->display("thanks.html");
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:18,代码来源:itransact.inc.php

示例15: cc_bill

 function cc_bill($cc_info, $member, $amount, $currency, $product_description, $charge_type, $invoice, $payment)
 {
     global $config, $db;
     $log = array();
     if (!$this->config["notification"]) {
         $this->config["notification"] = 3;
     }
     if ($this->config["notification"] == 1 || $this->config["notification"] == 3) {
         $this->manual_cc_mail($cc_info, $member, $payment, $charge_type);
     }
     if ($this->config["notification"] == 2 || $this->config["notification"] == 3) {
         if ($charge_type != CC_CHARGE_TYPE_RECURRING) {
             save_cc_info($cc_info, $member, $payment['paysys_id']);
         }
     }
     if ($charge_type != CC_CHARGE_TYPE_RECURRING) {
         $t =& new_smarty();
         $product = $db->get_product($payment['product_id']);
         $t->assign('payment', $payment);
         $t->assign('product', $product);
         $t->assign('user', $member);
         if (!($prices = $payment['data'][0]['BASKET_PRICES'])) {
             $prices = array($payment['product_id'] => $payment['amount']);
         }
         $pr = array();
         $subtotal = 0;
         foreach ($prices as $product_id => $price) {
             $v = $db->get_product($product_id);
             $subtotal += $v['price'];
             $pr[$product_id] = $v;
         }
         $t->assign('subtotal', $subtotal);
         $t->assign('total', array_sum($prices));
         $t->assign('products', $pr);
         $t->display($config['root_dir'] . "/plugins/payment/manual_cc/thanks.html");
         exit;
     }
     return array(CC_RESULT_IGNORE, "", "", array());
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:39,代码来源:manual_cc.inc.php


注:本文中的new_smarty函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。