Jump to content
xt:Commerce Community Forum

Startseite im Adminbereich ändern


satbayern

Recommended Posts

Bitteschön:

ersetze den Inhalt der admin/start.php durch folgendes, dann haste zusätzlich zur Statistik auch gleich noch die Geburtstage deiner Kunden.

 
<?php
/* --------------------------------------------------------------
$Id: start.php 1235 2005-09-21 19:11:43Z mz $
XT-Commerce - community made shopping
http://www.xt-commerce.com
Copyright (c) 2003 XT-Commerce
--------------------------------------------------------------
based on:
(c) 2000-2001 The Exchange Project
(c) 2002-2003 osCommerce coding standards (a typical file) www.oscommerce.com
(c) 2003 nextcommerce (start.php,1.5 2004/03/17); www.nextcommerce.org
Released under the GNU General Public License
--------------------------------------------------------------*/
require ('includes/application_top.php');
require_once 'includes/modules/carp/carp.php';
function array_qsort (&$array, $column=0, $order=SORT_ASC, $first=0, $last= -2)
{
// $array - the array to be sorted
// $column - index (column) on which to sort
// can be a string if using an associative array
// $order - SORT_ASC (default) for ascending or SORT_DESC for descending
// $first - start index (row) for partial array sort
// $last - stop index (row) for partial array sort
// $keys - array of key values for hash array sort
$keys = array_keys($array);
if($last == -2) $last = count($array) - 1;
if($last > $first) {
$alpha = $first;
$omega = $last;
$key_alpha = $keys[$alpha];
$key_omega = $keys[$omega];
$guess = $array[$key_alpha][$column];
while($omega >= $alpha) {
if($order == SORT_ASC) {
while($array[$key_alpha][$column] < $guess) {$alpha++; $key_alpha =
$keys[$alpha]; }
while($array[$key_omega][$column] > $guess) {$omega--; $key_omega =
$keys[$omega]; }
} else {
while($array[$key_alpha][$column] > $guess) {$alpha++; $key_alpha =
$keys[$alpha]; }
while($array[$key_omega][$column] < $guess) {$omega--; $key_omega =
$keys[$omega]; }
}
if($alpha > $omega) break;
$temporary = $array[$key_alpha];
$array[$key_alpha] = $array[$key_omega]; $alpha++;
$key_alpha = $keys[$alpha];
$array[$key_omega] = $temporary; $omega--;
$key_omega = $keys[$omega];
}
array_qsort ($array, $column, $order, $first, $omega);
array_qsort ($array, $column, $order, $alpha, $last);
}
}
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $_SESSION['language_charset']; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<style type="text/css">
.h2 {
font-family: Trebuchet MS,Palatino,Times New Roman,serif;
font-size: 13pt;
font-weight: bold;
}
.h3 {
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: 9pt;
font-weight: bold;
}
</style>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
<tr>
<td class="columnLeft2" width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td class="boxCenter" width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="80" rowspan="2"><?php echo xtc_image(DIR_WS_ICONS.'heading_news.gif'); ?></td>
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
</tr>
<tr>
<td class="main" valign="top"> </td>
</tr>
</table></td>
</tr>
<tr>
<td>
<?php include(DIR_WS_MODULES.FILENAME_SECURITY_CHECK); ?>

<?php
$customers_query = xtc_db_query("select count(*) as count from " . TABLE_CUSTOMERS);
$customers = xtc_db_fetch_array($customers_query);
$newsletter_query = xtc_db_query("select count(*) as count from " . TABLE_CUSTOMERS. " where customers_newsletter = '1'");
$newsletter = xtc_db_fetch_array($newsletter_query);
$products_query = xtc_db_query("select count(*) as count from " . TABLE_PRODUCTS . " where products_status = '1'");
$products = xtc_db_fetch_array($products_query);
$products1_query = xtc_db_query("select count(*) as count from " . TABLE_PRODUCTS . " where products_status = '0'");
$products1 = xtc_db_fetch_array($products1_query);
$products2_query = xtc_db_query("select count(*) as count from " . TABLE_PRODUCTS . "");
$products2 = xtc_db_fetch_array($products2_query);
$orders0_query = xtc_db_query("select count(*) as count from " . TABLE_ORDERS . " where orders_status = '0'");
$orders0 = xtc_db_fetch_array($orders0_query);
$orders1_query = xtc_db_query("select count(*) as count from " . TABLE_ORDERS . " where orders_status = '1'");
$orders1 = xtc_db_fetch_array($orders1_query);
$orders2_query = xtc_db_query("select count(*) as count from " . TABLE_ORDERS . " where orders_status = '2'");
$orders2 = xtc_db_fetch_array($orders2_query);
$orders3_query = xtc_db_query("select count(*) as count from " . TABLE_ORDERS . " where orders_status = '3'");
$orders3 = xtc_db_fetch_array($orders3_query);
$specials_query = xtc_db_query("select count(*) as count from " . TABLE_SPECIALS);
$specials = xtc_db_fetch_array($specials_query);

?>
<br />
<div align="center">
<div align="left">
<table width="100%" cellspacing="0" cellpadding="5" style="font-family: Verdana; font-size: 11px; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC">
<tr>
<td align="left" colspan="2" bgcolor="#FFCC99" style="border-bottom: 1px solid #CCCCCC">
<span style="font-size: 11pt; font-weight: 700">Statistik</span></td>
</tr>
<tr>
<td align="center" colspan="2" bgcolor="#F1F1F1" style="border-bottom: 1px solid #CCCCCC">
<p align="left"><font face="Verdana"><b>Kunden</b></font></td>
</tr>
<tr>
<td bgcolor="#F9F0F1" style="border-bottom: 1px dotted #000000">
<font face="Verdana">Kunden:</font></td>
<td bgcolor="#F9F0F1" style="border-bottom: 1px dotted #000000">
<font face="Verdana"><?php echo $customers['count']; ?></font></td>
</tr>
<tr>
<td bgcolor="#F9F0F1">
<font face="Verdana">Newsletter Abo:</font></td>
<td bgcolor="#F9F0F1">
<font face="Verdana"><?php echo $newsletter['count']; ?></font></td>
</tr>
<tr>
<td align="center" colspan="2" bgcolor="#F1F1F1" style="border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC">
<p align="left"><b><font face="Verdana">Artikel</font></b></td>
</tr>
<tr>
<td bgcolor="#F9F0F1" style="border-bottom: 1px dotted #000000">
<font face="Verdana">Aktive Artikel:</font></td>
<td bgcolor="#F9F0F1" style="border-bottom: 1px dotted #000000">
<font face="Verdana"><?php echo $products['count']; ?></font></td>
</tr>
<tr>
<td bgcolor="#F9F0F1" style="border-bottom: 1px dotted #000000">
<font face="Verdana">Inaktive Artikel:</font></td>
<td bgcolor="#F9F0F1" style="border-bottom: 1px dotted #000000">
<font face="Verdana"><?php echo $products1['count']; ?></font></td>
</tr>
<tr>
<td bgcolor="#F9F0F1" style="border-bottom: 1px dotted #000000">
<font face="Verdana">Artikel gesamt:</font></td>
<td bgcolor="#F9F0F1" style="border-bottom: 1px dotted #000000">
<font face="Verdana"><?php echo $products2['count']; ?></font></td>
</tr>
<tr>
<td bgcolor="#F9F0F1">
<font face="Verdana">Sonderangebote:</font></td>
<td bgcolor="#F9F0F1">
<font face="Verdana"><?php echo $specials['count']; ?></font></td>
</tr>
<tr>
<td align="center" colspan="2" bgcolor="#F1F1F1" style="border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC">
<p align="left"><b><font face="Verdana">Bestellungen</font></b></td>
</tr>
<tr>
<td bgcolor="#F9F0F1" style="border-bottom: 1px dotted #000000">
<font face="Verdana">Offen:</font></td>
<td bgcolor="#F9F0F1" style="border-bottom: 1px dotted #000000">
<font face="Verdana"><?php echo $orders1['count']; ?></font></td>
</tr>
<tr>
<td bgcolor="#F9F0F1" style="border-bottom: 1px dotted #000000">
<font face="Verdana">In Bearbeitung:</font></td>
<td bgcolor="#F9F0F1" style="border-bottom: 1px dotted #000000">
<font face="Verdana"><?php echo $orders2['count']; ?></font></td>
</tr>
<tr>
<td bgcolor="#F9F0F1" style="border-bottom: 1px dotted #000000">
<font face="Verdana">Versendet:</font></td>
<td bgcolor="#F9F0F1" style="border-bottom: 1px dotted #000000">
<font face="Verdana"><?php echo $orders3['count']; ?></font></td>
</tr>
<tr>
<td bgcolor="#F9F0F1">
<font face="Verdana">nicht Bestätigt:</font></td>
<td bgcolor="#F9F0F1">
<font face="Verdana"><?php echo $orders0['count']; ?></font></td>
</tr>
</table>
</div>
</div>
<span style="font-size: 11pt">


<br />
<div align="center">
<table cellpadding="5" cellspacing="0" width="100%" id="table1" style="border-bottom:1px solid #CCCCCC; border-top:1px solid #CCCCCC; font-family: Verdana; font-size: 11px">
<tr>
<td bgcolor="#FFCC99">
<b><span style="font-size: 11pt">Geburtstagsliste</span></b><span>
</span>
</td>
</tr>
</table>
</div>
<table cellpadding="5" cellspacing="0" style="font-family:Verdana; font-size:11px" width="100%" id="AutoNumber1">
<tr>
<td width="100%" colspan="2" bgcolor="#F1F1F1" style="border-bottom: 1px solid #CCCCCC"><b>Kunden, die heute Geburtstag haben:</b></td>
</tr>
<?php
$ergebnis=xtc_db_query("SELECT * FROM customers ORDER BY customers_dob");
$i=0;
while($row = mysql_fetch_object($ergebnis))
{
$gebdat=strtotime($row->customers_dob);
$gebjahr=date('Y',$gebdat);
$gebmonat=date('n',$gebdat);
$gebtag=date('j',$gebdat);
if ($gebmonat == date('n') and $gebtag == date('j'))
{
echo '<tr><td width="78%" bgcolor="#FFF9E9">';
echo $row->customers_firstname . " " . $row->customers_lastname;
echo '</td><td width="22%" bgcolor="#FFF9E9">';
echo xtc_date_long($row->customers_dob);
echo '</td></tr>';
}
if ($gebmonat == date('n') and $gebtag > date('j'))
{
//(nur zwischenspeichern und nach der schleife ausgeben)
$geb_bald[$i][0]=$row->customers_firstname;
$geb_bald[$i][1]=$row->customers_lastname;
$geb_bald[$i][2]=$row->customers_dob;
$i++;
}
}
?>
<tr>
<td width="100%" colspan="2" style="border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC" bgcolor="#F1F1F1"><b>Kunden, die noch in diesem Monat Geburtstag haben:</b></td>
</tr>
<?php

$anzahl = count($geb_bald);
for($i=0; $i<$anzahl; $i++) {
$geb_bald_sort[$i][0] = $geb_bald[$i][0];
$geb_bald_sort[$i][1] = $geb_bald[$i][1];
$geb_bald_sort[$i][2] = substr($geb_bald[$i][2],8,2);
}
if ($anzahl > 0)
array_qsort($geb_bald_sort, 2);

for($i=0;$i<$anzahl;$i++) {
for($a=0;$a<$anzahl;$a++) {
if (($geb_bald_sort[$i][0] == $geb_bald[$a][0]) && ($geb_bald_sort
[$i][1] == $geb_bald[$a][1]))
break;
}
$geb_bald_sort[$i][2] = $geb_bald[$a][2];
}

for($i=0; $i<$anzahl; $i++) {
echo '<tr><td width="78%" bgcolor="#F9F0F1" style="border-bottom: 1px dotted #000000">';
echo $geb_bald_sort[$i][0] . ' ' . $geb_bald_sort[$i][1];
echo '</td><td width="22%" bgcolor="#F9F0F1" style="border-bottom: 1px dotted #000000">';
echo xtc_date_long($geb_bald_sort[$i][2]);
echo '</td></tr>';
}
echo '</table><br>';
unset($geb_bald);
?>

</span>
</td>
</tr>

<tr>
<td style="border: 0px solid; border-color: #ffffff;" > </td>
<!-- body_text_eof //-->
</tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
[/php]

Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...

Chic, chic ... ziehmlich coole Erweiterung/ Änderung! Vielen Dank für diesen "Codeschnipsel", funktioniert einwandfrei!

Wie müsste man denn den Code ändern, damit neben dem Kundennamen auch die registrierte Mailadresse des Kunden angezeigt wird? Somit müßte man sich nicht erst das Profil raussuchen um Ihm eine nette Geburtstagsmail schicken zu können.

Vielen Dank für die immer wieder super gute Unterstützung

Euch allen eine schöne vorweihnachtliche Zeit

PS.: Und für die ganz faule Fraktion unter uns wäre es noch interessant gewesen, wenn gleich noch das Alter hinter dem Geburtsdatum angezeigt würde :) .

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...