kplace

Members
  • Content count

    29
  • Joined

  • Last visited

Community Reputation

1 Neutral

2 Followers

About kplace

Profile Information

  • Real Name
    Sonya Ellis
  • Gender
    Female
  1. I still have another problem that I need help with. I can't get the date to format the way I need it. I need the date to show Month/Day/Year. I thought I could just change the Y-m-d to m-d-Y but it breaks the calendar. Could someone look at the code below and please let me know what I am missing. <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2010 osCommerce Released under the GNU General Public License kalender.php, v1.7b by amaische Date: 2010-06-29 Released as contribution: 2010-06-29 kalendar.php v1.0 modfied by quirky to run on v2.31 Date: 2011-06-25 Released as contribution: 2011-06-25 */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CALENDAR); $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CALENDAR)); // _en = englisches Datum, eg. 2009-10-31 // _de = deutsches Datum, eg 31.10.2009 // _unix = Unix-Stamp if (empty($customer_id)) { $messageStack->add('kalender',ERROR_CUSTOMER_EMPTY, 'error'); $kalender_error = true; } else { // Definitionen vornehmen $array_time = array('9','10','11','12','13','14','15','16','17'); // Liste der zulässigen Stunden $array_time_end = array('10','11','12','13','14','15','16','17','18'); // Liste der zulässigen Stunden $yc_max_time = count($array_time); // Anzahl der zulässigen Stunden im array, hier 10 function ermittle_wochentag_b($yp_date_en) { $y_date_unix = strtotime($yp_date_en); $y_wochentag = date("w",$y_date_unix); if ($y_wochentag == 0) $y_wochentag_b = "Sunday"; elseif ($y_wochentag == 1) $y_wochentag_b = "Monday"; elseif ($y_wochentag == 2) $y_wochentag_b = "Tuesday"; elseif ($y_wochentag == 3) $y_wochentag_b = "Wednesday"; elseif ($y_wochentag == 4) $y_wochentag_b = "Thursday"; elseif ($y_wochentag == 5) $y_wochentag_b = "Friday"; elseif ($y_wochentag == 6) $y_wochentag_b = "Saturday"; return($y_wochentag_B); } // Wochenarbeitstage einlesen $lese_wt = "SELECT wt_txt FROM " . TABLE_WORK_TIME . " WHERE wt_hour IS NULL ORDER BY wt_id"; $y_erg_wt = MYSQL_QUERY($lese_wt); $y_anz_wt = MYSQL_NUMROWS($y_erg_wt); if ($y_anz_wt > 0) { $y_count_row=0; $y_count_array=0; $array_txt_day[$y_count_array] = "Sunday"; // aus technischen Gründen muß So am Anfang dazu, // es sollen aber eg. nur Mo-Sa angezeigt werden $y_count_array++; while ($y_count_row < $y_anz_wt) { $array_txt_day[$y_count_array] = mysql_result($y_erg_wt,$y_count_row,"wt_txt"); $y_count_row++; $y_count_array++; } } $yc_max_days = count($array_txt_day); // Anzahl der anzuzeigenden Wochentage, eg. Mo-Sa=6 // Translation list weekday text corresponds to the naming wt_txt,! Assignment to the date function with //0 = Sunday ... 6 = Saturday $array_wt_txt = array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); // existing objects read $lese_objekte = "SELECT object_id FROM " . TABLE_OBJECT . " WHERE 1"; $y_erg_objekte = MYSQL_QUERY($lese_objekte); $y_anz_objekte = MYSQL_NUMROWS($y_erg_objekte); if ($y_anz_objekte > 0) { $y_count_row=0; while ($y_count_row < $y_anz_objekte) { $array_object[$y_count_row] = mysql_result($y_erg_objekte,$y_count_row,"object_id"); $y_count_row++; } } $yc_max_object = count($array_object); // Number of places of objects // Date determined $y_ap = mktime(0, 0, 0, date("m") , date("d"), date("Y")); $y_heutiger_tag_unix=$y_ap; $y_heutiger_tag_en=date("Y-m-d",$y_heutiger_tag_unix); // to check whether set call with parameters // if so, then take this as a touchdown if (IsSet($HTTP_GET_VARS['ap'])) { $y_ap=$HTTP_GET_VARS['ap']; // Convert unix timestamp $y_ap=strtotime($y_ap); } // based on the touchdown determine the start of the week and the weekend! Unix time must be available for AP $y_last_day_week = 6; // Saturday = End of the week $y_current_day = date('w',$y_ap); // returns 0 for Sunday, 1 for Monday, 2 for Tuesday, etc. $y_days_until_last = $y_last_day_week - $y_current_day; // calculates the missing until Saturday Day $y_days_until_start = $y_current_day - 1; // Week will start on Monday, so -1 // starting from the date of the calculated time subtracted to Monday // $y_week_start = strtotime("-$y_days_until_start days", $y_ap); // starting from the date of the missing days to add to Saturday // $y_week_end = strtotime("+$y_days_until_last days", $y_ap); // every day of the week determined to write to an array // $y_day_start = date("w",$y_week_start); $y_day_start = -$y_day_start; $y_day_end = $y_day_start + $yc_max_days; $y_count_day = 0; for ($i=$y_day_start; $i<$y_day_end; $i++) { $array_wochentage[$y_count_day]=date("Y-m-d",mktime(0,0,0,date("m",$y_week_start),date("d",$y_week_start)+$i, date("Y",$y_week_start))); $y_count_day++; } if ($HTTP_GET_VARS['action']) { switch ($HTTP_GET_VARS['action']) { case 'insert': $y_start_date_de = $HTTP_GET_VARS['start_date']; $y_end_date_de = $HTTP_GET_VARS['end_date']; $y_start_time = $HTTP_GET_VARS['start_time']; $y_end_time = $HTTP_GET_VARS['end_time']; $y_customers_id = $customer_id; $y_array_object = $HTTP_GET_VARS['object']; $y_max_obj = count($y_array_object); // reformat from 31.10.2009 on American 2009-10-31 $date = explode(".",$y_start_date_de); $y_start_date_en = $date[2]."-".$date[1]."-".$date[0]; $date = explode(".",$y_end_date_de); $y_end_date_en = $date[2]."-".$date[1]."-".$date[0]; $sql_data_array = array('start_date' => tep_db_prepare_input($y_start_date_en), 'start_time' => tep_db_prepare_input($y_start_time), 'end_date' => tep_db_prepare_input($y_end_date_en), 'end_time' => tep_db_prepare_input($y_end_time), 'customers_id'=> tep_db_prepare_input($y_customers_id)); if (empty($y_start_date_de) OR empty($y_start_time) OR empty($y_end_date_de) OR empty($y_end_time)) { $messageStack->add('kalender',ERROR_DAT_TIME_EMPTY, 'error'); $kalender_error = true; } if ($y_max_obj == 0) { $messageStack->add('kalender',ERROR_OBJECT_EMPTY, 'error'); $kalender_error = true; } else { $y_count_obj = 0; while ($y_count_obj < $y_max_obj) { // prüfen, ob Objekt existiert $lese_objekt = "SELECT object_id FROM " . TABLE_OBJECT . " WHERE object_id = '" . $y_array_object[$y_count_obj] ."'"; $y_erg_objekt = MYSQL_QUERY($lese_objekt); $y_anz_objekt = MYSQL_NUMROWS($y_erg_objekt); if ($y_anz_objekt == 0) { $messageStack->add('kalender',ERROR_OBJECT, 'error'); $kalender_error = true; } $y_count_obj++; } // endwhile } // endig max_obj if (strtotime($y_start_date_en) < $y_heutiger_tag_unix) { $messageStack->add('kalender',ERROR_SDATE_BEFORE, 'error'); $kalender_error = true; } if (strtotime($y_start_date_en) == $y_heutiger_tag_unix) { $y_aktuelle_stunde=date("G"); if ($y_start_time <= $y_aktuelle_stunde) { $messageStack->add('kalender',ERROR_STIME_BEFORE, 'error'); $kalender_error = true; } } if (strtotime($y_start_date_en) > strtotime($y_end_date_en)) { $messageStack->add('kalender',ERROR_SDATE_WRONG, 'error'); $kalender_error = true; } if (strtotime($y_start_date_en) == strtotime($y_end_date_en)) { if ($y_start_time > $y_end_time) { $messageStack->add('kalender',ERROR_TIME_WRONG, 'error'); $kalender_error = true; } } $y_wt_b_start = ermittle_wochentag_b($y_start_date_en); // Check if start date is allowed $lese_wts = "SELECT wt_txt FROM " . TABLE_WORK_TIME . " WHERE wt_txt = '" . $y_wt_b_start . "'" . " AND wt_hour = '" . $y_start_time . "'"; $y_erg_wts = MYSQL_QUERY($lese_wts); $y_anz_wts = MYSQL_NUMROWS($y_erg_wts); if ($y_anz_wts <= 0) { $messageStack->add('kalender',ERROR_WTS, 'error'); $kalender_error = true; } $y_wt_b_end = ermittle_wochentag_b($y_end_date_en); // prüfen, ob Enddatum zulässig ist $lese_wte = "SELECT wt_txt FROM " . TABLE_WORK_TIME . " WHERE wt_txt = '" . $y_wt_b_end . "'" . " AND wt_hour = '" . $y_end_time . "'"; $y_erg_wte = MYSQL_QUERY($lese_wte); $y_anz_wte = MYSQL_NUMROWS($y_erg_wte); if ($y_anz_wte <= 0) { $messageStack->add('kalender',ERROR_WTE, 'error'); $kalender_error = true; } // prüfen, ob Feiertag $lese_holiday = "SELECT holiday_id FROM " . TABLE_HOLIDAYS . " WHERE holiday_date = '" . $y_start_date_en ."'" . " OR holiday_date = '" . $y_end_date_en ."'"; $y_erg_holiday = MYSQL_QUERY($lese_holiday); $y_anz_holiday = MYSQL_NUMROWS($y_erg_holiday); if ($y_anz_holiday > 0) { $messageStack->add('kalender',ERROR_HOLIDAY, 'error'); $kalender_error = true; } // prüfen, ob bereits vermietet // select zusammenbauen if (strtotime($y_start_date_en) == strtotime($y_end_date_en)) { // für die Bestückung des letzten Tages müssen die Werte wie folgt gesetzt werden $y_aktuelle_stunde = $y_start_time; $y_aktuelles_datum_en = $y_start_date_en; } else { // Datum ist unterschiedlich - jetzt für jeden Tag Datensätze überprüfen $y_tagesende = $array_time[$yc_max_time-1] + 1; $y_tagesanfang = $array_time[0]; $y_aktuelle_stunde = $y_start_time; $y_aktuelles_datum_en = $y_start_date_en; while (strtotime($y_end_date_en) > strtotime($y_aktuelles_datum_en)) { while ($y_tagesende > $y_aktuelle_stunde) { $y_count_obj2 = 0; while ($y_count_obj2 < $y_max_obj) { $lese_cal1 = "SELECT calendar_id FROM " . TABLE_CALENDAR . " WHERE object_id ='" . $y_array_object[$y_count_obj2] ."'" . " AND start_date = '" . $y_aktuelles_datum_en ."'" . " AND start_time = '" . $y_aktuelle_stunde ."'"; $y_erg_cal1 = MYSQL_QUERY($lese_cal1); $y_anz_cal1 = MYSQL_NUMROWS($y_erg_cal1); if ($y_anz_cal1 > 0) { $messageStack->add('kalender',ERROR_FULL, 'error'); $kalender_error = true; } $y_count_obj2++; } // endwhile object $y_aktuelle_stunde++; } // endwhile Stunden $y_aktuelles_datum_unix=strtotime("+1 day",strtotime($y_aktuelles_datum_en)); $y_aktuelles_datum_en=date("Y-m-d",$y_aktuelles_datum_unix); $y_aktuelle_stunde=$y_tagesanfang; } // endwhile Tage // für die Bestückung des letzten Tages müssen die Werte wie folgt gesetzt werden $y_aktuelle_stunde = $y_tagesanfang; $sql_data_array['start_date'] = $y_aktuelles_datum_en; } while ($y_end_time > $y_aktuelle_stunde) { $y_count_obj3 = 0; while ($y_count_obj3 < $y_max_obj) { $lese_cal2 = "SELECT calendar_id FROM " . TABLE_CALENDAR . " WHERE object_id ='" . $y_array_object[$y_count_obj3] ."'" . " AND start_date = '" . $y_aktuelles_datum_en ."'" . " AND start_time = '" . $y_aktuelle_stunde ."'"; $y_erg_cal2 = MYSQL_QUERY($lese_cal2); $y_anz_cal2 = MYSQL_NUMROWS($y_erg_cal2); if ($y_anz_cal2 > 0) { $messageStack->add('kalender',ERROR_FULL, 'error'); $kalender_error = true; } $y_count_obj3++; } // endwhile obj $y_aktuelle_stunde++; } if ($kalender_error == false) { // Wenn das Endedatum <> Startdatum ist, dann wird für jede Stunde des Tages ein Eintrag angelegt // solange bis Endedatum = Startdatum ist // Wenn Start- und Endedatum gleich sind und die Enduhrzeit um mehr als eine Stunde abweicht, // dann wird für jede Stunde dazwischen ein Datensatz angelegt if (strtotime($y_start_date_en) == strtotime($y_end_date_en)) { // für die Bestückung des letzten Tages müssen die Werte wie folgt gesetzt werden $y_aktuelle_stunde = $y_start_time; } else { // Datum ist unterschiedlich - jetzt für jeden Tag Datensätze erzeugen $y_tagesanfang = $array_time[0]; $y_aktuelle_stunde = $y_start_time; $y_aktuelles_datum_en = $y_start_date_en; while (strtotime($y_end_date_en) > strtotime($y_aktuelles_datum_en)) { // Tagesende des aktuell in Bearbeitung befindlichen Tages anhand der Worktime ermitteln $y_wt_b = ermittle_wochentag_b($y_aktuelles_datum_en); $lese_wtte = "SELECT wt_hour FROM " . TABLE_WORK_TIME . " WHERE wt_txt = '" . $y_wt_b . "'" . " ORDER BY wt_hour DESC"; $y_erg_wtte = MYSQL_QUERY($lese_wtte); $y_anz_wtte = MYSQL_NUMROWS($y_erg_wtte); if ($y_anz_wtte > 0) { // prüfen, ob der aktuell in Bearbeitung befindliche Tag ein Feiertag ist // falls ja, nächsten Tag nehmen $lese_holiday2 = "SELECT holiday_id FROM " . TABLE_HOLIDAYS . " WHERE holiday_date = '" . $y_aktuelles_datum_en ."'"; $y_erg_holiday2 = MYSQL_QUERY($lese_holiday2); $y_anz_holiday2 = MYSQL_NUMROWS($y_erg_holiday2); if ($y_anz_holiday2 > 0) { // es handelt sich um einen Feiertag $y_schreiben = false; } else { $y_schreiben = true; $y_tagesende = mysql_result($y_erg_wtte,0,"wt_hour"); } } else { // es wurde kein Datensatz gefunden => es handelt sich nicht um einen zulässigen Tag // => nächsten Tag nehmen $y_schreiben = false; } while ($y_tagesende > $y_aktuelle_stunde AND $y_schreiben == true) { $sql_data_array['start_date'] = $y_aktuelles_datum_en; $sql_data_array['start_time'] = $y_aktuelle_stunde; $y_count_obj4 = 0; while ($y_count_obj4 < $y_max_obj) { $sql_data_array['object_id'] = $y_array_object[$y_count_obj4]; $sql_data_array['calendar_id'] = tep_db_insert_id(); tep_db_perform(TABLE_CALENDAR, $sql_data_array); $y_count_obj4++; } // endwhile object $y_aktuelle_stunde++; } // endwhile Stunden $y_aktuelles_datum_unix=strtotime("+1 day",strtotime($y_aktuelles_datum_en)); $y_aktuelles_datum_en=date("Y-m-d",$y_aktuelles_datum_unix); $y_aktuelle_stunde=$y_tagesanfang; } // endwhile Tage // für die Bestückung des letzten Tages müssen die Werte wie folgt gesetzt werden $y_aktuelle_stunde = $y_tagesanfang; $sql_data_array['start_date'] = $y_aktuelles_datum_en; } // endif while ($y_end_time > $y_aktuelle_stunde) { $sql_data_array['start_time'] = $y_aktuelle_stunde; $y_count_obj5 = 0; while ($y_count_obj5 < $y_max_obj) { $sql_data_array['object_id'] = $y_array_object[$y_count_obj5]; $sql_data_array['calendar_id'] = tep_db_insert_id(); tep_db_perform(TABLE_CALENDAR, $sql_data_array); $y_count_obj5++; } // endwhile object $y_aktuelle_stunde++; } // Mail an Shop schicken // Kundendaten für email auslesen $lese_kd = "SELECT customers_firstname, customers_lastname, customers_telephone, customers_email_address FROM " . TABLE_CUSTOMERS . " WHERE customers_id = " . $y_customers_id; $y_erg_kd = MYSQL_QUERY($lese_kd); $y_anz_kd = MYSQL_NUMROWS($y_erg_kd); if ($y_anz_kd > 0) { $y_kd_firstname = mysql_result($y_erg_kd,0,"customers_firstname"); $y_kd_lastname = mysql_result($y_erg_kd,0,"customers_lastname"); $y_kd_email = mysql_result($y_erg_kd,0,"customers_email_address"); $y_kd_telephone = mysql_result($y_erg_kd,0,"customers_telephone"); } $email_subject = sprintf(TEXT_EMAIL_SUBJECT); $email_subject = $email_subject . " " . $y_kd_firstname . " " . $y_kd_lastname; $y_count_obj2 = 0; while ($y_count_obj2 < $y_max_obj) { $y_object_liste = $y_object_liste . $y_array_object[$y_count_obj2] . " "; $y_count_obj2++; } // endwhile $email_text = $y_customers_id . "<br>" . ENTRY_NAME . ": " . $y_kd_firstname . " " . $y_kd_lastname . "<br>" . ENTRY_PHONE . ": " . $y_kd_telephone . " " . "<br>" . ENTRY_MAIL . ": " . $y_kd_email . "<br><br>" . ENTRY_CAL_ID . ": " . $sql_data_array['calendar_id'] . "<br><br>" . ENTRY_START_DATE . ": " . $y_start_date_de . " - " . $y_start_time . "<br>" . ENTRY_END_DATE . ": " . $y_end_date_de . " - " . $y_end_time . "<br>" . ENTRY_OBJECT_ID . ": " . $y_object_liste; $email_body = TEXT_EMAIL_INTRO . $email_text; // an, email-an, subject, mailtext, von, email-von tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $email_subject, $email_body, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); // redirect to success page tep_redirect(tep_href_link(FILENAME_CALENDAR, 'action=success')); break; } case 'delete': if ($HTTP_GET_VARS['action'] != 'insert') { $calendar_id = tep_db_prepare_input($HTTP_GET_VARS['calendar_id']); $y_customers_id = $customer_id; if (empty($calendar_id)) { $messageStack->add('kalender',ERROR_CAL_EMPTY, 'error'); $kalender_del_error = true; } // Datum nachlesen, um zu prüfen, ob Löschen zulässig $lese_se = "SELECT MIN(start_date) FROM " . TABLE_CALENDAR . " WHERE calendar_id ='" . $calendar_id ."'"; $y_erg_se = MYSQL_QUERY($lese_se); $y_anz_se = MYSQL_NUMROWS($y_erg_se); if ($y_anz_se > 0) { $y_start_date_en = mysql_result($y_erg_se,0,"MIN(start_date)"); } $lese_se2 = "SELECT MAX(end_date) FROM " . TABLE_CALENDAR . " WHERE calendar_id ='" . $calendar_id ."'"; $y_erg_se2 = MYSQL_QUERY($lese_se2); $y_anz_se2 = MYSQL_NUMROWS($y_erg_se2); if ($y_anz_se2 > 0) { $y_end_date_en = mysql_result($y_erg_se2,0,"MAX(end_date)"); } // If current date is between the start and the end, it is clear not allowed // Just is not clear at day +1 admissible $y_selektions_tag_unix2 = strtotime("+1 day"); $y_selektions_tag = date("j",$y_selektions_tag_unix2); $y_selektions_monat = date("n",$y_selektions_tag_unix2); $y_selektions_jahr = date("Y",$y_selektions_tag_unix2); $y_start_tag = date("j",strtotime($y_start_date_en)); $y_start_monat = date("n",strtotime($y_start_date_en)); $y_start_jahr = date("Y",strtotime($y_start_date_en)); if (strtotime($y_start_date_en) == $y_heutiger_tag_unix OR strtotime($y_end_date_en) == $y_heutiger_tag_unix OR (strtotime($y_start_date_en) < $y_heutiger_tag_unix AND strtotime($y_end_date_en) > $y_heutiger_tag_unix) OR ($y_start_tag == $y_selektions_tag AND $y_start_monat == $y_selektions_monat AND $y_start_jahr == $y_selektions_jahr)) { $messageStack->add('kalender',ERROR_DAY_NOW, 'error'); $kalender_del_error = true; } if ($kalender_del_error == false) { tep_db_query("delete from " . TABLE_CALENDAR . " where calendar_id = '" . tep_db_input($calendar_id) . "'"); // Mail an Shop schicken // Kundendaten für email auslesen $lese_kd = "SELECT customers_firstname, customers_lastname FROM " . TABLE_CUSTOMERS . " WHERE customers_id = " . $y_customers_id; $y_erg_kd = MYSQL_QUERY($lese_kd); $y_anz_kd = MYSQL_NUMROWS($y_erg_kd); if ($y_anz_kd > 0) { $y_kd_firstname = mysql_result($y_erg_kd,0,"customers_firstname"); $y_kd_lastname = mysql_result($y_erg_kd,0,"customers_lastname"); } $email_subject = sprintf(TEXT_EMAIL_SUBJECT_DELETE); $email_subject = $email_subject . " " . $y_kd_firstname . " " . $y_kd_lastname; $email_text = $y_customers_id . " " . $y_kd_firstname . " " . $y_kd_lastname . "<br>" . ENTRY_CAL_ID . ": " . $calendar_id; $email_body = TEXT_EMAIL_INTRO_DELETE . $email_text; // an, email-an, subject, mailtext, von, email-von tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $email_subject, $email_body, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); break; } // endif kalender_error == 0 } // endif not insert } // endif switch } // endif action } // endif customer_id require(DIR_WS_INCLUDES . 'template_top.php'); ?> <style type="text/css">@@import url(../jscalendar-1.0/calendar-blue.css);</style> <script type="text/javascript" src="../jscalendar-1.0/calendar.js"></script> <script type="text/javascript" src="../jscalendar-1.0/lang/calendar-de.js"></script> <script type="text/javascript" src="../jscalendar-1.0/calendar-setup.js"></script> <?php require('includes/form_check.js.php'); ?> <script type="text/javascript"> function popup(name,einstellungen,id,daten) { var fenster = window.open('',name,einstellungen); var dokument = "<html><body><br>Kdnr: "+id+"<br>"; dokument += "Name: "+daten+"<br><br>"; dokument += "</body></html>\n\n"; fenster.document.writeln(dokument); fenster.document.close(); } </script> <h1><?php echo HEADING_TITLE; ?></h1> <?php if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) { ?> <div class="contentContainer"> <div class="contentText"> <?php echo TEXT_SUCCESS; ?> </div> <div style="float: right;"> <?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', tep_href_link(FILENAME_DEFAULT)); ?> </div> </div> <?php } else { ?> <div class="contentContainer"> <div class="contentText"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><?php echo $messageStack->output('kalender'); ?></td></tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="smallText"><?php echo TEXT_DESC_INSERT; ?></td> </tr> <tr> <?php // die Einfügen- und Löschbox nur aufblenden, wenn ein Kunde ausgewählt wurde if ($customer_id > 0) { echo " <td>"; echo tep_draw_form('cal_ins', FILENAME_CALENDAR, tep_get_all_get_params(array('action')) . 'action=insert'); ?> <table class=formArea border="0" width="60%" cellspacing="0" cellpadding="4"> <tr> <td class="main"><?php echo ENTRY_START_DATE; ?> <input name="start_date" type="text" size="15" id="start_date" > <button id="trigger_s">...</button> <script type="text/javascript"> Calendar.setup ( { inputField : "start_date", // ID of the input field ifFormat : "%m.%d.%Y", // the date format button : "trigger_s" // ID of the button } ); </script> <?php echo ENTRY_START_TIME; ?> <select name="start_time" size="1"> <?php $y_count_end_time=0; while ($y_count_end_time < $yc_max_time) { echo "<option value=" . $array_time[$y_count_end_time] . ">".$array_time[$y_count_end_time]."</option>"; $y_count_end_time++; } ?> </select> <input name="customers_id" type="hidden" value="<?php echo $customer_id ?>"> <input name="action" type="hidden" value="insert"> </td> </tr> <tr> <td class="main"><?php echo ENTRY_END_DATE; ?> <input name="end_date" type="text" size="15" id="end_date" > <button id="trigger_e">...</button> <script type="text/javascript"> Calendar.setup ( { inputField : "end_date", // ID of the input field ifFormat : "%d.%m.%Y", // the date format button : "trigger_e" // ID of the button } ); </script> <?php echo ENTRY_END_TIME; ?> <select name="end_time" size="1"> <?php $y_count_end_time=0; while ($y_count_end_time < $yc_max_time) { echo "<option value=" . $array_time_end[$y_count_end_time] . ">".$array_time_end[$y_count_end_time]."</option>"; $y_count_end_time++; } ?> </select> </td> </tr> <tr> <td class=main><?php echo ENTRY_OBJECT_ID; ?> <?php $y_count_objekt=0; while ($y_count_objekt < $yc_max_object) { $lese_object_desc = "SELECT object_description FROM " . TABLE_OBJECT . " WHERE object_id = " . $array_object[$y_count_objekt]; $y_erg_object_desc = MYSQL_QUERY($lese_object_desc); $y_anz_object_desc = MYSQL_NUMROWS($y_erg_object_desc); if ($y_anz_object_desc > 0) { $y_desc = mysql_result($y_erg_object_desc,0,"object_description"); echo "<input type=checkbox name=object[] value=" . $array_object[$y_count_objekt] . ">".$array_object[$y_count_objekt] . " - " . $y_desc . "<br>"; } $y_count_objekt++; } // endwhile ?> </select> </td> </tr> <tr> <td class="main" align="right"><span class="tdbLink"> <button id="add" type="submit"><?php echo IMAGE_BUTTON_INSERT; ?></button></span><script type="text/javascript">$("#add").button({icons:{primary:"ui-icon-plus"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script> </td> </tr> </table> </form> </td> <?php } ?> </tr> </table> <?php if ($customer_id > 0) { ?> <!-- BOF Blätterpfeile anzeigen --> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="main"> <?php // berechne Datum vor einer Woche $y_ap_vor = strtotime("-1 week",$y_ap); $y_ap_vor = date("Y-m-d",$y_ap_vor); $y_current_day_bl = date('w',$y_heutiger_tag_unix); // ergibt 0 für Sonntag, 1 für Montag, 2 für Di, etc $y_days_until_start_bl = $y_current_day_bl; // Woche soll ab (Montag) heute starten, daher (-1) kein Tag Abzug $y_week_start_bl = strtotime("-$y_days_until_start_bl days", $y_heutiger_tag_unix); // nur Termine bis zur aktuellen Kalenderwoche anzeigen, davorliegende Termine werden nicht angezeigt if (strtotime($y_ap_vor) >= $y_week_start_bl) { echo '<a href="' . tep_href_link('kalender.php','ap='.$y_ap_vor) . '">' . tep_image(DIR_WS_CATALOG . DIR_WS_IMAGES . 'button_back.gif', IMAGE_BUTTON_BACK,'7','7') . ' ' . TEXT_BACK . '</a>'; } ?> </td> <td class="main" align=right> <?php // berechne Datum in einer Woche $y_ap_nach = strtotime("+1 week",$y_ap); $y_ap_nach = date("Y-m-d",$y_ap_nach); echo '<a href="' . tep_href_link('kalender.php','ap='.$y_ap_nach) . '">' . TEXT_FOR . ' ' . tep_image(DIR_WS_CATALOG . DIR_WS_IMAGES . 'button_for.gif', IMAGE_BUTTON_FOR,'7','7') . '</a>'; ?> </td> </tr> </table> <!-- EOF Blätterpfeile anzeigen --> <!-- BOF erzeuge Wochentabelle --> <table class="formArea" style="table-layout:fixed" border="1px" bordercolor="#B3BAC5" width="100%" cellspacing="1" cellpadding="0"> <tr> <?php // für die deutsche Datumsanzeige muß das Datum im array zuerst in eine Unix-Zeit umgewandelt werden, // anschließend wird es deutsch formatiert. Achtung: für den DB-Zugriff wird das amerikanische Datum benötigt $y_count_i=1; while ($y_count_i < $yc_max_days) { echo "<td class=td-datum>" . $array_txt_day[$y_count_i] . "<br>" . date("d.m.Y",strtotime($array_wochentage[$y_count_i])) . "</td>"; $y_count_i++; } ?> </tr> <tr> <?php // lese zu der Woche alle Termindaten ein $y_count_wochentage=1; while ($y_count_wochentage < $yc_max_days) { echo "<td>"; echo "<table class=\"table-termin\" style=\"table-layout:fixed\" border=\"0\"><tr>"; // prüfen, ob es ein Feiertag ist, falls ja dies in den Kalender schreiben $lese_holiday = "SELECT holiday_description FROM " . TABLE_HOLIDAYS . " WHERE holiday_date = '" . $array_wochentage[$y_count_wochentage] ."'"; $y_erg_holiday = MYSQL_QUERY($lese_holiday); $y_anz_holiday = MYSQL_NUMROWS($y_erg_holiday); if ($y_anz_holiday > 0) { $y_holiday_description = mysql_result($y_erg_holiday,0,"holiday_description"); echo "<td class=\"td-termin\" bgcolor=\"lightgray\" rowspan=\"2\">" . $y_holiday_description . "</td>"; } else { // es ist kein Feiertag, normal weiterarbeiten echo "<td class=\"td-termin\"></td>"; // Platzhalter für Uhrzeit-Spalte $y_count_j=0; while ($y_count_j < $yc_max_object) { // alle vorhandenen Objekte anzeigen echo "<td class=\"td-termin\">" . $array_object[$y_count_j] . "</td>"; $y_count_j++; } echo "</tr>"; // lese zum Wochentag die zulässigen Uhrzeiten ein $y_tag_kuerzel = date("w",strtotime($array_wochentage[$y_count_wochentage])); // gibt 0=Sonntag...6=Samstag zurück => übersetzen $y_tag_kuerzel = $array_wt_txt[$y_tag_kuerzel]; $lese_wt_hour = "SELECT wt_hour FROM " . TABLE_WORK_TIME . " WHERE wt_txt = '" . $y_tag_kuerzel ."'". " AND wt_hour IS NOT NULL" . " ORDER BY wt_hour ASC"; $y_erg_wt_hour = MYSQL_QUERY($lese_wt_hour); $y_anz_wt_hour = MYSQL_NUMROWS($y_erg_wt_hour); if ($y_anz_wt_hour > 0) { // array initialisieren, damit bei unterschiedlichen Öffnungszeiten nicht die alten Daten // angzeigt werden $array_time = array(); $y_count_wt_hour=0; while ($y_count_wt_hour < $y_anz_wt_hour) { $array_time[$y_count_wt_hour] = mysql_result($y_erg_wt_hour,$y_count_wt_hour,"wt_hour"); $y_count_wt_hour++; } $yc_max_time = count($array_time); // Anzahl der Stunden im array } $y_count_time=0; while ($y_count_time < $yc_max_time) { // nur beim jeweils ersten Durchgang wird die Uhrzeit rausgeschrieben // echo "<td class=td-termin>" . $array_time[$y_count_time] . "</td>"; // Platzhalter für Uhrzeit-Spalte $y_zeit_ende = $array_time[$y_count_time] + 1; $y_letzte_stunde = $yc_max_time - 1; if ($y_count_time < $y_letzte_stunde) { echo "<tr><td class=\"td-termin\"><span class=\"smallText\">" . $array_time[$y_count_time]. "-" . $y_zeit_ende . "</span></td>"; // Platzhalter für Uhrzeit-Spalte } else { // es handelt sich um die letzte eingetragene Stunde in work_time, diese nicht anzeigen // die letzte Stunde wird nur zur Abrechnung benötigt ! Unterschied zwischen der Buchung // eines Zeitraumes (von 17-18 Uhr) und der stundenweise Abrechnung (1 h) } $y_count_object=0; while ($y_count_object < $yc_max_object) { // lese zum Wochentag zur ersten Uhrzeit zum ersten Objekt Daten ein // lese zum Wochentag zur ersten Uhrzeit zum zweiten Objekt Daten ein, etc $lese_calendar = "SELECT calendar_id, customers_id FROM " . TABLE_CALENDAR . " WHERE start_date = '" . $array_wochentage[$y_count_wochentage] ."'". " AND start_time = '" . $array_time[$y_count_time] . "'" . " AND object_id = '" . $array_object[$y_count_object]. "'"; $y_erg_calendar = MYSQL_QUERY($lese_calendar); $y_anz_calendar = MYSQL_NUMROWS($y_erg_calendar); if ($y_anz_calendar == 0) { echo "<td class=\"td-termin\" bgcolor=\"white\"></td>"; } elseif ($y_anz_calendar > 0) { $y_customers_id = mysql_result($y_erg_calendar,0,"customers_id"); $y_calendar_id = mysql_result($y_erg_calendar,0,"calendar_id"); if ($y_customers_id == $customer_id) { echo "<td class=\"td-termin\" bgcolor=\"yellow\"><span class=\"smallText\">" . $y_calendar_id . "</span></td>"; } else { echo "<td class=\"td-termin\" bgcolor=\"lightgrey\"><span class=\"smallText\">XXX</span></td>"; } } $y_count_object++; } // endwhile object echo "</tr>"; $y_count_time++; } // endwhile time } // endif feiertag echo "</table>"; echo "</td>"; $y_count_wochentage++; } // endwhile wochentage ?> </tr> </table> <?php } // endif customer_id > 0 ?> <!-- EOF erzeuge Wochentabelle --> <table border="2" width="100%" cellspacing="0" cellpadding="0"> <tr> <?php if ($customer_id > 0) { // read existing Schedule // There are only the dates are listed for deletion, are at least one day in the future $y_selektions_tag_unix = strtotime("+1 day"); $y_selektions_tag_en = date("Y-m-d",$y_selektions_tag_unix); $lese_termine = "SELECT calendar_id, start_date, object_id FROM " . TABLE_CALENDAR . " WHERE customers_id = " . $customer_id . " AND (start_date > '" . $y_selektions_tag_en . "'" . " OR " . " (start_date <= '" . $y_selektions_tag_en . "' AND end_date > '" . $y_selektions_tag_en . "'))" . " GROUP BY calendar_id ASC"; " ORDER BY calendar_id ASC"; $y_erg_termine = MYSQL_QUERY($lese_termine); $y_anz_termine = MYSQL_NUMROWS($y_erg_termine); if ($y_anz_termine > 0) { echo "<td class=formAreaTitle>"; echo tep_draw_form('cal_del', FILENAME_CALENDAR, tep_get_all_get_params(array('action')) . 'action=delete'); echo TEXT_TERMINE; ?> <table class=formArea> <tr> <td> <table> <tr> <td class=main><?php echo ENTRY_CAL_ID; ?></td> <td class=main> <?php echo ENTRY_START_DATE;?></td> <td class=main> <?php echo ENTRY_OBJECT_ID; ?></td> </tr> <?php $y_count_row=0; while ($y_count_row < $y_anz_termine){ echo "<tr>"; $y_calendar_id = mysql_result($y_erg_termine,$y_count_row,"calendar_id"); $y_start_datum = mysql_result($y_erg_termine,$y_count_row,"start_date"); $y_object_id = mysql_result($y_erg_termine,$y_count_row,"object_id"); // reformat of American 2009-10-31 on 31/10/2009 $date = explode("-",$y_start_datum); $y_start_datum = $date[2]. "." .$date[1]. "." .$date[0]; $lese_object_desc2 = "SELECT object_description FROM " . TABLE_OBJECT . " WHERE object_id = " . $y_object_id; $y_erg_object_desc2 = MYSQL_QUERY($lese_object_desc2); $y_anz_object_desc2 = MYSQL_NUMROWS($y_erg_object_desc2); if ($y_anz_object_desc2 > 0) { $y_object_desc = mysql_result($y_erg_object_desc2,0,"object_description"); } echo "<td class=main>" . $y_calendar_id . "</td>"; echo "<td class=main> " . $y_start_datum . "</td>"; echo "<td class=main> " . $y_object_id . " - " . $y_object_desc . "</td>"; echo "</tr>"; $y_count_row++; } // endwhile ?> </table> </td> </tr> <tr> <td class=main><?php echo ENTRY_CALENDAR_ID; ?> <input name="calendar_id" type="text" size="11" maxlength="11"></input> <input name="action" type="hidden" value="delete"> </td> <td class=main align=right><span class="tdbLinkdel"> <button id="del" type="submit"><?php echo IMAGE_BUTTON_DELETE; ?></button></span><script type="text/javascript">$("#del").button({icons:{primary:"ui-icon-trash"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLinkdel");</script> </td> </tr> </table> </form> </td> <?php } } ?> </tr> </table> <!-- body_text_eof //--> </div> <div class="buttonSet"> <span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', tep_href_link(FILENAME_DEFAULT)); ?></span> </div> </div> <?php } require(DIR_WS_INCLUDES . 'template_bottom.php'); require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  2. I figured out why this error was happening. In catalog/kalendar.php and in catalog/admin/khalendar.php. After require(DIR_WS_INCLUDES . 'template_top.php'); ?> Add:====================== <style type="text/css">@@import url(../jscalendar-1.0/ calendar-blue.css);</style> <script type="text/javascript" src="../jscalendar-1.0/calendar.js"></script> <script type="text/javascript" src="../jscalendar-1.0/lang/calendar-de.js"></script> <script type="text/javascript" src="../jscalendar-1.0/calendar-setup.js"></script> <?php require('includes/form_check.js.php'); ?> <script type="text/javascript"> function popup(name,einstellungen,id,daten) { var fenster = window.open('',name,einstellungen); var dokument = "<html><body><br>Kdnr: "+id+"<br>"; dokument += "Name: "+daten+"<br><br>"; dokument += "</body></html>\n\n"; fenster.document.writeln(dokument); fenster.document.close(); } </script>
  3. I installed the Time Management Addon http://addons.oscommerce.com/info/8068. I am having a few problems getting this work for me. I have made a few changes but I am still getting the same error. I think I am forgetting a step, but I am just not sure what that step is. I am using an unmodified version of 2.3.3. Here is the error that I am getting. The changes that I have made so far are as following --------------------------------------------------------------------------------+ catalog/admin/includes/filenames.php [Define file names] --------------------------------------------------------------------------------+ define('FILENAME_CALENDAR', 'kalender.php'); // kalender define('FILENAME_CALENDAR', 'kalender_admin.php'); // kalender define('FILENAME_CALENDAR', 'kalender_invoice.php'); // kalender define('FILENAME_CALENDAR', 'kalender_add_prod.php'); // kalender to define('FILENAME_CALENDAR', 'kalender.php'); // kalender define('FILENAME_CALENDAR_ADMIN', 'kalender_admin.php'); // kalender define('FILENAME_CALENDAR_INVOICE', 'kalender_invoice.php'); // kalender define('FILENAME_CALENDAR_ADD_PROD', 'kalender_add_prod.php'); // kalender --------------------------------------------------------------------------------+ catalog/admin/includes/database_tables.php [Define db tables] --------------------------------------------------------------------------------+ Changed this define('TABLE_CALENDAR', 'calendar'); // kalender define('TABLE_HOLIDAYS', 'holidays'); // kalender define('TABLE_OBJECT' , 'object'); // kalender define('TABLE_OBJEKT_PRODUCT', 'object_product'); // kalender define('TABLE_WORK_TIME', 'work_time'); // kalender to this define('TABLE_CALENDAR', 'calendar'); // kalender define('TABLE_HOLIDAYS', 'holidays'); // kalender define('TABLE_OBJECT' , 'object'); // kalender define('TABLE_OBJECT_PRODUCT', 'object_product'); // kalender define('TABLE_WORK_TIME', 'work_time'); // kalender catalog/kalendar.php and catalog/admin/kalendar.php (multiple areas) changed ========================================================== Y-m-d to =============================== m-d-Y =====use Jquery calendar (the original calendar did not pop up when you click on the button) Changed=========================================================== <table class="formArea" border="0" cellspacing="0" cellpadding="2"> <td class="main"><?php echo ENTRY_START_DATE; ?> <input name="start_date" type="text" size="15" id="start_date" > <button id="trigger_s">...</button> <script type="text/javascript"> Calendar.setup ( { inputField : "start_date", // ID of the input field ifFormat : "%d.%m.%Y", // the date format button : "trigger_s" // ID of the button } ); </script> TO:=============================================================== <table class="formArea" border="0" width="400px" cellspacing="0" cellpadding="2"> <tr> <td class="fieldKey"><?php echo ENTRY_START_DATE; ?> <?php echo tep_draw_input_field('start_date', '', 'id="start_date"') . ' ' . (tep_not_null(ENTRY_START_DATE) ? '<span class="inputRequirement">' . '</span>': ''); ?><script type="text/javascript">$('#start_date').datepicker({dateFormat: '<?php echo JQUERY_DATEPICKER_FORMAT; ?>', changeMonth: true, changeYear: true, yearRange: '-100:+0'});</script> Changed:============================================================================================================================= <td class="main"><?php echo ENTRY_END_DATE; ?> <input name="end_date" type="text" size="15" id="end_date" > <button id="trigger_e">...</button> <script type="text/javascript"> Calendar.setup ( { inputField : "end_date", // ID of the input field ifFormat : "%d.%m.%Y", // the date format button : "trigger_e" // ID of the button } ); </script> To================================================================================================================================== <td class="fieldKey"><?php echo ENTRY_END_DATE; ?> <?php echo tep_draw_input_field('end_date', '', 'id="end_date"') . ' ' . (tep_not_null(ENTRY_END_DATE) ? '<span class="inputRequirement">' . '</span>': ''); ?><script type="text/javascript">$('#end_date').datepicker({dateFormat: '<?php echo JQUERY_DATEPICKER_FORMAT; ?>', changeMonth: true, changeYear: true, yearRange: '-100:+0'});</script>
  4. I had the same problem and I did a compare of the old file and the new file and noticed that .ui-tabs .ui-tabs-hide { display: none !important; } was missing from the custom css file. I added this and now it works fine.
  5. I just wanted to say thank you for the wonderful contributions. I got both of them working together perfectly. I have attached a screenshot of a few changes that I made. I changed to order of the price and the model number and made the price larger and changed the color. I also moved the social bookmarks to under the picture. Thanks so much.
  6. I updated my jquery to 1.9.1 and now my tabs are not displaying correct. All of the tab information is showing up on the first tab. Descriptions, Reviews, Ask A Question ETC all on the first tab one under the other.
  7. Thank you Grep worked great.
  8. Can someone please let me know which files I need to edit to make the above changes.
  9. Where can I find instructions for the menu maker. I don't know what to put for group class etc.
  10. Thank you for the reply. I uninstalled Master Products and Reinstalled it and now it works perfect.
  11. I was wondering if anyone else is having the same problem that I am. I have installed Master Products for V2.3 and I can assign a product as a master, but if I need to edit the product, I am not able to save it. I get redirected to the categories page and the changes are not saved. Attached is my categories.php page. categories.php