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

Размер файла: 14.59Kb
<?php
#-----------------------------------------------------#
#          ********* WAP-MOTORS *********             #
#             Made by   :  Hoooch                     #
#               E-mail  :  [email protected]             #
#             WAP-Site  :  http://vira.h2m.ru         #
#                  ICQ  :  77-148-55                  #
#  Вы не имеете право вносить изменения в код скрипта #
#        для его дальнейшего распространения          #
#-----------------------------------------------------#	
require_once "../includes/start.php";
require_once "../includes/functions.php";
require_once "../includes/header.php";
include_once "../themes/".$config['themes']."/index.php";
print "<div class='c'><img src=\"logo.png\" alt=\"\"><br>Конструктор online</div>\n";
//print "<div class=\"messin\">\n";
$fr=array_merge(glob("midlet/*.jar"),glob("midlet/*.jad"));
foreach ($fr as $file)
{if((time()- filectime($file)) > 3600)unlink ($file);}

if (empty($_GET['step']))
{

print "<li><a href =\"./faq.php\">Описание</a>"."</li></ul>\n";
echo 'Собрано '.file_get_contents('count.dat').' раз<br />';
print "<b>"."Выбор модели телефона"."</b>\n";
print "<form  style = \"margin-bottom:5px;\" action = \"./?\">\n";
print "<input type = \"hidden\" name = \"step\" value = \"1\">\n";
print "1.<input type = \"radio\" name = \"mobile\" value = \"1\" checked = \"checked\">Motorola<br>\n";
print "2.<input type = \"radio\" name = \"mobile\" value = \"2\">Siemens x65-75<br>\n";
print "3.<input type = \"radio\" name = \"mobile\" value = \"3\">Sony Ericsson<br>\n";
print "4.<input type = \"radio\" name = \"mobile\" value = \"4\">Nokia<br>\n";
print "5.<input type = \"radio\" name = \"mobile\" value = \"5\">Samsung<br>\n";
print "6.<input type = \"radio\" name = \"mobile\" value = \"6\">Остальные<br>\n";
print "<input style = \"margin-top:5px;\" type = \"submit\" value = \"Дальше &#187;\">\n";
print "</form>\n";
print "<li><a href = \"../?\">На главную</a>"."</li></ul>\n";
}

if (!empty($_GET['step']))
{
switch ($_GET['step'])
{

case "1" :
print "<b>"."Выбор иконки загрузки"."</b>\n";
print "<form style = \"margin-bottom:5px;\" action = \"./?\">\n";
print "<input type = \"hidden\" name = \"step\" value = \"2\">\n";
print "<input type = \"hidden\" name = \"mobile\" value = \"".$_GET['mobile']."\">\n";
print "<input type = \"hidden\" name = \"i\" value = \"".$_GET['i']."\">\n";
print "<input type = \"hidden\" name = \"x\" value = \"".$_GET['x']."\">\n";
print "<input type = \"hidden\" name = \"m\" value = \"".$_GET['m']."\">\n";
print "<input type = \"hidden\" name = \"c\" value = \"".$_GET['c']."\">\n";
print "1.<input type = \"radio\" name = \"s\" value = \"1\" checked = \"checked\"><br>\n";
print "<img src = \"./10/1.png\" alt=\"\"><br>\n";
print "2.<input type = \"radio\" name = \"s\" value = \"2\"><br>\n";
print "<img src = \"./10/2.png\" alt=\"\"><br>\n";
print "3.<input type = \"radio\" name = \"s\" value = \"3\"><br>\n";
print "<img src = \"./10/3.png\" alt=\"\"><br>\n";
print "4.<input type = \"radio\" name = \"s\" value = \"4\"><br>\n";
print "<img src = \"./10/4.png\" alt=\"\"><br>\n";
print "5.<input type = \"radio\" name = \"s\" value = \"5\"><br>\n";
print "<img src = \"./10/5.png\" alt=\"\"><br>\n";
print "6.<input type = \"radio\" name = \"s\" value = \"6\"><br>\n";
print "<img src = \"./10/6.png\" alt=\"\"><br>\n";
print "<input style = \"margin-top:5px;\" type = \"submit\" value = \"дальше &#187;&#187;\">\n";
print "</form>\n";
print "<li><a href = \"./?step=5&amp;mobile=".$_GET['mobile']."&amp;i=".$_GET['i']."&amp;x=".$_GET['x']."&amp;m=".$_GET['m']."&amp;c=".$_GET['c']."\">На шаг назад</a></li>\n";
print "<li><a href = \"./?\">Начать сборку сначала</a></li>\n";
print "<li><a href = \"../?\">На главную</a></li></ul>\n";
		$c = file_get_contents('count.dat')+1;
		$fp = fopen('count.dat','w');
		fwrite($fp,$c);
		fclose($fp);
break;

case "2" :
print "<b>"."Выбор лого"."</b>\n";
print "<form style = \"margin-bottom:5px;\" action = \"./?\">\n";
print "<input type = \"hidden\" name = \"step\" value = \"3\">\n";
print "<input type = \"hidden\" name = \"mobile\" value = \"".$_GET['mobile']."\">\n";
print "<input type = \"hidden\" name = \"i\" value = \"".$_GET['i']."\">\n";
print "<input type = \"hidden\" name = \"x\" value = \"".$_GET['x']."\">\n";
print "<input type = \"hidden\" name = \"m\" value = \"".$_GET['m']."\">\n";
print "<input type = \"hidden\" name = \"c\" value = \"".$_GET['c']."\">\n";
print "<input type = \"hidden\" name = \"s\" value = \"".$_GET['s']."\">\n";
print "1.<input type = \"radio\" name = \"l\" value = \"1\" checked = \"checked\"> <br>\n";
print "<img src = \"./logo/1.png\" alt=\"\"><br>\n";
print "2.<input type = \"radio\" name = \"l\" value = \"2\"> <br>\n";
print "<img src = \"./logo/2.png\" alt=\"\"><br>\n";
print "3.<input type = \"radio\" name = \"l\" value = \"3\"> <br>\n";
print "<img src = \"./logo/3.png\" alt=\"\"><br>\n";
print "4.<input type = \"radio\" name = \"l\" value = \"4\"> <br>\n";
print "<img src = \"./logo/4.png\" alt=\"\"><br>\n";
print "5.<input type = \"radio\" name = \"l\" value = \"5\"> <br>\n";
print "<img src = \"./logo/5.png\" alt=\"\"><br>\n";
print "6.<input type = \"radio\" name = \"l\" value = \"6\"> <br>\n";
print "<img src = \"./logo/6.png\" alt=\"\"><br>\n";
print "7.<input type = \"radio\" name = \"l\" value = \"7\"> <br>\n";
print "<img src = \"./logo/7.png\" alt=\"\"><br>\n";
print "8.<input type = \"radio\" name = \"l\" value = \"8\"> <br>\n";
print "<img src = \"./logo/8.png\" alt=\"\"><br>\n";
print "<input style = \"margin-top:5px;\" type = \"submit\" value = \"дальше &#187;\">\n";
print "</form>\n";
print "<li><a href = \"./?step=6&amp;mobile=".$_GET['mobile']."&amp;i=".$_GET['i']."&amp;x=".$_GET['x']."&amp;m=".$_GET['m']."&amp;c=".$_GET['c']."&amp;s=".$_GET['s']."\">На шаг назад</a></li>\n";
print "<li><a href = \"./?\">Начать сборку сначала</a></li>\n";
print "<li><a href = \"../?\">На главную</a></li></ul>\n";
break;

case "3" :
print "<b>"."Выбор иконки программы"."</b>\n";
print "<form style = \"margin-bottom:5px;\" action = \"./?\">\n";
print "<input type = \"hidden\" name = \"step\" value = \"make\">\n";
print "<input type = \"hidden\" name = \"mobile\" value = \"".$_GET['mobile']."\">\n";
print "<input type = \"hidden\" name = \"i\" value = \"".$_GET['i']."\">\n";
print "<input type = \"hidden\" name = \"x\" value = \"".$_GET['x']."\">\n";
print "<input type = \"hidden\" name = \"m\" value = \"".$_GET['m']."\">\n";
print "<input type = \"hidden\" name = \"c\" value = \"".$_GET['c']."\">\n";
print "<input type = \"hidden\" name = \"s\" value = \"".$_GET['s']."\">\n";
print "<input type = \"hidden\" name = \"l\" value = \"".$_GET['l']."\">\n";
print "1.<input type = \"radio\" name = \"ic\" value = \"1\" checked = \"checked\"> <br>\n";
print "<img src = \"./icon/1.png\" alt=\"\"><br>\n";
print "2.<input type = \"radio\" name = \"ic\" value = \"2\"> <br>\n";
print "<img src = \"./icon/2.png\" alt=\"\"><br>\n";
print "3.<input type = \"radio\" name = \"ic\" value = \"3\"> <br>\n";
print "<img src = \"./icon/3.png\" alt=\"\"><br>\n";
print "4.<input type = \"radio\" name = \"ic\" value = \"4\"> <br>\n";
print "<img src = \"./icon/4.png\" alt=\"\"><br>\n";
print "5.<input type = \"radio\" name = \"ic\" value = \"5\"> <br>\n";
print "<img src = \"./icon/5.png\" alt=\"\"><br>\n";
print "6.<input type = \"radio\" name = \"ic\" value = \"6\"> <br>\n";
print "<img src = \"./icon/6.png\" alt=\"\"><br>\n";
print "7.<input type = \"radio\" name = \"ic\" value = \"7\"> <br>\n";
print "<img src = \"./icon/7.png\" alt=\"\"><br>\n";
print "<input style = \"margin-top:5px;\" type = \"submit\" value = \"дальше &#187;\">\n";
print "</form>\n";
print "<li><a href = \"./?step=7&amp;mobile=".$_GET['mobile']."&amp;i=".$_GET['i']."&amp;x=".$_GET['x']."&amp;m=".$_GET['m']."&amp;c=".$_GET['c']."&amp;s=".$_GET['s']."&amp;l=".$_GET['l']."\">На шаг назад</a></li>\n";
print "<li><a href = \"./?\">Начать сборку сначала</a></li>\n";
print "<li><a href = \"../?\">На главную</a></li></ul>\n";
break;

case "make" :
if (isset($_GET['mobile'])){
switch ($_GET['mobile']){
case '1' : $mdir = 'all/';
break;
default :  $mdir = 'all/';}}
else $mdir = 'all/';
if (isset($_GET['i'])){
if(file_exists('icons/'.$_GET['i'].'.png')){
copy('icons/'.$_GET['i'].'.png','sout/'.$mdir.'icons.png');
}else copy('icons/1.png','sout/'.$mdir.'icons.png');}
elseif (!isset($_GET['i'])){copy('icons/1.png','sout/'.$mdir.'icons.png');}
if (isset($_GET['x'])){
if(file_exists('xstatus/'.$_GET['x'].'.png')){
copy('xstatus/'.$_GET['x'].'.png','sout/'.$mdir.'xstatus.png');
}else copy('xstatus/1.png','sout/'.$mdir.'xstatus.png');}
elseif (!isset($_GET['x'])){copy('xstatus/1.png','sout/'.$mdir.'xstatus.png');}
if (isset($_GET['m'])){
if(file_exists('micons/'.$_GET['m'].'.png')){
copy('micons/'.$_GET['m'].'.png','sout/'.$mdir.'micons.png');
}else copy('micons/1.png','sout/'.$mdir.'micons.png');}
elseif (!isset($_GET['m'])){copy('micons/1.png','sout/'.$mdir.'micons.png');}
if (isset($_GET['c'])){
if(file_exists('clicons/'.$_GET['c'].'.png')){
copy('clicons/'.$_GET['c'].'.png','sout/'.$mdir.'clicons.png');
}else copy('clicons/1.png','sout/'.$mdir.'clicons.png');}
elseif (!isset($_GET['c'])){copy('clicons/1.png','sout/'.$mdir.'clicons.png');}
if (isset($_GET['s'])){if(file_exists('10/'.$_GET['s'].'.png')){
copy('10/'.$_GET['s'].'.png','sout/'.$mdir.'10.png');
copy('10/'.$_GET['s'].'.txt','sout/'.$mdir.'10.txt');}else {
copy('10/1.png','sout/'.$mdir.'10.png');
copy('10/1.txt','sout/'.$mdir.'10.txt');}}elseif (!isset($_GET['s'])){
copy('10/1.png','sout/'.$mdir.'10.png');
copy('10/1.txt','sout/'.$mdir.'10.txt');
}
if (isset($_GET['l'])){
if(file_exists('logo/'.$_GET['l'].'.png')){
copy('logo/'.$_GET['l'].'.png','sout/'.$mdir.'30.png');
}else copy('logo/1.png','sout/'.$mdir.'30.png');}
elseif (!isset($_GET['l'])){copy('logo/1.png','sout/'.$mdir.'30.png');}
if (isset($_GET['ic'])){
if(file_exists('icon/'.$_GET['ic'].'.png')){
copy('icon/'.$_GET['ic'].'.png','sout/'.$mdir.'l.png');
}else copy('icon/1.png','sout/'.$mdir.'l.png');}
elseif (!isset($_GET['ic'])){copy('icon/1.png','sout/'.$mdir.'l.png');}

if (isset($_GET['o']))
{
switch ($_GET['o']){
case '1.mp3' :copy ('sound/online/1.mp3','sout/'.$mdir.'online.mp3');$o_type = 'mp3';
break;
case '2.mp3' :copy ('sound/online/2.mp3','sout/'.$mdir.'online.mp3');$o_type = 'mp3';
break;
case '3.mp3' :copy ('sound/online/3.mp3','sout/'.$mdir.'online.mp3');$o_type = 'mp3';
break;
case '1.wav' :copy ('sound/online/1.wav','sout/'.$mdir.'online.wav');$o_type = 'wav';
break;
case '1.mid' :copy ('sound/online/1.mid','sout/'.$mdir.'online.mid');$o_type = 'mid';
break;
default : {copy ('sound/online/1.mp3','sout/'.$mdir.'online.mp3');$o_type = 'mp3';}
}}
else {copy ('sound/online/1.mp3','sout/'.$mdir.'online.mp3');$o_type = 'mp3';}

if (isset($_GET['ms']))
{
switch ($_GET['ms'])
{
case '1.mp3' :copy ('sound/message/1.mp3','sout/'.$mdir.'message.mp3');$ms_type = 'mp3';
break;
case '2.mp3' :copy ('sound/message/2.mp3','sout/'.$mdir.'message.mp3');$ms_type = 'mp3';
break;
case '1.wav' :copy ('sound/message/1.wav','sout/'.$mdir.'message.wav');$ms_type = 'wav';
break;
case '1.mid' :copy ('sound/message/1.mid','sout/'.$mdir.'message.mid'); $ms_type = 'mid';
break;
default : {copy ('sound/message/1.mp3','sout/'.$mdir.'message.mp3');$ms_type = 'mp3';}
}}
else {copy ('sound/message/1.mp3','sout/'.$mdir.'message.mp3');$ms_type = 'mp3';}

if (isset($_GET['t']))
{
switch ($_GET['t'])
{
case '1.mp3' :copy ('sound/typing/1.mp3','sout/'.$mdir.'typing.mp3');$t_type = 'mp3';
break;
case '1.wav' : copy ('sound/typing/1.wav','sout/'.$mdir.'typing.wav');$t_type = 'wav';
break;
case '1.mid' :copy ('sound/typing/1.mid','sout/'.$mdir.'typing.mid');$t_type = 'mid';
break;
default : {copy ('sound/typing/1.mp3','sout/'.$mdir.'typing.mp3');$t_type = 'mp3';}
}}
else {copy ('sound/typing/1.mp3','sout/'.$mdir.'typing.mp3');$t_type = 'mp3';}

require_once('pclzip.lib.php');
$rand = 'ucweb'.rand(0000000001,9999999999).'.jar';
$rand_jad = str_replace('jar','jad',$rand);
$archive = new PclZip($rand);
$v_list = $archive->create('sout/'.$mdir,
PCLZIP_OPT_REMOVE_PATH, 'sout/'.$mdir);
copy ($rand,"midlet/$rand");
unlink ($rand);
unlink ('sout/'.$mdir.'icons.png');
unlink ('sout/'.$mdir.'xstatus.png');
unlink ('sout/'.$mdir.'micons.png');
unlink ('sout/'.$mdir.'clicons.png');
unlink ('sout/'.$mdir.'10.png');
unlink ('sout/'.$mdir.'10.txt');
unlink ('sout/'.$mdir.'30.png');
unlink ('sout/'.$mdir.'l.png');
unlink ('sout/'.$mdir.'online.'.$o_type);
unlink ('sout/'.$mdir.'message.'.$ms_type);
unlink ('sout/'.$mdir.'typing.'.$t_type);
$jad = new PclZip('midlet/'.$rand);
$a = $jad->extract(PCLZIP_OPT_BY_NAME,"META-INF/MANIFEST.MF", PCLZIP_OPT_EXTRACT_AS_STRING);
$a = str_replace("\n\n","\n",$a[0]['content']);
$a .= "MIDlet-Jar-Size: ".filesize('midlet/'.$rand)."\nMIDlet-Jar-URL: ".$rand."";
$jad_file = fopen ('midlet/'.$rand_jad ,'w');
fwrite ($jad_file,$a."\n");
fclose($jad_file);


echo 'Собрано '.file_get_contents('count.dat').' раз<br />';


$dl = 'midlet/'.$rand.'';
if(!copy("content/phone/{$w}.jar",$dl))
		echo 'Размер приложения: '.ceil(filesize($dl)/1024).'kb <br />
		';
		print "Ссылки для скачивания:\n";
print "<li><a href = \"./".$dl."\">http://".$_SERVER['HTTP_HOST'].'/'.$dl."</a></li>\n";
print "<li><a style =\"margin-bottom:3px;\" href = \"./midlet/".$rand_jad."\">http://".$_SERVER['HTTP_HOST'].'/midlet/'.$rand_jad."</a></li></ul>\n";
print "Ссылки для копирования:<br>\n";
print "<form action =\"\"><input style =\"margin-bottom:3px;\" type = \"text\" size = \"15\" value = "."http://".$_SERVER['HTTP_HOST'].'/ucweb/midlet/'.$rand."><br>\n";
print "<input type = \"text\" size = \"15\" value = "."http://".$_SERVER['HTTP_HOST'].'/ucweb/midlet/'.$rand_jad."></form>\n";
print "Ссылки будут доступны в течении 1 часа.\n" ;
print "<li><a href = \"./?\">В раздел ucweb</a></li>\n";
print "<li><a href = \"../?\">На главную</a></li></ul>\n";
break;
default : print ':)';
}}
print "";
$start_time = microtime(); $start_array = explode(" ", $start_time); $start_time = $start_array[1] + $start_array[0]; 
$end_time = microtime(); $end_array = explode(" ", $end_time); $end_time = $end_array[1] + $end_array[0]; $time = $end_time - $start_time;
printf("%f сек.", $time);
print "</body></html>";
echo '<img src="../images/img/homepage.gif" alt="image" /> <a href="../index.php?'.SID.'">На главную</a> '; 
include_once "../themes/".$config['themes']."/foot.php";
?>