Habe mal nachgesehen. Die besagte Datei steuert das Einstellen neuer Angebote im Backend (liegt im admin Ordner), die Anweisung die den Fehler verursacht steuert wohl die Start, Endzeit.
Habe schon mal versucht es umzuschreiben mit preg_replace() aber dann meldet mir das System das die Startzeit nicht in der Vergangenheit liegen darf. Ergo hab ich Mist gebaut beim Umschreiben.
Ich bin mal so frech und stelle die Datei hier mal rein. Evtl gibt es ja einen der Profis hier, der sofort das Problem erkennt und beheben kann. Ist ja auch im Sinne von allen da die PHP Versionen ja nicht stehenbleiben und die ereg_replace Anweisung nunmal nicht mehr greift.
<?php/* --------------------------------------------------------------
$Id: xtf_live_shopping.php 2008-07-02 10:00:00 JK $
XT-Factory
http://www.xt-factory.de
Copyright (c) 2008 XT-Factory
--------------------------------------------------------------
based on:
(c) 2000-2001 The Exchange Project (earlier name of osCommerce)
(c) 2002-2003 osCommerce(specials.php,v 1.38 2002/05/16); www.oscommerce.com
(c) 2003 nextcommerce (specials.php,v 1.9 2003/08/18); www.nextcommerce.org
(c) 2003 xt:commerce (specials.php); www.(( Wir dulden keine kommerziellen Werbelinks - Bitte Forenregeln beachten! ))
Released under the GNU General Public License
--------------------------------------------------------------*/ require('includes/application_top.php'); require(DIR_FS_CATALOG
.DIR_WS_CLASSES
. 'xtcPrice.php'); $xtPrice = new xtcPrice
(DEFAULT_CURRENCY
,$_SESSION['customers_status']['customers_status_id']); require_once(DIR_FS_INC
.'xtc_get_tax_rate.inc.php');function xtc_set_live_shopping_status_admin
($live_shopping_id, $status) { if ($status == '1') { return xtc_db_query
("update ".TABLE_XTF_LIVE_SHOPPING
." set status = '1', date_status_change = now() where live_shopping_id = '".$live_shopping_id."'"); } elseif ($status == '0') { return xtc_db_query
("update ".TABLE_XTF_LIVE_SHOPPING
." set status = '0', date_status_change = now() where live_shopping_id = '".$live_shopping_id."'"); } else { return -1; }} switch ($_GET['action']) { case 'setflag': xtc_set_live_shopping_status_admin
($_GET['id'], $_GET['flag']); xtc_redirect
(xtc_href_link
(FILENAME_XTF_LIVE_SHOPPING
, '', 'NONSSL')); break; case 'insert': // insert a product on live_shopping if (PRICE_IS_BRUTTO
=='true' && substr($_POST['live_shopping_price'], -1) != '%'){ $sql="select tr.tax_rate from " . TABLE_TAX_RATES
. " tr, " . TABLE_PRODUCTS
. " p where tr.tax_class_id = p. products_tax_class_id and p.products_id = '". $_POST['products_id'] . "' "; $tax_query = xtc_db_query
($sql); $tax = xtc_db_fetch_array
($tax_query); $_POST['live_shopping_price'] = ($_POST['live_shopping_price']/($tax['tax_rate']+100)*100); } if (substr($_POST['live_shopping_price'], -1) == '%') { $new_live_shopping_insert_query = xtc_db_query
("select products_id,products_tax_class_id, products_price from " . TABLE_PRODUCTS
. " where products_id = '" . (int
)$_POST['products_id'] . "'"); $new_live_shopping_insert = xtc_db_fetch_array
($new_live_shopping_insert_query); $_POST['products_price'] = $new_live_shopping_insert['products_price']; $_POST['live_shopping_price'] = ($_POST['products_price'] - (($_POST['live_shopping_price'] / 100) * $_POST['products_price'])); } $start_date = ''; if ($_POST['from_day'] && $_POST['from_month'] && $_POST['from_year'] && $_POST['from_time']) { if(strlen($_POST['from_time']) != 8 || substr($_POST['from_time'], -3,1) != ':' || substr($_POST['from_time'], -6,1) != ':' || substr($_POST['from_time'], -2,2) >= '60' || substr($_POST['from_time'], -5,2) >= '60'|| substr($_POST['from_time'], -8,2) >= '24'){ xtc_redirect
(xtc_href_link
(FILENAME_XTF_LIVE_SHOPPING
, 'page=' . $_GET['page'].'&action=new&error='.urlencode(XTF_ERROR_NO_STARTDATE_WRONG
))); }else{ $start_date = $_POST['from_year']; $start_date .= (strlen($_POST['from_month']) == 1) ?
'0' . $_POST['from_month'] : $_POST['from_month']; $start_date .= (strlen($_POST['from_day']) == 1) ?
'0' . $_POST['from_day'] : $_POST['from_day']; $_POST['from_time'] = ereg_replace(':','',$_POST['from_time']); $start_date .= (strlen($_POST['from_time']) == 1) ?
'0' . $_POST['from_time'] : $_POST['from_time']; } }else{ xtc_redirect
(xtc_href_link
(FILENAME_XTF_LIVE_SHOPPING
, 'page=' . $_GET['page'].'&action=new&error='.urlencode(XTF_ERROR_NO_STARTDATE
))); } $expires_date = ''; if ($_POST['day'] && $_POST['month'] && $_POST['year'] && $_POST['from_time']) { if(strlen($_POST['time']) != 8 || substr($_POST['time'], -3,1) != ':' || substr($_POST['time'], -6,1) != ':' || substr($_POST['from_time'], -2,2) >= '60' || substr($_POST['from_time'], -5,2) >= '60'|| substr($_POST['from_time'], -8,2) >= '24'){ xtc_redirect
(xtc_href_link
(FILENAME_XTF_LIVE_SHOPPING
, 'page=' . $_GET['page'].'&action=new&error='.urlencode(XTF_ERROR_NO_STARTDATE_WRONG
))); }else{ $expires_date = $_POST['year']; $expires_date .= (strlen($_POST['month']) == 1) ?
'0' . $_POST['month'] : $_POST['month']; $expires_date .= (strlen($_POST['day']) == 1) ?
'0' . $_POST['day'] : $_POST['day']; $_POST['time'] = ereg_replace(':','',$_POST['time']); $expires_date .= (strlen($_POST['time']) == 1) ?
'0' . $_POST['time'] : $_POST['time']; } }else{ if($_POST['live_shopping_gultigkeit'] != XTF_LIVE_SHOPPING_HOURS
&& xtc_not_null
($_POST['live_shopping_gultigkeit'])){ $gultig_h = $_POST['live_shopping_gultigkeit']; }else{ $gultig_h = XTF_LIVE_SHOPPING_HOURS
; } if($_POST['live_shopping_gultigkeit_minutes'] != XTF_LIVE_SHOPPING_MINUTES
&& xtc_not_null
($_POST['live_shopping_gultigkeit_minutes'])){ $gultig_m = '+'.$_POST['live_shopping_gultigkeit_minutes'].' minutes'; }else{ $gultig_m = '+'.XTF_LIVE_SHOPPING_MINUTES
.' minutes'; } $new_expire = strtotime($start_date); $new_expire = strtotime('+'.$gultig_h.'hours'.$gultig_m,$new_expire); /* this fixes the microsecond problem in php < 5 */ if (version_compare(PHP_VERSION, '5.0.0', '<')) { $xtf_time = substr($start_date,8); $xtf_time = wordwrap($xtf_time,2,':',true); $xtf_time = split(':',$xtf_time); $new_expire = mktime($xtf_time[0],$xtf_time[1],$xtf_time[2],$_POST['from_month'],$_POST['from_day'],$_POST['from_year']); $new_expire = strtotime('+'.$gultig_h.'hours'.$gultig_m,$new_expire); } $new_expire = date("YmdHis",$new_expire); $expires_date = $new_expire; } $jetzt= date("YmdHis",time()); if($start_date <= $jetzt || $expires_date <= $jetzt){ xtc_redirect
(xtc_href_link
(FILENAME_XTF_LIVE_SHOPPING
, 'page=' . $_GET['page'].'&action=new&error='.urlencode(XTF_ERROR_NO_GREATER
))); } if(!$_POST['live_shopping_price'] || !xtc_not_null
($_POST['live_shopping_price'])){ xtc_redirect
(xtc_href_link
(FILENAME_XTF_LIVE_SHOPPING
, 'page=' . $_GET['page'].'&action=new&error='.urlencode(XTF_ERROR_NO_PRICE
))); } if($start_date >= $expires_date){ xtc_redirect
(xtc_href_link
(FILENAME_XTF_LIVE_SHOPPING
, 'page=' . $_GET['page'].'&action=new&error='.urlencode(XTF_ERROR_NO_STARTDATE_GREATER
))); } xtc_db_query
("insert into " . TABLE_XTF_LIVE_SHOPPING
. " (products_id, live_shopping_quantity, live_shopping_got_quantity, live_shopping_new_products_price, live_shopping_date_added, start_date, expires_date, status) values ('" . $_POST['products_id'] . "', '" . $_POST['live_shopping_quantity'] . "', '" . $_POST['live_shopping_quantity'] . "', '" . $_POST['live_shopping_price'] . "', now(), '" . $start_date . "', '" . $expires_date . "', '0')"); xtc_redirect
(xtc_href_link
(FILENAME_XTF_LIVE_SHOPPING
, 'page=' . $_GET['page'])); break; case 'update': // update a product on live_shoppingdefine('DIR_WS_THUMBNAIL_IMAGES',DIR_WS_CATALOG_THUMBNAIL_IMAGES
); $live_shopping_id = xtc_db_prepare_input
($_POST['live_shopping_id']); if (PRICE_IS_BRUTTO
=='true' && substr($_POST['live_shopping_price'], -1) != '%'){ $sql="select tr.tax_rate from " . TABLE_TAX_RATES
. " tr, " . TABLE_PRODUCTS
. " p where tr.tax_class_id = p. products_tax_class_id and p.products_id = '". $_POST['products_up_id'] . "' "; $tax_query = xtc_db_query
($sql); $tax = xtc_db_fetch_array
($tax_query); $_POST['live_shopping_price'] = ($_POST['live_shopping_price']/($tax[tax_rate
]+100)*100); } if (substr($_POST['live_shopping_price'], -1) == '%') { $_POST['live_shopping_price'] = ($_POST['products_price'] - (($_POST['live_shopping_price'] / 100) * $_POST['products_price'])); } $start_date = ''; if ($_POST['from_day'] && $_POST['from_month'] && $_POST['from_year'] && $_POST['from_time']) { if(strlen($_POST['from_time']) != 8 || substr($_POST['from_time'], -3,1) != ':' || substr($_POST['from_time'], -6,1) != ':' || substr($_POST['from_time'], -2,2) >= '60' || substr($_POST['from_time'], -5,2) >= '60'|| substr($_POST['from_time'], -8,2) >= '24'){ xtc_redirect
(xtc_href_link
(FILENAME_XTF_LIVE_SHOPPING
, 'page=' . $_GET['page'].'&action=edit&sID='.$live_shopping_id.'&error='.urlencode(XTF_ERROR_NO_STARTDATE_WRONG
))); }else{ $start_date = $_POST['from_year']; $start_date .= (strlen($_POST['from_month']) == 1) ?
'0' . $_POST['from_month'] : $_POST['from_month']; $start_date .= (strlen($_POST['from_day']) == 1) ?
'0' . $_POST['from_day'] : $_POST['from_day']; $_POST['from_time'] = ereg_replace(':','',$_POST['from_time']); $start_date .= (strlen($_POST['from_time']) == 1) ?
'0' . $_POST['from_time'] : $_POST['from_time']; } } $expires_date = ''; if ($_POST['day'] && $_POST['month'] && $_POST['year']) {if(strlen($_POST['time']) != 8 || substr($_POST['time'], -3,1) != ':' || substr($_POST['time'], -6,1) != ':' || substr($_POST['time'], -2,2) >= '60' || substr($_POST['time'], -5,2) >= '60'|| substr($_POST['time'], -8,2) >= '24'){ xtc_redirect
(xtc_href_link
(FILENAME_XTF_LIVE_SHOPPING
, 'page=' . $_GET['page'].'&action=edit&sID='.$live_shopping_id.'&error='.urlencode(XTF_ERROR_NO_STARTDATE_WRONG
))); }else{ $expires_date = $_POST['year']; $expires_date .= (strlen($_POST['month']) == 1) ?
'0' . $_POST['month'] : $_POST['month']; $expires_date .= (strlen($_POST['day']) == 1) ?
'0' . $_POST['day'] : $_POST['day']; $_POST['time'] = ereg_replace(':','',$_POST['time']); $expires_date .= (strlen($_POST['time']) == 1) ?
'0' . $_POST['time'] : $_POST['time']; } } if(!$_POST['live_shopping_price'] || !xtc_not_null
($_POST['live_shopping_price'])){ xtc_redirect
(xtc_href_link
(FILENAME_XTF_LIVE_SHOPPING
, 'page=' . $_GET['page'].'&action=edit&sID='.$live_shopping_id.'&error='.urlencode(XTF_ERROR_NO_PRICE
))); } if($start_date >= $expires_date){ xtc_redirect
(xtc_href_link
(FILENAME_XTF_LIVE_SHOPPING
, 'page=' . $_GET['page'].'&action=edit&sID='.$live_shopping_id.'&error='.urlencode(XTF_ERROR_NO_STARTDATE_GREATER
))); } $jetzt= date("YmdHis",time()); $status = 'status = 0 ,'; if($start_date <= $jetzt && $expires_date >= $jetzt){ $status = 'status = 1 ,'; } if($start_date <= $jetzt && $expires_date >= $jetzt && $_POST['live_shopping_quantity'] <= '0' && $_POST['live_shopping_got_quantity'] != '0'){ $status = 'status = 0 ,'; } if($start_date <= $jetzt && $expires_date >= $jetzt && $_POST['live_shopping_quantity'] > '0' && $_POST['live_shopping_got_quantity'] != '0'){ $status = 'status = 1 ,'; } xtc_db_query
("update " . TABLE_XTF_LIVE_SHOPPING
. " set live_shopping_quantity = '" . $_POST['live_shopping_quantity'] . "', live_shopping_got_quantity = '" . $_POST['live_shopping_got_quantity'] . "', live_shopping_new_products_price = '" . $_POST['live_shopping_price'] . "', live_shopping_last_modified = now(), ".$status." start_date = '" . $start_date . "', expires_date = '" . $expires_date . "' where live_shopping_id = '" . $_POST['live_shopping_id'] . "'"); xtc_redirect
(xtc_href_link
(FILENAME_XTF_LIVE_SHOPPING
, 'page=' . $_GET['page'] . '&sID=' . $live_shopping_id)); break; case 'deleteconfirm': $live_shopping_id = xtc_db_prepare_input
($_GET['sID']); xtc_db_query
("delete from " . TABLE_XTF_LIVE_SHOPPING
. " where live_shopping_id = '" . xtc_db_input
($live_shopping_id) . "'"); xtc_redirect
(xtc_href_link
(FILENAME_XTF_LIVE_SHOPPING
, 'page=' . $_GET['page'])); break; }?><!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">
<script type="text/javascript" src="includes/general.js"></script>
<?php if ( ($_GET['action'] == 'new') || ($_GET['action'] == 'edit') ) {?><link rel="stylesheet" type="text/css" href="includes/javascript/calendar.css">
<script type="text/javascript" src="includes/javascript/calendarcode_new.js"></script>
<?php }?></head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="SetFocus();">
<div id="popupcalendar" class="text"></div>
<!-- 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="2">
<tr>
<td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading">
<?php echo HEADING_TITLE
; ?></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($_GET['error'] && xtc_not_null
($_GET['error'])){ ?> <tr><td colspan="2" class="main" style="color:#FF0000;">
<?php echo urldecode($_GET['error']); ?></td>
</tr>
<?php } ?><?php if ( ($_GET['action'] == 'new') || ($_GET['action'] == 'edit') ) { $form_action = 'insert'; if ( ($_GET['action'] == 'edit') && ($_GET['sID']) ) { $form_action = 'update'; $product_query = xtc_db_query
("select p.products_tax_class_id,
p.products_id,
pd.products_name,
p.products_price,
xtf_ls.live_shopping_got_quantity,
xtf_ls.live_shopping_quantity,
xtf_ls.live_shopping_new_products_price,
xtf_ls.start_date,
xtf_ls.expires_date from
" . TABLE_PRODUCTS
. " p,
" . TABLE_PRODUCTS_DESCRIPTION
. " pd,
" . TABLE_XTF_LIVE_SHOPPING
. "
xtf_ls where p.products_id = pd.products_id
and pd.language_id = '" . (int
)$_SESSION['languages_id'] . "'
and p.products_id = xtf_ls.products_id
and xtf_ls.live_shopping_id = '" . (int
)$_GET['sID'] . "'"); $product = xtc_db_fetch_array
($product_query); $sInfo = new objectInfo
($product); } else { $sInfo = new objectInfo
(array()); // create an array of products on live_shopping, which will be excluded from the pull down menu of products // (when creating a new product on live_shopping) $live_shopping_array = array(); $live_shopping_query = xtc_db_query
("select
p.products_id from
" . TABLE_PRODUCTS
. " p,
" . TABLE_SPECIALS
. " s
where p.products_id = s.products_id
and s.status = '1'"); while ($live_shopping = xtc_db_fetch_array
($live_shopping_query)) { $live_shopping_array[] = $live_shopping['products_id']; } // check and get the last Live Shopping $check_live_shopping_array = array(); $check_live_shopping_query = xtc_db_query
("select
xtf_ls.start_date,xtf_ls.expires_date from
" . TABLE_XTF_LIVE_SHOPPING
. " xtf_ls order by xtf_ls.expires_date DESC"); while ($check_live_shopping = xtc_db_fetch_array
($check_live_shopping_query)) { $check_live_shopping_array[] = array('expires_date'=>$check_live_shopping['expires_date']); } }?> <tr><form name="new_live_shopping"
<?php echo 'action="' . xtc_href_link
(FILENAME_XTF_LIVE_SHOPPING
, xtc_get_all_get_params
(array('action', 'info', 'sID')) . 'action=' . $form_action, 'NONSSL') . '"'; ?> method="post">
<td><br /><table border="0" cellspacing="0" cellpadding="2">
<td class="main">
<?php echo TEXT_LIVE_SHOPPING_PRODUCT
; echo ($sInfo->products_name) ?
"" : ''; ?> </td>
<?php $price=$sInfo->products_price; $new_price=$sInfo->live_shopping_new_products_price; if (PRICE_IS_BRUTTO
=='true'){ $price_netto=xtc_round
($price,PRICE_PRECISION
); $new_price_netto=xtc_round
($new_price,PRICE_PRECISION
); $price= ($price*(xtc_get_tax_rate
($sInfo->products_tax_class_id)+100)/100); $new_price= ($new_price*(xtc_get_tax_rate
($sInfo->products_tax_class_id)+100)/100); } $price=xtc_round
($price,PRICE_PRECISION
); $new_price=xtc_round
($new_price,PRICE_PRECISION
); echo '<input type="hidden" name="products_up_id" value="' . $sInfo->products_id . '">'; echo xtc_draw_hidden_field
('live_shopping_id', $_GET['sID']); ?> <td class="main">
<?php echo ($sInfo->products_name) ?
$sInfo->products_name . ' <small>(' . $xtPrice->xtcFormat($price,true). ')</small>' : xtc_draw_products_pull_down
('products_id', 'style="font-size:10px"', $live_shopping_array); echo xtc_draw_hidden_field
('products_price', $sInfo->products_price); ?></td>
</tr>
<tr>
<td class="main">
<?php echo TEXT_LIVE_SHOPPING_SPECIAL_PRICE
; ?> </td>
<td class="main">
<?php echo xtc_draw_input_field
('live_shopping_price', $new_price);?> </td>
</tr>
<tr>
<td class="main">
<?php if($sInfo->products_name){echo TEXT_LIVE_SHOPPING_SPECIAL_QUANTITY_UPDATE
;}else{echo TEXT_LIVE_SHOPPING_SPECIAL_QUANTITY
;} ?> </td>
<td class="main">
<?php echo xtc_draw_input_field
('live_shopping_quantity', $sInfo->live_shopping_quantity);?> </td>
</tr>
<?php if($sInfo->products_name){ ?> <tr>
<td class="main">
<?php echo TEXT_LIVE_SHOPPING_GOT_QUANTITY
; ?> </td>
<td class="main">
<?php echo TEXT_LIVE_SHOPPING_GOT_QUANTITY_AUTO
;echo xtf_draw_checkbox_field
('GOT_QUANTITY_AUTO', '1', true,'onclick="check_checkbox(this)"');?><div id="GOT_QUANTITY_AUTO_DIV" style="display:none;">
<?php echo xtc_draw_input_field
('live_shopping_got_quantity', $sInfo->live_shopping_got_quantity);?></div></td>
</tr>
<?php } ?><?php if(!$sInfo->products_name){ ?> <tr>
<td class="main">
<?php echo TEXT_LIVE_SHOPPING_GULTIGKEIT
; ?> </td>
<td class="main">
<?php echo xtc_draw_input_field
('live_shopping_gultigkeit', XTF_LIVE_SHOPPING_HOURS
);?> </td>
</tr>
<tr>
<td class="main">
<?php echo TEXT_LIVE_SHOPPING_GULTIGKEIT_MINUTES
; ?> </td>
<td class="main">
<?php echo xtc_draw_input_field
('live_shopping_gultigkeit_minutes', XTF_LIVE_SHOPPING_MINUTES
);?> </td>
</tr>
<?php } ?> <?php if($sInfo->products_name){ ?> <tr>
<td class="main">
<?php echo TEXT_LIVE_SHOPPING_START_DATE
; ?> </td>
<td class="main">
<?php echo TEXT_LIVE_SHOPPING_START_AUTO_UPDATE
;echo xtf_draw_checkbox_field
('FROM_CHECK_AUTO', '1', true,'onclick="check_checkbox(this)"');?><div id="FROM_CHECK_AUTO_DIV" style="display:none;">
<?php echo xtc_draw_input_field
('from_day', substr($sInfo->start_date, 8, 2), 'size="2" maxlength="2" class="cal-TextBox"') . xtc_draw_input_field
('from_month', substr($sInfo->start_date, 5, 2), 'size="2" maxlength="2" class="cal-TextBox"') . xtc_draw_input_field
('from_year', substr($sInfo->start_date, 0, 4), 'size="4" maxlength="4" class="cal-TextBox"'); ?><a class="so-BtnLink" href="javascript:calClick();return false;" onMouseOver="calSwapImg('BTN_from_date', 'img_Date_OVER',true);" onMouseOut="calSwapImg('BTN_from_date', 'img_Date_UP',true);" onClick="calSwapImg('BTN_from_date', 'img_Date_DOWN');showCalendar('new_live_shopping','from_day','from_month','from_year','dteWhen','BTN_from_date');return false;">
<?php echo xtc_image
(DIR_WS_IMAGES
. 'cal_date_up.gif', 'Calendar', '22', '17', 'align="absmiddle" name="BTN_from_date"'); ?></a>
<?php echo xtc_draw_input_field
('from_time', substr($sInfo->start_date, 11, 8), 'size="8" maxlength="8" class="cal-TextBox"'); echo TEXT_LIVE_SHOPPING_CLOCK
; ?></div></td>
</tr>
<?php }else{ ?> <?php if($check_live_shopping_array){ ?> <tr>
<td class="main">
<?php echo TEXT_LIVE_SHOPPING_START_DATE
; ?> </td>
<td class="main">
<?php echo TEXT_LIVE_SHOPPING_START_AUTO
;echo xtf_draw_checkbox_field
('FROM_CHECK_AUTO', '1', true,'onclick="check_checkbox(this)"');?><div id="FROM_CHECK_AUTO_DIV" style="display:none;">
<?php echo xtc_draw_input_field
('from_day', substr($check_live_shopping_array[0]['expires_date'], 8, 2), 'size="2" maxlength="2" class="cal-TextBox"') . xtc_draw_input_field
('from_month', substr($check_live_shopping_array[0]['expires_date'], 5, 2), 'size="2" maxlength="2" class="cal-TextBox"') . xtc_draw_input_field
('from_year', substr($check_live_shopping_array[0]['expires_date'], 0, 4), 'size="4" maxlength="4" class="cal-TextBox"'); ?><a class="so-BtnLink" href="javascript:calClick();return false;" onMouseOver="calSwapImg('BTN_from_date', 'img_Date_OVER',true);" onMouseOut="calSwapImg('BTN_from_date', 'img_Date_UP',true);" onClick="calSwapImg('BTN_from_date', 'img_Date_DOWN');showCalendar('new_live_shopping','from_day','from_month','from_year','dteWhen','BTN_from_date');return false;">
<?php echo xtc_image
(DIR_WS_IMAGES
. 'cal_date_up.gif', 'Calendar', '22', '17', 'align="absmiddle" name="BTN_from_date"'); ?></a>
<?php echo xtc_draw_input_field
('from_time', substr($check_live_shopping_array[0]['expires_date'], 11, 8), 'size="8" maxlength="8" class="cal-TextBox"'); echo TEXT_LIVE_SHOPPING_CLOCK
; ?></div></td>
</tr>
<?php }else{ ?><tr>
<td class="main">
<?php echo TEXT_LIVE_SHOPPING_START_DATE
; ?> </td>
<td class="main">
<?php echo xtc_draw_input_field
('from_day', substr($sInfo->start_date, 8, 2), 'size="2" maxlength="2" class="cal-TextBox"') . xtc_draw_input_field
('from_month', substr($sInfo->start_date, 5, 2), 'size="2" maxlength="2" class="cal-TextBox"') . xtc_draw_input_field
('from_year', substr($sInfo->start_date, 0, 4), 'size="4" maxlength="4" class="cal-TextBox"'); ?><a class="so-BtnLink" href="javascript:calClick();return false;" onMouseOver="calSwapImg('BTN_from_date', 'img_Date_OVER',true);" onMouseOut="calSwapImg('BTN_from_date', 'img_Date_UP',true);" onClick="calSwapImg('BTN_from_date', 'img_Date_DOWN');showCalendar('new_live_shopping','from_day','from_month','from_year','dteWhen','BTN_from_date');return false;">
<?php echo xtc_image
(DIR_WS_IMAGES
. 'cal_date_up.gif', 'Calendar', '22', '17', 'align="absmiddle" name="BTN_from_date"'); ?></a>
<?php echo xtc_draw_input_field
('from_time', substr($sInfo->start_date, 11, 8), 'size="8" maxlength="8" class="cal-TextBox"'); echo TEXT_LIVE_SHOPPING_CLOCK
; ?></td>
</tr>
<?php } ?> <?php } ?> <tr>
<td class="main">
<?php echo TEXT_LIVE_SHOPPING_EXPIRES_DATE
; ?> </td>
<td class="main">
<?php if($sInfo->products_name){echo TEXT_LIVE_SHOPPING_AUTO_UPDATE
;}else{echo TEXT_LIVE_SHOPPING_AUTO
;} echo xtf_draw_checkbox_field
('CHECK_AUTO', '1', true,'onclick="check_checkbox(this)"');?><div id="CHECK_AUTO_DIV" style="display:none;">
<?php echo xtc_draw_input_field
('day', substr($sInfo->expires_date, 8, 2), 'size="2" maxlength="2" class="cal-TextBox"') . xtc_draw_input_field
('month', substr($sInfo->expires_date, 5, 2), 'size="2" maxlength="2" class="cal-TextBox"') . xtc_draw_input_field
('year', substr($sInfo->expires_date, 0, 4), 'size="4" maxlength="4" class="cal-TextBox"'); ?><a class="so-BtnLink" href="javascript:calClick();return false;" onMouseOver="calSwapImg('BTN_date', 'img_Date_OVER',true);" onMouseOut="calSwapImg('BTN_date', 'img_Date_UP',true);" onClick="calSwapImg('BTN_date', 'img_Date_DOWN');showCalendar('new_live_shopping','day','month','year','dteWhen','BTN_date');return false;">
<?php echo xtc_image
(DIR_WS_IMAGES
. 'cal_date_up.gif', 'Calendar', '22', '17', 'align="absmiddle" name="BTN_date"'); ?></a>
<?php echo xtc_draw_input_field
('time', substr($sInfo->expires_date, 11, 9), 'size="9" maxlength="9" class="cal-TextBox"'); echo TEXT_LIVE_SHOPPING_CLOCK
; ?></div></td>
</tr>
</table></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="main"><br />
<?php if($sInfo->products_name){ ?><?php echo TEXT_LIVE_SHOPPING_PRICE_TIP
; ?><?php }else{ ?> <?php echo TEXT_LIVE_SHOPPING_PRICE_TIP_NEW
; ?> <?php } ?></td>
<td class="main" align="right" valign="top"><br />
<?php echo (($form_action == 'insert') ?
'<input type="submit" class="button" onClick="this.blur();" value="' . BUTTON_INSERT
. '"/>' : '<input type="submit" class="button" onClick="this.blur();" value="' . BUTTON_UPDATE
. '"/>'). ' <a class="button" onClick="this.blur();" href="' . xtc_href_link
(FILENAME_XTF_LIVE_SHOPPING
, 'page=' . $_GET['page'] . '&sID=' . $_GET['sID']) . '">' . BUTTON_CANCEL
. '</a>'; ?></td>
</tr>
</table></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_PRODUCTS
; ?></td>
<td class="dataTableHeadingContent" align="right">
<?php echo TABLE_HEADING_PRODUCTS_PRICE
; ?></td>
<td class="dataTableHeadingContent" align="right">
<?php echo TABLE_HEADING_STATUS
; ?></td>
<td class="dataTableHeadingContent" align="right">
<?php echo TABLE_HEADING_FROM
; ?> </td>
<td class="dataTableHeadingContent" align="right">
<?php echo TABLE_HEADING_TO
; ?> </td>
</tr>
<?php $live_shopping_query_raw = "select p.products_id, pd.products_name,p.products_tax_class_id, p.products_price, xtf_ls.live_shopping_id, xtf_ls.live_shopping_new_products_price, xtf_ls.live_shopping_date_added, xtf_ls.live_shopping_last_modified, xtf_ls.expires_date,xtf_ls.start_date, xtf_ls.date_status_change, xtf_ls.status,xtf_ls.live_shopping_quantity,xtf_ls.live_shopping_got_quantity from " . TABLE_PRODUCTS
. " p, " . TABLE_XTF_LIVE_SHOPPING
. " xtf_ls, " . TABLE_PRODUCTS_DESCRIPTION
. " pd where p.products_id = pd.products_id and pd.language_id = '" . $_SESSION['languages_id'] . "' and p.products_id = xtf_ls.products_id order by xtf_ls.expires_date DESC"; $live_shopping_split = new splitPageResults
($_GET['page'], '20', $live_shopping_query_raw, $live_shopping_query_numrows); $live_shopping_query = xtc_db_query
($live_shopping_query_raw); while ($live_shopping = xtc_db_fetch_array
($live_shopping_query)) { $price=$live_shopping['products_price']; $new_price=$live_shopping['live_shopping_new_products_price']; if (PRICE_IS_BRUTTO
=='true'){ $price_netto=xtc_round
($price,PRICE_PRECISION
); $new_price_netto=xtc_round
($new_price,PRICE_PRECISION
); $price= ($price*(xtc_get_tax_rate
($live_shopping['products_tax_class_id'])+100)/100); $new_price= ($new_price*(xtc_get_tax_rate
($live_shopping['products_tax_class_id'])+100)/100); } $live_shopping['products_price']=xtc_round
($price,PRICE_PRECISION
); $live_shopping['live_shopping_new_products_price']=xtc_round
($new_price,PRICE_PRECISION
); if ( ((!$_GET['sID']) || ($_GET['sID'] == $live_shopping['live_shopping_id'])) && (!$sInfo) ) { $products_query = xtc_db_query
("select products_image from " . TABLE_PRODUCTS
. " where products_id = '" . $live_shopping['products_id'] . "'"); $products = xtc_db_fetch_array
($products_query); $sInfo_array = xtc_array_merge
($live_shopping, $products); $sInfo = new objectInfo
($sInfo_array); $sInfo->live_shopping_new_products_price = $live_shopping['live_shopping_new_products_price']; $sInfo->products_price = $live_shopping['products_price']; } if ( (is_object($sInfo)) && ($live_shopping['live_shopping_id'] == $sInfo->live_shopping_id) ) { echo ' <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . xtc_href_link
(FILENAME_XTF_LIVE_SHOPPING
, 'page=' . $_GET['page'] . '&sID=' . $sInfo->live_shopping_id . '&action=edit') . '\'">' . "\n"; } else { echo ' <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . xtc_href_link
(FILENAME_XTF_LIVE_SHOPPING
, 'page=' . $_GET['page'] . '&sID=' . $live_shopping['live_shopping_id']) . '\'">' . "\n"; }?> <td class="dataTableContent">
<?php echo $live_shopping['products_name']; ?></td>
<td class="dataTableContent" align="right"><span class="oldPrice">
<?php echo $xtPrice->xtcFormat($live_shopping['products_price'],true); ?> </span> <span class="specialPrice">
<?php echo $xtPrice->xtcFormat($live_shopping['live_shopping_new_products_price'],true); ?> </span></td>
<td class="dataTableContent" align="right">
<?php $jetzt= date("Y-m-d H:i:s",time()); if ($live_shopping['status'] == '1') { echo xtc_image
(DIR_WS_IMAGES
. 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN
, 10, 10) . ' ' . xtc_image
(DIR_WS_IMAGES
. 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT
, 10, 10) . ''; } else { if ($live_shopping['status'] == '0' && $live_shopping['live_shopping_got_quantity'] != '0' && $live_shopping['live_shopping_quantity'] <= '0' && $jetzt < $live_shopping['expires_date'] && $jetzt > $live_shopping['start_date']) { echo xtc_image
(DIR_WS_IMAGES
. 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT
, 10, 10) . ' ' . xtc_image
(DIR_WS_IMAGES
. 'icon_status_yellow.gif', IMAGE_ICON_STATUS_YELLOW
, 10, 10); }else{ echo xtc_image
(DIR_WS_IMAGES
. 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT
, 10, 10) . ' ' . xtc_image
(DIR_WS_IMAGES
. 'icon_status_red.gif', IMAGE_ICON_STATUS_RED
, 10, 10); } }?></td>
<td class="dataTableContent" align="right">
<?php echo $live_shopping['start_date']; ?></td>
<td class="dataTableContent" align="right">
<?php echo $live_shopping['expires_date']; ?></td>
</tr>
<?php }?> <tr>
<td colspan="5"><table border="0" width="100%" cellpadding="0"cellspacing="2">
<tr>
<td class="smallText" valign="top">
<?php echo $live_shopping_split->display_count($live_shopping_query_numrows, '20', $_GET['page'], TEXT_DISPLAY_NUMBER_OF_LIVE_SHOPPING
); ?></td>
<td class="smallText" align="right">
<?php echo $live_shopping_split->display_links($live_shopping_query_numrows, '20', MAX_DISPLAY_PAGE_LINKS
, $_GET['page']); ?></td>
</tr>
<?php if (!$_GET['action']) {?> <tr>
<td colspan="2" align="right">
<?php echo '<a class="button" onClick="this.blur();" href="' . xtc_href_link
(FILENAME_XTF_LIVE_SHOPPING
, 'page=' . $_GET['page'] . '&action=new') . '">' . BUTTON_NEW_PRODUCTS
. '</a>'; ?></td>
</tr>
<?php }?> </table></td>
</tr>
<tr>
<td colspan="5">
<?php echo TEXT_INFO_COLORS
; ?> </td></tr>
</table></td>
<?php $heading = array(); $contents = array(); switch ($_GET['action']) { case 'delete': $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_LIVE_SHOPPING
. '</b>'); $contents = array('form' => xtc_draw_form
('live_shopping', FILENAME_XTF_LIVE_SHOPPING
, 'page=' . $_GET['page'] . '&sID=' . $sInfo->live_shopping_id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_INFO_DELETE_INTRO
); $contents[] = array('text' => '<br /><b>' . $sInfo->products_name . '</b>'); $contents[] = array('align' => 'center', 'text' => '<br /><input type="submit" class="button" onClick="this.blur();" value="' . BUTTON_DELETE
. '"/> <a class="button" onClick="this.blur();" href="' . xtc_href_link
(FILENAME_XTF_LIVE_SHOPPING
, 'page=' . $_GET['page'] . '&sID=' . $sInfo->live_shopping_id) . '">' . BUTTON_CANCEL
. '</a>'); break; default: if (is_object($sInfo)) { $heading[] = array('text' => '<b>' . $sInfo->products_name . '</b>'); $contents[] = array('align' => 'center', 'text' => '<a class="button" onClick="this.blur();" href="' . xtc_href_link
(FILENAME_XTF_LIVE_SHOPPING
, 'page=' . $_GET['page'] . '&sID=' . $sInfo->live_shopping_id . '&action=edit') . '">' . BUTTON_EDIT
. '</a> <a class="button" onClick="this.blur();" href="' . xtc_href_link
(FILENAME_XTF_LIVE_SHOPPING
, 'page=' . $_GET['page'] . '&sID=' . $sInfo->live_shopping_id . '&action=delete') . '">' . BUTTON_DELETE
. '</a>'); $contents[] = array('text' => '<br />' . TEXT_INFO_DATE_ADDED
. ' ' . xtc_date_short
($sInfo->live_shopping_date_added)); $contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED
. ' ' . xtc_date_short
($sInfo->live_shopping_last_modified)); $contents[] = array('align' => 'center', 'text' => '<br />' . xtc_product_thumb_image
($sInfo->products_image, $sInfo->products_name, SMALL_IMAGE_WIDTH
, SMALL_IMAGE_HEIGHT
)); $contents[] = array('text' => '<br />' . TEXT_INFO_ORIGINAL_PRICE
. ' ' . $xtPrice->xtcFormat($sInfo->products_price,true)); $contents[] = array('text' => '' . TEXT_INFO_NEW_PRICE
. ' ' . $xtPrice->xtcFormat($sInfo->live_shopping_new_products_price,true)); $contents[] = array('text' => '' . TEXT_INFO_PERCENTAGE
. ' ' . number_format(100 - (($sInfo->live_shopping_new_products_price / $sInfo->products_price) * 100)) . '%'); $contents[] = array('text' => '<br />' . TEXT_INFO_START_DATE
. ' <b>' . $sInfo->start_date . '</b>'); $contents[] = array('text' => TEXT_INFO_EXPIRES_DATE
. ' <b>' . $sInfo->expires_date . '</b>'); $contents[] = array('text' => '' . TEXT_INFO_STATUS_CHANGE
. ' ' . $sInfo->date_status_change); } 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>
<!-- 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');function xtf_draw_checkbox_field
($name, $value = '', $checked = false, $parameters = '') { $selection = '<input type="checkbox" name="' . $name . '"'; if ($value != '') { $selection .= ' value="' . $value . '"'; } if ( ($checked == true) || ($GLOBALS[$name] == 'on') || ($value && ($GLOBALS[$name] == $value))) { $selection .= ' checked="checked"'; } if (xtc_not_null
($parameters)) $selection .= ' ' . $parameters; $selection .= '>'; return $selection; } ?>