本文整理汇总了PHP中cw_display函数的典型用法代码示例。如果您正苦于以下问题:PHP cw_display函数的具体用法?PHP cw_display怎么用?PHP cw_display使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cw_display函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cw_checkout_show_cart
function cw_checkout_show_cart($action)
{
global $smarty;
$top_message =& cw_session_register('top_message');
$smarty->assign('top_message', $top_message);
$top_message = array();
$cart =& cw_session_register('cart', array());
$smarty->assign('cart', $cart);
$smarty->assign('action', $action);
header("Content-type: application/xml");
cw_display('customer/checkout/xml_cart.tpl', $smarty);
die;
}
示例2: order_tracking_redirect
function order_tracking_redirect()
{
global $smarty, $request_prepared;
cw_load('doc');
$order = cw_call('cw_doc_get', array($request_prepared['doc_id'], 0));
if (empty($order) || $order['info']['tracking'] != $request_prepared['tracking']) {
cw_header_location('index.php?target=error_message&error=access_denied&id=59');
}
$smarty->assign('order', $order);
$form = cw_display('addons/shipping_system/tracking.tpl', $smarty, false);
echo $form;
exit;
}
示例3: cw_send_mail
function cw_send_mail($from, $to, $subject_template, $body_template, $language = null, $crypted = false, $is_pdf = false, $files = array())
{
global $smarty;
global $current_language;
if (empty($to)) {
return;
}
$to = cw_real_mail_address($to);
$language = $language ? $language : $current_language;
$mail_subject = chop(cw_display($subject_template, $smarty, false, $language));
$mail_message = cw_display($body_template, $smarty, false, $language);
$_files = implode(",", $files);
cw_array2insert('mail_spool', cw_addslashes(array('mail_from' => $from, 'mail_to' => $to, 'subject' => $mail_subject, 'body' => $mail_message, 'crypted' => $crypted, 'pdf_copy' => $is_pdf, 'files' => $_files)));
return;
}
示例4: cw_web_get_layout_inner
function cw_web_get_layout_inner($sql)
{
global $tables, $smarty, $top_message;
$data = cw_query_first("select * from {$tables['layouts']} where {$sql}");
$data['data'] = unserialize($data['data']);
$smarty->assign('layout', $data);
$templates = cw_query("select * from {$tables['layouts_templates']} where layout_id='{$data['layout_id']}' order by orderby");
if (is_array($templates)) {
foreach ($templates as $template) {
$template['content'] = cw_display($template['template'], $smarty, false);
preg_match_all('/id[ ]*=[ ]*"(.*)"/Uims', $template['content'], $out);
$template['sub_ids'] = $out[1];
$data['parts'][] = $template;
}
}
unset($smarty->_included_files);
$data['elements'] = cw_query("select le.* from {$tables['layouts_elements']} as le where le.layout_id='{$data['layout_id']}' and display='none'");
return $data;
}
示例5: cw_spam
function cw_spam($message, $recipients, $send_language, $list_id)
{
global $config, $smarty;
global $current_language, $tables;
global $app_main_dir;
$saved_language = $current_language;
$current_language = $send_language;
$email_spec = "###EMAIL###";
$smarty->assign('email', $email_spec);
$smarty->assign('list_id', $list_id);
$signature_template = "mail/newsletter_signature.tpl";
$sign_delim = "\n\n";
$message['headers'] = array("Content-Type" => "text/html");
$sign_delim = "<br /><br />";
$signature = cw_display($signature_template, $smarty, false);
$extra = array("Content-Type" => "text/html");
foreach ($recipients as $recipient) {
cw_send_simple_mail($config['news']['newsletter_email'], $recipient, $message['subject'], $message['body'] . $sign_delim . preg_replace("/{$email_spec}/S", $recipient, $signature), $extra);
}
$current_language = $saved_language;
}
示例6: cw_pdf_generate
function cw_pdf_generate($file, $template, $save_to_file = false, $landscape = false, $pages_limit = 0, $page_margins = array('10', '10', '10', '10'), $show_pages = true)
{
global $smarty, $var_dirs, $current_location;
set_time_limit(2700);
ini_set('memory_limit', '512M');
$smarty->assign('is_pdf', true);
# kornev, only for A4 && 1024 p/wide
$wcr = $hcr = 1024 / 210;
$smarty->assign('wcr', $wcr);
$smarty->assign('hcr', $hcr);
if ($save_to_file && $file) {
$html = $file;
} else {
$html = cw_display($template, $smarty, false);
}
parse_config_file(HTML2PS_DIR . 'html2ps.config');
$pipeline = PipelineFactory::create_default_pipeline('', '');
$pipeline->fetchers[] = new MyFetcherMemory($html, $current_location);
if ($save_to_file) {
$pipeline->destination = new MyDestinationFile($save_to_file);
} else {
$pipeline->destination = new DestinationDownload($file);
}
if ($show_pages) {
$pipeline->pre_tree_filters[] = new PreTreeFilterHeaderFooter('', '<div>' . cw_get_langvar_by_name('lbl_page', null, false, true) . ' ##PAGE## / ##PAGES## </div>');
}
$pipeline->pre_tree_filters[] = new PreTreeFilterHTML2PSFields();
$media =& Media::predefined('A4');
$media->set_landscape($landscape);
$media->set_margins(array('left' => $page_margins[3], 'right' => $page_margins[1], 'top' => $page_margins[0], 'bottom' => $page_margins[2]));
$media->set_pixels(1024);
$g_config = array('cssmedia' => 'print', 'scalepoints' => '1', 'renderimages' => true, 'renderlinks' => false, 'renderfields' => false, 'renderforms' => false, 'mode' => 'html', 'encoding' => '', 'debugbox' => false, 'pdfversion' => '1.4', 'smartpagebreak' => true, 'draw_page_border' => false, 'html2xhtml' => false, 'method' => 'fpdf', 'pages_limit' => $pages_limit);
$pipeline->configure($g_config);
$pipeline->process_batch(array(''), $media);
if (!$save_to_file) {
exit(0);
}
}
示例7: cw_header_location
$cart_prods[$k] = $v;
}
}
$cart["products"] = $cart_prods;
} else {
$cart = "";
}
cw_header_location("cart.php?{$QUERY_STRING}");
}
$cart = cw_func_call('cw_cart_actions', array('action' => $action, 'products' => $products, 'userinfo' => $userinfo), $cart);
if ($action == 'ajax_update') {
$wcart = cw_func_call('cw_cart_get_warehouses_cart', array('cart' => $cart, 'products' => $products, 'userinfo' => $userinfo));
$smarty->assign('warehouses_cart', $wcart);
$smarty->assign('expired', !count($products));
$smarty->assign('products', $products);
cw_display('customer/cart/ajax_cart_js.tpl', $smarty);
exit(0);
}
# kornev, check the requirements before the checkout
if ($mode == 'checkout') {
if (cw_is_cart_empty($cart)) {
cw_header_location('index.php?target=' . $target);
}
cw_session_unregister('secure_oid');
if ($cart['info']['display_subtotal'] < $config['General']['minimal_order_amount'] && $config['General']['minimal_order_amount'] > 0) {
cw_header_location('index.php?target=error_message&error=min_order');
}
if ($config['General']['maximum_order_amount'] > 0 && $cart['info']['display_subtotal'] > $config['General']['maximum_order_amount']) {
cw_header_location("index.php?target=error_message&max_order");
}
if ($config['General']['maximum_order_items'] > 0 && cw_cart_count_items($cart) > $config['General']['maximum_order_items']) {
示例8: die
<?php
if (!defined('APP_START')) {
die('Access denied');
}
cw_load('accounting');
$smarty->assign('subcategories', cw_accounting_get_subcategories($cat, $current_category));
$smarty->assign('current_category', $current_category);
$smarty->assign('name', $name);
$smarty->assign('id', $id);
$smarty->assign('index', $index);
$smarty->assign('name', $name);
$smarty->assign('el_name', $el_name);
$smarty->assign('multiple', $multiple);
$smarty->assign('parent_category_id', $cat);
cw_display('main/ajax/accounting_categories.tpl', $smarty);
exit(0);
示例9: cw_load
<?php
cw_load('category');
$smarty->assign('subcategories', cw_category_get_subcategories($cat, $current_category));
$smarty->assign('current_category', $current_category);
$smarty->assign('name', $name);
$smarty->assign('id', $id);
$smarty->assign('index', $index);
$smarty->assign('el_name', $el_name);
$smarty->assign('multiple', $multiple);
$smarty->assign('parent_category_id', $cat);
$smarty->assign('return_type', $return_type);
cw_display('main/ajax/categories.tpl', $smarty);
exit(0);
示例10: cw_load
<?php
cw_load('user');
$smarty->assign('el_membership', $el_membership);
$smarty->assign('memberships', cw_user_get_memberships($usertype));
cw_display('main/ajax/memberships.tpl', $smarty);
exit(0);
示例11: cw_include
}
#
# If gcindex is empty - add
# overwise - update
#
if (!$fill_error && !$amount_error) {
if (!empty($addons['Gift_Certificates']) && $action == "addgc2wl") {
cw_include('addons/Wishlist/wishlist.php');
}
if ($mode == "preview") {
$smarty->assign('giftcerts', array($giftcert));
header("Content-Type: text/html");
header("Content-Disposition: inline; filename=giftcertificates.html");
$_tmp_smarty_debug = $smarty->debugging;
$smarty->debugging = false;
cw_display("addons/Gift_Certificates/gc_customer_print.tpl", $smarty);
$smarty->debugging = $_tmp_smarty_debug;
exit;
}
if (isset($gcindex) && isset($cart['giftcerts'][$gcindex])) {
$cart['giftcerts'][$gcindex] = $giftcert;
} else {
$cart['giftcerts'][] = $giftcert;
}
cw_header_location("index.php?target=cart");
}
} elseif ($action == "delgc") {
#
# Remove GC from cart
#
array_splice($cart['giftcerts'], $gcindex, 1);
示例12: cw_display
<?php
# kornev, TOFIX
require $app_main_dir . "/include/popup_print_sn.php";
cw_display("main/popup_print_sn.tpl", $smarty);
示例13: dod_get_coupons_ajax
function dod_get_coupons_ajax()
{
global $smarty, $dod_type;
$smarty->assign('dod_coupons', dod_get_coupons());
$smarty->assign('dod_type', $dod_type);
//$smarty->fetch('addons/deal_of_day/admin/coupons.tpl', null, null, true);
cw_display('addons/deal_of_day/admin/coupons.tpl', $smarty);
exit(0);
}
示例14: cw_load
cw_load('barcode');
cw_barcode_get($barcode, $type, $width, $height);
exit;
}
if ($mode == 'categories') {
cw_include('include/ajax/categories.php');
}
if (in_array($mode, array('counties', 'states', 'regions', 'cities'))) {
cw_include('include/map/ajax_countries.php');
}
if ($mode == 'aom') {
cw_include('include/orders/order_edit_ajax.php');
}
// < Old style AJAX JSON requests
if ($mode == 'map') {
/* mode "map" acceptes following parameters
country - country code
state - state code
name - name of fields, which will be extended by [state] and [country]
*/
cw_include('include/map/ajax_map.php');
}
if (!empty($top_message)) {
$top_message = array();
}
$smarty->assign('is_ajax', $is_ajax);
$smarty->assign('ajax_blocks', $ajax_blocks);
// XML AJAX response
header('Content-type: text/xml');
cw_display('main/ajax/ajax_response.tpl', $smarty);
exit(0);
示例15: cw_header_location
}
}
cw_header_location("index.php?target=salesman_report");
} elseif ($action == 'export') {
$smarty->assign("delimiter", $delimiter);
$report = cw_query("SELECT {$tables['customers']}.*, {$tables['salesman_plans']}.min_paid, SUM(IF({$tables['docs']}.status NOT IN ('P', 'C'), {$tables['salesman_payment']}.commissions, 0)) as sum, SUM(IF({$tables['salesman_payment']}.paid = 'Y' AND {$tables['docs']}.status IN ('P', 'C'), {$tables['salesman_payment']}.commissions, 0)) as sum_paid, SUM(IF({$tables['salesman_payment']}.paid <> 'Y' AND {$tables['docs']}.status IN ('P', 'C'), {$tables['salesman_payment']}.commissions, 0)) as sum_nopaid, IF(SUM(IF(({$tables['salesman_payment']}.paid <> 'Y' AND {$tables['docs']}.status IN ('P', 'C')), {$tables['salesman_payment']}.commissions, 0)) >= {$tables['salesman_plans']}.min_paid, 'Y', '') as is_paid FROM {$tables['customers']}, {$tables['salesman_payment']}, {$tables['salesman_commissions']}, {$tables['salesman_plans']}, {$tables['docs']} WHERE {$tables['salesman_plans']}.plan_id = {$tables['salesman_commissions']}.plan_id AND {$tables['salesman_commissions']}.salesman_customer_id={$tables['customers']}.customer_id AND {$tables['customers']}.customer_id={$tables['salesman_payment']}.salesman_customer_id AND {$tables['docs']}.doc_id = {$tables['salesman_payment']}.doc_id AND {$tables['customers']}.usertype = 'B' AND {$tables['customers']}.status = 'Y' GROUP BY {$tables['customers']}.customer_id" . ($use_limit == 'Y' ? " HAVING is_paid = 'Y'" : ""));
if ($report) {
foreach ($report as $key => $value) {
foreach ($value as $rk => $rv) {
$report[$key][$rk] = '"' . str_replace("\"", "\"\"", $report[$key][$rk]) . '"';
}
}
}
$smarty->assign("report", $report);
header("Content-Type: text/csv");
header("Content-Disposition: attachment; filename=salesman_report.csv");
cw_display("admin/main/salesman_report_export.tpl", $smarty);
exit;
}
$result = cw_query("SELECT {$tables['customers']}.customer_id, {$tables['salesman_plans']}.min_paid, SUM(IF({$tables['docs']}.status NOT IN ('P', 'C'), {$tables['salesman_payment']}.commissions, 0)) as sum, SUM(IF({$tables['salesman_payment']}.paid = 'Y' AND {$tables['docs']}.status IN ('P', 'C'), {$tables['salesman_payment']}.commissions, 0)) as sum_paid, SUM(IF({$tables['salesman_payment']}.paid <> 'Y' AND {$tables['docs']}.status IN ('P', 'C'), {$tables['salesman_payment']}.commissions, 0)) as sum_nopaid, IF(SUM(IF(({$tables['salesman_payment']}.paid <> 'Y' AND {$tables['docs']}.status IN ('P', 'C')), {$tables['salesman_payment']}.commissions, 0)) >= {$tables['salesman_plans']}.min_paid, 'Y', '') as is_paid FROM {$tables['customers']}, {$tables['salesman_payment']}, {$tables['salesman_commissions']}, {$tables['salesman_plans']}, {$tables['docs']} WHERE {$tables['salesman_plans']}.plan_id = {$tables['salesman_commissions']}.plan_id AND {$tables['salesman_commissions']}.salesman_customer_id={$tables['customers']}.customer_id AND {$tables['customers']}.customer_id={$tables['salesman_payment']}.salesman_customer_id AND {$tables['docs']}.doc_id = {$tables['salesman_payment']}.doc_id AND {$tables['customers']}.usertype = 'B' AND {$tables['customers']}.status = 'Y' GROUP BY {$tables['customers']}.customer_id" . ($use_limit == 'Y' ? " HAVING is_paid = 'Y'" : ""));
if ($result) {
foreach ($result as $k => $v) {
if ($v['is_paid']) {
$is_paid = 'Y';
}
}
$smarty->assign("is_paid", $is_paid);
}
$smarty->assign("result", $result);
$smarty->assign('use_limit', $use_limit);
$smarty->assign('main', 'report');