<?php
$document = JFactory::getDocument();
$document->addScriptDeclaration('
<script src="/../js/datetimepicker_css.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
<script>
if (!Modernizr.touch || !Modernizr.inputtypes.date) {
$('input[type=date]')
.attr('type', 'text')
.datepicker({
// Consistent format with the HTML5 picker
dateFormat: 'yy-mm-dd'
});
}
</script>
<form method="post" action="../includes/UpdateCalendar.inc.php">
<table width="50%">
<tr>
<td><label for="event">Evenement</label></td>
<td width="769"><input placeholder="Event name" required="required" type="text" name="event" id="event" draggable="true"></td>
</tr>
<tr>
<td><label for="eventdate">Datum/Uur</label></td>
<td><input type="datetime" id="eventdate" name="eventdate" required="required" placeholder="Date/time" />
<img src="/../images/calendar/Cal.jpg" alt="" width="25" style="cursor:pointer" onclick="javascript:NewCssCal('eventdate','yyyyMMdd','dropdown',true,'24','','future')"/></td>
</tr>
<tr>
<td><label for="eventlocation">Locatie</label></td>
<td><input type="text" name="eventlocation" id="eventlocation" required="required" placeholder="Location"></td>
</tr>
<tr>
<td><label for="eventcity">Gemeente</label></td>
<td><input type="text" name="eventcity" id="eventcity" required="required" placeholder="City"></td>
</tr>
<tr>
<td><label for="showfrom">Zichtbaar vanaf</label></td>
<td><input type="date" id="showfrom" name="showfrom" required="required" placeholder="Show from">
<img src="/../images/calendar/Cal.jpg" alt="" width="25" style="cursor:pointer" onclick="javascript:NewCssCal('showfrom','yyyyMMdd','dropdown',false,'24','','future')"/></td>
</tr>
<tr>
<td><label for="showuntil">Zichtbaar tot</label></td>
<td><input type="date" id="showuntil" name="showuntil" required="required" placeholder="Show until">
<img src="/../images/calendar/Cal.jpg" alt="" width="25" style="cursor:pointer" onclick="javascript:NewCssCal('showuntil','yyyyMMdd','dropdown',false,'24','','future')"/></td>
</tr>
<tr>
<td><label for="view">Zichtbaar voor</label></td>
<td><select name="view" type="text" id="view" value="">
<option value="OPENBAAR">Iedereen</option>
<option value="PRIVE">Leden</option>
</select></td>
</tr>
<tr>
<td width="115"></td>
<td><input type="submit" name="submit" value="Opslaan"></td>
</tr>
</table>
<p >* Verplicht veld</p>
</form>
<br/>
<?php
// maak de verbinding $db= mysql_connect( "Server", "database", "wachtwoord" );
require '../includes/connection2.inc.php';
$sql = "SELECT `event`, date_format(eventdate, '%W %d-%m-%Y') as EDate, time_format(eventdate, '%H:%i') as ETime, `eventlocation`, `eventcity`, `view`, date_format(showfrom, '%a %d-%m-%Y') as FDate, date_format(showuntil, '%a %d-%m-%Y') as UDate FROM `Kalender` WHERE `showuntil` >=now() ORDER BY `eventdate` ASC";
$result = mysql_query( $sql );
$Color="1";
echo "<table width='100%'>";
echo "<tr style='font-weight:BOLD;'>";
echo "<td>Evenement</td><td>Datum</td><td>Uur</td><td>Locatie</td><td>Gemeente</td><td>Openbaar/Privé</td><td>Van</td><td>Tot</td>";
echo "</tr>";
while( $row = mysql_fetch_array( $result )) {
if($Color==1){
echo "<tr bgcolor='#66FFFF'>";
echo "<td width='20%'>";
echo $row['event'];
echo "</td><td width='15%'>";
echo $row['EDate'];
echo "</td><td width='5%'>";
echo $row['ETime'];
echo "</td><td width='15%'>";
echo $row['eventlocation'];
echo "</td><td width='10%'>";
echo $row['eventcity'];
echo "</td><td width='10%'>";
echo $row['view'];
echo "</td><td width='10%'>";
echo $row['FDate'];
echo "</td><td width='10%'>";
echo $row['UDate'];
echo "</td>";
echo "</tr>";
$Color="2";
}else{
echo "<tr bgcolor='#CCCCCC'>";
echo "<td width='20%'>";
echo $row['event'];
echo "</td><td width='15%'>";
echo $row['EDate'];
echo "</td><td width='5%'>";
echo $row['ETime'];
echo "</td><td width='15%'>";
echo $row['eventlocation'];
echo "</td><td width='10%'>";
echo $row['eventcity'];
echo "</td><td width='10%'>";
echo $row['view'];
echo "</td><td width='10%'>";
echo $row['FDate'];
echo "</td><td width='10%'>";
echo $row['UDate'];
echo "</td>";
echo "</tr>";
$Color="1";
}
}
echo "</table>";
?>
');
?>