tjgames
22.11.2006, 07:43
Hallo!
Ich aktualisiere meine Produkte immer per csv-Import und habe mir eine Contribution vion osCommerce so umgeschrieben, dass alle Artikel angezeigt werden, die beim letzen Import nicht aktualisiert wurden.
Neben jedem Artikel kann man ein Feld Markieren und es dann mit Klick auf die Schaltfläche löschen. Dies ist immer sehr umständlich, da ich immer jedes einzelne Markieren muss.
Nun zu meiner Frage: Wie bekomme ich es hin, dass ich ein Feld habe um alle Artikel zu Markieren. Also so wie bei der Kategorie und Artikelverwaltung?
Der Inhalt der Daei (delete_hardware.php):
**require('includes/application_top.php');
**
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Tranistional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<style type="text/css">
<!--
th {**font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; background-color: #eeeeee}
/ table {**border: #666666; border-style: dashed; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px} /
/ td {**font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; padding-top: 3px; padding-bottom: 3px; padding-left: 5px} /
td.left {**font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; padding-top: 3px; padding-bottom: 3px; padding-left: 5px; text-align: right; padding-right: 16px}
-->
</style>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
<div id="spiffycalendar" class="text"></div>
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<table border="0" width="100%" cellspacing="2" cellpadding="2">
**<tr>
****<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
********</table></td>
****<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
******<tr>
********<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
**********<tr>
************<td class="pageHeading"><?php echo "Deleted Product Search" ?></td>
************<td class="pageHeading" align="right"><?php echo xtc_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
**********</tr>
********</table></td>
******</tr>
******<tr>
********<td align="left">
<?php
$products_update_query = xtc_db_query("SELECT products_update_date FROM ".TABLE_PRODUCTS_UPDATE." WHERE products_update_id =1");
$products_update = xtc_db_fetch_array($products_update_query);
$update = $products_update['products_update_date'];
**echo "<form name=\"update\" method=\"post\" action=\"".$_SERVER["PHP_SELF"]."?action=update_prices\">";
**echo "<table>";
**echo "<tr><th>Product ID</th><th>EAN</th><th>Title</th><th>Aktualisiert</th><th>Delete</th></tr><tr>";
$result = xtc_db_query("SELECT FROM ".TABLE_PRODUCTS.", ".TABLE_PRODUCTS_DESCRIPTION."**WHERE (products.products_update_hardware NOT LIKE**'".$update."') AND products.products_id = products_description.products_id");
****if ($row = mysql_fetch_array($result)) {
********do {
************$prezzo=round($row['products_price'],2);
************echo "<td align=\"center\">".$row["products_model"]."</td>\n";
************echo "<td align=\"center\">".$row["products_ean"]."</td>\n";
************echo "<td>".$row["products_name"]."</td>\n";
************echo "<td align=\"center\">".$row["products_update_hardware"]."</td>\n";
************echo "<td align=\"center\"><input type=\"checkbox\" name=\"product_new_price[".$row['products_id']."]\" value=\"removed\"></td>\n";
************echo "</tr>\n";
********}
********while($row = mysql_fetch_array($result));
****}
echo "
<input type=\"submit\" value=\"Remove the products you selected\">";
echo "</form>
<hr>
";
if ($action == "update_prices") {
****foreach($HTTP_POST_VARS['product_new_price'] as $id => $cancella) {
********echo "id: $id -> $cancella
";
****************** xtc_db_query("delete from " . TABLE_SPECIALS . " where products_id = '".$id. "'");
****************** xtc_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . $id . "'");
****************** xtc_db_query("delete from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $id . "'");
****************** xtc_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $id . "'");
****************** xtc_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where products_id = '" . $id . "'");
****************** xtc_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where products_id = '" . $id . "'");
****************** xtc_db_query("delete from " . TABLE_PRODUCTS . " where products_id = '" . $id . "'");
****************** $count++;
****}
****echo "
<font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">$count product removed!!</font></p>";
}
?>
****</table></td>
**</tr>
</table>
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
Ist zwar nicht ganz nach xtc geschrieben, aber es war ja auch ne Contribution für osCommerce.
Oder gibt es da eine Komfortablere Lösung?
Über eure Hilfe würde ich mich sehr freuen.
Liebe Grüße Till
Ich aktualisiere meine Produkte immer per csv-Import und habe mir eine Contribution vion osCommerce so umgeschrieben, dass alle Artikel angezeigt werden, die beim letzen Import nicht aktualisiert wurden.
Neben jedem Artikel kann man ein Feld Markieren und es dann mit Klick auf die Schaltfläche löschen. Dies ist immer sehr umständlich, da ich immer jedes einzelne Markieren muss.
Nun zu meiner Frage: Wie bekomme ich es hin, dass ich ein Feld habe um alle Artikel zu Markieren. Also so wie bei der Kategorie und Artikelverwaltung?
Der Inhalt der Daei (delete_hardware.php):
**require('includes/application_top.php');
**
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Tranistional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<style type="text/css">
<!--
th {**font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; background-color: #eeeeee}
/ table {**border: #666666; border-style: dashed; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px} /
/ td {**font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; padding-top: 3px; padding-bottom: 3px; padding-left: 5px} /
td.left {**font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; padding-top: 3px; padding-bottom: 3px; padding-left: 5px; text-align: right; padding-right: 16px}
-->
</style>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
<div id="spiffycalendar" class="text"></div>
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<table border="0" width="100%" cellspacing="2" cellpadding="2">
**<tr>
****<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
********</table></td>
****<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
******<tr>
********<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
**********<tr>
************<td class="pageHeading"><?php echo "Deleted Product Search" ?></td>
************<td class="pageHeading" align="right"><?php echo xtc_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
**********</tr>
********</table></td>
******</tr>
******<tr>
********<td align="left">
<?php
$products_update_query = xtc_db_query("SELECT products_update_date FROM ".TABLE_PRODUCTS_UPDATE." WHERE products_update_id =1");
$products_update = xtc_db_fetch_array($products_update_query);
$update = $products_update['products_update_date'];
**echo "<form name=\"update\" method=\"post\" action=\"".$_SERVER["PHP_SELF"]."?action=update_prices\">";
**echo "<table>";
**echo "<tr><th>Product ID</th><th>EAN</th><th>Title</th><th>Aktualisiert</th><th>Delete</th></tr><tr>";
$result = xtc_db_query("SELECT FROM ".TABLE_PRODUCTS.", ".TABLE_PRODUCTS_DESCRIPTION."**WHERE (products.products_update_hardware NOT LIKE**'".$update."') AND products.products_id = products_description.products_id");
****if ($row = mysql_fetch_array($result)) {
********do {
************$prezzo=round($row['products_price'],2);
************echo "<td align=\"center\">".$row["products_model"]."</td>\n";
************echo "<td align=\"center\">".$row["products_ean"]."</td>\n";
************echo "<td>".$row["products_name"]."</td>\n";
************echo "<td align=\"center\">".$row["products_update_hardware"]."</td>\n";
************echo "<td align=\"center\"><input type=\"checkbox\" name=\"product_new_price[".$row['products_id']."]\" value=\"removed\"></td>\n";
************echo "</tr>\n";
********}
********while($row = mysql_fetch_array($result));
****}
echo "
<input type=\"submit\" value=\"Remove the products you selected\">";
echo "</form>
<hr>
";
if ($action == "update_prices") {
****foreach($HTTP_POST_VARS['product_new_price'] as $id => $cancella) {
********echo "id: $id -> $cancella
";
****************** xtc_db_query("delete from " . TABLE_SPECIALS . " where products_id = '".$id. "'");
****************** xtc_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . $id . "'");
****************** xtc_db_query("delete from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $id . "'");
****************** xtc_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $id . "'");
****************** xtc_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where products_id = '" . $id . "'");
****************** xtc_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where products_id = '" . $id . "'");
****************** xtc_db_query("delete from " . TABLE_PRODUCTS . " where products_id = '" . $id . "'");
****************** $count++;
****}
****echo "
<font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">$count product removed!!</font></p>";
}
?>
****</table></td>
**</tr>
</table>
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
Ist zwar nicht ganz nach xtc geschrieben, aber es war ja auch ne Contribution für osCommerce.
Oder gibt es da eine Komfortablere Lösung?
Über eure Hilfe würde ich mich sehr freuen.
Liebe Grüße Till