3 public $typ =
"scheduleDate";
9 $this->
set_date(
"to",
"0000-00-00 00:00");
14 for(
$i=$begin ;
$i<$end ; ++
$i){
15 if(
$i == $selected ){
16 echo
"<option value='$i' selected='selected'>$i</option>";
18 echo
"<option value='$i'>$i</option>";
24 $date = explode(
"~",$this->dispName);
25 if(
sizeof($date) != 2 ){
26 $date = array(
"0000-00-00 00:00" ,
"0000-00-00 00:00" );
29 if( $code ==
"from" ){
31 }
else if($code ==
"to"){
34 return "0000-00-00 00:00";
43 if( $code ==
"from" ){
46 }
else if($code ==
"to"){
52 $this->dispName =
"{$d_from}~{$d_to}";
56 $date_arr = strptime($datestr,
"%Y-%m-%d %H:%M");
57 if( $date_arr ===
false ){
60 if(isset($date_arr[
"tm_year"])){
61 $date_arr[
"tm_year"] = 1900+$date_arr[
"tm_year"];
62 }
else{ $date_arr[
"tm_year"] = 0;}
64 if(isset($date_arr[
"tm_mon"])){
65 $date_arr[
"tm_mon"] = 1+$date_arr[
"tm_mon"];
66 }
else{ $date_arr[
"tm_mon"] = 1;}
68 if(!isset($date_arr[
"tm_mday"])){
69 $date_arr[
"tm_mday"] = 1;
71 if(!isset($date_arr[
"tm_hour"])){
72 $date_arr[
"tm_hour"] = 0;
74 if(!isset($date_arr[
"tm_min"])){
75 $date_arr[
"tm_min"] = 0;
90 if($date !=
"0000-00-00 00:00"){
91 $val = $date_arr[
"tm_mday"].
"-". $date_arr[
"tm_mon"].
"-".$date_arr[
"tm_year"];
95 }
else if($code ==
"to"){
100 $id_pref =
"date_{$this->ID}_{$code}";
102 if( $code2 ==
"date" ){
103 echo
"<script type='text/javascript'>";
104 echo
"document.write(\"<input type='text' id='{$id_pref}_datepicker' name='{$id_pref}_datepicker' placeholder='TT-MM-JJJJ' value='$val' size='7'/>\");";
105 echo
"$( \"#{$id_pref}_datepicker\" ).datepicker({dateFormat: \"dd-mm-yy\" });";
109 echo
"<select name='{$id_pref}_day' id='{$id_pref}_day'>";
113 echo
"<select name='{$id_pref}_month' id='{$id_pref}_month'>";
117 echo
"<input type='text' value='{$date_arr["tm_year
"]}' name='{$id_pref}_year' id='{$id_pref}_year' size='4'/>";
120 }
else if( $code2 ==
"time" ){
127 echo
"<input type='text' size='7' name='{$id_pref}_time' value='$t' placeholder='HH:MM'/>";
134 if( (isset($_SESSION[
"last_option_edit"])) AND ( $_SESSION[
"last_option_edit"] == $this->ID ) ){
135 $edited =
"option_last_edit";
136 unset($_SESSION[
"last_option_edit"] );
140 echo
"<tr class='$edited line$l'>";
141 echo
"<td>{$this->ID}</td>";
142 echo
"<td style='padding:.5em 0em;'>";
151 <input type='submit' name='addq_option_ID{$this->ID}' title='Frage Einfügen' value='' style='padding:0px;margin:0px;background-color:transparent;background-image:url( ".APP_ROOT.
"/icons/22/list-add.png );background-repeat:no-repeat;width:26px;height:26px;' />
152 <input type='submit' name='rmq_option_ID{$this->ID}' title='Frage Löschen' value='' tabindex='-1' style='padding:0px;margin:0px;background-color:transparent;background-image:url( ".APP_ROOT.
"/icons/22/edit-delete.png );background-repeat:no-repeat;width:26px;height:26px;' />
168 foreach( array(
"from",
"to") as $code ){
169 $prefix =
"date_{$this->ID}_{$code}";
172 if( (isset($_POST[
"{$prefix}_datepicker"])) AND ($_POST[
"{$prefix}_datepicker"] !=
"" ) ){
174 $d = explode(
"-",$_POST[
"{$prefix}_datepicker"]);
175 if( (
sizeof($d)==3) ){
176 $day = intval($d[0]);
177 $month = intval($d[1]);
178 $year = intval($d[2]);
180 return "Ein Datum ist falsch geschrieben";
184 }
else if( (isset($_POST[
"{$prefix}_month"])) AND (isset($_POST[
"{$prefix}_day"])) AND (isset($_POST[
"{$prefix}_year"])) ){
185 if( (is_numeric($_POST[
"{$prefix}_month"])) AND (is_numeric($_POST[
"{$prefix}_day"])) AND (is_numeric($_POST[
"{$prefix}_year"])) ){
186 $day = intval( $_POST[
"{$prefix}_day"] );
187 $month = intval( $_POST[
"{$prefix}_month"] );
188 $year = intval( $_POST[
"{$prefix}_year"] );
191 $day = $month = $year = 0;
192 }
else if($code ==
"from"){
193 return "Ein Datum ist falsch geschrieben";
199 $day = $month = $year = 0;
200 }
else if($code ==
"from"){
201 return "Ein Datum ist falsch geschrieben";
206 if( (isset($_POST[
"{$prefix}_time"])) AND ($_POST[
"{$prefix}_time"] !=
"") ){
207 $time = $_POST[
"{$prefix}_time"];
208 $time = explode(
":",$time);
209 if( (
sizeof($time) == 2) AND (is_numeric($time[0])) AND (is_numeric($time[1])) ){
210 $hour = intval($time[0]);
211 $min = intval($time[1]);
213 return "Eine Zeitangabe ist falsch angegeben";
223 $year_s = str_pad(
"$year",4,
"0",STR_PAD_LEFT);
225 if(
"$year_s-$month_s-$day_s" !=
"0000-00-00" ){
226 if (checkdate($month,$day,$year)){
227 if( ($hour>=0) AND ($hour<24) AND ($min>=0) AND ($min<60)){
228 $datetime =
"$year-$month_s-$day_s $hour_s:$min_s";
231 return "Zeitangabe falsch. Stunden zwischen 0 und 23, minuten zwischen 0 und 59";
234 return "Eines der angegebenen Daten existiert nicht";
237 $this->
set_date($code,
"0000-00-00 00:00");