<?php
include("postget.php");
include_once("common.php");
checklevel(4,$_REQUEST['clientid']);

if($sendclick ==""._SEND."") {
	mysql_query("UPDATE hd_config SET valor='$Xdf' WHERE variable='df'",$db_link);
	mysql_query("UPDATE hd_config SET valor='$Xdfs' WHERE variable='dfs'",$db_link);
	messagetop(_THE_CHANGES_WHERE_MADE_SUCCESSFULLY,'','preferences.php',1);
}


$query="SELECT * FROM hd_config ORDER BY ref";
$result=mysql_query($query,$db_link);
$fila=0;
while($row=mysql_fetch_array($result))
{
	$Config[$fila][0]=$row["variable"] ;
	$Config[$fila][1]="'".$row["valor"]."'";
	//	$Config[$fila][1]=$row["valor"];
	$fila++ ;

}


print("<form method='POST'>");
echo '<table class="table table-striped">';

echo '<tr>';
print("<td>"._DATE_FORMAT.": </td><td>");

?>

	<SELECT name=Xdf>
	<option value='d/m/y' <?php if ("'d/m/y'" == $Config[6][1]) {echo "selected";} ?>>d/m/y (<?php echo date('d/m/y',time()) ?>)</option>
	<option value='d/m/Y' <?php if ("'d/m/Y'" == $Config[6][1]) {echo "selected";} ?>>d/m/Y (<?php echo date('d/m/Y',time()) ?>)</option>
	<option value='m/d/y' <?php if ("'m/d/y'" == $Config[6][1]) {echo "selected";} ?>>m/d/y (<?php echo date('m/d/y',time()) ?>)</option>
	<option value='m/d/Y' <?php if ("'m/d/Y'" == $Config[6][1]) {echo "selected";} ?>>m/d/Y (<?php echo date('m/d/Y',time()) ?>)</option>
	<option value='y/m/d' <?php if ("'y/m/d'" == $Config[6][1]) {echo "selected";} ?>>y/m/d (<?php echo date('y/m/d',time()) ?>)</option>
	<option value='Y/m/d' <?php if ("'Y/m/d'" == $Config[6][1]) {echo "selected";} ?>>Y/m/d (<?php echo date('Y/m/d',time()) ?>)</option>
	<option value='M/d/Y' <?php if ("'M/d/Y'" == $Config[6][1]) {echo "selected";} ?>>M/d/Y (<?php echo date('M/d/Y',time()) ?>)</option>
	</select></td></tr>
	
<?php	
echo '<tr>';
print("<td>"._DATE_FORMAT_SHORT.": </td><td>");
?>

	<SELECT name=Xdfs>
	<option value='d/m' <?php if ("'d/m'" == $Config[28][1]) {echo "selected";} ?>>d/m (<?php echo date('d/m',time()) ?>)</option>
	<option value='m/d' <?php if ("'m/d'" == $Config[28][1]) {echo "selected";} ?>>m/d (<?php echo date('m/d',time()) ?>)</option>
	<option value='d/M' <?php if ("'d/M'" == $Config[28][1]) {echo "selected";} ?>>d/M (<?php echo date('d/M',time()) ?>)</option>
	<option value='M/d' <?php if ("'M/d'" == $Config[28][1]) {echo "selected";} ?>>M/d (<?php echo date('M/d',time()) ?>)</option>
	</select></td></tr>
	
<?php	

print("</table>");
print("<input type=submit name=sendclick value="._SEND."></form>");

?>