<?php
/////////////////////////////////////////////// opciones para el modulo download
include("postget.php");
include_once("common.php");
$pagetitle = _DOWNLOADS;

checklevel(4,$_REQUEST['clientid']);
if ($config[56][1]==1){
	$disabled=" disabled ";
	$mensaje= " "._CHANGE_NOT_ALLOWED_IN_DEMO_MODE;
}else{
	$disabled=" ";
	$mensaje= "";
}


//////////////////////////////////////////////////////////////// si se envi� el formulario, cargar los errores
if ($_REQUEST[sendclick]==""._SEND."") {
	$estiloerror = "class='formfielderror'";
	$errors = '';
	if ($_POST['new125']=='') {$errors.= "<br>".ucfirst(_ALLOWED_FILE_TYPES).": "._NOT_SPECIFIED.""; $estilonew125=$estiloerror;}
	if ($_POST['new75']=='') {$errors.= "<br>".ucfirst(_DIRECTORY_FOR_DOWNLOADS).": "._NOT_SPECIFIED.""; $estilonew75=$estiloerror;}
}

//////////////////////////////////////////////////////////////// si no hay errores y se presion� SEND
if($errors=='' AND $_REQUEST[sendclick] ==""._SEND."") {

	mysql_query("UPDATE hd_config SET valor='$new125' WHERE ref='125'",$db_link);
	mysql_query("UPDATE hd_config SET valor='$new75' WHERE ref='75'",$db_link);

	messagetop(_THE_CHANGES_WHERE_MADE_SUCCESSFULLY,'','preferences16.php',1);

}else{


	$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++ ;
	}

	include("head_template.php");
	echo '
<div class="container">
	<div class="row">
';

	print errors($errors); $errors = '';

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

	print("<tr><td>".ucfirst(_ALLOWED_FILE_TYPES).": </td><td>");
	print("<input $estilonew125 name='new125' value='".$Config[125][1]."'> ("._SEPARATED_BY_SPACES.")</td></tr>");

	print("<tr><td><b>".ucfirst(_DIRECTORY_FOR_DOWNLOADS).":</b> </td><td>&nbsp;&nbsp;&nbsp;&nbsp;");
	print($config[1][1]."/<input $estilonew75 name=new75 value=".$Config[75][1]."></td></tr>");

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

echo '
</div>
</div>
';
	include("foot_template.php");
}
?>