• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP zen_date_diff函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: while

    ?>
</td>
				<td class="smallText" align="center"><?php 
    echo TEXT_DOWNLOAD_MAX_COUNT;
    ?>
</td>
			</tr>
<?php 
    // add legend
    while (!$orders_download->EOF) {
        // $order->info['date_purchased'] . ' vs ' . (zen_date_diff($order->info['date_purchased'], date('Y-m-d')) > $orders_download->fields['download_maxdays'] ? 'NO' : 'YES') . ' vs ' .
        switch (true) {
            case $orders_download->fields['download_maxdays'] <= 0 && $orders_download->fields['download_count'] <= 0:
                $zc_file_status = TEXT_INFO_EXPIRED_DATE . '<a href="' . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $_GET['oID'] . '&action=edit&download_reset_on=' . $orders_download->fields['orders_products_download_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_yellow_on.gif', IMAGE_ICON_STATUS_EXPIRED) . '</a>';
                break;
            case $orders_download->fields['download_maxdays'] != 0 && zen_date_diff($order->info['date_purchased'], date('Y-m-d')) > $orders_download->fields['download_maxdays']:
                $zc_file_status = TEXT_INFO_EXPIRED_DATE . '<a href="' . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $_GET['oID'] . '&action=edit&download_reset_on=' . $orders_download->fields['orders_products_download_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_yellow_on.gif', IMAGE_ICON_STATUS_EXPIRED) . '</a>';
                break;
            case $orders_download->fields['download_maxdays'] == 0:
                $zc_file_status = '<a href="' . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $_GET['oID'] . '&action=edit&download_reset_off=' . $orders_download->fields['orders_products_download_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_CURRENT) . '</a>';
                break;
            case $orders_download->fields['download_maxdays'] > 0 and $orders_download->fields['download_count'] > 0:
                $zc_file_status = '<a href="' . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $_GET['oID'] . '&action=edit&download_reset_off=' . $orders_download->fields['orders_products_download_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_CURRENT) . '</a>';
                break;
                /*
                 * case ($orders_download->fields['download_maxdays'] <= 1 or $orders_download->fields['download_count'] <= 1): $zc_file_status = TEXT_INFO_EXPIRED_COUNT . '<a href="' . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $_GET['oID'] . '&action=edit&download_reset_on=' . $orders_download->fields['orders_products_download_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_yellow_on.gif', IMAGE_ICON_STATUS_EXPIRED) . '</a>'; break;
                 */
            /*
             * case ($orders_download->fields['download_maxdays'] <= 1 or $orders_download->fields['download_count'] <= 1): $zc_file_status = TEXT_INFO_EXPIRED_COUNT . '<a href="' . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $_GET['oID'] . '&action=edit&download_reset_on=' . $orders_download->fields['orders_products_download_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_yellow_on.gif', IMAGE_ICON_STATUS_EXPIRED) . '</a>'; break;
             */
            case $orders_download->fields['download_maxdays'] != 0 && $orders_download->fields['download_count'] <= 1:
开发者ID:wwxgitcat,项目名称:zencart_v1.0,代码行数:31,代码来源:orders_download.php


示例2: ipn_update_orders_status_and_history

/**
 * Write order-history update to ZC tables denoting the update supplied by the IPN
 */
function ipn_update_orders_status_and_history($ordersID, $new_status = 1, $txn_type)
{
    global $db;
    ipn_debug_email('IPN NOTICE :: Updating order #' . (int) $ordersID . ' to status: ' . (int) $new_status . ' (txn_type: ' . $txn_type . ')');
    $db->Execute("update " . TABLE_ORDERS . "\n                  set orders_status = '" . (int) $new_status . "'\n                  where orders_id = '" . (int) $ordersID . "'");
    $sql_data_array = array('orders_id' => (int) $ordersID, 'orders_status_id' => (int) $new_status, 'date_added' => 'now()', 'comments' => 'PayPal status: ' . $_POST['payment_status'] . ' ' . ' @ ' . $_POST['payment_date'] . ($_POST['parent_txn_id'] != '' ? "\n" . ' Parent Trans ID:' . $_POST['parent_txn_id'] : '') . "\n" . ' Trans ID:' . $_POST['txn_id'] . "\n" . ' Amount: ' . $_POST['mc_gross'] . ' ' . $_POST['mc_currency'], 'customer_notified' => false);
    zen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
    ipn_debug_email('IPN NOTICE :: Update complete.');
    /**
     * Activate any downloads associated with an order which has now been cleared
     */
    if ($txn_type == 'echeck-cleared' || $txn_type == 'express-checkout-cleared' || substr($txn_type, 0, 8) == 'cleared-') {
        $check_status = $db->Execute("select date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int) $ordersID . "'");
        $zc_max_days = zen_date_diff($check_status->fields['date_purchased'], date('Y-m-d H:i:s', time())) + (int) DOWNLOAD_MAX_DAYS;
        ipn_debug_email('IPN NOTICE :: Updating order #' . (int) $ordersID . ' downloads (if any).  New max days: ' . (int) $zc_max_days . ', New count: ' . (int) DOWNLOAD_MAX_COUNT);
        $update_downloads_query = "update " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " set download_maxdays='" . (int) $zc_max_days . "', download_count='" . (int) DOWNLOAD_MAX_COUNT . "' where orders_id='" . (int) $ordersID . "'";
        $db->Execute($update_downloads_query);
    }
}
开发者ID:wwxgitcat,项目名称:zencart_v1.0,代码行数:22,代码来源:paypal_functions.php


示例3: while

             }
         }
     }
     if ($order_updated == true) {
         if ($status == DOWNLOADS_ORDERS_STATUS_UPDATED_VALUE) {
             // adjust download_maxdays based on current date
             $chk_downloads_query = "SELECT opd.*, op.products_id from " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd, " . TABLE_ORDERS_PRODUCTS . " op\n                                    WHERE op.orders_id='" . (int) $oID . "'\n                                    and opd.orders_products_id = op.orders_products_id";
             $chk_downloads = $db->Execute($chk_downloads_query);
             while (!$chk_downloads->EOF) {
                 $chk_products_download_time_query = "SELECT pa.products_attributes_id, pa.products_id, pad.products_attributes_filename, pad.products_attributes_maxdays, pad.products_attributes_maxcount\n                                                    from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad\n                                                    WHERE pa.products_attributes_id = pad.products_attributes_id\n                                                    and pad.products_attributes_filename = '" . $chk_downloads->fields['orders_products_filename'] . "'\n                                                    and pa.products_id = '" . $chk_downloads->fields['products_id'] . "'";
                 $chk_products_download_time = $db->Execute($chk_products_download_time_query);
                 if ($chk_products_download_time->EOF) {
                     $zc_max_days = DOWNLOAD_MAX_DAYS == 0 ? 0 : zen_date_diff($check_status->fields['date_purchased'], date('Y-m-d H:i:s', time())) + DOWNLOAD_MAX_DAYS;
                     $update_downloads_query = "update " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " set download_maxdays='" . $zc_max_days . "', download_count='" . DOWNLOAD_MAX_COUNT . "' where orders_id='" . (int) $oID . "' and orders_products_download_id='" . $_GET['download_reset_on'] . "'";
                 } else {
                     $zc_max_days = $chk_products_download_time->fields['products_attributes_maxdays'] == 0 ? 0 : zen_date_diff($check_status->fields['date_purchased'], date('Y-m-d H:i:s', time())) + $chk_products_download_time->fields['products_attributes_maxdays'];
                     $update_downloads_query = "update " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " set download_maxdays='" . $zc_max_days . "', download_count='" . $chk_products_download_time->fields['products_attributes_maxcount'] . "' where orders_id='" . (int) $oID . "' and orders_products_download_id='" . $chk_downloads->fields['orders_products_download_id'] . "'";
                 }
                 $db->Execute($update_downloads_query);
                 $chk_downloads->MoveNext();
             }
         }
         $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');
     } else {
         $messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');
     }
     zen_redirect(zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('action')) . 'action=edit', 'NONSSL'));
     break;
 case 'deleteconfirm':
     // demo active test
     if (zen_admin_demo()) {
开发者ID:TrinityComputers,项目名称:PhreeBooksERP,代码行数:31,代码来源:orders_mod_phreebooks.php


示例4: date

        $zv_db_patch_ok = false;
        $messageStack->add(WARNING_DATABASE_VERSION_OUT_OF_DATE, 'warning');
    }
}
// Check that shipping/payment modules have been defined
if (zen_get_configuration_key_value('MODULE_PAYMENT_INSTALLED') == '') {
    $messageStack->add(ERROR_PAYMENT_MODULES_NOT_DEFINED, 'caution');
}
if (zen_get_configuration_key_value('MODULE_SHIPPING_INSTALLED') == '') {
    $messageStack->add(ERROR_SHIPPING_MODULES_NOT_DEFINED, 'caution');
}
// if welcome email coupon is set and <= 21 days warn shop owner
if (NEW_SIGNUP_DISCOUNT_COUPON > 0) {
    $zc_welcome_check = $db->Execute("SELECT coupon_expire_date from " . TABLE_COUPONS . " WHERE coupon_id=" . (int) NEW_SIGNUP_DISCOUNT_COUPON);
    $zc_current_date = date('Y-m-d');
    $zc_days_to_expire = zen_date_diff($zc_current_date, $zc_welcome_check->fields['coupon_expire_date']);
    if ($zc_days_to_expire <= 21) {
        $zc_caution_warning = $zc_days_to_expire <= 5 ? 'warning' : 'caution';
        $messageStack->add(sprintf(WARNING_WELCOME_DISCOUNT_COUPON_EXPIRES_IN, $zc_days_to_expire), $zc_caution_warning);
    }
}
// Alerts for EZ-Pages
if (EZPAGES_STATUS_HEADER == '2' and strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])) {
    $messageStack->add(TEXT_EZPAGES_STATUS_HEADER_ADMIN, 'caution');
}
if (EZPAGES_STATUS_FOOTER == '2' and strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])) {
    $messageStack->add(TEXT_EZPAGES_STATUS_FOOTER_ADMIN, 'caution');
}
if (EZPAGES_STATUS_SIDEBOX == '2' and strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])) {
    $messageStack->add(TEXT_EZPAGES_STATUS_SIDEBOX_ADMIN, 'caution');
}
开发者ID:ygeneration666,项目名称:ec,代码行数:31,代码来源:header.php


示例5: order

     // trigger any appropriate updates which should be sent back to the payment gateway:
     $order = new order((int) $oID);
     if ($order->info['payment_module_code']) {
         if (file_exists(DIR_FS_CATALOG_MODULES . 'payment/' . $order->info['payment_module_code'] . '.php')) {
             require_once DIR_FS_CATALOG_MODULES . 'payment/' . $order->info['payment_module_code'] . '.php';
             require_once DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/modules/payment/' . $order->info['payment_module_code'] . '.php';
             $module = new $order->info['payment_module_code']();
             if (method_exists($module, '_doStatusUpdate')) {
                 $response = $module->_doStatusUpdate($oID, $status, $comments, $customer_notified, $check_status->fields['orders_status']);
             }
         }
     }
     if ($order_updated == true) {
         if ($status == DOWNLOADS_ORDERS_STATUS_UPDATED_VALUE) {
             // adjust download_maxdays based on current date
             $zc_max_days = zen_date_diff($check_status->fields['date_purchased'], date('Y-m-d H:i:s', time())) + DOWNLOAD_MAX_DAYS;
             $update_downloads_query = "update " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " set download_maxdays='" . $zc_max_days . "', download_count='" . DOWNLOAD_MAX_COUNT . "' where orders_id='" . (int) $oID . "'";
             $db->Execute($update_downloads_query);
         }
         $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');
     } else {
         $messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');
     }
     zen_redirect(zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('action')) . 'action=edit', 'NONSSL'));
     break;
 case 'deleteconfirm':
     // demo active test
     if (zen_admin_demo()) {
         $_GET['action'] = '';
         $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
         zen_redirect(zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('oID', 'action')), 'NONSSL'));
开发者ID:dalinhuang,项目名称:yijinhuanxiang,代码行数:31,代码来源:orders.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP zen_date_long函数代码示例发布时间:2022-05-23
下一篇:
PHP zen_create_random_value函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap