View file nkat/edit.php

File size: 6.18Kb
<?php

include "xconf.php";
header("Cache-Control: no-cache");
include "fo.php";
$version=trim($version);

if ($version=="xhtml"){

$version=xhtml;
include "xhtml_head.php";

$div_s="<div class=\"a\">";
$div_ss="<div class=\"b\">";
$div_e="</div>";


if(!isset($id)){ print "
$div_s<form action=\"edit.php?version=$version\" method=\"post\">";
print"Ba&#x0448; ID:<br/><input type=\"text\" name=\"id\" format=\"*N\"/><br/>
&#x041F;apo&#x043B;&#x044C;:<br/> <input type=\"password\" name=\"pass\"/>
<postfield name=\"id\" value=\"$(id)\"/>
<postfield name=\"pass\" value=\"$(pass)\"/>
<input type=\"hidden\" name=\"seenform\" value=\"add\"> <br/><br/>
<input type=\"submit\" value=\"&#x0418;&#x0437;&#x043C;e&#x043D;&#x0438;&#x0442;&#x044C;\">
</form>$div_e";}

else{
$id=intval($id);
$pass=coding_cool(substr(trim($pass), 0, 30));
$q = mysql_query("select * from `cool_site` where  id='$id';");
$data = mysql_fetch_array($q);
if(empty($id))
print "Вы не ввели ID!";
	if(!empty($pass)&&$pass==$data['pass']){
	
	print "
$div_s<form action=\"edit_ok.php?version=$version\" method=\"post\">";
		print"Ha&#x0437;&#x0432;a&#x043D;&#x0438;e:<br/>
		<input type=\"text\" name=\"title\" maxlength=\"30\" value=\"".$data['title']."\"/><br/>
		A&#x0434;pec:<br/>
		<input type=\"text\" name=\"link\" maxlength=\"100\" value=\"".$data['link']."\"/><br/>";
		print"Ka&#x0442;e&#x0433;op&#x0438;&#x044F;:<br/><select name=\"k\" value=\"".$data['category']."\">";
		$q=mysql_query("select * from `cool_raz` where 1 order by por asc");
		while($datas = @mysql_fetch_array($q)){
		print"<option value=\"".$datas['id']."\">".$datas['text']."</option>";}
		print"</select><br/>
		O&#x043F;&#x0438;ca&#x043D;&#x0438;e:<br/>
		<input type=\"text\" name=\"about\" maxlength=\"300\" value=\"".$data['about']."\"/><br/>
		C&#x0442;ap&#x044B;&#x0439; &#x041F;apo&#x043B;&#x044C;<br/>
		<input type=\"text\" name=\"oldpass\" maxlength=\"30\" value=\"".$data['pass']."\"/><br/>
		Ho&#x0432;&#x044B;&#x0439; &#x041F;apo&#x043B;&#x044C;:<br/>
		<input type=\"text\" name=\"pass\" maxlength=\"30\" value=\"".$data['pass']."\"/><br/>
		E-Mail:<br/>
		<input type=\"text\" name=\"email\" maxlength=\"70\" value=\"".$data['email']."\"/><br/>
		Tpa&#x043D;c&#x043B;&#x0438;&#x0442;:<select name=\"trans\"> 
		<option value=\"0\">He&#x0442;</option>
		<option value=\"1\">&#x0414;a</option>
		</select><br/>
		<postfield name=\"title\" value=\"$(title)\"/>
		<postfield name=\"oldpass\" value=\"$(oldpass)\"/>
		<postfield name=\"id\" value=\"$id\"/>
		<postfield name=\"pass\" value=\"$(pass)\"/>
		<postfield name=\"link\" value=\"$(link)\"/>
		<postfield name=\"about\" value=\"$(about)\"/>
		<postfield name=\"email\" value=\"$(email)\"/>
		<postfield name=\"trans\" value=\"$(trans)\"/>
		<postfield name=\"k\" value=\"$(k)\"/>
		<input type=\"hidden\" name=\"seenform\" value=\"add\"> <br/><br/>
<input type=\"submit\" value=\"&#x0418;&#x0437;&#x043C;e&#x043D;&#x0438;&#x0442;&#x044C;\">
</form>$div_e";
	}else{print"&#x0438;&#x043B;&#x0438; &#x043D;e&#x043F;pa&#x0432;&#x0438;&#x043B;&#x044C;&#x043D;&#x044B;&#x0439; &#x043F;apo&#x043B;&#x044C;<br/>";}}



}
else {
$version=wml;
$div_s="";
$div_ss="";
$div_e="";
include "wml_head.php";
print "
<p align=\"left\">";




if(!isset($id)){
print"Ba&#x0448; ID:<input type=\"text\" name=\"id\" format=\"*N\"/><br/>
&#x041F;apo&#x043B;&#x044C;: <input type=\"password\" name=\"pass\"/><br/>
<anchor title=\"go\">&#x0418;&#x0437;&#x043C;e&#x043D;&#x0438;&#x0442;&#x044C;<go href=\"edit.php?version=$version\" method=\"post\">
<postfield name=\"id\" value=\"$(id)\"/>
<postfield name=\"pass\" value=\"$(pass)\"/>
</go></anchor><br/>";}

else{
$id=intval($id);
$pass=coding_cool(substr(trim($pass), 0, 30));
$q = mysql_query("select * from `cool_site` where  id='$id';");
$data = mysql_fetch_array($q);
if(empty($id))
print "Вы не ввели ID!";
	if(!empty($pass)&&$pass==$data['pass']){
		print"Ha&#x0437;&#x0432;a&#x043D;&#x0438;e:<br/>
		<input type=\"text\" name=\"title\" maxlength=\"30\" value=\"".$data['title']."\"/><br/>
		A&#x0434;pec:<br/>
		<input type=\"text\" name=\"link\" maxlength=\"100\" value=\"".$data['link']."\"/><br/>";
		print"Ka&#x0442;e&#x0433;op&#x0438;&#x044F;:<br/><select name=\"k\" value=\"".$data['category']."\">";
		$q=mysql_query("select * from `cool_raz` where 1 order by por asc");
		while($datas = @mysql_fetch_array($q)){
		print"<option value=\"".$datas['id']."\">".$datas['text']."</option>";}
		print"</select><br/>
		O&#x043F;&#x0438;ca&#x043D;&#x0438;e:<br/>
		<input type=\"text\" name=\"about\" maxlength=\"300\" value=\"".$data['about']."\"/><br/>
		C&#x0442;ap&#x044B;&#x0439; &#x041F;apo&#x043B;&#x044C;<br/>
		<input type=\"text\" name=\"oldpass\" maxlength=\"30\" value=\"".$data['pass']."\"/><br/>
		Ho&#x0432;&#x044B;&#x0439; &#x041F;apo&#x043B;&#x044C;:<br/>
		<input type=\"text\" name=\"pass\" maxlength=\"30\" value=\"".$data['pass']."\"/><br/>
		E-Mail:<br/>
		<input type=\"text\" name=\"email\" maxlength=\"70\" value=\"".$data['email']."\"/><br/>
		Tpa&#x043D;c&#x043B;&#x0438;&#x0442;:<select name=\"trans\"> 
		<option value=\"0\">He&#x0442;</option>
		<option value=\"1\">&#x0414;a</option>
		</select><br/>
		<anchor>&#x0418;&#x0437;&#x043C;e&#x043D;&#x0438;&#x0442;&#x044C;&#187;
		<go href=\"edit_ok.php?version=$version\" method=\"post\">
		<postfield name=\"title\" value=\"$(title)\"/>
		<postfield name=\"oldpass\" value=\"$(oldpass)\"/>
		<postfield name=\"id\" value=\"$id\"/>
		<postfield name=\"pass\" value=\"$(pass)\"/>
		<postfield name=\"link\" value=\"$(link)\"/>
		<postfield name=\"about\" value=\"$(about)\"/>
		<postfield name=\"email\" value=\"$(email)\"/>
		<postfield name=\"trans\" value=\"$(trans)\"/>
		<postfield name=\"k\" value=\"$(k)\"/>
		</go></anchor><br/>";
	}else{print"&#x0438;&#x043B;&#x0438; &#x043D;e&#x043F;pa&#x0432;&#x0438;&#x043B;&#x044C;&#x043D;&#x044B;&#x0439; &#x043F;apo&#x043B;&#x044C;<br/>";}}
	}
print"$div_ss<br/>*****<br/><a href=\"./?version=$version\">B &#x043A;a&#x0442;a&#x043B;o&#x0433;</a><br/>*****<br/>

</p>$div_e";
if ($version=="xhtml"){
include "xhtml3_down.php";
$version=xhtml;

}
else {
include "wml3_down.php";
}
?>