[go: up one dir, main page]

Menu

[r613]: / lmoid / result.php  Maximize  Restore  History

Download this file

146 lines (132 with data), 4.5 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php
session_start();
if (empty($_SESSION['ok'])) {
header("Location: ".$_SERVER['HTTP_HOST']."/index.php");
exit;
}
if (empty($_SESSION['files'])) unset($_SESSION['files']);
$rejected=array();
$sendfiles=isset($_POST['file'])?$_POST['file']:array();
$apache2=isset($_POST['apache2'])?1:0;
require_once("cfg.php");
require_once("db_connect.php");
if (isset($_POST['send']) && !empty($sendfiles)) {
require_once("zip.php");
$zipfile = new zipfile();
foreach($sendfiles as $file) {
$query=mysql_query("SELECT name FROM team WHERE id='$file'");
while($j = mysql_fetch_assoc($query)) {
$team=$j['name'];
$team2=$team;
if ($apache2==1) $team2=preg_replace("/[^a-zA-Z0-9]/",'',$team);
}
if (GET_smallTeamIcon($team) != '') {
$zipfile->add_file(implode('',file(substr(GET_smallTeamIcon($team),1))), substr(GET_smallTeamIcon($team),7));
}
if (GET_bigTeamIcon($team) != '') {
$zipfile->add_file(implode('',file(substr(GET_bigTeamIcon($team),1))), substr(GET_bigTeamIcon($team),7));
}
}
header("Content-Type: application/zip");
header("Content-Disposition: attachment; filename=\"icons.zip\"");
echo $zipfile->file();
} else {
if (!isset($_SESSION['files'])) $_SESSION['files']=array();
if (!empty($_GET['add'])) {
$add_files=explode(',',$_GET['add']);
foreach ($add_files as $add) {
if (count($_SESSION['files'])<MAXIMUM_ICONS_PER_ZIP) {
$x=array_search($add,$_SESSION['files']);
if ($x===FALSE) {
$_SESSION['files'][]=$add;
} else {
$rejected[]=$add;
}
} else{
$rejected[]=$add;
}
}
}
if(isset($_POST['deleteall']))
unset($_SESSION['files']);
if(isset($_GET['del'])) {
$del = $_GET['del'];
$x = array_search($del, $_SESSION['files']);
if ($x!==FALSE) {
unset($_SESSION['files'][$x]);
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="de">
<head>
<title><?php echo RESULT?></title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" />
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div class="container">
<h1>Auswahl</h1><?php
if (count($_SESSION['files'])>0) {
if (count($rejected)>0) {?>
<dl>
<dt><?php echo NO_ICON_ZIP?><small>(<?php echo NO_ZIP_ARG1?> [<?php echo MAXIMUM_ICONS_PER_ZIP?>] <?php echo NO_ZIP_ARG2?>)</small></dt><?php
foreach ($rejected as $file) {
$query=mysql_query("SELECT name FROM team WHERE id=$file");
$j = mysql_fetch_row($query);
$team=$j[0];?>
<dd><?php echo $team?></dd><?php
}?>
</dl><?php
}?>
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
<table>
<tr>
<th colspan="5"><?php echo SEL_ICONS?></th>
</tr><?php
$i=0;
foreach ($_SESSION['files'] as $file) {
$i++;
$query=mysql_query("SELECT name FROM team WHERE id=$file");
$j = mysql_fetch_row($query);
$team=$j[0];?>
<tr>
<td><?php echo $i?>.</td>
<td><?php echo HTML_smallTeamIcon('',$team,"alt=''");?></td>
<td><?php echo check_big(HTML_bigTeamIcon('',$team," alt=''"));?></td>
<td><?php echo $team?><input type="hidden" name="file[]" value="<?php echo $file?>"></td>
<td><a class='label label-danger' href="<?php echo $_SERVER['PHP_SELF']?>?del=<?php echo $file?>"><?php echo DEL_LIST?></a></td>
</tr><?php
}?>
</table>
<table id="choose">
<tr>
<td>
<input type="checkbox" name="apache2">
</td>
<td><acronym title="<?php echo APACHE_HINT?>"><?php echo APACHE_COMP?></acronym></td>
</tr>
<tr>
<td><input class="btn btn-danger btn-xs" type="submit" name="deleteall" value="<?php echo DEL_LIST?>"></td>
</tr>
<tr>
<td><input class="btn btn-success btn-xs" type="submit" name="send" value="<?php echo SAVE_LIST?>"></td>
</tr>
<tr>
<td colspan="2"><h5><?php echo SAVE_LOCAL?>!</h5></td>
</tr>
</table>
</form><?php
}
if ($i==0) {?>
<p><?php echo SEL_TEAM?></p><?php
}
?>
<br /><br />
<address>&copy; Ren&eacute; Marth</address>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
</body>
</html><?php
}?>