Просмотр файла forex_table/index.php

Размер файла: 27.15Kb
<?
/*
СТОЛ ЗАКАЗОВ!
Автор:FOREX
Сайт:JOJO.SU
Дата создания:24/03/09
Потрачено времени:3 дня по 4 часа.
Перепродажа и Бесплатное Распространение скрипта запрещено!
*/		
error_reporting(0);
include "config.php";

if(isset($_GET['page']))
{
$page = $_GET['page'];
}
else
{
$page = "";
}

if($page != "index" && $page != "vip"&& $page != "nevip"&& $page != "nevozmojno"&& $page != "zakazi"&& $page != "zakaz"&& $page != "search"&& $page != "search2"&& $page != "make")
{
$page = "index";
}

switch($page)
{
case 'index':
header("Content-type: text/html; charset=utf-8");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache, must-relative");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"ru\"><head>\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
echo "<title>".$link." - Заказ Контенка</title>\n";
echo "
<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />
</head>
<body>";
echo"<div class=\"title\"><b>Стол Заказов</b></div><div class=\"cat\">
<div class=\"dir\">	
";
@mysql_select_db("$DBNAME");
$q = mysql_query("SELECT COUNT(*) FROM `zakaz_make` WHERE `status` = 2;");
$status2 = mysql_result($q, 0);
$q = mysql_query("SELECT COUNT(*) FROM `zakaz_make` WHERE `status` = 1;");
$status1 = mysql_result($q, 0);
$q = mysql_query("SELECT COUNT(*) FROM `zakaz_make` WHERE `status` = 3;");
$status3 = mysql_result($q, 0);

echo"
<div class=\"dir\">	
<img src=\"kv.gif\" alt=\"\"/><a href=\"index.php?page=zakaz\">Оставить Заказ</a><br/>	
</div>
<div class=\"dir\">												
<img src=\"kv.gif\" alt=\"\"/><a href=\"index.php?page=vip\">Выполненые Заказы</a>($status1)<br/>
</div>	
<div class=\"dir\">					
<img src=\"kv.gif\" alt=\"\"/><a href=\"index.php?page=nevip\">Не Выполненые Заказы</a>($status2)<br/>
</div>	
<div class=\"dir\">		
<img src=\"kv.gif\" alt=\"\"/><a href=\"index.php?page=nevozmojno\">Невозможно Выполнить Заказы</a>($status3)<br/>	
</div>	
<img src=\"kv.gif\" alt=\"\"/><a href=\"index.php?page=search\">Проверить статус заказа</a><br/>	
";	
echo"
</div></div><div class=\"cat\">	
<img src=\"kv.gif\" alt=\"\"/><a href=\"http://".$link."\">На главную</a><br/></div>	
</div></div><div class=\"rekl\">	";
$q = mysql_query("SELECT * FROM `zakaz_rekl`  LIMIT 10;");
while($forex = mysql_fetch_array($q))
{
$rekl = $forex['rekl'];
$reklname = $forex['reklname'];
$rek = $forex['rek'];
echo "<a href=\"".$rekl."\">".$reklname."</a><br/>\n";

}

echo"	
</div>	
";	
echo "</body></html>";
break;
case 'vip':
header("Content-type: text/html; charset=utf-8");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache, must-relative");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"ru\"><head>\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
echo "<title>".$link." - Выполненные</title>\n";
echo "
<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />
</head>
<body>";
echo"<div class=\"title\"><b>Выполненные заказы</b></div><div class=\"cat\">
<div class=\"dir\">	
";
@mysql_select_db("$DBNAME");
$query = @mysql_query("SELECT COUNT(*) FROM `zakaz_make` WHERE `status` = 1 ;");
$all = @mysql_result($query, 0);

if(isset($_GET['s'])) $s = intval($_GET['s']);
else $s = 0;
if($s < 0) $s = 0;
if($s > $all) $s = 0;
$c = $s + 1;

$q = mysql_query("SELECT  * FROM `zakaz_make` WHERE `status` = 1 ORDER BY `id` DESC LIMIT  $s, 10;");

if(mysql_num_rows($q) == 0)
{
echo "Выполненых Заказов НеТ!<br/>\n";
}

$c = 1;
while($forex = mysql_fetch_array($q))
{
$sid = $forex['id'];	
$artist = $forex['artist'];
$track = $forex['track'];
$radio = $forex['radio'];
$nick = $forex['nick'];
$addit = $forex['addit'];
$status = $forex['status'];
$vlink = $forex['vlink'];
$vname = $forex['vname'];
$why = $forex['why'];

echo "<img src=\"winamp.gif\" alt=\"\"/><a href=\"index.php?page=zakazi&amp;id=$sid\">".$artist."-".$track."</a><br/>Заказал : ".$nick."</div><div class=\"dir\">\n";
$c++;
}
echo"<div class=\"cat\">";
if ($all > $s + 10)  echo "<small><a href=\"index.php?s=".($s+10)."&amp;page=vip\">След.</a></small><br/>";
if ($s > 2) echo "<small><a href=\"nevipoln.php?s=".($s-10)."&amp;page=vip\">Пред</a></small><br/>";
echo"
</div><div class=\"cat\"><img src=\"kv.gif\" alt=\"\"/> <a href=\"index.php\">Назад</a><br/>	
<img src=\"kv.gif\" alt=\"\"/><a href=\"http://".$link."\">На главную</a><br/>	
</div></div></div><div class=\"rekl\">	";
$q = mysql_query("SELECT * FROM `zakaz_rekl`  LIMIT 10;");
while($forex = mysql_fetch_array($q))
{
$rekl = $forex['rekl'];
$reklname = $forex['reklname'];
$rek = $forex['rek'];
echo "<a href=\"".$rekl."\">".$reklname."</a><br/>\n";

}

echo"	
</div>	
";	
echo "</body></html>";
break;
case 'nevip':
header("Content-type: text/html; charset=utf-8");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache, must-relative");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"ru\"><head>\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
echo "<title>".$link." - Не выполненные</title>\n";
echo "
<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />
</head>
<body>";
echo"<div class=\"title\"><b>Невыполненные заказы</b></div><div class=\"cat\">
<div class=\"dir\">	
";
@mysql_select_db("$DBNAME");
$query = @mysql_query("SELECT COUNT(*) FROM `zakaz_make` WHERE `status` = 2 ;");
$all = @mysql_result($query, 0);

if(isset($_GET['s'])) $s = intval($_GET['s']);
else $s = 0;
if($s < 0) $s = 0;
if($s > $all) $s = 0;
$c = $s + 1;

$q = mysql_query("SELECT  * FROM `zakaz_make` WHERE `status` = 2 ORDER BY `id` DESC LIMIT  $s, 10;");

if(mysql_num_rows($q) == 0)
{
echo "Не выполненых Заказов НеТ!<br/>\n";
}

$c = 1;
while($forex = mysql_fetch_array($q))
{
$sid = $forex['id'];	
$artist = $forex['artist'];
$track = $forex['track'];
$radio = $forex['radio'];
$nick = $forex['nick'];
$addit = $forex['addit'];
$status = $forex['status'];
echo "<img src=\"winamp.gif\" alt=\"\"/><a href=\"index.php?page=zakazi&amp;id=$sid\">".$artist."-".$track."</a><br/>Заказал : ".$nick."</div><div class=\"dir\">\n";
$c++;
}
echo"</div><div class=\"cat\">";
if ($all > $s + 10)  echo "<small><a href=\"nevipoln.php?s=".($s+10)."&amp;page=nevip\">След.</a></small><br/>";
if ($s > 2) echo "<small><a href=\"nevipoln.php?s=".($s-10)."&amp;page=nevip\">Пред</a></small><br/>";
echo"
</div><div class=\"cat\"><img src=\"kv.gif\" alt=\"\"/> <a href=\"index.php\">Назад</a><br/>	
<img src=\"kv.gif\" alt=\"\"/><a href=\"http://".$link."\">На главную</a><br/>	
</div></div></div><div class=\"rekl\">	";
$q = mysql_query("SELECT * FROM `zakaz_rekl`  LIMIT 10;");
while($forex = mysql_fetch_array($q))
{
$rekl = $forex['rekl'];
$reklname = $forex['reklname'];
$rek = $forex['rek'];
echo "<a href=\"".$rekl."\">".$reklname."</a><br/>\n";

}

echo"	
</div>	
";	

echo "</body></html>";
break;
case 'nevozmojno':
header("Content-type: text/html; charset=utf-8");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache, must-relative");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"ru\"><head>\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
echo "<title>".$link." - Невозможно Выполнить</title>\n";
echo "
<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />
</head>
<body>";
echo"<div class=\"title\"><b>Невозможно Выполнить</b></div><div class=\"cat\">
<div class=\"dir\">	
";
@mysql_select_db("$DBNAME");
$query = @mysql_query("SELECT COUNT(*) FROM `zakaz_make` WHERE `status` = 3 ;");
$all = @mysql_result($query, 0);

if(isset($_GET['s'])) $s = intval($_GET['s']);
else $s = 0;
if($s < 0) $s = 0;
if($s > $all) $s = 0;
$c = $s + 1;

$q = mysql_query("SELECT  * FROM `zakaz_make` WHERE `status` = 3 ORDER BY `id` DESC LIMIT  $s, 10;");

if(mysql_num_rows($q) == 0)
{
echo "Нет заказов с таким статусом!<br/>\n";
}

$c = 1;
while($forex = mysql_fetch_array($q))
{
$sid = $forex['id'];		
$artist = $forex['artist'];
$track = $forex['track'];
$radio = $forex['radio'];
$nick = $forex['nick'];
$addit = $forex['addit'];
$status = $forex['status'];
$vlink = $forex['vlink'];
$vname = $forex['vname'];
$why = $forex['why'];

echo "<img src=\"winamp.gif\" alt=\"\"/><a href=\"index.php?page=zakazi&amp;id=$sid\">".$artist."-".$track."</a><br/>Заказал : ".$nick."</div><div class=\"dir\">\n";
$c++;
}
echo"<div class=\"cat\">";
if ($all > $s + 10)  echo "<small><a href=\"nevozmojno.php?s=".($s+10)."&amp;page=nevozmojno\">След.</a></small><br/>";
if ($s > 2) echo "<small><a href=\"nevozmojno.php?s=".($s-10)."&amp;page=nevozmojno\">Пред</a></small><br/>";
echo"
</div><div class=\"cat\"><img src=\"kv.gif\" alt=\"\"/> <a href=\"index.php\">Назад</a><br/>	
<img src=\"kv.gif\" alt=\"\"/><a href=\"http://".$link."\">На главную</a><br/>	
</div></div></div><div class=\"rekl\">	";
$q = mysql_query("SELECT * FROM `zakaz_rekl`  LIMIT 10;");
while($forex = mysql_fetch_array($q))
{
$rekl = $forex['rekl'];
$reklname = $forex['reklname'];
$rek = $forex['rek'];
echo "<a href=\"".$rekl."\">".$reklname."</a><br/>\n";

}

echo"	
</div>	
";	
echo "</body></html>";
break;
case 'search':
header("Content-type: text/html; charset=utf-8");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache, must-relative");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"ru\"><head>\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
echo "<title>".$link." - Проверка Статуса</title>\n";
echo "
<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />
</head>
<body>";
echo"<div class=\"title\"><b>Проверка статуса заказа</b></div>
<form action=\"index.php?page=search2\" method=\"post\">	
Введите номер заказа:<div class=\"dir\">";
//@mysql_select_db("zakaz");
echo"
           <input name=\"sid\" type=\"text\" maxlength=\"11\"/><br/>
		<input class=\"ibutton\" type=\"submit\" value=\"Смотреть\"/>
	</div>
</form>";

echo"
</div><div class=\"cat\"><img src=\"kv.gif\" alt=\"\"/> <a href=\"index.php\">Назад</a><br/>	
<img src=\"kv.gif\" alt=\"\"/><a href=\"http://".$link."\">На главную</a><br/>	
</div></div></div><div class=\"rekl\">	";
$q = mysql_query("SELECT * FROM `zakaz_rekl`  LIMIT 10;");
while($forex = mysql_fetch_array($q))
{
$rekl = $forex['rekl'];
$reklname = $forex['reklname'];
$rek = $forex['rek'];
echo "<a href=\"".$rekl."\">".$reklname."</a><br/>\n";

}

echo"	
</div>	
";	
echo "</body></html>";
break;
case 'search2':
header("Content-type: text/html; charset=utf-8");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache, must-relative");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"ru\"><head>\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
echo "<title>".$link." - Проверка статуса</title>\n";
echo "
<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />
</head>
<body>";
echo"<div class=\"title\"><b>Проверка статуса заказа</b></div>";
@mysql_select_db("$DBNAME");
$q = mysql_query("SELECT * FROM `zakaz_make` WHERE id=".$sid."");
$jojo=mysql_num_rows($q);

$qi=mysql_query("SELECT * FROM zakaz_make where id=".$sid."");
$id_num=mysql_num_rows($qi);
mysql_free_result($qi);
if($id_num==0){
exit("Заказа не существует!
</div><div class=\"cat\"><img src=\"kv.gif\" alt=\"\"/> <a href=\"index.php?page=search\">Назад</a><br/>	
<img src=\"kv.gif\" alt=\"\"/><a href=\"http://".$link."\">На главную</a><br/>	
	");
echo"</div><div class=\"rekl\">";
$q = mysql_query("SELECT * FROM `zakaz_rekl`  LIMIT 10;");
while($forex = mysql_fetch_array($q))
{
$rekl = $forex['rekl'];
$reklname = $forex['reklname'];
$rek = $forex['rek'];
echo "<a href=\"".$rekl."\">".$reklname."</a><br/>\n";

}
echo"	
</div>	
";	


}else{
   //        while ($row= mysql_fetch_array($q))
        //   {
$forex = mysql_fetch_array ($q);       
$artist = $forex['artist'];
$track = $forex['track'];
$type = $forex['radio'];
$nick = $forex['nick'];
$sid = $forex['id'];
$addit = $forex['addit'];
$tarix = $forex['tarix'];
$status = $forex['status'];
$why = $forex['why'];
$vlink = $forex['vlink'];
$vname = $forex['vname'];
$vipoln = $forex['vipoln'];
  	 	   
 echo"<b>$artist - $track</b><br/>
   <b>Тип:</b>";
if($type == 1) { echo"Полные Mp3<br/>"; }
if($type == 2) { echo"Видео<br/>"; }
if($type == 3) { echo"Мелодии / рингтоны / реалтоны<br/>"; }
if($type == 4) { echo"Картики / анимации<br/>"; }
if($type == 5) { echo"Игры<br/>"; }
if($type == 6) { echo"Темы оформления<br/>"; }
if($type == 7) { echo"Программы<br/>"; }
if($type == 8) { echo"Другое<br/>"; }
echo"
<b>Дополнительно:</b>$addit<br/>
<b>Дата заказа</b>:$tarix<br/>
<b>Статус</b>:";
if($status == 1) { echo"Выполнен<br/>"; }
if($status == 2) { echo"Выполняется<br/>"; }
if($status == 3) { echo"Невозможно Выполнить!<br/>"; }
echo"
Заказал:$nick<br/>
";	
echo"<a href=\"http://".$vlink."\">".$vname."</a><br/>";
echo"".$why." <br/>	";							

       //    }
   }

echo"
</div><div class=\"cat\"><img src=\"kv.gif\" alt=\"\"/> <a href=\"index.php?page=search\">Назад</a><br/>	
</div></div></div><div class=\"rekl\">	";
$q = mysql_query("SELECT * FROM `zakaz_rekl`  LIMIT 10;");
while($forex = mysql_fetch_array($q))
{
$rekl = $forex['rekl'];
$reklname = $forex['reklname'];
$rek = $forex['rek'];
echo "<a href=\"".$rekl."\">".$reklname."</a><br/>\n";

}

echo"	
</div>	
";	
echo "</body></html>";
break;
case 'zakazi':
header("Content-type: text/html; charset=utf-8");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache, must-relative");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"ru\"><head>\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
echo "<title>".$link." - Заказ Контенка</title>\n";
echo "
<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />
</head>
<body>";
echo"<div class=\"title\"><b>Статус заказа</b></div><div class=\"cat\">
<b>Заказ #$id:</b></div><div class=\"dir\">";
@mysql_select_db("$DBNAME");
$q = mysql_query("SELECT * FROM `zakaz_make` WHERE `id` = '".$id."';");
$s = intval($_GET['s']);
if(mysql_num_rows($q) == 0)
{
echo "Заказ Не найден!Возможно был удален!<br/>";
}
else
{
$forex = mysql_fetch_array($q);

$artist = $forex['artist'];
$track = $forex['track'];
$type = $forex['radio'];
$nick = $forex['nick'];
$sid = $forex['id'];
$addit = $forex['addit'];
$tarix = $forex['tarix'];
$status = $forex['status'];
$why = $forex['why'];
$vlink = $forex['vlink'];
$vname = $forex['vname'];
$vipoln = $forex['vipoln'];
}
echo"<b>$artist - $track</b><br/>
   <b>Тип:</b>";
if($type == 1) { echo"Полные Mp3<br/>"; }
if($type == 2) { echo"Видео<br/>"; }
if($type == 3) { echo"Мелодии / рингтоны / реалтоны<br/>"; }
if($type == 4) { echo"Картики / анимации<br/>"; }
if($type == 5) { echo"Игры<br/>"; }
if($type == 6) { echo"Темы оформления<br/>"; }
if($type == 7) { echo"Программы<br/>"; }
if($type == 8) { echo"Другое<br/>"; }
echo"
<b>Дополнительно:</b>$addit<br/>
<b>Дата заказа</b>:$tarix<br/>";
//echo"<b>Выполнен:</b>$vipoln<br/>";	
echo"
<b>Статус</b>:";
if($status == 1) { echo"Выполнен<br/>"; }
if($status == 2) { echo"Выполняется<br/>"; }
if($status == 3) { echo"Невозможно Выполнить!<br/>"; }
echo"
Заказал:$nick<br/>	
<a href=\"http://".$vlink."\">".$vname."</a><br/>
".$why." <br/>				
";	
echo"
</div><div class=\"cat\"><img src=\"kv.gif\" alt=\"\"/> <a href=\"index.php\">Назад</a><br/>	
<img src=\"kv.gif\" alt=\"\"/><a href=\"http://".$link."\">На главную</a><br/>
</div></div></div><div class=\"rekl\">	";	
$q = mysql_query("SELECT * FROM `zakaz_rekl`  LIMIT 10;");
while($forex = mysql_fetch_array($q))
{
$rekl = $forex['rekl'];
$reklname = $forex['reklname'];
$rek = $forex['rek'];
echo "<a href=\"".$rekl."\">".$reklname."</a><br/>\n";

}

echo"	
</div>	
";	
echo "</body></html>";
break;
case 'zakaz':
header("Content-type: text/html; charset=utf-8");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache, must-relative");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"ru\"><head>\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
echo "<title>".$link." - Заказ Контенка</title>\n";
echo "
<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />
</head>
<body>";
echo "<div class=\"title\"><b>Оставить заказ</b></div>";
echo"
<form action=\"index.php?page=make$nocache\" method=\"post\">
<div class=\"dir\">	
		Автор / исполнитель<br/>
		<small>(если имеется)</small>: <br/>
		<input name=\"artist\" type=\"text\" maxlength=\"255\"/><br/>
		Название / описание: <br/>
		<input name=\"track\" type=\"text\" maxlength=\"255\"/><br/>
		Категория :<br/>
		<input name=\"type\" type=\"radio\" value=\"1\" checked=\"checked\"/>Полные Mp3<br/>
		<input name=\"type\" type=\"radio\" value=\"2\"/>Видео<br/>
		<input name=\"type\" type=\"radio\" value=\"3\"/>Мелодии / рингтоны / реалтоны<br/>
		<input name=\"type\" type=\"radio\" value=\"4\"/>Картики / анимации<br/>
		<input name=\"type\" type=\"radio\" value=\"5\"/>Игры<br/>
		<input name=\"type\" type=\"radio\" value=\"6\"/>Темы оформления<br/>
		<input name=\"type\" type=\"radio\" value=\"7\"/>Программы<br/>
		<input name=\"type\" type=\"radio\" value=\"8\"/>Другое<br/>
		Ваш Ник: <br/>
		<input name=\"nick\" type=\"text\" maxlength=\"50\"/><br/>
Модель телефона<br/> <small>(просьба указывать разрешение экрана)</small>: <br/>
		<input name=\"addit\" type=\"text\" maxlength=\"455\"/><br/><br/>
		<input class=\"ibutton\" type=\"submit\" value=\"Заказать\"/>	</div>
</form>	
</div><div class=\"cat\"><img src=\"kv.gif\" alt=\"\"/> <a href=\"index.php\">Назад</a><br/>	
<img src=\"kv.gif\" alt=\"\"/><a href=\"http://".$link."\">На главную</a><br/>	
</div></div></div><div class=\"rekl\">	";	
$q = mysql_query("SELECT * FROM `zakaz_rekl`  LIMIT 10;");
while($forex = mysql_fetch_array($q))
{
$rekl = $forex['rekl'];
$reklname = $forex['reklname'];
$rek = $forex['rek'];
echo "<a href=\"".$rekl."\">".$reklname."</a><br/>\n";

}

echo"	
</div>	
";	
echo "</body></html>";
break;
case 'make':
header("Content-type: text/html; charset=utf-8");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache, must-relative");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"ru\"><head>\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
echo "<title>".$link." - Заказ Контенка</title>\n";
echo "
<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />
</head>
<body>";

$lat = array("J", "j", "Zh", "zh", "Ch", "ch", "Ye", "ye", "Yu", "yu", "Ya", "ya", "Shc", "shc", "Sh", "sh", "Yo", "yo", "Q", "q", "'", "A", "a", "B", "b", "C", "c", "D", "d", "E", "e", "F", "f", "G", "g", "H", "h", "I", "i", "K", "k", "L", "l", "M", "m", "N", "n", "O", "o", "P", "p", "R", "r", "S", "s", "T", "t", "U", "u", "V", "v", "X", "x", "Z", "z");
$rus = array("Й", "й", "Ж", "ж", "Ч", "ч", "Э", "э", "Ю", "ю", "Я", "я", "Щ", "щ", "Ш", "ш", "Ё", "ё", "Ь", "ь", "ъ", "А", "а", "Б", "б", "Ц", "ц", "Д", "д", "Е", "е", "Ф", "ф", "Г", "г", "Х", "х", "И", "и", "К", "к", "Л", "л", "М", "м", "Н", "н", "О", "о", "П", "п", "Р", "р", "С", "с", "Т", "т", "У", "у", "В", "в", "Х", "х", "З", "з");
$nickname = trim(htmlspecialchars(mysql_escape_string($_POST['nickname'])));
$artist = trim(htmlspecialchars(mysql_escape_string(trim($_POST['artist']))));
$track = trim(htmlspecialchars(mysql_escape_string(trim($_POST['track']))));
$nick = trim(htmlspecialchars(mysql_escape_string(trim($_POST['nick']))));
$addit = trim(htmlspecialchars(mysql_escape_string(trim($_POST['addit']))));
$radio = intval($_POST['radio']);
$artist = str_replace('$', '$$', $artist);
$track = str_replace('$', '$$', $track);
$nick = str_replace('$', '$$', $nick);
$addit = str_replace('$', '$$', $addit);
$translit = $_POST['translit'];

if(substr_count($translit, "artist") != 0)
{
$artist = str_replace($lat, $rus, $artist);
}

if(substr_count($translit, "track") != 0)
{
$track = str_replace($lat, $rus, $track);
}

if(substr_count($translit, "nick") != 0)
{
$nick = str_replace($lat, $rus, $nick);
}

if(substr_count($translit, "addit") != 0)
{
$addit = str_replace($lat, $rus, $addit);
}


if(empty($track))	
{
echo "<div class=\"title\"><b>Ошибка!!!</b></div>";	
echo "Поле Название / описание не заполнено!<br/>\n";
echo"</div><div class=\"cat\"><img src=\"kv.gif\" alt=\"\"/> <a href=\"index.php?page=zakaz\">Назад</a><br/>	
<img src=\"kv.gif\" alt=\"\"/><a href=\"http://".$link."\">На главную</a><br/>	
</div>.<div class=\"rekl\">	
</div>	";

break;
}
if(empty($nick))	
{
echo "<div class=\"title\"><b>Ошибка!!!</b></div>";	
echo "Поле Ваш Ник не заполнено!<br/>\n";
echo"</div><div class=\"cat\"><img src=\"kv.gif\" alt=\"\"/> <a href=\"index.php?page=zakaz\">Назад</a><br/>	
<img src=\"kv.gif\" alt=\"\"/><a href=\"http://".$link."\">На главную</a><br/>	
</div>.<div class=\"rekl\">	
</div>	";

break;
}
if(empty($track))	
{
echo "<div class=\"addit\"><b>Ошибка!!!</b></div>";	
echo "Поле Модель телефона не заполнено!<br/>\n";
echo"</div><div class=\"cat\"><img src=\"kv.gif\" alt=\"\"/> <a href=\"index.php?page=zakaz\">Назад</a><br/>	
<img src=\"kv.gif\" alt=\"\"/><a href=\"http://".$link."\">На главную</a><br/>	
</div>.<div class=\"rekl\">	
</div>	";

break;
}

@mysql_select_db("$DBNAME");
$sql = mysql_query("SELECT `id` FROM `zakaz_make` WHERE `artist` = '".$artist."' AND `track` = '".$track."';");
if(mysql_num_rows($sql) != 0)
{
echo "<div class=\"title\"><b>Ошибка!!!</b></div>";		
echo "Такой Заказ уже существует!<br/>\n";
echo"</div><div class=\"cat\"><img src=\"kv.gif\" alt=\"\"/> <a href=\"index.php?page=zakaz\">Назад</a><br/>	
<img src=\"kv.gif\" alt=\"\"/><a href=\"http://".$link."\">На главную</a><br/>	
</div>.<div class=\"rekl\">	
</div>	";

break;
}

@mysql_select_db("$DBNAME");
$tarix = date("d/m/Y");
$sql = @mysql_query("INSERT INTO `zakaz_make` SET `artist` = '".$artist."', `track` = '".$track."', `nick` = '".$nick."', radio=".$type.",`forex` = '".$id."',`addit` = '".$addit."',`status` = 2,`tarix`='".$tarix."';");
$c = 1;

if($sql)
{
echo "<div class=\"title\"><b>Заказ поставлен в очередь на выполнение</b></div>";	
echo"
<div class=\"cat\">
	<b>Вы заказали:</b></div><div class=\"dir\">
     <b>".$artist."</b> -
	 <b>".$track."</b><br/>
   <b>Тип:</b>";
if($type == 1) { echo"Полные Mp3<br/>"; }
if($type == 2) { echo"Видео<br/>"; }
if($type == 3) { echo"Мелодии / рингтоны / реалтоны<br/>"; }
if($type == 4) { echo"Картики / анимации<br/>"; }
if($type == 5) { echo"Игры<br/>"; }
if($type == 6) { echo"Темы оформления<br/>"; }
if($type == 7) { echo"Программы<br/>"; }
if($type == 8) { echo"Другое<br/>"; }

$zakaz = mysql_query("select * from zakaz_make order by id;");
if (mysql_affected_rows()!=0)
{
while ($forex=mysql_fetch_array($zakaz))
{
$q=mysql_query("select max(id) from zakaz_make;");
$row=mysql_fetch_array($q);
$last_id=$row['0'];
$id=$forex['id'];
if ($id!=$last_id) {echo "";}// else {echo "";}
}
}
	
echo"
    <b>Номер вашего заказа:</b> $last_id <br/>
";

echo"
<span calss=\"red\">*</span> <small> Запомните номер вашего заказа для быстрой проверки его Статуса! (см. Стол заказов / Проверить статус заказа)</small>
</div>
";	
}
else
{
echo "При добавлении произошла ошибка!<br/>\n";
echo mysql_error()."<br/>\n";
}
echo"
</div><div class=\"cat\"><img src=\"kv.gif\" alt=\"\"/> <a href=\"index.php?page=zakaz\">Назад</a><br/>	
<img src=\"kv.gif\" alt=\"\"/><a href=\"http://".$link."\">На главную</a><br/>	
</div>.<div class=\"rekl\">	
</div>	
";	
echo "</body></html>";
break;

}
?>