| Neuer Benutzer
Registriert seit: 06.03.2010
Beiträge: 3
PHP-Kenntnisse: Anfänger
| Sorry was ist jetzt zweiter Beitrag in dem Forum.
Also hier kommt meine Datei neu.php PHP-Code: <?php function monthBack( $timestamp ){ return mktime(0,0,0, date("m",$timestamp)-1,date("d",$timestamp),date("Y",$timestamp) ); } function yearBack( $timestamp ){ return mktime(0,0,0, date("m",$timestamp),date("d",$timestamp),date("Y",$timestamp)-1 ); } function monthForward( $timestamp ){ return mktime(0,0,0, date("m",$timestamp)+1,date("d",$timestamp),date("Y",$timestamp) ); } function yearForward( $timestamp ){ return mktime(0,0,0, date("m",$timestamp),date("d",$timestamp),date("Y",$timestamp)+1 ); }
function getCalender($date,$headline = array('Mo','Di','Mi','Do','Fr','Sa','So')) { $sum_days = date('t',$date); $LastMonthSum = date('t',mktime(0,0,0,(date('m',$date)-1),0,date('Y',$date))); foreach( $headline as $key => $value ) { echo "<div class=\"day headline\">".$value."</div>\n"; } for( $i = 1; $i <= $sum_days; $i++ ) { $day_name = date('D',mktime(0,0,0,date('m',$date),$i,date('Y',$date))); $day_number = date('w',mktime(0,0,0,date('m',$date),$i,date('Y',$date))); if( $i == 1) { for( $b = 0; $b < array_search($day_name,array('Mon','Tue','Wed','Thu','Fri','Sat','Sun')); $b++ ) { $x = $LastMonthSum -$b; echo "<div class=\"day before\">".sprintf("%02d",$x)."</div>\n"; } } $m=date('m',$date); $y=date('y',$date); if( $i == date('d',$date)) { //{<a href="ziel.html" title="Beschreibung">Ein Link</a> #echo"<td><a href=\"Login.php\" target=\"_parent\" id=\"forenlink1\">Login</a></td>"; echo "<a href=\"neu.php?id=$i:$m:$y:$date\" target=\"_parent\" id=\"$i\" ><div class=\"day normal\">".sprintf("%02d",$i)."</div></a>\n"; } else { echo "<a href=\"neu.php?id=$i:$m:$y:$date \" target=\"_parent\" id=\"$i\" ><div class=\"day normal\">".sprintf("%02d",$i)."</div></a>\n"; } if( $i == $sum_days) { $next_sum = (6 - array_search($day_name,array('Mon','Tue','Wed','Thu','Fri','Sat','Sun'))); for( $c = 1; $c <=$next_sum; $c++) { echo "<div class=\"day after\"> ".sprintf("%02d",$c)." </div>\n"; } } } } ?> <html> <head> <style type="text/css"> body { font-family:verdana; font-size:12px; } a { color:black; text-decoration: none; } a:hover { text-decoration: underline; background: #eaeaea; } .calender { width:280px; border:1px solid black; } * html .calender, * + html .calender { width:282px; } .calender div.after, .calender div.before{ color:silver; } .day { float:left; width:40px; height:40px; line-height: 40px; text-align: center; } .day.headline { background:silver; } .clear { clear:left; } .pagination { text-align: center; height:20px; line-height:20px; font-weight: bold; } .pagination a { width:20px; height:20px; } a.logo { width:50px; height:20px; display:block; background:white url(neu.jpg;) center center; } a.logo:link { border:thick outset grey; } a.logo:visited { border:thick outset grey; } //a.logo:hover { border:thick inset grey; } a.logo span {visibility:none; }
</style> </head> <body> <?php $date_übergeben=$_GET['id']; #list($tag,$monat,$jahr)=split(".", $date_übergeben, 5); list($tag, $monat, $jahr, $date_an) =split(":", $date_übergeben, 4); $arr_date=split(".",$date_übergeben); #echo $date_übergeben; echo $tag, $monat, $jahr, $date_an;
echo "<form action=\"neu2.php\" . method=\"POST\">"; echo "Tag: <input type=\"text\" . name=\"an_tag\" . value=\"$tag\" . ><br>"; echo "Monat: <input type=\"text\" . name=\"an_monat\" . value=\"$monat\" . ><br>"; echo "Jahr: <input type=\"text\" . name=\"an_jahr\" . value=\"$jahr\" . ><p>"; echo "Date: <input type=\"text\" . name=\"an_date\" . value=\"$date_an\" . ><p>"; echo "<input type=\"submit\" . value=\"weiter\"><p>"; echo "</form>"; ?>
<?php echo"<form action=\"neu2.php\" method=\"post\">"; echo"<b>Zimmer-Typ:</b>"; echo"<select name=\"system\" size=\"1\">"; echo" <option selected>Doppelzimmer"; echo" <option>Zimmer A"; echo" <option>Zimmer B"; echo"</select>"; echo"<br><br><br>"; echo"<b>Anreisedatum:</b> <br>"; echo"Tag:<input name=\"tag\" size=\"2\" value=\"$tag\">"; echo"Monat:<input name=\"monat\" size=\"2\" value=\"$monat\">"; echo"Jahr:<input name=\"jahr\" size=\"4\" value=\"$jahr\">"; echo"<br><br><br>"; echo"</form>"; ?> <?php $output=$_GET[id]; echo $output;
if( isset($_REQUEST['timestamp'])) $date = $_REQUEST['timestamp']; else $date = time();
$arrMonth = array( "January" => "Januar", "February" => "Februar", "March" => "März", "April" => "April", "May" => "Mai", "June" => "Juni", "July" => "Juli", "August" => "August", "September" => "September", "October" => "Oktober", "November" => "November", "December" => "Dezember" ); $headline = array('Mo','Di','Mi','Do','Fr','Sa','So');
?>
<div class="calender"> <div class="pagination"> <a href="?timestamp=<?php echo yearBack($date); ?>" class="last">|«</a> <a href="?timestamp=<?php echo monthBack($date); ?>" class="last">«</a> <span><?php echo $arrMonth[date('F',$date)];?> <?php echo date('Y',$date); ?></span> <a href="?timestamp=<?php echo monthForward($date); ?>" class="next">»</a> <a href="?timestamp=<?php echo yearForward($date); ?>" class="next">»|</a> </div> <?php getCalender($date,$headline); ?> <div class="clear"></div> </div> <br><br> <input type="reset" value="Abbrechen"> <?php
//falls die Variablen Werte enthalten $_POST[dblink_id]=@mysql_connect("localhost","root",""); if (!$_POST[dblink_id]) {echo "<p>Verbindung zum Datenbankserver ist zur Zeit nicht möglich!</p>"; exit(); } else {echo "<p>Verbindung zum Datenbankserver ist hergestellt! </p>"; echo "<p>Verbindungsnummer : $_POST[dblink_id]</p>"; } mysql_select_db("weingut",$_POST[dblink_id]); #$sql = 'UPDATE `temp` SET `tempnummer` = \'1\', `tag` = \'\', `monat` = \'\', `jahr` = \'\' WHERE `temp`.`tempnummer` = 1 LIMIT 1;'; #$result=mysql_query($sql); #$sql2 = 'UPDATE `temp` SET `tempnummer` = \'2\', `tag` = \'\', `monat` = \'\', `jahr` = \'\' WHERE `temp`.`tempnummer` = 2 LIMIT 1;'; #$result=mysql_query($sql2); mysql_close($_POST[dblink_id]) ?> </body> </html> Dann neu2.php : PHP-Code: <?php
function monthBack( $timestamp ){ return mktime(0,0,0, date("m",$timestamp)-1,date("d",$timestamp),date("Y",$timestamp) ); } function yearBack( $timestamp ){ return mktime(0,0,0, date("m",$timestamp),date("d",$timestamp),date("Y",$timestamp)-1 ); } function monthForward( $timestamp ){ return mktime(0,0,0, date("m",$timestamp)+1,date("d",$timestamp),date("Y",$timestamp) ); } function yearForward( $timestamp ){ return mktime(0,0,0, date("m",$timestamp),date("d",$timestamp),date("Y",$timestamp)+1 ); }
function getCalender($date,$headline = array('Mo','Di','Mi','Do','Fr','Sa','So')) { $sum_days = date('t',$date); $LastMonthSum = date('t',mktime(0,0,0,(date('m',$date)-1),0,date('Y',$date))); foreach( $headline as $key => $value ) { echo "<div class=\"day headline\">".$value."</div>\n"; } for( $i = 1; $i <= $sum_days; $i++ ) { $day_name = date('D',mktime(0,0,0,date('m',$date),$i,date('Y',$date))); $day_number = date('w',mktime(0,0,0,date('m',$date),$i,date('Y',$date))); if( $i == 1) { for( $b = 0; $b < array_search($day_name,array('Mon','Tue','Wed','Thu','Fri','Sat','Sun')); $b++ ) { $x = $LastMonthSum -$b; echo "<div class=\"day before\">".sprintf("%02d",$x)."</div>\n"; } } $m=date('m',$date); $y=date('y',$date);
//if( $i == date('d',$date)) { //echo"<a href="google.de">"<div class=\"day current\">".sprintf("%02d",$i)."</div>\n</a>"; // } else { // echo"<a href="google.de">"<div class=\"day normal\">".sprintf("%02d",$i)."</div>\n</a>"; //} if( $i == date('d',$date)) { echo "<a href=\"neu2.php?tag2=$i:$m:$y\" target=\"_parent\" id=\"$i\" ><div class=\"day normal\">".sprintf("%02d",$i)."</div></a>\n"; } else { echo "<a href=\"neu2.php?tag2=$i:$m:$y \" target=\"_parent\" id=\"$i\" ><div class=\"day normal\">".sprintf("%02d",$i)."</div></a>\n"; } if( $i == $sum_days) { $next_sum = (6 - array_search($day_name,array('Mon','Tue','Wed','Thu','Fri','Sat','Sun'))); for( $c = 1; $c <=$next_sum; $c++) { echo "<div class=\"day after\"> ".sprintf("%02d",$c)." </div>\n"; } } } } ?> <html> <head> <style type="text/css"> body { font-family:verdana; font-size:12px; } a { color:black; text-decoration: none; } a:hover { text-decoration: underline; background: #eaeaea; } .calender { width:280px; border:1px solid black; } * html .calender, * + html .calender { width:282px; } .calender div.after, .calender div.before{ color:silver; } .day { float:left; width:40px; height:40px; line-height: 40px; text-align: center; } .day.headline { background:silver; } .day.current { font-weight:bold; } .clear { clear:left; } .pagination { text-align: center; height:20px; line-height:20px; font-weight: bold; } .pagination a { width:20px; height:20px; } a.logo { width:50px; height:20px; display:block; background:white url(neu.jpg;) center center; } a.logo:link { border:thick outset grey; } a.logo:visited { border:thick outset grey; } //a.logo:hover { border:thick inset grey; } a.logo span {visibility:none; }
</style> </head> <body> <?php $date_übergeben=$_GET['tag2']; #list($tag,$monat,$jahr)=split(".", $date_übergeben, 5); list($tag, $monat, $jahr) = split(":", $date_übergeben, 3); $arr_date=split(".",$date_übergeben); #echo $date_übergeben; echo $tag, $monat, $jahr;
$an_tag=$_POST[an_tag]; $an_monat=$_POST[an_monat]; $an_jahr=$_POST[an_jahr]; $an_date=$_POST[an_date];
$_POST[dblink_id]=@mysql_connect("localhost","root",""); if (!$_POST[dblink_id]) {echo "<p>Verbindung zum Datenbankserver ist zur Zeit nicht möglich!</p>"; exit(); } else {echo "<p>Verbindung zum Datenbankserver ist hergestellt! </p>"; echo "<p>Verbindungsnummer : $_POST[dblink_id]</p>"; } if($geschrieben!=1) { mysql_select_db("weingut",$_POST[dblink_id]); $sql = "UPDATE temp SET tempnummer = \"1\", tag =\"".$an_tag."\", monat = \"".$an_monat."\", jahr =\"".$an_jahr."\" , date = \"".$an_date."\" WHERE temp.tempnummer = 1 LIMIT 1;"; #$sql = 'UPDATE `temp` SET `tag` = \'13\', `monat` = \'4\', `jahr` = \'15\' WHERE `temp`.`tempnummer` = 1 LIMIT 1;'; $result=mysql_query($sql); $geschrieben=1; } else { #if(!($tag)=="") #{ $sql2 = 'SELECT * FROM `temp` WHERE temp . tempnummer = 1 LIMIT 0, 30 '; $result=mysql_query($sql2); $row=mysql_fetch_array($result); #{ $an_tag=$_row[tag]; $an_monat=$_row[monat]; $an_jahr=$_row[jahr]; $an_date=$_row[date]; } #}
echo "<form action=\"neu3.php\" . method=\"POST\">"; echo "Tag......: <input type=\"text\" . name=\"ab_tag\" . value=\"$tag\" . ><br>"; echo "Monat: <input type=\"text\" . name=\"ab_monat\" . value=\"$monat\" . ><br>"; echo "Jahr.......: <input type=\"text\" . name=\"ab_jahr\" . value=\"$jahr\" . ><p>"; echo "Date.......: <input type=\"text\" . name=\"ab_date\" . value=\"$date\" . ><p>"; echo "<input type=\"submit\" . value=\"weiter\"><p>"; #echo "</form>"; #echo"<b>Zimmer-Typ:</b>"; #echo"<select name=\"system\" size=\"1\">"; #echo" <option selected>Doppelzimmer"; #echo" <option>Zimmer A"; #echo" <option>Zimmer B"; #echo"</select>"; echo"<br><br><br>"; echo"<b>Anreisedatum:</b> <br>"; echo"Tag:<input name=\"tag\" size=\"2\" value=\"$an_tag\">"; echo"Monat:<input name=\"monat\" size=\"2\" value=\"$an_monat\">"; echo"Jahr:<input name=\"jahr\" size=\"4\" value=\"$an_jahr\">"; echo"<br><br><br>"; echo"</form>";
#if(!isset($_POST[host]) && !isset($_POST[user]) && !isset($_POST[passwort]))
echo "antag:"; echo $an_tag, $an_monat, $an_jahr; echo"<br>"; echo $an_date;
if( isset($_REQUEST['timestamp'])) $date = $_REQUEST['timestamp']; else $date = time();
$arrMonth = array( "January" => "Januar", "February" => "Februar", "March" => "März", "April" => "April", "May" => "Mai", "June" => "Juni", "July" => "Juli", "August" => "August", "September" => "September", "October" => "Oktober", "November" => "November", "December" => "Dezember" ); $headline = array('Mon','Die','Mit','Don','Fri','Sam','Son');
?>
<div class="calender"> <div class="pagination"> <a href="?timestamp=<?php echo yearBack($date); ?>" class="last">|«</a> <a href="?timestamp=<?php echo monthBack($date); ?>" class="last">«</a> <span><?php echo $arrMonth[date('F',$date)];?> <?php echo date('Y',$date); ?></span> <a href="?timestamp=<?php echo monthForward($date); ?>" class="next">»</a> <a href="?timestamp=<?php echo yearForward($date); ?>" class="next">»|</a> </div> <?php getCalender($date,$headline); ?> <div class="clear"></div> </div> <br><br> <form action="neu.php" method="link"> <input type="submit" value="Zurück"> </form> </body> </html> Und schließlich neu3.php : PHP-Code: <?php function monthBack( $timestamp ){ return mktime(0,0,0, date("m",$timestamp)-1,date("d",$timestamp),date("Y",$timestamp) ); } function yearBack( $timestamp ){ return mktime(0,0,0, date("m",$timestamp),date("d",$timestamp),date("Y",$timestamp)-1 ); } function monthForward( $timestamp ){ return mktime(0,0,0, date("m",$timestamp)+1,date("d",$timestamp),date("Y",$timestamp) ); } function yearForward( $timestamp ){ return mktime(0,0,0, date("m",$timestamp),date("d",$timestamp),date("Y",$timestamp)+1 ); }
function getCalender($date,$headline = array('Mo','Di','Mi','Do','Fr','Sa','So')) { $sum_days = date('t',$date); $LastMonthSum = date('t',mktime(0,0,0,(date('m',$date)-1),0,date('Y',$date))); foreach( $headline as $key => $value ) { echo "<div class=\"day headline\">".$value."</div>\n"; } for( $i = 1; $i <= $sum_days; $i++ ) { $day_name = date('D',mktime(0,0,0,date('m',$date),$i,date('Y',$date))); $day_number = date('w',mktime(0,0,0,date('m',$date),$i,date('Y',$date))); if( $i == 1) { for( $b = 0; $b < array_search($day_name,array('Mon','Tue','Wed','Thu','Fri','Sat','Sun')); $b++ ) { $x = $LastMonthSum -$b; echo "<div class=\"day before\">".sprintf("%02d",$x)."</div>\n"; } } $m=date('m',$date); $y=date('y',$date); $_POST[dblink_id]=@mysql_connect("localhost","root",""); if (!$_POST[dblink_id]) {#echo "<p>Verbindung zum Datenbankserver ist zur Zeit nicht möglich!</p>"; exit(); } else {#echo "<p>Verbindung zum Datenbankserver ist hergestellt! </p>"; #echo "<p>Verbindungsnummer : $_POST[dblink_id]</p>"; } mysql_select_db("weingut",$_POST[dblink_id]); $aktuell_monat=date('m',$date); $aktuell_jahr=date('y',$date); if( $i == date('d',$date)) //{<a href="ziel.html" title="Beschreibung">Ein Link</a> { $aktuell_tag=sprintf("%02d",$i); $sql = "SELECT * FROM auftrag WHERE tag = 01 and monat = 02 and jahr = 10 LIMIT 0, 30 "; echo "<div class=\"day current\">".sprintf("%02d",$i)."</div>\n"; } else { $aktuell_tag=sprintf("%02d",$i); echo "<div class=\"day normal\">".sprintf("%02d",$i)."</div>\n"; } #echo"<td><a href=\"Login.php\" target=\"_parent\" id=\"forenlink1\">Login</a></td>"; #echo "<a href=\"neu.php?id=$i:$m:$y\" target=\"_parent\" id=\"$i\" ><div class=\"day current\">".sprintf("%02d",$i)."</div></a>\n"; #} else { #echo "<a href=\"neu.php?id=$i:$m:$y \" target=\"_parent\" id=\"$i\" ><div class=\"day normal\">".sprintf("%02d",$i)."</div></a>\n"; if( $i == $sum_days) { $next_sum = (6 - array_search($day_name,array('Mon','Tue','Wed','Thu','Fri','Sat','Sun'))); for( $c = 1; $c <=$next_sum; $c++) { echo "<div class=\"day after\"> ".sprintf("%02d",$c)." </div>\n"; } } } } ?> <html> <head> <style type="text/css"> body { font-family:verdana; font-size:20px; } a { color:black; text-decoration: none; } a:hover { text-decoration: underline; background: #eaeaea; } .calender { width:400px; border:1px solid black; } * html .calender, * + html .calender { width:400px; } .calender div.after, .calender div.before{ color:silver; } .day { float:left; width:50px; height:50px; line-height: 50px; text-align: center;
} .day.headline { background:silver; color:black; } .clear { clear:left; } .pagination { text-align: center; height:50px; line-height:50px; font-weight: bold; } .pagination a { width:50px; height:50px; } a.logo { width:50px; height:20px; display:block; background:white url(neu.jpg;) center center; } a.logo:link { border:thick outset grey; } a.logo:visited { border:thick outset grey; } //a.logo:hover { border:thick inset grey; } a.logo span {visibility:none; }
</style> </head> <body> <?php
$ab_tag=$_POST[ab_tag]; $ab_monat=$_POST[ab_monat]; $ab_jahr=$_POST[ab_jahr]; $ab_date=$_POST[ab_date];
echo $ab_tag; echo ","; ?> <?php //$output=$_GET[id]; //echo $output;
if( isset($_REQUEST['timestamp'])) $date = $_REQUEST['timestamp']; else $date = time();
$arrMonth = array( "January" => "Januar", "February" => "Februar", "March" => "März", "April" => "April", "May" => "Mai", "June" => "Juni", "July" => "Juli", "August" => "August", "September" => "September", "October" => "Oktober", "November" => "November", "December" => "Dezember" ); $headline = array('Mo','Di','Mi','Do','Fr','Sa','So');
?>
<div class="calender"> <div class="pagination"> <a href="?timestamp=<?php echo yearBack($date); ?>" class="last">|«</a> <a href="?timestamp=<?php echo monthBack($date); ?>" class="last">«</a> <span><?php echo $arrMonth[date('F',$date)];?> <?php echo date('Y',$date); ?></span> <a href="?timestamp=<?php echo monthForward($date); ?>" class="next">»</a> <a href="?timestamp=<?php echo yearForward($date); ?>" class="next">»|</a> </div> <?php getCalender($date,$headline); ?> <div class="clear"></div> </div> <br><br> <form action="neu4.php" method="link"> <input type="submit" value="Weiter"> </form> <form action="neu.php" method="link"> <input type="submit" value="Zurück zum Anreisedatum"> </form> </body> </html> |