Exemplo n.º 1
0
$basket_quantity = 0;
if ($row = mysql_fetch_object($result)) {
    $basket_quantity = $row->basket_quantity;
    $basket_id = $row->basket_id;
}
/////////////// FINISH PRE-PROCESSING AND BEGIN PAGE GENERATION /////////////////
// Generate the display output
$display .= '
  <table width="100%" class="compact">
    <tr valign="top">
      <td align="left" width="50%">
    <img src="' . DIR_GRAPHICS . 'current.png" width="32" height="32" align="left" hspace="2" alt="Order"><br>
    <strong>' . $relative_text . 'Order</strong>
        <ul class="fancyList1">
          <li><strong>Open' . $open_suffix . ':</strong>&nbsp;' . date('M&\\n\\b\\s\\p;j,&\\n\\b\\s\\p;g:i&\\n\\b\\s\\p;A&\\n\\b\\s\\p;(T)', strtotime(ActiveCycle::date_open_next())) . '</li>
          <li><strong>Close' . $close_suffix . ':</strong>&nbsp;' . date('M&\\n\\b\\s\\p;j,&\\n\\b\\s\\p;g:i&\\n\\b\\s\\p;A&\\n\\b\\s\\p;(T)', strtotime(ActiveCycle::date_closed_next())) . '</li>
          <li class="last_of_group"><strong>Delivery:</strong>&nbsp;' . date('F&\\n\\b\\s\\p;j', strtotime(ActiveCycle::delivery_date_next())) . '</li>
        </ul>
<!--
    <img src="' . DIR_GRAPHICS . 'shopping.png" width="32" height="32" align="left" hspace="2" alt="Basket Status"><br>
    <strong>Basket Status</strong>
        <ul class="fancyList1">
          <li class="last_of_group">' . $basket_status . '</li>
        </ul>
-->
    <img src="' . DIR_GRAPHICS . 'type.png" width="32" height="32" align="left" hspace="2" alt="Membership Type"><br>
    <strong>Membership Type</strong> [<a onClick="popup_src(\'update_membership.php?display_as=popup\', \'membership_renewal\', \'\');">Change</a>]
        <ul class="fancyList1">
          <li><strong>' . $_SESSION['renewal_info']['membership_class'] . ':</strong> ' . $_SESSION['renewal_info']['membership_description'] . '<br><br></li>
          <li class="last_of_group">' . $_SESSION['renewal_info']['membership_message'] . '</li>
        </ul>
Exemplo n.º 2
0
 private static function get_next_delivery_info()
 {
     if (self::$next_query_complete === false) {
         global $connection;
         // Set up for pulling only order cycles appropriate to the current customer_type permissions
         // Allow "orderex" direct access to all order cycles
         $customer_type_query = CurrentMember::auth_type('orderex') ? '1' : '0';
         if (CurrentMember::auth_type('member')) {
             $customer_type_query .= '
           OR customer_type LIKE "%member%"';
         }
         if (CurrentMember::auth_type('institution')) {
             $customer_type_query .= '
           OR customer_type LIKE "%institution%"';
         }
         // Set the default "where condition" to be the cycle that opened most recently
         // Do not use MySQL NOW() because it does not know about the php timezone directive
         $now = date('Y-m-d H:i:s', time());
         $query = '
             (SELECT
               date_open,
               date_closed,
               delivery_date,
               delivery_id,
               producer_markdown / 100 AS producer_markdown,
               retail_markup / 100 AS retail_markup,
               wholesale_markup / 100 AS wholesale_markup,
               1 AS using_next
             FROM
               ' . TABLE_ORDER_CYCLES . '
             WHERE
               date_closed > "' . $now . '"
               AND (' . $customer_type_query . ')
             ORDER BY
               date_closed ASC
             LIMIT 0,1)
           UNION
             (SELECT
               date_open,
               date_closed,
               delivery_date,
               delivery_id,
               producer_markdown / 100 AS producer_markdown,
               retail_markup / 100 AS retail_markup,
               wholesale_markup / 100 AS wholesale_markup,
               0 AS using_next
             FROM
               ' . TABLE_ORDER_CYCLES . '
             WHERE
               date_open < "' . $now . '"
               AND (' . $customer_type_query . ')
             ORDER BY
               date_open DESC
             LIMIT 0,1)';
         $result = @mysql_query($query, $connection) or die(debug_print("ERROR: 863024 ", array($query, mysql_error()), basename(__FILE__) . ' LINE ' . __LINE__));
         if ($row = mysql_fetch_object($result)) {
             self::$date_open_next = $row->date_open;
             self::$date_closed_next = $row->date_closed;
             self::$delivery_date_next = $row->delivery_date;
             self::$delivery_id_next = $row->delivery_id;
             self::$producer_markdown_next = $row->producer_markdown;
             self::$retail_markup_next = $row->retail_markup;
             self::$wholesale_markup_next = $row->wholesale_markup;
             self::$using_next = $row->using_next;
             self::$next_query_complete = true;
         }
     }
 }