예제 #1
0
      SET
        msg_all = "' . mysql_real_escape_string($_REQUEST['msg_all']) . '",
        msg_bottom = "' . mysql_real_escape_string($_REQUEST['msg_bottom']) . '"
      WHERE
      delivery_id >= ' . ActiveCycle::delivery_id();
    $resultu = @mysql_query($sqlu, $connection) or die('<br><br>You found a bug. If there is an error listed below, please copy and paste the error into an email to <a href="mailto:' . WEBMASTER_EMAIL . '">' . WEBMASTER_EMAIL . '</a><br><br><b>Error:</b> Updating ' . mysql_error() . '<br><b>Error No: </b>' . mysql_errno());
    $message = ': <font color="#FFFFFF">Messages have been updated</font>';
}
$sqlmsg = '
  SELECT msg_all,
    delivery_id,
    msg_bottom
  FROM
    ' . TABLE_ORDER_CYCLES . '
  WHERE
    delivery_id = ' . ActiveCycle::delivery_id();
$resultmsg = @mysql_query($sqlmsg, $connection) or die('<br><br>You found a bug. If there is an error listed below, please copy and paste the error into an email to <a href="mailto:' . WEBMASTER_EMAIL . '">' . WEBMASTER_EMAIL . '</a><br><br><b>Error:</b> Selecting message ' . mysql_error() . '<br><b>Error No: </b>' . mysql_errno());
while ($row = mysql_fetch_array($resultmsg)) {
    $msg_all = $row['msg_all'];
    $msg_bottom = $row['msg_bottom'];
}
$content .= $font . '
  <h3>Editing Text on the Invoices</h3>
  <p>This will change the message for the current invoice (' . date(DATE_FORMAT_CLOSED, strtotime(ActiveCycle::delivery_date())) . ') and all future invoices until changed.</p>
  <table width="685" cellpadding="7" cellspacing="2" border="0">
    <tr bgcolor="#AE58DA">
      <td align="left"><b>Message to all Members ' . $message . '</b></td>
    </tr>
    <tr>
      <td align="left" bgcolor="#EEEEEE">
        <form action="' . $_SERVER['SCRIPT_NAME'] . '" method="POST">
예제 #2
0
<?php

include_once 'config_openfood.php';
session_start();
valid_auth('member_admin');
$delivery_id = ActiveCycle::delivery_id();
$sql = '
  SELECT
    ' . TABLE_MEMBER . '.*,
    ' . TABLE_MEMBERSHIP_TYPES . '.membership_class
  FROM
    ' . TABLE_MEMBER . '
  LEFT JOIN ' . TABLE_MEMBERSHIP_TYPES . ' on ' . TABLE_MEMBER . '.membership_type_id = ' . TABLE_MEMBERSHIP_TYPES . '.membership_type_id
  WHERE
    ' . TABLE_MEMBER . '.pending = "0"
    AND ' . TABLE_MEMBER . '.membership_discontinued != "1"
  ORDER BY
    member_id DESC,
    last_name ASC,
    first_name ASC';
$rs = @mysql_query($sql, $connection) or die(debug_print("ERROR: 785033 ", array($sql, mysql_error()), basename(__FILE__) . ' LINE ' . __LINE__));
$num = mysql_numrows($rs);
while ($row = mysql_fetch_array($rs)) {
    $member_id = $row['member_id'];
    $first_name = $row['first_name'];
    $last_name = $row['last_name'];
    $first_name_2 = $row['first_name_2'];
    $last_name_2 = $row['last_name_2'];
    $business_name = $row['business_name'];
    $address_line1 = $row['address_line1'];
    $address_line2 = $row['address_line2'];
예제 #3
0
// if (time() > strtotime($site_down_at_time) && time() < strtotime($site_down_at_time) + $down_time_duration) $site_is_down = true;
// if (time() > strtotime($site_down_at_time) - $down_time_warning && time() < strtotime($site_down_at_time) + $down_time_duration) $warn_now = true;
// Check if the member is logged in
if ($_SESSION['member_id']) {
    // Get basket information, but don't re-query if we already have it
    if (!isset($basket_quantity) && ActiveCycle::delivery_id()) {
        $query = '
          SELECT
            COUNT(product_id) AS basket_quantity,
            ' . NEW_TABLE_BASKET_ITEMS . '.basket_id
          FROM
            ' . NEW_TABLE_BASKET_ITEMS . '
          LEFT JOIN ' . NEW_TABLE_BASKETS . ' ON ' . NEW_TABLE_BASKETS . '.basket_id = ' . NEW_TABLE_BASKET_ITEMS . '.basket_id
          WHERE
            ' . NEW_TABLE_BASKETS . '.member_id = "' . mysql_real_escape_string($_SESSION['member_id']) . '"
            AND ' . NEW_TABLE_BASKETS . '.delivery_id = ' . mysql_real_escape_string(ActiveCycle::delivery_id()) . '
          GROUP BY
            ' . NEW_TABLE_BASKETS . '.member_id';
        $result = @mysql_query($query, $connection) or die(debug_print("ERROR: 780934 ", array($query, mysql_error()), basename(__FILE__) . ' LINE ' . __LINE__));
        $basket_quantity = 0;
        if ($row = mysql_fetch_object($result)) {
            $basket_quantity = $row->basket_quantity;
            $basket_id = $row->basket_id;
        }
    }
    // Check if this is a forced update or if it is member-requested
    if ($_SESSION['renewal_info']['membership_expired'] && $update_membership_page != true) {
        $popup_renew_membership .= '
          <script type="text/javascript">
            jQuery(document).ready(function() {
              popup_src("update_membership.php?display_as=popup", "membership_renewal", "index.php?action=logout");
예제 #4
0
        <ul class="fancyList1">

          <li><a href="category_list_edit.php">Edit Categories and Subcategories</a></li>
          <li><a href="edit_configuration.php">Edit Site Configuration</a></li>
          <li class="last_of_group"><a href="invoice_edittext.php">Edit Invoice Messages</a></li>
          <li><a href="view_order_schedule.php">View/Set Ordering Schedule</a></li>

        </ul>
      </td>
      <td align="left" width="50%">
        <img src="' . DIR_GRAPHICS . 'launch.png" width="32" height="32" align="left" hspace="2" alt="Current Delivery Cycle Functions"><br>
        <b>Current Delivery Cycle Functions</b>
        <ul class="fancyList1">
          <li><a href="orders_list_withtotals.php?delivery_id=' . ActiveCycle::delivery_id() . '">Members with orders this cycle (with totals)</a></li>
          <li><a href="members_list_emailorders.php?delivery_id=' . ActiveCycle::delivery_id() . '">Customer Email Addresses this cycle</a></li>
          <li class="last_of_group"><a href="orders_prdcr_list.php?delivery_id=' . ActiveCycle::delivery_id() . '">Producers with Customers this Cycle</a></li>
        </ul>
        <img src="' . DIR_GRAPHICS . 'kcron.png" width="32" height="32" align="left" hspace="2" alt="Previous Delivery Cycle Functions"><br>
        <b>Previous Delivery Cycle Functions</b>
        <ul class="fancyList1">
          <li class="last_of_group"><a href="generate_invoices.php">Generate Invoices</a></li>
        </ul>
      </td>
    </tr>
  </table>';
$page_title_html = '<span class="title">' . $_SESSION['show_name'] . '</span>';
$page_subtitle_html = '<span class="subtitle">Site Admin Panel</span>';
$page_title = 'Site Admin Panel';
$page_tab = 'admin_panel';
include "template_header.php";
echo '
예제 #5
0
<?php

include_once 'config_openfood.php';
session_start();
// Items dependent upon the location of this header
$pager = array();
// Set up some variables that might be needed
if (isset($_SESSION['member_id'])) {
    $member_id = $_SESSION['member_id'];
}
if (isset($_SESSION['producer_id_you'])) {
    $producer_id_you = $_SESSION['producer_id_you'];
}
$delivery_id = mysql_real_escape_string(ActiveCycle::delivery_id());
// Allow cashier to override member_id
if (isset($_GET['member_id']) && CurrentMember::auth_type('cashier')) {
    $member_id = $_GET['member_id'];
}
// Allow producer_admin or cashier to override producer_id_you
if (isset($_GET['producer_id']) && CurrentMember::auth_type('cashier,producer_admin')) {
    $producer_id_you = $_GET['producer_id'];
}
// Allow anyone to override the delivery_id
if ($_GET['delivery_id']) {
    $delivery_id = mysql_real_escape_string($_GET['delivery_id']);
}
// Initialize display of wholesale and retail to false
$wholesale_member = false;
$retail_member = false;
//////////////////////////////////////////////////////////////////////////////////////
//                                                                                  //
function order_cycle_navigation($data)
{
    // Set up the previous/next order cycle (delivery_id) navigation
    $http_get_query = ($_GET['type'] ? '&type=' . $_GET['type'] : '') . ($_GET['producer_id'] ? '&producer_id=' . $_GET['producer_id'] : '') . ($_GET['category_id'] ? '&category_id=' . $_GET['category_id'] : '') . ($_GET['subcat_id'] ? '&subcat_id=' . $_GET['subcat_id'] : '') . ($_GET['query'] ? '&query=' . $_GET['query'] : '') . ($_GET['a'] ? '&a=' . $_GET['a'] : '');
    return '<div id="delivery_id_nav">
    <a class="prior" href="' . $_SERVER['SCRIPT_NAME'] . '?delivery_id=' . ($_GET['delivery_id'] ? $_GET['delivery_id'] - 1 : ActiveCycle::delivery_id() - 1) . $http_get_query . '">&larr; PRIOR ORDER </a>
    <span class="delivery_id">' . date(DATE_FORMAT_CLOSED, strtotime(ActiveCycle::delivery_date($_GET['delivery_id']))) . '</span>
    <a class="next" href="' . $_SERVER['SCRIPT_NAME'] . '?delivery_id=' . ($_GET['delivery_id'] ? $_GET['delivery_id'] + 1 : ActiveCycle::delivery_id() + 1) . $http_get_query . '"> NEXT ORDER &rarr;</a>
  </div>';
}
예제 #7
0
          <li> <a href="members_list_withemail.php">Members who have email</a></li>
          <li class="last_of_group"> <a href="members_list_noemail.php">Members without email</a></li>
        </ul>
      </td>
      <td align="left" width="50%">
        <img src="' . DIR_GRAPHICS . 'bottom.png" width="32" height="32" align="left" hspace="2" alt="Membership Information"><br>
        <b>Membership Information</b>
        <ul class="fancyList1">
          <li><a href="member_lookup.php?action=find">Find/Edit Members</a></li>
          <li><a href="edit_member_types.php">Mass Edit Membership Types</a></li>
          <li><a href="edit_auth_types.php">Mass Edit Auth Types</a></li>
        </ul>
        <img src="' . DIR_GRAPHICS . 'kcron.png" width="32" height="32" align="left" hspace="2" alt="Delivery Cycle Functions"><br>
        <b>Delivery Cycle Functions</b>
        <ul class="fancyList1">
          <li class="last_of_group"><a href="orders_list_withtotals.php?delivery_id=' . ActiveCycle::delivery_id() . '">Members with orders this cycle (with totals)</a></li>
          <li><a href="members_list_emailorders.php?delivery_id=' . ActiveCycle::delivery_id() . '">Customer Email Addresses this cycle</a></li>
        </ul>
      </td>
    </tr>
  </table>';
$page_title_html = '<span class="title">' . $_SESSION['show_name'] . '</span>';
$page_subtitle_html = '<span class="subtitle">Member Admin Panel</span>';
$page_title = 'Member Admin Panel';
$page_tab = 'member_admin_panel';
include "template_header.php";
echo '
  <!-- CONTENT BEGINS HERE -->
  ' . $display_admin . '
  <!-- CONTENT ENDS HERE -->';
include "template_footer.php";
        $plain_display .= '<span>' . $email_address . '</span><br>';
        $mail_count++;
    }
}
$content_list = '
<table width="80%">
  <tr>
    <td align="left">
      <div align="center">
        <h3>Member Ordering for Delivery #' . $delivery_id . ': <?echo $mail_count;?> Members</h3>
      </div>
      ' . ($delivery_id > 1 ? '
      <div style="float:left;border:1px solid #440; background-color:#ffd;padding:3px 20px;">
        <a href="' . $_SERVER['SCRIPT_NAME'] . '?delivery_id=' . ($delivery_id - 1) . '">Get list for prior order</a>
      </div>' : '') . '
      ' . ($delivery_id < ActiveCycle::delivery_id() ? '
      <div style="float:right;border:1px solid #440; background-color:#ffd;padding:3px 20px;">
        <a href="' . $_SERVER['SCRIPT_NAME'] . '?delivery_id=' . ($delivery_id + 1) . '">Get list for next order</a>
      </div>' : '') . '
      <br><br>
      <input type="radio" name="display_type" onClick=\'{document.getElementById("fancy").style.display="none";document.getElementById("plain").style.display="";}\'>Show plain addresses
      <br>
      <input type="radio" name="display_type" onClick=\'{document.getElementById("plain").style.display="none";document.getElementById("fancy").style.display="";}\'>Show fancy addresses
      <br><br>
    <div id="fancy"><div style="float:left";>' . $home_phone_display . '</div><div style="float:left;margin-left:1em;">' . $fancy_display . '</div></div>
    <div id="plain" style="display:none">' . $plain_display . '</div>
  </td></tr>
</table>';
$page_title_html = '<span class="title">Delivery Cycle Functions</span>';
$page_subtitle_html = '<span class="subtitle">Email List of Members with Orders</span>';
$page_title = 'Delivery Cycle Functions: Email List of Members with Orders';
예제 #9
0
          <!-- <li class="last_of_group"><a href="producer_select_site.php">Select Collection Point</a></li> -->
          <li><a href="product_list.php?&type=labels_bystoragecustomer">Labels &ndash; One per Customer/Storage</a></li>
          <li class="last_of_group"><a href="product_list.php?&type=labels_byproduct">Labels &ndash; One per Item</a></li>
        </ul>
          <img src="' . DIR_GRAPHICS . 'invoices.png" width="32" height="32" align="left" hspace="2" alt="Producer invoices"><br>
          <b>' . $active_business_name . ' Producer Orders</b>
          <ul class="fancyList1">
            <li><a href="product_list.php?&type=producer_byproduct">Producer Basket (by product)</a></li>
            <li><a href="product_list.php?&type=producer_bystoragecustomer">Producer Basket List (by storage/customer)</a></li>
            <li class="last_of_group"><a href="product_list.php?&type=producer_bycustomer">Producer Basket List (by customer)</a></li>

            <li><a href="order_summary.php">Order Summary</a></li>
            <li><a href="show_report.php?type=producer_invoice">Producer Invoice</a></li>
            <li class="last_of_group"><a href="past_producer_invoices.php?producer_id=' . $_SESSION['producer_id_you'] . '">Past Producer Invoices</a></li>
            <li><a href="route_list.php?delivery_id=' . ActiveCycle::delivery_id() . '&type=pickup&producer_id=' . $_SESSION['producer_id_you'] . '">Routing Checklist (by customer)</a></li>
            <li class="last_of_group"><a href="route_list.php?delivery_id=' . ActiveCycle::delivery_id() . '&type=dropoff&producer_id=' . $_SESSION['producer_id_you'] . '">Routing Checklist (by destination)</a></li>

          </ul>
          <img src="' . DIR_GRAPHICS . 'product.png" width="32" height="32" align="left" hspace="2" alt="Edit your products"><br>
          <b>Edit ' . $active_business_name . ' Products</b>
          <ul class="fancyList1">
            <li><a href="product_list.php?a=retail&type=producer_list">Listed&nbsp;Retail</a></li>
            <li><a href="product_list.php?a=wholesale&type=producer_list">Listed&nbsp;Wholesale</a></li>
            <li><a href="product_list.php?a=unlisted&type=producer_list">Unlisted</a></li>
            <li class="last_of_group"><a href="product_list.php?a=archived&type=producer_list">Archived</a></li>
            <li class="last_of_group"><a href="edit_products.php?producer_id=' . $_SESSION['producer_id_you'] . '">Add A New Product</a></li>
            <li class="last_of_group"><a href="edit_inventory.php">Manage Your Inventory</a></li>
          </ul>
          ';
}
$display .= '
function get_delivery_codes_list($request_data)
{
    global $connection;
    // See if it is okay to open a basket...
    if (ActiveCycle::delivery_id() && (ActiveCycle::ordering_window() == 'open' || CurrentMember::auth_type('orderex'))) {
        // If requested to open-basket...
        if ($request_data['action'] == 'open_basket') {
            if ($request_data['site_id'] && $request_data['delivery_type']) {
                $site_id = $request_data['site_id'];
                $delivery_type = $request_data['delivery_type'];
                // First try an assigned delivery_id... then use the current active one
                $delivery_id = $request_data['delivery_id'];
                if (!$delivery_id) {
                    $delivery_id = ActiveCycle::delivery_id();
                }
                // First try an assigned member_id... then use the current session one
                $member_id = $request_data['member_id'];
                if (!$member_id) {
                    $member_id = $_SESSION['member_id'];
                }
                // Update the basket
                $basket_info = open_update_basket(array('member_id' => $member_id, 'delivery_id' => $delivery_id, 'site_id' => $site_id, 'delivery_type' => $delivery_type));
            }
        } else {
            $basket_info = get_basket($request_data['member_id'], $request_data['delivery_id']);
        }
        //         // Ordering is open and there is no basket open yet
        //         // Get this member's most recent delivery location
        //         $query = '
        //           SELECT
        //             '.NEW_TABLE_SITES.'.site_id,
        //             '.NEW_TABLE_SITES.'.deltype
        //           FROM
        //             '.NEW_TABLE_BASKETS.'
        //           LEFT JOIN
        //             '.NEW_TABLE_SITES.' USING(site_id)
        //           WHERE
        //             '.NEW_TABLE_BASKETS.'.member_id = "'.mysql_real_escape_string($_SESSION['member_id']).'"
        //             AND '.NEW_TABLE_SITES.'.inactive = "0"
        //           ORDER BY
        //             delivery_id DESC
        //           LIMIT
        //             1';
        //           $result = mysql_query ($query, $connection) or die(debug_print ("ERROR: 548167 ", array ($query,mysql_error()), basename(__FILE__).' LINE '.__LINE__));
        //           if ($row = mysql_fetch_array ($result))
        //             {
        //               $site_id_prior = $row['site_id'];
        //               $deltype_prior = $row['deltype'];
        //             }
        // Constrain this shopper's baskets to the site_type they are enabled to use
        $site_type_constraint = '';
        if (CurrentMember::auth_type('member')) {
            $site_type_constraint .= '
              ' . (strlen($site_type_constraint) > 0 ? 'OR ' : '') . 'site_type LIKE "%customer%"';
        }
        if (CurrentMember::auth_type('institution')) {
            $site_type_constraint .= '
              ' . (strlen($site_type_constraint) > 0 ? 'OR ' : '') . 'site_type LIKE "%institution%"';
        }
        $site_type_constraint = '
            AND (' . $site_type_constraint . '
              )';
        // Now get the list of all available delivery codes and flag the one
        // that corresponds to this member's prior order
        $query = '
          SELECT
            ' . NEW_TABLE_SITES . '.site_id,
            ' . NEW_TABLE_SITES . '.site_short,
            ' . NEW_TABLE_SITES . '.site_long,
            ' . NEW_TABLE_SITES . '.delivery_type,
            ' . NEW_TABLE_SITES . '.site_description,
            ' . NEW_TABLE_SITES . '.delivery_charge,
            ' . NEW_TABLE_SITES . '.inactive,
            ' . TABLE_MEMBER . '.address_line1,
            ' . TABLE_MEMBER . '.work_address_line1
          FROM
            (' . NEW_TABLE_SITES . ',
            ' . TABLE_MEMBER . ')
          WHERE
            ' . NEW_TABLE_SITES . '.inactive != "1"
            AND ' . TABLE_MEMBER . '.member_id = "' . mysql_real_escape_string($_SESSION['member_id']) . '"' . $site_type_constraint . '
          ORDER BY
            site_long';
        $result = mysql_query($query, $connection) or die(debug_print("ERROR: 671934 ", array($query, mysql_error()), basename(__FILE__) . ' LINE ' . __LINE__));
        $site_id_array = array();
        $delivery_type_array = array();
        $display .= '
            <div id="delivery_dropdown" class="dropdown">
              <a href="' . $_SERVER['SCRIPT_NAME'] . '?action=delivery_list_only"><h1 class="delivery_select">' . ($basket_info['site_id'] ? 'Selected: ' . $basket_info['site_long'] : 'Select Location') . '
              </h1></a>
              <div id="delivery_select">
                <ul class="delivery_select">';
        while ($row = mysql_fetch_array($result)) {
            // Simplify variables
            $site_id = $row['site_id'];
            $site_long = $row['site_long'];
            $delivery_type = $row['delivery_type'];
            $site_description = $row['site_description'];
            $delivery_charge = $row['delivery_charge'];
            $inactive = $row['inactive'];
            $address = $row['address_line1'];
            $work_address = $row['work_address_line1'];
            // Set up some text for the $delivery type (delivery or pickup)
            if ($delivery_type == 'P') {
                $delivery_type_text = 'Pick up your order here';
                $delivery_type_class = 'delivery_type-p';
            } elseif ($delivery_type == 'D') {
                $delivery_type_text_h = 'HOME delivery';
                $delivery_type_text_w = 'WORK delivery';
                if ($delivery_charge) {
                    $delivery_type_text_h .= ' ($' . number_format($delivery_charge, 2) . ' charge)';
                    $delivery_type_text_w .= ' ($' . number_format($delivery_charge, 2) . ' charge)';
                }
                $delivery_type_class = 'delivery_type-d';
            } else {
                $delivery_type_text = '';
                $delivery_type_class = '';
            }
            // Process the inactive options
            if ($inactive == 0) {
                $show_site = true;
                $active_class = ' active';
                $select_link_href = $_SERVER['SCRIPT_NAME'] . '?action=open_basket&amp;site_id=' . $site_id . '&amp;delivery_type=P';
                $select_link_h_href = $_SERVER['SCRIPT_NAME'] . '?action=open_basket&amp;site_id=' . $site_id . '&amp;delivery_type=H';
                $select_link_w_href = $_SERVER['SCRIPT_NAME'] . '?action=open_basket&amp;site_id=' . $site_id . '&amp;delivery_type=W';
                $delivery_type_class .= 'a';
                // color
            } elseif ($inactive == 2) {
                $show_site = true;
                $active_class = ' inactive';
                $select_link_href = '';
                $select_link_h_href = '';
                $select_link_w_href = '';
                $delivery_type_class .= 'i';
                // color
                $delivery_type_text = '(Not available for pick up this cycle)';
                // clobber the delivery type text
                $delivery_type_text_h = '(Not available for home delivery this cycle)';
                // clobber the delivery type text
                $delivery_type_text_w = '(Not available for work delivery this cycle)';
                // clobber the delivery type text
            } else {
                $show_site = false;
                $active_class = ' suspended';
                $select_link_href = '';
                $select_link_h_href = '';
                $select_link_w_href = '';
                $delivery_type_class .= 'i';
                // color
                $delivery_type_text = '(Not available for pick up this cycle)';
                // clobber the delivery type text
                $delivery_type_text_h = '(Not available for home delivery this cycle)';
                // clobber the delivery type text
                $delivery_type_text_w = '(Not available for work delivery this cycle)';
                // clobber the delivery type text
            }
            // Process current selection
            if ($site_id == CurrentBasket::site_id()) {
                $selected = true;
                $select_class = ' select';
                $delivery_type_class .= 'c';
                // color
            } else {
                $selected = 'false';
                $select_class = '';
                $delivery_type_class .= 'g';
                // greyscale
            }
            if ($show_site == true) {
                if ($delivery_type == 'P') {
                    $display .= '
                  <li class="' . $delivery_type_class . $active_class . $select_class . '" ' . ($select_link_href != '' ? 'onclick="javascript:location.href=\'' . $select_link_href : '') . '\';parent.close_delivery_selector();">
                      <span class="site_long">' . $site_long . '</span>
                      <span class="site_action">' . $delivery_type_text . '</span>
                      <span class="site_description">' . br2nl($site_description) . '</span>
                  </li>';
                }
                // For delivery_type = delivery, we will give an option for "home"
                if ($delivery_type == 'D' && $address) {
                    if ($basket_info['delivery_type'] != 'H') {
                        $select_class = '';
                    }
                    $display .= '
                  <li class="' . $delivery_type_class . $active_class . $select_class . '" ' . ($select_link_h_href != '' ? 'onclick="javascript:location.href=\'' . $select_link_h_href : '') . '\';parent.close_delivery_selector();">
                      <span class="site_long">' . $site_long . '</span>
                      <span class="site_action">' . $delivery_type_text_h . '</span>
                      <span class="site_description"><strong>To home address:</strong> ' . $address . '<br>' . br2nl($site_description) . '</span>
                  </li>';
                }
                // For delivery_type = delivery, we will also give an option for "work"
                if ($delivery_type == 'D' && $work_address) {
                    if ($basket_info['delivery_type'] != 'W') {
                        $select_class = '';
                    }
                    $display .= '
                  <li class="' . $delivery_type_class . $active_class . $select_class . '" ' . ($select_link_w_href != '' ? 'onclick="javascript:location.href=\'' . $select_link_w_href : '') . '\';parent.close_delivery_selector();">
                      <span class="site_long">' . $site_long . '</span>
                      <span class="site_action">' . $delivery_type_text_w . '</span>
                      <span class="site_description"><strong>To work address:</strong> ' . $work_address . '<br>' . br2nl($site_description) . '</span>
                  </li>';
                }
            }
        }
        $display .= '
                </ul>
              </div>
            </div>';
    }
    return $display;
}
예제 #11
0
    $basket_quantity = $row->basket_quantity;
    $basket_id = $row->basket_id;
    $delivery_type = $row->delivery_type;
}
if (ActiveCycle::ordering_window() == 'open') {
    if ($basket_id) {
        $basket_status = 'Ready for shopping<br>' . $basket_quantity . ' ' . Inflect::pluralize_if($basket_quantity, 'item') . ' in basket';
    } else {
        $basket_status = '
          <em>Use Select Location (above) to open a shopping basket</em>';
    }
} else {
    $basket_status = 'Ordering is currently closed<br>' . $basket_quantity . ' ' . Inflect::pluralize_if($basket_quantity, 'item') . ' in basket';
}
// Set content_top to show basket selector...
$delivery_codes_list .= get_delivery_codes_list(array('action' => $_GET['action'], 'member_id' => $_SESSION['member_id'], 'delivery_id' => ActiveCycle::delivery_id(), 'site_id' => $_GET['site_id'], 'delivery_type' => $_GET['delivery_type']));
$baskets_list .= get_baskets_list();
// Generate the display output
$display .= '
  <table width="100%" class="compact">
    <tr valign="top">
      <td align="left" width="50%">' . ($delivery_codes_list ? '<div class="content_top">' . $delivery_codes_list . '
        </div>' : '') . '
      </td>
      <td align="right" width="50%">' . ($baskets_list ? '<div class="content_top" style="float:right;">' . $baskets_list . '
        </div>' : '') . '
      </td>
    </tr>
    <tr>
      <td>';
$display .= '
예제 #12
0
    if ($row["category_name"] && $row["subcategory_name"] && $row["delivery_date"]) {
        if (isset($categories[$row["category_name"]][$row["subcategory_name"]][$row["delivery_date"]])) {
            $categories[$row["category_name"]][$row["subcategory_name"]][$row["delivery_date"]] += $row["real_price"];
        } else {
            $categories[$row["category_name"]][$row["subcategory_name"]][$row["delivery_date"]] = $row["real_price"];
        }
    }
}
$query = '
  SELECT
    delivery_date
  FROM
    ' . TABLE_ORDER_CYCLES . '
  WHERE
    delivery_id <= "' . mysql_real_escape_string(ActiveCycle::delivery_id()) . '"
    AND delivery_id > "' . mysql_real_escape_string(ActiveCycle::delivery_id() - $num_cycles) . '"
  ORDER BY
    delivery_date DESC';
$dates_sql = mysql_query($query);
$delivery_dates = array();
$spreadsheet = "Subcategory / Date";
$date_headers = "";
while ($row = mysql_fetch_array($dates_sql)) {
    array_push($delivery_dates, $row["delivery_date"]);
    $date_headers .= '
      <th class="date">' . $row["delivery_date"] . '</th>';
    $spreadsheet .= "\t" . $row["delivery_date"];
}
$table = "";
$spreadsheet .= "\n";
ksort($categories);
예제 #13
0
}
// Get a delivery_id for pulling current producer "invoices"
if ($_GET['delivery_id']) {
    $delivery_id = mysql_real_escape_string($_GET['delivery_id']);
} else {
    $delivery_id = mysql_real_escape_string(ActiveCycle::delivery_id());
}
// Get a basket_id in cases where we are looking at baskets or invoices...
if ($_GET['basket_id']) {
    $basket_id = mysql_real_escape_string($_GET['basket_id']);
} else {
    $basket_id = mysql_real_escape_string(CurrentBasket::basket_id());
}
// Determine whether the order is open or not
$order_open = false;
if (ActiveCycle::ordering_window() == 'open' && ActiveCycle::delivery_id() == $delivery_id || CurrentMember::auth_type('orderex')) {
    $order_open = true;
}
// Initialize display of wholesale and retail to false
$display_wholesale_price = false;
$display_retail_price = false;
$is_wholesale_item = false;
// SET UP QUERY PARAMETERS THAT APPLY TO MOST LISTS
// Only show for listed producers -- not unlisted (1) or suspended (2)
$where_unlisted_producer = '
    AND unlisted_producer = "0"';
// Normally, do not show producers that are pending (1)
$where_producer_pending = '
    ' . TABLE_PRODUCER . '.pending = 0';
// Set up an exception for hiding zero-inventory products
$where_zero_inventory = '';
예제 #14
0
 private static function get_basket_info()
 {
     if (self::$query_complete === false) {
         global $connection;
         $query = '
           SELECT
             ' . NEW_TABLE_BASKETS . '.basket_id,
             ' . NEW_TABLE_SITES . '.site_id,
             ' . NEW_TABLE_SITES . '.site_short,
             ' . NEW_TABLE_SITES . '.site_long,
             ' . NEW_TABLE_BASKETS . '.checked_out
           FROM
             ' . NEW_TABLE_BASKETS . '
           LEFT JOIN ' . NEW_TABLE_SITES . ' USING(site_id)
           WHERE
             ' . NEW_TABLE_BASKETS . '.delivery_id = "' . mysql_real_escape_string(ActiveCycle::delivery_id()) . '"
             AND ' . NEW_TABLE_BASKETS . '.member_id = "' . mysql_real_escape_string($_SESSION['member_id']) . '"';
         $result = @mysql_query($query, $connection) or die(debug_print("ERROR: 783032 ", array($query, mysql_error()), basename(__FILE__) . ' LINE ' . __LINE__));
         if ($row = mysql_fetch_object($result)) {
             self::$basket_id = $row->basket_id;
             self::$site_id = $row->site_id;
             self::$site_short = $row->site_short;
             self::$site_long = $row->site_long;
             self::$basket_checked_out = $row->checked_out;
             self::$query_complete = true;
         }
     }
 }
예제 #15
0
  }

.c_list_header {
  position:relative;
  font-weight:bold;
  text-decoration:underline;
  color:#008;
  }

</style>';
$prior_delivery_link = ' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ';
$next_delivery_link = ' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ';
if ($delivery_id > 1) {
    $prior_delivery_link = '<a href="' . $_SERVER['SCRIPT_NAME'] . '?delivery_id=' . number_format($delivery_id - 1, 0) . '">&larr; PRIOR &#151;</a>';
}
if ($delivery_id < ActiveCycle::delivery_id()) {
    $next_delivery_link = '<a href="' . $_SERVER['SCRIPT_NAME'] . '?delivery_id=' . number_format($delivery_id + 1, 0) . '">&#151; NEXT &rarr;</a>';
}
$content .= '
<h1>Generate Invoices for Delivery #' . $delivery_id . '<br>' . $delivery_date . '</h1>
<p class="order_nav">' . $prior_delivery_link . ' &nbsp; &nbsp; OTHER ORDERS &nbsp; &nbsp; ' . $next_delivery_link . '</p>';
$customer_output_html = INVOICE_WEB_PATH . 'invoices_customers-' . $delivery_id . '.html';
$customer_output_pdf = INVOICE_WEB_PATH . 'invoices_customers-' . $delivery_id . '.pdf';
if (!file_exists(INVOICE_FILE_PATH . 'invoices_customers-' . $delivery_id . '.html')) {
    $cust_view_html = ' style="display:none;"';
}
if (!file_exists(INVOICE_FILE_PATH . 'invoices_customers-' . $delivery_id . '.pdf')) {
    $cust_view_pdf = ' style="display:none;"';
}
$content .= '
<div id="left-column">