[ Index ]
 

Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/admin/ -> stats_customers.php (source)

   1  <?php
   2  //

   3  // +----------------------------------------------------------------------+

   4  // |zen-cart Open Source E-commerce                                       |

   5  // +----------------------------------------------------------------------+

   6  // | Copyright (c) 2003 The zen-cart developers                           |

   7  // |                                                                      |

   8  // | http://www.zen-cart.com/index.php                                    |

   9  // |                                                                      |

  10  // | Portions Copyright (c) 2003 osCommerce                               |

  11  // +----------------------------------------------------------------------+

  12  // | This source file is subject to version 2.0 of the GPL license,       |

  13  // | that is bundled with this package in the file LICENSE, and is        |

  14  // | available through the world-wide-web at the following url:           |

  15  // | http://www.zen-cart.com/license/2_0.txt.                             |

  16  // | If you did not receive a copy of the zen-cart license and are unable |

  17  // | to obtain it through the world-wide-web, please send a note to       |

  18  // | license@zen-cart.com so we can mail you a copy immediately.          |

  19  // +----------------------------------------------------------------------+

  20  //  $Id: stats_customers.php 1969 2005-09-13 06:57:21Z drbyte $

  21  //

  22    require ('includes/application_top.php');
  23  
  24    require (DIR_WS_CLASSES . 'currencies.php');
  25    $currencies = new currencies();
  26  ?>
  27  <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
  28  <html <?php echo HTML_PARAMS; ?>>
  29  <head>
  30  <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
  31  <title><?php echo TITLE; ?></title>
  32  <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
  33  <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
  34  <script language="javascript" src="includes/menu.js"></script>
  35  <script language="javascript" src="includes/general.js"></script>
  36  <script type="text/javascript">
  37    <!--
  38    function init()
  39    {
  40      cssjsmenu('navbar');
  41      if (document.getElementById)
  42      {
  43        var kill = document.getElementById('hoverJS');
  44        kill.disabled = true;
  45      }
  46    }
  47    // -->

  48  </script>
  49  </head>
  50  <body onload="init()">
  51  <!-- header //-->
  52  <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
  53  <!-- header_eof //-->
  54  
  55  <!-- body //-->
  56  <table border="0" width="100%" cellspacing="2" cellpadding="2">
  57    <tr>
  58  <!-- body_text //-->
  59      <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  60        <tr>
  61          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  62            <tr>
  63              <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
  64              <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
  65            </tr>
  66          </table></td>
  67        </tr>
  68        <tr>
  69          <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  70            <tr>
  71              <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  72                <tr class="dataTableHeadingRow">
  73                  <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NUMBER; ?></td>
  74                  <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS; ?></td>
  75                  <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_PURCHASED; ?>&nbsp;</td>
  76                </tr>
  77  <?php
  78    if (isset($_GET['page']) && ($_GET['page'] > 1)) $rows = $_GET['page'] * MAX_DISPLAY_SEARCH_RESULTS_REPORTS - MAX_DISPLAY_SEARCH_RESULTS_REPORTS;
  79    $customers_query_raw = "select c.customers_id, c.customers_firstname, c.customers_lastname, sum(op.products_quantity * op.final_price)+sum(op.onetime_charges)  as ordersum from " . TABLE_CUSTOMERS . " c, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS . " o where c.customers_id = o.customers_id and o.orders_id = op.orders_id group by c.customers_firstname, c.customers_lastname order by ordersum DESC";
  80    $customers_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS_REPORTS, $customers_query_raw, $customers_query_numrows);
  81  // fix counted customers

  82    $customers_query_m = $db->Execute("select customers_id
  83                                             from " . TABLE_ORDERS . " group by customers_id");
  84  
  85    $customers_query_numrows = $customers_query_m->RecordCount();
  86  
  87    $rows = 0;
  88    $customers = $db->Execute($customers_query_raw);
  89    while (!$customers->EOF) {
  90      $rows++;
  91  
  92      if (strlen($rows) < 2) {
  93        $rows = '0' . $rows;
  94      }
  95  ?>
  96                <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='<?php echo zen_href_link(FILENAME_CUSTOMERS, 'cID=' . $customers->fields['customers_id'], 'NONSSL'); ?>'">
  97                  <td class="dataTableContent" align="right"><?php echo $customers->fields['customers_id']; ?>&nbsp;&nbsp;</td>
  98                  <td class="dataTableContent"><?php echo '<a href="' . zen_href_link(FILENAME_CUSTOMERS, 'cID=' . $customers->fields['customers_id'], 'NONSSL') . '">' . $customers->fields['customers_firstname'] . ' ' . $customers->fields['customers_lastname'] . '</a>'; ?></td>
  99                  <td class="dataTableContent" align="right"><?php echo $currencies->format($customers->fields['ordersum']); ?>&nbsp;</td>
 100                </tr>
 101  <?php
 102      $customers->MoveNext();
 103    }
 104  ?>
 105              </table></td>
 106            </tr>
 107            <tr>
 108              <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
 109                <tr>
 110                  <td class="smallText" valign="top"><?php echo $customers_split->display_count($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_REPORTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS); ?></td>
 111                  <td class="smallText" align="right"><?php echo $customers_split->display_links($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_REPORTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?>&nbsp;</td>
 112                </tr>
 113              </table></td>
 114            </tr>
 115          </table></td>
 116        </tr>
 117      </table></td>
 118  <!-- body_text_eof //-->
 119    </tr>
 120  </table>
 121  <!-- body_eof //-->
 122  
 123  <!-- footer //-->
 124  <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
 125  <!-- footer_eof //-->
 126  </body>
 127  </html>
 128  <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>


Généré le : Mon Nov 26 16:45:43 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics