<?php
include('header.php');
echo $h;

if ($_REQUEST['do']=="edit_opitions"){

$id          = $_POST['id'];
$name_site   = addslashes($_POST['name_site']);
$name_script = addslashes($_POST['name_script']);
$name_url    = addslashes($_POST['name_url']);
$name_path   = addslashes($_POST['name_path']);
$name_email  = addslashes($_POST['name_email']);
$addflashincp       = $_POST['addflashincp'];
$addurlincp         = $_POST['addurlincp'];
$addsignaturesincp  = $_POST['addsignaturesincp'];
$addfatawaincp      = $_POST['addfatawaincp'];
$addqraanincp       = $_POST['addqraanincp'];
$num_menu           = $_POST['num_menu'];
$addmhadrhincp      = $_POST['addmhadrhincp'];
$num_photo          = $_POST['num_photo'];
$htmlorphp            = $_POST['htmlorphp'];
$copyrights           = addslashes($_POST['copyrights']);

$keywords           = addslashes($_POST['keywords']);
$description           = addslashes($_POST['description']);

$limited = $_POST['limited'];
$menustyle = $_POST['menustyle'];

$textheader = addslashes($_POST['textheader']);
$textfooter = addslashes($_POST['textfooter']);
$textclose = addslashes($_POST['textclose']);
$closesite = $_POST['closesite'];


$allowcomment_news = $_POST['allowcomment_news'];
$allowshowcomment_news = $_POST['allowshowcomment_news'];
$activecomment = $_POST['activecomment'];
$limitcomments = $_POST['limitcomments'];

$query1 =  mysql_query("UPDATE opitions SET
name_site='$name_site',
name_script='$name_script',
name_url='$name_url',
name_path='$name_path',
name_email='$name_email',
addflashincp='$addflashincp',
addurlincp='$addurlincp',
addsignaturesincp='$addsignaturesincp',
addfatawaincp='$addfatawaincp',
addqraanincp='$addqraanincp',
addmhadrhincp='$addmhadrhincp',
num_photo='$num_photo',
htmlorphp='$htmlorphp',
limited='$limited',
menustyle='$menustyle',
textheader='$textheader',
textfooter='$textfooter',
textclose='$textclose',
closesite='$closesite',
copyrights='$copyrights',
description='$description',
keywords='$keywords',
allowcomment_news='$allowcomment_news',
allowshowcomment_news='$allowshowcomment_news',
activecomment='$activecomment',
limitcomments='$limitcomments' where id='1'");
echo $LANGAUGE_CP[34];
echo "<META HTTP-EQUIV='Refresh' CONTENT='1;URL=opitions.php' />";

}else {
if(isset($_GET['box1']) AND $_GET['box1']==1){
$tea1 = '<small>( <u>'.$LANGAUGE_CP[699].'</u> - <a href="opitions.php?box1=0">'.$LANGAUGE_CP[700].'</a> )</small>';
$ten1 = 'textarea1';
}else{
$tea1 = '<small>( <a href="opitions.php?box1=1">'.$LANGAUGE_CP[699].'</a> - <u>'.$LANGAUGE_CP[700].'</u> )</small>';
$ten1 = 'xtextarea1';
}

if(isset($_GET['box2']) AND $_GET['box2']==1){
$tea2 = '<small>( <u>'.$LANGAUGE_CP[699].'</u> - <a href="opitions.php?box2=0">'.$LANGAUGE_CP[700].'</a> )</small>';
$ten2 = 'textarea1';
}else{
$tea2 = '<small>( <a href="opitions.php?box2=1">'.$LANGAUGE_CP[699].'</a> - <u>'.$LANGAUGE_CP[700].'</u> )</small>';
$ten2 = 'xtextarea2';
}

if(isset($_GET['box3']) AND $_GET['box3']==1){
$tea3 = '<small>( <u>'.$LANGAUGE_CP[699].'</u> - <a href="opitions.php?box3=0">'.$LANGAUGE_CP[700].'</a> )</small>';
$ten3 = 'textarea1';
}else{
$tea3 = '<small>( <a href="opitions.php?box3=1">'.$LANGAUGE_CP[699].'</a> - <u>'.$LANGAUGE_CP[700].'</u> )</small>';
$ten3 = 'xtextarea3';
}

$sql = "SELECT * FROM opitions where id=1";
$result = mysql_query ($sql) or die ("Query failed");
$p_cats = mysql_fetch_array($result);

$td1 = "40%";
$td2 = "60%";

$p_cats['textheader'] = stripslashes($p_cats['textheader']);
$p_cats['textheader'] = htmlspecialchars($p_cats['textheader']);

$p_cats['textfooter'] = stripslashes($p_cats['textfooter']);
$p_cats['textfooter'] = htmlspecialchars($p_cats['textfooter']);

$p_cats['textclose'] = stripslashes($p_cats['textclose']);
$p_cats['textclose'] = htmlspecialchars($p_cats['textclose']);

$p_cats['name_site'] = stripslashes($p_cats['name_site']);
$p_cats['name_site'] = htmlspecialchars($p_cats['name_site']);

$p_cats['name_url'] = stripslashes($p_cats['name_url']);
$p_cats['name_url'] = htmlspecialchars($p_cats['name_url']);

$p_cats['name_path'] = stripslashes($p_cats['name_path']);
$p_cats['name_path'] = htmlspecialchars($p_cats['name_path']);

$p_cats['name_email'] = stripslashes($p_cats['name_email']);
$p_cats['name_email'] = htmlspecialchars($p_cats['name_email']);

$p_cats['name_script'] = stripslashes($p_cats['name_script']);
$p_cats['name_script'] = htmlspecialchars($p_cats['name_script']);

$p_cats['copyrights'] = stripslashes($p_cats['copyrights']);
$p_cats['copyrights'] = htmlspecialchars($p_cats['copyrights']);

$p_cats['keywords'] = stripslashes($p_cats['keywords']);
$p_cats['keywords'] = htmlspecialchars($p_cats['keywords']);

$p_cats['description'] = stripslashes($p_cats['description']);
$p_cats['description'] = htmlspecialchars($p_cats['description']);

echo "<form method='POST' action='opitions.php?do=edit_opitions'>

<table class='xtable' width='100%' id='AutoNumber15'>

<tr>
<td width='100%' colspan='2' class='xtt' align='center'>".$LANGAUGE_CP[348]."</td>
</tr>

<tr>
<td width='$td1' class='xtr'>".$LANGAUGE_CP[349]."</td>
<td width='$td2' class='xtd'><input name='name_site' size='60' value='".$p_cats['name_site']."' /></td>
</tr>


<tr>
<td width='$td1' class='xtr'>".$LANGAUGE_CP[350]."</td>
<td width='$td2' class='xtd'><input name='name_url' size='60' dir='ltr' value='".$p_cats['name_url']."' /></td>
</tr>


<tr>
<td width='$td1' class='xtr'>".$LANGAUGE_CP[351]."</td>
<td width='$td2' class='xtd'><input name='name_path' size='60' dir='ltr' value='".$p_cats['name_path']."' /></td>
</tr>


<tr>
<td width='$td1' class='xtr'>".$LANGAUGE_CP[352]."</td>
<td width='$td2' class='xtd'><input name='name_email' size='60' dir='ltr' value='".$p_cats['name_email']."' /></td>
</tr>


<tr>
<td width='$td1' class='xtr'>".$LANGAUGE_CP[353]."</td>
<td width='$td2' class='xtd'><input name='name_script' size='60' dir='ltr' value='".$p_cats['name_script']."' /></td>
</tr>


<tr>
<td width='$td1' class='xtr'>".$LANGAUGE_CP[354]."</td>
<td width='$td2' class='xtd'><input name='copyrights' size='60' value='".$p_cats['copyrights']."' /></td>
</tr>

<tr>
<td width='$td1' class='xtr'>".$LANGAUGE_CP[355]."</td>
<td width='$td2' class='xtd'><input name='description' size='60' value='".$p_cats['description']."' /></td>
</tr>

<tr>
<td width='$td1' class='xtr'>".$LANGAUGE_CP[91]."</td>
<td width='$td2' class='xtd'><input name='keywords' size='60' value='".$p_cats['keywords']."' /></td>
</tr>

<tr>
<td width='$td1' class='xtr'>".$LANGAUGE_CP[356]."</td>
<td width='$td2' class='xtd'><input name='num_photo' size='10' value='$p_cats[num_photo]' /></td>
</tr>

<tr>
<td width='$td1' class='xtr'>".$LANGAUGE_CP[357]."</td>
<td width='$td2' class='xtd'><input name='limited' size='10' value='$p_cats[limited]' /></td>
</tr>

<tr>
<td width='$td1' class='xtr'>".$LANGAUGE_CP[698]."</td>
<td width='$td2' class='xtd'><input name='limitcomments' size='10' value='$p_cats[limitcomments]' /></td>
</tr>

<tr>
<td width='$td1' class='xtr'>".$LANGAUGE_CP[693]."</td>
<td width='$td2' class='xtd'>
<select size='1' name='allowcomment_news'>";
if ($p_cats[allowcomment_news]=="1"){
echo "<OPTION value='1' selected='selected'>".$LANGAUGE_CP[139]."</OPTION>
<OPTION value='0'>".$LANGAUGE_CP[140]."</OPTION>";
}else{
echo "<OPTION value='0' selected='selected'>".$LANGAUGE_CP[140]."</OPTION>
<OPTION value='1'>".$LANGAUGE_CP[139]."</OPTION>";
}
echo "</select></td></tr>


<tr>
<td width='$td1' class='xtr'>".$LANGAUGE_CP[694]."</td>
<td width='$td2' class='xtd'>
<select size='1' name='allowshowcomment_news'>";
if ($p_cats[allowshowcomment_news]=="1"){
echo "<OPTION value='1' selected='selected'>".$LANGAUGE_CP[139]."</OPTION>
<OPTION value='0'>".$LANGAUGE_CP[140]."</OPTION>";
}else{
echo "<OPTION value='0' selected='selected'>".$LANGAUGE_CP[140]."</OPTION>
<OPTION value='1'>".$LANGAUGE_CP[139]."</OPTION>";
}
echo "</select></td></tr>


<tr>
<td width='$td1' class='xtr'>".$LANGAUGE_CP[695]."</td>
<td width='$td2' class='xtd'>
<select size='1' name='activecomment'>";
if ($p_cats[activecomment]=="1"){
echo "<OPTION value='1' selected='selected'>".$LANGAUGE_CP[696]."</OPTION>
<OPTION value='0'>".$LANGAUGE_CP[697]."</OPTION>";
}else{
echo "<OPTION value='0' selected='selected'>".$LANGAUGE_CP[697]."</OPTION>
<OPTION value='1'>".$LANGAUGE_CP[696]."</OPTION>";
}
echo "</select></td></tr>

<tr>
<td width='$td1' class='xtr'>".$LANGAUGE_CP[358]."</td>
<td width='$td2' class='xtd'>
<select size='1' name='htmlorphp'>";
if ($p_cats[htmlorphp]=="1"){
echo "<OPTION value='1' selected='selected'>".$LANGAUGE_CP[139]."</OPTION>
<OPTION value='0'>".$LANGAUGE_CP[140]."</OPTION>";
}else{
echo "<OPTION value='0' selected='selected'>".$LANGAUGE_CP[140]."</OPTION>
<OPTION value='1'>".$LANGAUGE_CP[139]."</OPTION>";
}
echo "</select></td></tr>";

/*
echo "<tr>
<td width='$td1' class='xtr'>".$LANGAUGE_CP[359]."</td>
<td width='$td2' class='xtd'>
<select size='1' name='menustyle'>";
if ($p_cats[menustyle]=="1"){
echo "<OPTION value='1' selected='selected'>".$LANGAUGE_CP[139]."</OPTION>
<OPTION value='0'>".$LANGAUGE_CP[140]."</OPTION>";
}else{
echo "<OPTION value='0' selected='selected'>".$LANGAUGE_CP[140]."</OPTION>
<OPTION value='1'>".$LANGAUGE_CP[139]."</OPTION>";
}
echo "</select></td></tr>";
*/

echo "<tr>
<td width='$td1' class='xtr'>".$LANGAUGE_CP[360]."</td>
<td width='$td2' class='xtd'>
<select size='1' name='closesite'>";
if ($p_cats[closesite]=="1"){
echo "<OPTION value='1' selected='selected'>".$LANGAUGE_CP[139]."</OPTION>
<OPTION value='0'>".$LANGAUGE_CP[140]."</OPTION>";
}else{
echo "<OPTION value='0' selected='selected'>".$LANGAUGE_CP[140]."</OPTION>
<OPTION value='1'>".$LANGAUGE_CP[139]."</OPTION>";
}
echo "</select></td></tr>";


echo "<tr>
<td class='xtd' colspan='2' align='center'>
".$LANGAUGE_CP[361]."<br />
".$tea1."<br /><br />
<textarea id='".$ten1."' name='textclose' rows='5' cols='80'>".$p_cats['textclose']."</textarea>
</td>
</tr>


<tr>
<td class='xtd' colspan='2' align='center'>
".$LANGAUGE_CP[362]."<br />
".$tea2."<br /><br />
<textarea id='".$ten2."' name='textheader' rows='5' cols='80'>".$p_cats['textheader']."</textarea>
</td>
</tr>

<tr>
<td class='xtd' colspan='2' align='center'>
".$LANGAUGE_CP[363]."<br />
".$tea3."<br /><br />
<textarea id='".$ten3."'name='textfooter' rows='5' cols='80'>".$p_cats['textfooter']."</textarea>
</td>
</tr>


<tr>
<td width='100%' colspan='2' align='center' class='xtr'><input type='submit' value=' ".$LANGAUGE_CP[33]." ' name='B1' /></td>
</tr>

</table>

</form>";
}
echo $f;
?>