File size: 3.62Kb
<?php
##########################################
##UTF-8,lang-ru,"Monospace"(regular)[10]##
##########################################
#######################################
##Системные файлы/файлы конфигурации
##Установки соединения с базой данных:
if(is_file('./sys/etc/mysql_connection.php')) { //(Если есть.
include './sys/etc/mysql_connection.php'; //Подключим
} //<<)
##Основная конфигурация программы:
if(is_file('./sys/etc/usr_conf.php')) { //(Если есть.
include './sys/etc/usr_conf.php'; //Подключим
} //<<)
#######################################
include_once './sys/libs/zip.class2.php';
$id = intval($_GET["jar"]);
$id = mysql_real_escape_string($id);
$sql_sel = "SELECT * FROM mlb_texts WHERE text_id=$id and text_pid=0";
$sql_q = "SELECT * FROM mlb_texts WHERE text_pid=$id";
$res = mysql_fetch_array(mysql_query($sql_sel));
$qg = mysql_query($sql_q);
$plus = '';
while($res_q = mysql_fetch_array($qg)) {
$plus .= stripslashes($res_q["text_text"]);
}
$MANIF = file_get_contents('./sys/jar/META-INF/MANIFEST.MF');
$aclass = file_get_contents('./sys/jar/a.class');
$bclass = file_get_contents('./sys/jar/b.class');
$cclass = file_get_contents('./sys/jar/c.class');
$dclass = file_get_contents('./sys/jar/d.class');
$eclass = file_get_contents('./sys/jar/e.class');
$fclass = file_get_contents('./sys/jar/f.class');
$gclass = file_get_contents('./sys/jar/g.class');
$hclass = file_get_contents('./sys/jar/h.class');
$iclass = file_get_contents('./sys/jar/i.class');
$jclass = file_get_contents('./sys/jar/j.class');
$charsets = file_get_contents('./sys/jar/charsets');
$files = file_get_contents('./sys/jar/files');
$htxt = file_get_contents('./sys/jar/h.txt');
$mainclass = file_get_contents('./sys/jar/main.class');
$windows866 = file_get_contents('./sys/jar/windows-866');
$windows1251 = file_get_contents('./sys/jar/windows-1251');
$epng = file_get_contents('./sys/jar/e.png');
$cpng = file_get_contents('./sys/jar/c.png');
$tozip = stripslashes($res["text_text"]).$plus;
$tozip = '<encoding="UTF-8">'."\n".$tozip;
$createZip = new createZip;
$createZip -> addDirectory('META-INF/');
$createZip -> addFile($tozip, 'text.txt');
$createZip -> addFile($MANIF, 'META-INF/'.'MANIFEST.MF');
$createZip -> addFile($aclass, 'a.class');
$createZip -> addFile($bclass, 'b.class');
$createZip -> addFile($cclass, 'c.class');
$createZip -> addFile($dclass, 'd.class');
$createZip -> addFile($eclass, 'e.class');
$createZip -> addFile($fclass, 'f.class');
$createZip -> addFile($gclass, 'g.class');
$createZip -> addFile($hclass, 'h.class');
$createZip -> addFile($iclass, 'i.class');
$createZip -> addFile($jclass, 'j.class');
$createZip -> addFile($charsets, 'charsets');
$createZip -> addFile($files, 'files');
$createZip -> addFile($htxt, 'h.txt');
$createZip -> addFile($windows866, 'windows-866');
$createZip -> addFile($windows1251, 'windows-1251');
$createZip -> addFile($mainclass, 'main.class');
$createZip -> addFile($epng, 'e.png');
$createZip -> addFile($cpng, 'c.png');
$fileName = $dir_f."txt_".(str_replace(' ', '', microtime())*10000000000000).".jar";
$fd = fopen ($fileName, "wb");
$out = fwrite ($fd, $createZip -> getZippedfile());
fclose ($fd);
$createZip -> forceDownload($fileName);
@unlink($fileName);
?>