Файл: index.php
Строк: 499
<?php
error_reporting(0);
header ("Content-type: text/html; charset=utf-8");
Header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
Header("Cache-Control: no-cache, must-revalidate");
Header("Pragma: no-cache");
Header("Last-Modified: ".gmdate("D, d M Y H:i:s")."GMT");
print "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">n";
print "<html><head>n";
print "<meta http-equiv="Content-Type" content="text/html; charset=utf-8">n";
print "<link rel="stylesheet" type="text/css" href="./style.css">n";
print "<title>keepermobile online</title>n";
print "</head><body>n";
print "<div class="c"><div class ="mig"><img src="logo.png" alt=""><br>конструктор online</div></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 "<ul><li><a href ="./faq.php">Регистрация кошелька</a>"."</li></ul>n";
print "<b>"."Выбор модели телефона"."</b>n";
print "<form style = "margin-bottom:5px;" action = "./?">n";
print "<input type = "hidden" name = "step" value = "2">n";
print "1.<input type = "radio" name = "mobile" value = "1">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" checked = "checked">Остальные<br>n";
print "<input style = "margin-top:5px;" type = "submit" value = "Дальше »">n";
print "</form>n";
print "<ul><li><a href = "../?">На главную</a>"."</li></ul>n";
}
if (!empty($_GET['step']))
{
switch ($_GET['step'])
{
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 "<input style = "margin-top:5px;" type = "submit" value = "дальше »">n";
print "</form>n";
print "<ul><li><a href = "./?step=6&mobile=".$_GET['mobile']."&i=".$_GET['i']."&x=".$_GET['x']."&m=".$_GET['m']."&c=".$_GET['c']."&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 "<input style = "margin-top:5px;" type = "submit" value = "дальше »">n";
print "</form>n";
print "<ul><li><a href = "./?step=7&mobile=".$_GET['mobile']."&i=".$_GET['i']."&x=".$_GET['x']."&m=".$_GET['m']."&c=".$_GET['c']."&s=".$_GET['s']."&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('smiles/'.$_GET['s'].'.png')){
copy('smiles/'.$_GET['s'].'.png','sout/'.$mdir.'smiles.png');
copy('smiles/'.$_GET['s'].'.txt','sout/'.$mdir.'smiles.txt');}else {
copy('smiles/1.png','sout/'.$mdir.'smiles.png');
copy('smiles/1.txt','sout/'.$mdir.'smiles.txt');}}elseif (!isset($_GET['s'])){
copy('smiles/1.png','sout/'.$mdir.'smiles.png');
copy('smiles/1.txt','sout/'.$mdir.'smiles.txt');
}
if (isset($_GET['l'])){
if(file_exists('logo/'.$_GET['l'].'.png')){
copy('logo/'.$_GET['l'].'.png','sout/'.$mdir.'logo.png');
}else copy('logo/1.png','sout/'.$mdir.'logo.png');}
elseif (!isset($_GET['l'])){copy('logo/1.png','sout/'.$mdir.'logo.png');}
if (isset($_GET['ic'])){
if(file_exists('icon/'.$_GET['ic'].'.png')){
copy('icon/'.$_GET['ic'].'.png','sout/'.$mdir.'ic.png');
}else copy('icon/1.png','sout/'.$mdir.'ic.png');}
elseif (!isset($_GET['ic'])){copy('icon/1.png','sout/'.$mdir.'ic.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 = 'keepermobile'.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.'smiles.png');
unlink ('sout/'.$mdir.'smiles.txt');
unlink ('sout/'.$mdir.'logo.png');
unlink ('sout/'.$mdir.'ic.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("nn","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);
print "Ссылки для скачивания:n";
print "<ul><li><a href = "./midlet/".$rand."">http://".$_SERVER['HTTP_HOST'].'/midlet/'.$rand."</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'].'/keepermobile/midlet/'.$rand."><br>n";
print "<input type = "text" size = "15" value = "."http://".$_SERVER['HTTP_HOST'].'/keepermobile/midlet/'.$rand_jad."></form>n";
print "Ссылки будут доступны в течении 1 часа.n" ;
print "<ul><li><a href = "./?">В раздел keepermobile</a></li>n";
print "<li><a href = "../?">На главную</a></li></ul>n";
break;
default : print ':)';
}}
print "</div>n";
print "<div class="c">by Sich</div>n";
print "</body></html>";
?>