if (mysql_num_rows($donequery) > 0) {
             $ttl = vam_db_fetch_array($donequery);
             if ($emailttl <= $ttl['dateadded']) {
                 $sentdate = $ttl['dateadded'];
                 $fcolor = $CONTACTED_COLOR;
             }
         }
         $ccquery = vam_db_query("select * from " . TABLE_ORDERS . " where customers_id = '" . $curcus . "'");
         if (mysql_num_rows($ccquery) > 0) {
             $customer = '&nbsp;[<font color="' . $CURCUST_COLOR . '">' . TEXT_CURRENT_CUSTOMER . '</font>]';
         }
         $sentInfo = TEXT_NOT_CONTACTED;
         if ($sentdate != '') {
             $sentInfo = cart_date_short($sentdate);
         }
         $cline = "\n        <tr bgcolor=" . $fcolor . ">\n          <td class='dataTableContent' align='center' width='1%'>" . vam_draw_checkbox_field('custid[]', $curcus) . "</td>\n          <td class='dataTableContent' align='left' width='9%' nowrap><b>" . $sentInfo . "</b></td>\n          <td class='dataTableContent' align='left' width='15%' nowrap> " . cart_date_short($inrec['bdate']) . "</td>\n          <td class='dataTableContent' align='left' width='30%' nowrap><a href='" . vam_href_link(FILENAME_CUSTOMERS, 'search=' . $inrec['lname'], 'NONSSL') . "'>" . $inrec['fname'] . " " . $inrec['lname'] . "</a>" . $customer . "</td>\n          <td class='dataTableContent' align='left' colspan='2' width='30%' nowrap><a href='" . vam_href_link('mail.php', 'selected_box=tools&customer=' . $inrec['email']) . "'>" . $inrec['email'] . "</a></td>\n          <td class='dataTableContent' align='left' colspan='2' width='15%' nowrap>" . $inrec['phone'] . "</td>\n        </tr>";
     }
 }
 // empty the shopping cart
 $query2 = vam_db_query("select  p.products_price price,\n                                    p.products_model model,\n                                    pd.products_name name\n                            from    " . TABLE_PRODUCTS . " p,\n                                    " . TABLE_PRODUCTS_DESCRIPTION . " pd,\n                                    " . TABLE_LANGUAGES . " l\n                            where   p.products_id = '" . $inrec['pid'] . "' and\n                                    pd.products_id = p.products_id and\n                                    pd.language_id = '" . $_SESSION['languages_id'] . "' ");
 $inrec2 = vam_db_fetch_array($query2);
 // BEGIN OF ATTRIBUTE DB CODE
 $prodAttribs = '';
 // DO NOT DELETE
 if ($SHOW_ATTRIBUTES) {
     $attribquery = vam_db_query("select  cba.products_id pid,\n                                           po.products_options_name poname,\n                                           pov.products_options_values_name povname\n                                   from    " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " cba,\n                                           " . TABLE_PRODUCTS_OPTIONS . " po,\n                                           " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov,\n                                           " . TABLE_LANGUAGES . " l\n                                   where   cba.products_id ='" . $inrec['pid'] . "' and\n                                           po.products_options_id = cba.products_options_id and\n                                           pov.products_options_values_id = cba.products_options_value_id and\n                                           po.language_id = '" . $_SESSION['languages_id'] . "' and\n                                           pov.language_id = '" . $_SESSION['languages_id'] . "'\n                                ");
     $hasAttributes = false;
     if (vam_db_num_rows($attribquery)) {
         $hasAttributes = true;
         $prodAttribs = '<br>';
         while ($attribrecs = vam_db_fetch_array($attribquery)) {
Пример #2
0
                         } else {
                             $status = ' [' . TEXT_CURRENT_CUSTOMER . ']';
                         }
                     }
                 }
             }
             if ($skip) {
                 continue;
             }
             // got a matched cart, skip to next one
         }
         $sentInfo = TEXT_NOT_CONTACTED;
         if ($sentdate != '') {
             $sentInfo = cart_date_short($sentdate);
         }
         $cline = "\n\t\t\t\t<tr bgcolor=" . $fcolor . ">\n\t\t\t\t  <td class='dataTableContent' align='center' width='1%'>" . tep_draw_checkbox_field('custid[]', $curcus, RCS_AUTO_CHECK == 'true' ? $checked : 0) . "</td>\n\t\t\t\t  <td class='dataTableContent' align='left' width='9%' nowrap><b>" . $sentInfo . "</b></td>\n\t\t\t\t  <td class='dataTableContent' align='left' width='15%' nowrap> " . cart_date_short($inrec['bdate']) . "</td>\n\t\t\t\t  <td class='dataTableContent' align='left' width='30%' nowrap><a href='" . tep_href_link(FILENAME_CUSTOMERS, 'search=' . $inrec['lname'], 'NONSSL') . "'>" . $customer . "</a>" . $status . "</td>\n\t\t\t\t  <td class='dataTableContent' align='left' colspan='2' width='30%' nowrap><a href='" . tep_href_link('mail.php', 'selected_box=tools&amp;customer=' . $inrec['email']) . "'>" . $inrec['email'] . "</a></td>\n\t\t\t\t  <td class='dataTableContent' align='left' colspan='1' width='15%' nowrap>" . $inrec['phone'] . "</td>\n\t\t\t\t  <td><a href=" . tep_href_link(FILENAME_RECOVER_CART_SALES, "action=delete&amp;customer_id=" . $curcus . "&amp;tdate=" . $tdate . "&amp;sdate=" . $sdate) . ">" . tep_image_button('button_delete.gif', IMAGE_DELETE) . "</a></td>\n\t\t\t\t</tr>";
     }
 }
 // We only have something to do for the product if the quantity selected was not zero!
 if ($inrec['qty'] != 0) {
     // Get the product information (name, price, etc)
     $query2 = tep_db_query("select  p.products_price price,\n\t\t\t\t\t\t\t\t\t\t\t\t\tp.products_tax_class_id taxclass,\n\t\t\t\t\t\t\t\t\t\t\t\t\tp.products_model model,\n\t\t\t\t\t\t\t\t\t\t\t\t\tpd.products_name name\n\t\t\t\t\t\t\t\t\t\t from    " . TABLE_PRODUCTS . " p,\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . TABLE_PRODUCTS_DESCRIPTION . " pd,\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . TABLE_LANGUAGES . " l\n\t\t\t\t\t\t\t\t\t\t where   p.products_id = '" . (int) $inrec['pid'] . "' and\n\t\t\t\t\t\t\t\t\t\t\t\t\tpd.products_id = p.products_id and\n\t\t\t\t\t\t\t\t\t\t\t\t\tpd.language_id = " . (int) $languages_id);
     $inrec2 = tep_db_fetch_array($query2);
     // Check to see if the product is on special, and if so use that pricing
     $sprice = tep_get_products_special_price($inrec['pid']);
     if ($sprice < 1) {
         $sprice = $inrec2['price'];
     }
     // Some users may want to include taxes in the pricing, allow that. NOTE HOWEVER that we don't have a good way to get individual tax rates based on customer location yet!
     if (RCS_INCLUDE_TAX_IN_PRICES == 'true') {
         $sprice += $sprice * tep_get_tax_rate($inrec2['taxclass']) / 100;
              $result3->MoveNext();
            }
          }


          $sentInfo = TEXT_NOT_CONTACTED;

          if (!empty($sentdate)) {
            $sentInfo = cart_date_short($sentdate);
          }

          $cline = '
          <tr bgcolor="' . $fcolor . '">
            <td class="dataTableContent" align="center" width="1%">' . oos_draw_checkbox_field('custid[]', $curcus, RCS_AUTO_CHECK == '1' ? $checked : 0) . '</td>
            <td class="dataTableContent" align="left" width="9%" nowrap><b>' . $sentInfo . '</b></td>
            <td class="dataTableContent" align="left" width="15%" nowrap>' . cart_date_short($inrec['bdate']) . '</td>
            <td class="dataTableContent" align="left" width="30%" nowrap><a href="' . oos_href_link_admin($aFilename['customers'], 'search=' . $inrec['lname'], 'NONSSL') . '">' . $customer . '</a>' . $status . '</td>
            <td class="dataTableContent" align="left" colspan="2" width="30%" nowrap><a href="' . oos_href_link_admin($aFilename['mail'], 'selected_box=tools&customer=' . $inrec['email']) . '">' . $inrec['email'] . '</a></td>
            <td class="dataTableContent" align="left" colspan="2" width="15%" nowrap>' . $inrec['phone'] . '</td>
          </tr>';
          echo $cline;
        }
      }

      // We only have something to do for the product if the quantity selected was not zero!
      if ($inrec['qty'] != 0) {
        // Get the product information (name, price, etc)
        $productstable = $oostable['products'];
        $products_descriptiontable = $oostable['products_description'];
        $sql6 = "SELECT p.products_price AS price,
                        p.products_model AS model,