<?php
include("postget.php");
include_once("common.php");
checklevel(4,$_REQUEST['clientid']);
if ($config[56][1]==1){
	$disabled=" disabled ";
	$mensaje= " "._CHANGE_NOT_ALLOWED_IN_DEMO_MODE;
}else{
	$disabled=" ";
	$mensaje= "";
}


if($sendclick ==""._SEND."") {

	$newvalue = "";
	$newvalue .= "first:".$_POST['first']." ";
	$newvalue .= "last:".$_POST['last']." ";
	$newvalue .= "company:".$_POST['company']." ";
	$newvalue .= "country:".$_POST['country']." ";
	$newvalue .= "state:".$_POST['state']." ";
	$newvalue .= "city:".$_POST['city']." ";
	$newvalue .= "address:".$_POST['address']." ";
	$newvalue .= "phone:".$_POST['phone']." ";
	$newvalue .= "email:".$_POST['email']." ";
	$newvalue .= "zip:".$_POST['zip']." ";
	$newvalue .= "clientalias:".$_POST['clientalias']." ";
	$newvalue .= "password:".$_POST['password']." ";
	$newvalue .= "personalized_1:".$_POST['personalized_1']." ";
	$newvalue .= "personalized_2:".$_POST['personalized_2']." ";
	$newvalue .= "personalized_3:".$_POST['personalized_3']." ";
	$newvalue .= "personalized_4:".$_POST['personalized_4']." ";
	$newvalue .= "personalized_5:".$_POST['personalized_5']." ";

	mysql_query("UPDATE hd_config SET valor='$newvalue' WHERE ref='8'",$db_link);


	messagetop(_THE_CHANGES_WHERE_MADE_SUCCESSFULLY,'','preferences.php',1);
}




//include("head_template.php");

$valores = query("SELECT valor FROM hd_config WHERE ref='8'",1);

//print("valores ".$valores[0]);

$aValores = explode(' ',$valores[0]);

print("<form method='POST'>");

print(tip(50));

print("<table class='table table-striped'>");

print("<tr><th align='center' width='30%'><b>".ucfirst(_EDITABLE)."?</b></th><th align='center'><b>".ucfirst(_FIELDS)."</b></th></tr>");


print('<tr><td align="center"><input type="checkbox" name="first"');
if (in_array('first:on',$aValores)){print(" checked");};
print("></td>");
print('<td align="left" valign="middle"><b>'.ucfirst(_FIRST_NAME).'</b></td></tr>');


print('<tr><td align="center"><input type="checkbox" name="last"');
if (in_array('last:on',$aValores)){print(" checked");};
print("></td>");
print('<td align="left" valign="middle"><b>'.ucfirst(_LAST_NAME).'</b></td></tr>');


print('<tr><td align="center"><input type="checkbox" name="company"');
if (in_array('company:on',$aValores)){print(" checked");};
print("></td>");
print('<td align="left" valign="middle"><b>'.ucfirst(_COMPANY).'</b></td></tr>');


print('<tr><td align="center"><input type="checkbox" name="country"');
if (in_array('country:on',$aValores)){print(" checked");};
print("></td>");
print('<td align="left" valign="middle"><b>'.ucfirst(_COUNTRY).'</b></td></tr>');


print('<tr><td align="center"><input type="checkbox" name="state"');
if (in_array('state:on',$aValores)){print(" checked");};
print("></td>");
print('<td align="left" valign="middle"><b>'.ucfirst(_STATE).'</b></td></tr>');


print('<tr><td align="center"><input type="checkbox" name="city"');
if (in_array('city:on',$aValores)){print(" checked");};
print("></td>");
print('<td align="left" valign="middle"><b>'.ucfirst(_CITY).'</b></td></tr>');


print('<tr><td align="center"><input type="checkbox" name="address"');
if (in_array('address:on',$aValores)){print(" checked");};
print("></td>");
print('<td align="left" valign="middle"><b>'.ucfirst(_ADDRESS).'</b></td></tr>');


print('<tr><td align="center"><input type="checkbox" name="phone"');
if (in_array('phone:on',$aValores)){print(" checked");};
print("></td>");
print('<td align="left" valign="middle"><b>'.ucfirst(_PHONE).'</b></td></tr>');

print('<tr><td align="center"><input type="checkbox" name="email"');
if (in_array('email:on',$aValores)){print(" checked");};
print("></td>");
print('<td align="left" valign="middle"><b>'.ucfirst(_EMAIL).'</b></td></tr>');


print('<tr><td align="center"><input type="checkbox" name="zip"');
if (in_array('zip:on',$aValores)){print(" checked");};
print("></td>");
print('<td align="left" valign="middle"><b>'.ucfirst(_ZIP_CODE).'</b></td></tr>');


print('<tr><td align="center"><input type="checkbox" name="clientalias"');
if (in_array('clientalias:on',$aValores)){print(" checked");};
print("></td>");
print('<td align="left" valign="middle"><b>'.ucfirst(_ALIAS).'</b></td></tr>');


print('<tr><td align="center"><input type="checkbox" name="password"');
if (in_array('password:on',$aValores)){print(" checked");};
print("></td>");
print('<td align="left" valign="middle"><b>'.ucfirst(_PASSWORD).'</b></td></tr>');


print('<tr><td align="center"><input type="checkbox" name="personalized_1"');
if (in_array('personalized_1:on',$aValores)){print(" checked");};
print("></td>");
print('<td align="left" valign="middle"><b>'.ucfirst(_PERSONALIZED).' 1</b></td></tr>');


print('<tr><td align="center"><input type="checkbox" name="personalized_2"');
if (in_array('personalized_2:on',$aValores)){print(" checked");};
print("></td>");
print('<td align="left" valign="middle"><b>'.ucfirst(_PERSONALIZED).' 2</b></td></tr>');


print('<tr><td align="center"><input type="checkbox" name="personalized_3"');
if (in_array('personalized_3:on',$aValores)){print(" checked");};
print("></td>");
print('<td align="left" valign="middle"><b>'.ucfirst(_PERSONALIZED).' 3</b></td></tr>');


print('<tr><td align="center"><input type="checkbox" name="personalized_4"');
if (in_array('personalized_4:on',$aValores)){print(" checked");};
print("></td>");
print('<td align="left" valign="middle"><b>'.ucfirst(_PERSONALIZED).' 4</b></td></tr>');


print('<tr><td align="center"><input type="checkbox" name="personalized_5"');
if (in_array('personalized_5:on',$aValores)){print(" checked");};
print("></td>");
print('<td align="left" valign="middle"><b>'.ucfirst(_PERSONALIZED).' 5</b></td></tr>');


print("</table>");

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

?>