DarKmaN_AC
26.04.2006, 16:20
Ich versuche gerade die Contrib Multishop von OSC, auf XTC zu ändern. Dabei habe ich folgene Fehlermeldung wenn ich die Datei aufrufe:
''>ZITAT</div>Multishop
1146 - Table 'd0021cc6.TABLE_SHOPS' doesn't exist
select count( ) as total from TABLE_SHOPS s, TABLE_SHOPS_INFO si where s.shops_id = si.shops_id
[XT SQL Error]
[/b]
Hier ist der PHP Code von dieser Datei:
''>ZITAT</div>
<?php
/
shops.php v1.00
Publied for
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com (http://anonym.to/?http://www.oscommerce.com)
Copyright © 2003 osCommerce
Released under the GNU General Public License
Created by XoraX for Multi-Shop Contribution
http://xorax.free.fr (http://anonym.to/?http://xorax.free.fr)
xxorax@gmail.com
/
require('includes/application_top.php');
$action = (isset($HTTP_GET['action']) ? $HTTP_GET['action'] : '');
// if (xtc_not_null($action)) {
switch ($action) {
case 'insert':
case 'save':
if (isset($HTTP_GET['sID'])) $shops_id = xtc_db_prepare_input($HTTP_GET['sID']);
$shops_name = xtc_db_prepare_input($HTTP_POST['shops_name']);
$sql_data_array = array('shops_name' => $shops_name);
if ($action == 'insert') {
xtc_db_perform(TABLE_SHOPS, $sql_data_array);
$shops_id = xtc_db_insert_id();
} elseif ($action == 'save') {
xtc_db_perform(TABLE_SHOPS, $sql_data_array, 'update', "shops_id = '" . (int)$shops_id . "'");
}
$sql_data_array = array('shops_addr' => xtc_db_prepare_input($_POST['shops_addr']),
'shops_ville' => xtc_db_prepare_input($_POST['shops_ville']),
'shops_cp' => xtc_db_prepare_input($_POST['shops_cp']),
'shops_tel' => xtc_db_prepare_input($_POST['shops_tel']),
'shops_fax' => xtc_db_prepare_input($_POST['shops_fax']),
'shops_indic' => xtc_db_prepare_input($_POST['shops_indic'])
);
if($action == 'insert') {
$insert_sql_data = array('shops_id' => $manufacturers_id);
$sql_data_array = array_merge($sql_data_array, $insert_sql_data);
xtc_db_perform(TABLE_SHOPS_INFO, $sql_data_array);
} elseif ($action == 'save') {
xtc_db_perform(TABLE_SHOPS_INFO, $sql_data_array, 'update', "shops_id = '" . (int)$shops_id . "'");
}
if ($shops_image = new upload('shops_image', DIR_FS_CATALOG_IMAGES)) {
xtc_db_query("update " . TABLE_SHOPS_INFO . " set shops_image = '" . $shops_image->filename . "' where shops_id = '" . (int)$shops_id . "'");
}
if ($shops_plan = new upload('shops_plan', DIR_FS_CATALOG_IMAGES)) {
xtc_db_query("update " . TABLE_SHOPS_INFO . " set shops_plan = '" . $shops_plan->filename . "' where shops_id = '" . (int)$shops_id . "'");
}
if (USE_CACHE == 'true') {
xtc_reset_cache_block('shops');
}
xtc_redirect(xtc_href_link(FILENAME_SHOPS, (isset($HTTP_GET['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'sID=' . $shops_id));
break;
case 'deleteconfirm':
$shops_id = xtc_db_prepare_input($HTTP_GET['sID']);
if (isset($HTTP_POST['delete_image']) && ($HTTP_POST_VARS['delete_image'] == 'on')) {
$shop_query = xtc_db_query("select shops_image from " . TABLE_SHOPS_INFO . " where shops_id = '" . (int)$shops_id . "'");
$shop = xtc_db_fetch_array($shop_query);
$image_location = DIR_FS_CATALOG_IMAGES_SHOPS . $shop['shops_image'];
if (file_exists($image_location)) @unlink($image_location);
$image_location = DIR_FS_CATALOG_IMAGES_SHOPS . xtc_parse_image($shop['shops_image'], SMALL_IMAGE_EXT);
if (file_exists($image_location)) @unlink($image_location);
}
if (isset($HTTP_POST['delete_plan']) && ($HTTP_POST['delete_plan'] == 'on')) {
$shop_query = xtc_db_query("select shops_plan from " . TABLE_SHOPS_INFO . " where shops_id = '" . (int)$shops_id . "'");
$shop = xtc_db_fetch_array($shop_query);
$image_location = DIR_FS_CATALOG_IMAGES_SHOPS . $shop['shops_plan'];
if (file_exists($image_location)) @unlink($image_location);
$image_location = DIR_FS_CATALOG_IMAGES_SHOPS . xtc_parse_image($shop['shops_plan'], SMALL_IMAGE_EXT);
if (file_exists($image_location)) @unlink($image_location);
}
xtc_db_query("delete from " . TABLE_SHOPS . " where shops_id = '" . (int)$shops_id . "'");
xtc_db_query("delete from " . TABLE_SHOPS_INFO . " where shops_id = '" . (int)$shops_id . "'");
if (isset($HTTP_POST['delete_products']) && ($HTTP_POST['delete_products'] == 'on')) {
$products_query = xtc_db_query("select products_id from " . TABLE_PRODUCTS . " where shops_id = '" . (int)$shops_id . "'");
while ($products = xtc_db_fetch_array($products_query)) {
xtc_remove_product($products['products_id']);
}
} else {
xtc_db_query("update " . TABLE_PRODUCTS . " set shops_id = '' where shops_id = '" . (int)$shops_id . "'");
}
if (USE_CACHE == 'true') {
xtc_reset_cache_block('shops');
}
xtc_redirect(xtc_href_link(FILENAME_SHOPS, 'page=' . $HTTP_GET_VARS['page']));
break;
case 'new':
$head = TEXT_HEADING_NEW_SHOP;
break;
case 'edit':
$head = TEXT_HEADING_EDIT_SHOP;
break;
default:
$head = HEADING_TITLE;
break;
}
// }
?>
<!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">
<script language="javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="SetFocus();">
<?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 width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo $head; ?></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>
<?php
if ( ($action == 'new') || ($action == 'edit') ) {
$form_action = 'insert';
if ( ($action == 'edit') && isset($HTTP_GET_VARS['sID']) ) {
$form_action = 'save';
$shop_query = xtc_db_query("select s.shops_id, s.shops_name, si.shops_addr, si.shops_ville, si.shops_cp, si.shops_tel, si.shops_fax, si.shops_indic, si.shops_image, si.shops_plan from " . TABLE_SHOPS . " s, " . TABLE_SHOPS_INFO. " si where s.shops_id = '" . (int)$HTTP_GET_VARS['sID'] . "' and s.shops_id = si.shops_id");
$shop = xtc_db_fetch_array($shop_query);
$sInfo = new objectInfo($shop);
} else {
$sInfo = new objectInfo(array());
}
?>
<tr><form name="new_shop" <?php echo 'action="' . xtc_href_link(FILENAME_SHOPS, xtc_get_all_get_params(array('action', 'info', 'sID')) . 'action=' . $form_action, 'NONSSL') . '"'; ?> method="post" enctype="multipart/form-data"><?php if ($form_action == 'save') echo xtc_draw_hidden_field('shops_id', $HTTP_GET_VARS['sID']); ?>
<td>
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td class="main"><?php echo TEXT_SHOPS_NAME; ?></td>
<td class="main"><?php echo xtc_draw_input_field('shops_name', (isset($sInfo->shops_name) ? $sInfo->shops_name : '')); ?></td>
</tr>
<tr>
<td colspan="2"><?php echo xtc_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="main"><?php echo TEXT_SHOPS_ADDR; ?></td>
<td class="main"><?php echo xtc_draw_input_field('shops_addr', (isset($sInfo->shops_addr) ? $sInfo->shops_addr : '')); ?></td>
</tr>
<tr>
<td class="main"><?php echo TEXT_SHOPS_CP; ?></td>
<td class="main"><?php echo xtc_draw_input_field('shops_cp', (isset($sInfo->shops_cp) ? $sInfo->shops_cp: '')); ?></td>
</tr>
<tr>
<td class="main"><?php echo TEXT_SHOPS_VILLE; ?></td>
<td class="main"><?php echo xtc_draw_input_field('shops_ville', (isset($sInfo->shops_ville) ? $sInfo->shops_ville: '')); ?></td>
</tr>
<tr>
<td colspan="2"><?php echo xtc_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="main" valign="top"><?php echo TEXT_SHOPS_INDIC; ?></td>
<td class="main"><?php echo xtc_draw_textarea_field('shops_indic', 'soft', '70', '15', (isset($sInfo->shops_indic) ? $sInfo->shops_indic: '') ); ?></td>
</tr>
<tr>
<td colspan="2"><?php echo xtc_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="main"><?php echo TEXT_SHOPS_TEL; ?></td>
<td class="main"><?php echo xtc_draw_input_field('shops_tel', (isset($sInfo->shops_tel) ? $sInfo->shops_tel: '')); ?></td>
</tr>
<tr>
<td class="main"><?php echo TEXT_SHOPS_FAX; ?></td>
<td class="main"><?php echo xtc_draw_input_field('shops_fax', (isset($sInfo->shops_fax) ? $sInfo->shops_fax: '')); ?></td>
</tr>
<tr>
<td colspan="2"><?php echo xtc_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="main"><?php echo TEXT_SHOPS_IMAGE; ?></td>
<td class="main"><?php echo xtc_draw_file_field('shops_image'); ?></td>
</tr>
<tr>
<td class="main"><?php echo TEXT_SHOPS_PLAN; ?></td>
<td class="main"><?php echo xtc_draw_file_field('shops_plan'); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo xtc_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="main" align="right" valign="top">
<?php echo (($form_action == 'insert') ? xtc_image_submit('button_insert.gif', IMAGE_INSERT) : xtc_image_submit('button_update.gif', IMAGE_UPDATE)). '' . xtc_image_button('button_cancel.gif', IMAGE_CANCEL) . ' (' . xtc_href_link(FILENAME_SHOPS, 'page=' . $HTTP_GET_VARS['page'] . (isset($HTTP_GET_VARS['sID']) ? '&sID=' . $HTTP_GET_VARS['sID'] : '')) . ')'; ?></td>
</td>
</form></tr>
<?php
}else{
?>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_SHOPS; ?></td>
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?></td>
</tr>
<?php
$shops_query_raw = "select s.shops_id, s.shops_name, si.shops_addr, si.shops_ville, si.shops_cp, si.shops_tel, si.shops_fax, si.shops_image, si.shops_plan from " . TABLE_SHOPS . " s, " . TABLE_SHOPS_INFO . " si where s.shops_id = si.shops_id order by s.shops_name";
$shops_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $shops_query_raw, $shops_query_numrows);
$shops_query = xtc_db_query($shops_query_raw);
while ($shops = xtc_db_fetch_array($shops_query)) {
if ((!isset($HTTP_GET_VARS['sID']) || (isset($HTTP_GET_VARS['sID']) && ($HTTP_GET_VARS['sID'] == $shops['shops_id']))) && !isset($sInfo) && (substr($action, 0, 3) != 'new')) {
$shop_products_query = xtc_db_query("select count( ) as products_count from " . TABLE_PRODUCTS . " where shops_id = '" . (int)$shops['shops_id'] . "'");
$shop_products = xtc_db_fetch_array($shop_products_query);
$sInfo_array = array_merge($shops, $shop_products);
$sInfo = new objectInfo($sInfo_array);
}
if (isset($sInfo) && is_object($sInfo) && ($shops['shops_id'] == $sInfo->shops_id)) {
echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . xtc_href_link(FILENAME_SHOPS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $shops['shops_id'] . '&action=edit') . '\'">' . "\n";
} else {
echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . xtc_href_link(FILENAME_SHOPS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $shops['shops_id']) . '\'">' . "\n";
}
?>
<td class="dataTableContent"><?php echo $shops['shops_name']; ?></td>
<td class="dataTableContent" align="right"><?php if (isset($sInfo) && is_object($sInfo) && ($shops['shops_id'] == $sInfo->shops_id)) { echo xtc_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '' . xtc_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ' (' . xtc_href_link(FILENAME_SHOPS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $shops['shops_id']) . ')'; } ?></td>
</tr>
<?php
}
?>
<tr>
<td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="smallText" valign="top"><?php echo $shops_split->display_count($shops_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_SHOPS); ?></td>
<td class="smallText" align="right"><?php echo $shops_split->display_links($shops_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
</tr>
</table></td>
</tr>
<?php
if (empty($action)) {
?>
<tr>
<td align="right" colspan="2" class="smallText"><?php echo '' . xtc_image_button('button_insert.gif', IMAGE_INSERT) . ' (' . xtc_href_link(FILENAME_SHOPS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->shops_id . '&action=new') . ')'; ?></td>
</tr>
<?php
}
?>
</table></td>
<?php
$heading = array();
$contents = array();
switch ($action) {
case 'delete':
$heading[] = array('text' => '' . TEXT_HEADING_DELETE_SHOP . '');
$contents = array('form' => xtc_draw_form('shops', FILENAME_SHOPS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->shops_id . '&action=deleteconfirm'));
$contents[] = array('text' => TEXT_DELETE_INTRO);
$contents[] = array('text' => '
' . $sInfo->shops_name . '');
$contents[] = array('text' => '
' . xtc_draw_checkbox_field('delete_image', '', true) . ' ' . TEXT_DELETE_IMAGE);
$contents[] = array('text' => '
' . xtc_draw_checkbox_field('delete_plan', '', true) . ' ' . TEXT_DELETE_PLAN);
if ($sInfo->products_count > 0) {
$contents[] = array('text' => '
' . xtc_draw_checkbox_field('delete_products') . ' ' . TEXT_DELETE_PRODUCTS);
$contents[] = array('text' => '
' . sprintf(TEXT_DELETE_WARNING_PRODUCTS, $sInfo->products_count));
}
$contents[] = array('align' => 'center', 'text' => '
' . xtc_image_submit('button_delete.gif', IMAGE_DELETE) . ' ' . xtc_image_button('button_cancel.gif', IMAGE_CANCEL) . ' (' . xtc_href_link(FILENAME_SHOPS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->shops_id) . ')');
break;
default:
if (isset($sInfo) && is_object($sInfo)) {
$heading[] = array('text' => '' . $sInfo->shops_name . '');
$contents[] = array('align' => 'center', 'text' => '' . xtc_image_button('button_edit.gif', IMAGE_EDIT) . ' (' . xtc_href_link(FILENAME_SHOPS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->shops_id . '&action=edit') . ') ' . xtc_image_button('button_delete.gif', IMAGE_DELETE) . ' (' . xtc_href_link(FILENAME_SHOPS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->shops_id . '&action=delete') . ')');
$contents[] = array('text' => '
' . TEXT_SHOPS_IMAGE . $sInfo->shops_image . '
' . TEXT_SHOPS_PLAN . $sInfo->shops_plan );
$contents[] = array('text' => '
' . TEXT_SHOPS_ADDR . '
'.$sInfo->shops_addr);
$contents[] = array('text' => '
' . TEXT_SHOPS_CP . '
'.$sInfo->shops_cp);
$contents[] = array('text' => '
' . TEXT_SHOPS_VILLE . '
'.$sInfo->shops_ville);
$contents[] = array('text' => '
' . TEXT_SHOPS_TEL . '' . $sInfo->shops_tel . '
' . TEXT_SHOPS_FAX . '' . $sInfo->shops_fax);
$contents[] = array('text' => '
' . TEXT_PRODUCTS . ' ' . $sInfo->products_count);
}
break;
}
if ( (xtc_not_null($heading)) && (xtc_not_null($contents)) ) {
echo ' <td width="25%" valign="top">' . "\n";
$box = new box;
echo $box->infoBox($heading, $contents);
echo ' </td>' . "\n";
}
}
?>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
[/b]
und folgender mysql code läßt sich nicht hinzufügen:
''>ZITAT</div>
INSERT INTO `configuration` VALUES ('', 'Affichage du Bloc Nos Magasins', 'MAX_DISPLAY_SHOPS_IN_A_LIST', '20', 'Quand le nombre de magasins dépasse cette valeur, une \'liste déroulante\' sera utilisée à la place de la liste par défaut.', 3, 8, '2005-04-29 01:13:06', '2005-04-28 05:16:13', NULL, NULL);
INSERT INTO `configuration` VALUES ('', 'Affichage du Bloc Nos Magasins \'Liste\'', 'MAX_SHOPS_LIST', '0', 'Quand cette valeur est égale à 1 la \'liste déroulante\' classique sera utilisée. Sinon, une liste sera affichée avec le nombre de lignes spécifiées.', 3, 8, '2005-04-29 01:12:10', '2005-04-28 05:16:13', NULL, NULL);
INSERT INTO `configuration` VALUES ('', 'Affichage du Bloc Nos Magasins \'Longueur du nom\'', 'MAX_DISPLAY_SHOP_NAME_LEN', '15', 'Longueur maximum du nom de magasin à afficher.', 3, 8, NULL, '2005-04-28 05:16:13', NULL, NULL);
[/b]
Könnte mir jemand bitte mal helfen uns sich das mal anschauen?
Das Modul wird für die xtc 3.04 sein!
THX!!
Gruß
Andre´
''>ZITAT</div>Multishop
1146 - Table 'd0021cc6.TABLE_SHOPS' doesn't exist
select count( ) as total from TABLE_SHOPS s, TABLE_SHOPS_INFO si where s.shops_id = si.shops_id
[XT SQL Error]
[/b]
Hier ist der PHP Code von dieser Datei:
''>ZITAT</div>
<?php
/
shops.php v1.00
Publied for
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com (http://anonym.to/?http://www.oscommerce.com)
Copyright © 2003 osCommerce
Released under the GNU General Public License
Created by XoraX for Multi-Shop Contribution
http://xorax.free.fr (http://anonym.to/?http://xorax.free.fr)
xxorax@gmail.com
/
require('includes/application_top.php');
$action = (isset($HTTP_GET['action']) ? $HTTP_GET['action'] : '');
// if (xtc_not_null($action)) {
switch ($action) {
case 'insert':
case 'save':
if (isset($HTTP_GET['sID'])) $shops_id = xtc_db_prepare_input($HTTP_GET['sID']);
$shops_name = xtc_db_prepare_input($HTTP_POST['shops_name']);
$sql_data_array = array('shops_name' => $shops_name);
if ($action == 'insert') {
xtc_db_perform(TABLE_SHOPS, $sql_data_array);
$shops_id = xtc_db_insert_id();
} elseif ($action == 'save') {
xtc_db_perform(TABLE_SHOPS, $sql_data_array, 'update', "shops_id = '" . (int)$shops_id . "'");
}
$sql_data_array = array('shops_addr' => xtc_db_prepare_input($_POST['shops_addr']),
'shops_ville' => xtc_db_prepare_input($_POST['shops_ville']),
'shops_cp' => xtc_db_prepare_input($_POST['shops_cp']),
'shops_tel' => xtc_db_prepare_input($_POST['shops_tel']),
'shops_fax' => xtc_db_prepare_input($_POST['shops_fax']),
'shops_indic' => xtc_db_prepare_input($_POST['shops_indic'])
);
if($action == 'insert') {
$insert_sql_data = array('shops_id' => $manufacturers_id);
$sql_data_array = array_merge($sql_data_array, $insert_sql_data);
xtc_db_perform(TABLE_SHOPS_INFO, $sql_data_array);
} elseif ($action == 'save') {
xtc_db_perform(TABLE_SHOPS_INFO, $sql_data_array, 'update', "shops_id = '" . (int)$shops_id . "'");
}
if ($shops_image = new upload('shops_image', DIR_FS_CATALOG_IMAGES)) {
xtc_db_query("update " . TABLE_SHOPS_INFO . " set shops_image = '" . $shops_image->filename . "' where shops_id = '" . (int)$shops_id . "'");
}
if ($shops_plan = new upload('shops_plan', DIR_FS_CATALOG_IMAGES)) {
xtc_db_query("update " . TABLE_SHOPS_INFO . " set shops_plan = '" . $shops_plan->filename . "' where shops_id = '" . (int)$shops_id . "'");
}
if (USE_CACHE == 'true') {
xtc_reset_cache_block('shops');
}
xtc_redirect(xtc_href_link(FILENAME_SHOPS, (isset($HTTP_GET['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'sID=' . $shops_id));
break;
case 'deleteconfirm':
$shops_id = xtc_db_prepare_input($HTTP_GET['sID']);
if (isset($HTTP_POST['delete_image']) && ($HTTP_POST_VARS['delete_image'] == 'on')) {
$shop_query = xtc_db_query("select shops_image from " . TABLE_SHOPS_INFO . " where shops_id = '" . (int)$shops_id . "'");
$shop = xtc_db_fetch_array($shop_query);
$image_location = DIR_FS_CATALOG_IMAGES_SHOPS . $shop['shops_image'];
if (file_exists($image_location)) @unlink($image_location);
$image_location = DIR_FS_CATALOG_IMAGES_SHOPS . xtc_parse_image($shop['shops_image'], SMALL_IMAGE_EXT);
if (file_exists($image_location)) @unlink($image_location);
}
if (isset($HTTP_POST['delete_plan']) && ($HTTP_POST['delete_plan'] == 'on')) {
$shop_query = xtc_db_query("select shops_plan from " . TABLE_SHOPS_INFO . " where shops_id = '" . (int)$shops_id . "'");
$shop = xtc_db_fetch_array($shop_query);
$image_location = DIR_FS_CATALOG_IMAGES_SHOPS . $shop['shops_plan'];
if (file_exists($image_location)) @unlink($image_location);
$image_location = DIR_FS_CATALOG_IMAGES_SHOPS . xtc_parse_image($shop['shops_plan'], SMALL_IMAGE_EXT);
if (file_exists($image_location)) @unlink($image_location);
}
xtc_db_query("delete from " . TABLE_SHOPS . " where shops_id = '" . (int)$shops_id . "'");
xtc_db_query("delete from " . TABLE_SHOPS_INFO . " where shops_id = '" . (int)$shops_id . "'");
if (isset($HTTP_POST['delete_products']) && ($HTTP_POST['delete_products'] == 'on')) {
$products_query = xtc_db_query("select products_id from " . TABLE_PRODUCTS . " where shops_id = '" . (int)$shops_id . "'");
while ($products = xtc_db_fetch_array($products_query)) {
xtc_remove_product($products['products_id']);
}
} else {
xtc_db_query("update " . TABLE_PRODUCTS . " set shops_id = '' where shops_id = '" . (int)$shops_id . "'");
}
if (USE_CACHE == 'true') {
xtc_reset_cache_block('shops');
}
xtc_redirect(xtc_href_link(FILENAME_SHOPS, 'page=' . $HTTP_GET_VARS['page']));
break;
case 'new':
$head = TEXT_HEADING_NEW_SHOP;
break;
case 'edit':
$head = TEXT_HEADING_EDIT_SHOP;
break;
default:
$head = HEADING_TITLE;
break;
}
// }
?>
<!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">
<script language="javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="SetFocus();">
<?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 width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo $head; ?></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>
<?php
if ( ($action == 'new') || ($action == 'edit') ) {
$form_action = 'insert';
if ( ($action == 'edit') && isset($HTTP_GET_VARS['sID']) ) {
$form_action = 'save';
$shop_query = xtc_db_query("select s.shops_id, s.shops_name, si.shops_addr, si.shops_ville, si.shops_cp, si.shops_tel, si.shops_fax, si.shops_indic, si.shops_image, si.shops_plan from " . TABLE_SHOPS . " s, " . TABLE_SHOPS_INFO. " si where s.shops_id = '" . (int)$HTTP_GET_VARS['sID'] . "' and s.shops_id = si.shops_id");
$shop = xtc_db_fetch_array($shop_query);
$sInfo = new objectInfo($shop);
} else {
$sInfo = new objectInfo(array());
}
?>
<tr><form name="new_shop" <?php echo 'action="' . xtc_href_link(FILENAME_SHOPS, xtc_get_all_get_params(array('action', 'info', 'sID')) . 'action=' . $form_action, 'NONSSL') . '"'; ?> method="post" enctype="multipart/form-data"><?php if ($form_action == 'save') echo xtc_draw_hidden_field('shops_id', $HTTP_GET_VARS['sID']); ?>
<td>
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td class="main"><?php echo TEXT_SHOPS_NAME; ?></td>
<td class="main"><?php echo xtc_draw_input_field('shops_name', (isset($sInfo->shops_name) ? $sInfo->shops_name : '')); ?></td>
</tr>
<tr>
<td colspan="2"><?php echo xtc_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="main"><?php echo TEXT_SHOPS_ADDR; ?></td>
<td class="main"><?php echo xtc_draw_input_field('shops_addr', (isset($sInfo->shops_addr) ? $sInfo->shops_addr : '')); ?></td>
</tr>
<tr>
<td class="main"><?php echo TEXT_SHOPS_CP; ?></td>
<td class="main"><?php echo xtc_draw_input_field('shops_cp', (isset($sInfo->shops_cp) ? $sInfo->shops_cp: '')); ?></td>
</tr>
<tr>
<td class="main"><?php echo TEXT_SHOPS_VILLE; ?></td>
<td class="main"><?php echo xtc_draw_input_field('shops_ville', (isset($sInfo->shops_ville) ? $sInfo->shops_ville: '')); ?></td>
</tr>
<tr>
<td colspan="2"><?php echo xtc_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="main" valign="top"><?php echo TEXT_SHOPS_INDIC; ?></td>
<td class="main"><?php echo xtc_draw_textarea_field('shops_indic', 'soft', '70', '15', (isset($sInfo->shops_indic) ? $sInfo->shops_indic: '') ); ?></td>
</tr>
<tr>
<td colspan="2"><?php echo xtc_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="main"><?php echo TEXT_SHOPS_TEL; ?></td>
<td class="main"><?php echo xtc_draw_input_field('shops_tel', (isset($sInfo->shops_tel) ? $sInfo->shops_tel: '')); ?></td>
</tr>
<tr>
<td class="main"><?php echo TEXT_SHOPS_FAX; ?></td>
<td class="main"><?php echo xtc_draw_input_field('shops_fax', (isset($sInfo->shops_fax) ? $sInfo->shops_fax: '')); ?></td>
</tr>
<tr>
<td colspan="2"><?php echo xtc_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="main"><?php echo TEXT_SHOPS_IMAGE; ?></td>
<td class="main"><?php echo xtc_draw_file_field('shops_image'); ?></td>
</tr>
<tr>
<td class="main"><?php echo TEXT_SHOPS_PLAN; ?></td>
<td class="main"><?php echo xtc_draw_file_field('shops_plan'); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo xtc_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="main" align="right" valign="top">
<?php echo (($form_action == 'insert') ? xtc_image_submit('button_insert.gif', IMAGE_INSERT) : xtc_image_submit('button_update.gif', IMAGE_UPDATE)). '' . xtc_image_button('button_cancel.gif', IMAGE_CANCEL) . ' (' . xtc_href_link(FILENAME_SHOPS, 'page=' . $HTTP_GET_VARS['page'] . (isset($HTTP_GET_VARS['sID']) ? '&sID=' . $HTTP_GET_VARS['sID'] : '')) . ')'; ?></td>
</td>
</form></tr>
<?php
}else{
?>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_SHOPS; ?></td>
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?></td>
</tr>
<?php
$shops_query_raw = "select s.shops_id, s.shops_name, si.shops_addr, si.shops_ville, si.shops_cp, si.shops_tel, si.shops_fax, si.shops_image, si.shops_plan from " . TABLE_SHOPS . " s, " . TABLE_SHOPS_INFO . " si where s.shops_id = si.shops_id order by s.shops_name";
$shops_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $shops_query_raw, $shops_query_numrows);
$shops_query = xtc_db_query($shops_query_raw);
while ($shops = xtc_db_fetch_array($shops_query)) {
if ((!isset($HTTP_GET_VARS['sID']) || (isset($HTTP_GET_VARS['sID']) && ($HTTP_GET_VARS['sID'] == $shops['shops_id']))) && !isset($sInfo) && (substr($action, 0, 3) != 'new')) {
$shop_products_query = xtc_db_query("select count( ) as products_count from " . TABLE_PRODUCTS . " where shops_id = '" . (int)$shops['shops_id'] . "'");
$shop_products = xtc_db_fetch_array($shop_products_query);
$sInfo_array = array_merge($shops, $shop_products);
$sInfo = new objectInfo($sInfo_array);
}
if (isset($sInfo) && is_object($sInfo) && ($shops['shops_id'] == $sInfo->shops_id)) {
echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . xtc_href_link(FILENAME_SHOPS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $shops['shops_id'] . '&action=edit') . '\'">' . "\n";
} else {
echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . xtc_href_link(FILENAME_SHOPS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $shops['shops_id']) . '\'">' . "\n";
}
?>
<td class="dataTableContent"><?php echo $shops['shops_name']; ?></td>
<td class="dataTableContent" align="right"><?php if (isset($sInfo) && is_object($sInfo) && ($shops['shops_id'] == $sInfo->shops_id)) { echo xtc_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '' . xtc_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ' (' . xtc_href_link(FILENAME_SHOPS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $shops['shops_id']) . ')'; } ?></td>
</tr>
<?php
}
?>
<tr>
<td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="smallText" valign="top"><?php echo $shops_split->display_count($shops_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_SHOPS); ?></td>
<td class="smallText" align="right"><?php echo $shops_split->display_links($shops_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
</tr>
</table></td>
</tr>
<?php
if (empty($action)) {
?>
<tr>
<td align="right" colspan="2" class="smallText"><?php echo '' . xtc_image_button('button_insert.gif', IMAGE_INSERT) . ' (' . xtc_href_link(FILENAME_SHOPS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->shops_id . '&action=new') . ')'; ?></td>
</tr>
<?php
}
?>
</table></td>
<?php
$heading = array();
$contents = array();
switch ($action) {
case 'delete':
$heading[] = array('text' => '' . TEXT_HEADING_DELETE_SHOP . '');
$contents = array('form' => xtc_draw_form('shops', FILENAME_SHOPS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->shops_id . '&action=deleteconfirm'));
$contents[] = array('text' => TEXT_DELETE_INTRO);
$contents[] = array('text' => '
' . $sInfo->shops_name . '');
$contents[] = array('text' => '
' . xtc_draw_checkbox_field('delete_image', '', true) . ' ' . TEXT_DELETE_IMAGE);
$contents[] = array('text' => '
' . xtc_draw_checkbox_field('delete_plan', '', true) . ' ' . TEXT_DELETE_PLAN);
if ($sInfo->products_count > 0) {
$contents[] = array('text' => '
' . xtc_draw_checkbox_field('delete_products') . ' ' . TEXT_DELETE_PRODUCTS);
$contents[] = array('text' => '
' . sprintf(TEXT_DELETE_WARNING_PRODUCTS, $sInfo->products_count));
}
$contents[] = array('align' => 'center', 'text' => '
' . xtc_image_submit('button_delete.gif', IMAGE_DELETE) . ' ' . xtc_image_button('button_cancel.gif', IMAGE_CANCEL) . ' (' . xtc_href_link(FILENAME_SHOPS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->shops_id) . ')');
break;
default:
if (isset($sInfo) && is_object($sInfo)) {
$heading[] = array('text' => '' . $sInfo->shops_name . '');
$contents[] = array('align' => 'center', 'text' => '' . xtc_image_button('button_edit.gif', IMAGE_EDIT) . ' (' . xtc_href_link(FILENAME_SHOPS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->shops_id . '&action=edit') . ') ' . xtc_image_button('button_delete.gif', IMAGE_DELETE) . ' (' . xtc_href_link(FILENAME_SHOPS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->shops_id . '&action=delete') . ')');
$contents[] = array('text' => '
' . TEXT_SHOPS_IMAGE . $sInfo->shops_image . '
' . TEXT_SHOPS_PLAN . $sInfo->shops_plan );
$contents[] = array('text' => '
' . TEXT_SHOPS_ADDR . '
'.$sInfo->shops_addr);
$contents[] = array('text' => '
' . TEXT_SHOPS_CP . '
'.$sInfo->shops_cp);
$contents[] = array('text' => '
' . TEXT_SHOPS_VILLE . '
'.$sInfo->shops_ville);
$contents[] = array('text' => '
' . TEXT_SHOPS_TEL . '' . $sInfo->shops_tel . '
' . TEXT_SHOPS_FAX . '' . $sInfo->shops_fax);
$contents[] = array('text' => '
' . TEXT_PRODUCTS . ' ' . $sInfo->products_count);
}
break;
}
if ( (xtc_not_null($heading)) && (xtc_not_null($contents)) ) {
echo ' <td width="25%" valign="top">' . "\n";
$box = new box;
echo $box->infoBox($heading, $contents);
echo ' </td>' . "\n";
}
}
?>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
[/b]
und folgender mysql code läßt sich nicht hinzufügen:
''>ZITAT</div>
INSERT INTO `configuration` VALUES ('', 'Affichage du Bloc Nos Magasins', 'MAX_DISPLAY_SHOPS_IN_A_LIST', '20', 'Quand le nombre de magasins dépasse cette valeur, une \'liste déroulante\' sera utilisée à la place de la liste par défaut.', 3, 8, '2005-04-29 01:13:06', '2005-04-28 05:16:13', NULL, NULL);
INSERT INTO `configuration` VALUES ('', 'Affichage du Bloc Nos Magasins \'Liste\'', 'MAX_SHOPS_LIST', '0', 'Quand cette valeur est égale à 1 la \'liste déroulante\' classique sera utilisée. Sinon, une liste sera affichée avec le nombre de lignes spécifiées.', 3, 8, '2005-04-29 01:12:10', '2005-04-28 05:16:13', NULL, NULL);
INSERT INTO `configuration` VALUES ('', 'Affichage du Bloc Nos Magasins \'Longueur du nom\'', 'MAX_DISPLAY_SHOP_NAME_LEN', '15', 'Longueur maximum du nom de magasin à afficher.', 3, 8, NULL, '2005-04-28 05:16:13', NULL, NULL);
[/b]
Könnte mir jemand bitte mal helfen uns sich das mal anschauen?
Das Modul wird für die xtc 3.04 sein!
THX!!
Gruß
Andre´