forked from Edrard/MSFC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
attack.php
115 lines (106 loc) · 4.15 KB
/
attack.php
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
<?php
/*
* Project: Clan Stat
* License: Creative Commons - Attribution-Noncommercial-Share Alike 3.0 Unported
* Link: http://creativecommons.org/licenses/by-nc-sa/3.0/
* -----------------------------------------------------------------------
* Began: 2011
* Date: $Date: 2011-10-24 11:54:02 +0200 $
* -----------------------------------------------------------------------
* @author $Author: Edd, Exinaus, Shw $
* @copyright 2011-2012 Edd - Aleksandr Ustinov
* @link http://wot-news.com
* @package Clan Stat
* @version $Rev: 2.2.0 $
*
*/
?>
<?php
error_reporting(E_ALL & ~E_STRICT);
ini_set("display_errors", 1);
if (file_exists(dirname(__FILE__).'/function/mysql.php')) {
define('ROOT_DIR', dirname(__FILE__));
}else{
define('ROOT_DIR', '.');
}
//Starting script time execution timer
$begin_time = microtime(true);
//Cheker
include_once(ROOT_DIR.'/including/check.php');
//MYSQL
include_once(ROOT_DIR.'/function/mysql.php');
//Multiget CURL
include_once(ROOT_DIR.'/function/curl.php');
include_once(ROOT_DIR.'/function/mcurl.php');
// Include Module functions
include_once(ROOT_DIR.'/function/rating.php');
include_once(ROOT_DIR.'/function/func.php');
include_once(ROOT_DIR.'/function/func_main.php');
include_once(ROOT_DIR.'/function/func_get.php');
include_once(ROOT_DIR.'/function/func_gk.php');
// Including main config files
include_once(ROOT_DIR.'/function/config.php');
include_once(ROOT_DIR.'/config/config_'.$config['server'].'.php');
//Loding language pack
foreach(scandir(ROOT_DIR.'/translate/') as $files){
if (preg_match ("/_".$config['lang'].".php/", $files)){
include_once(ROOT_DIR.'/translate/'.$files);
}
}
$battel = array();
if(is_valid_url($config['td']) == true){
$battel = get_clan_attack($config,$config['clan']);
}
//include_once(ROOT_DIR.'/views/header.php');
?>
<script type="text/javascript" id="js">
$(document).ready(function()
{
$("#attack").tablesorter({sortList:[[1,0]]});
});
</script>
<div align="center">
<table id="attack" cellspacing="1" cellpadding="2" width="100%">
<thead>
<tr>
<th width="40"><?=$lang['type']; ?></th>
<th><?=$lang['time']; ?></th>
<th><?=$lang['province']; ?></th>
</tr>
</thead>
<tbody>
<?php if (isset($battel['request_data'])){
foreach ($battel['request_data']['items'] as $val){
if (strlen($val['time']) > 1){
$date = date('H:i',$val['time']);
} else {
$date = '--:--';
}
if ($val['type'] == 'landing'){
$type = '<img src="./images/landing.png">';
} elseif ($val['type'] == 'for_province'){
$type = '<img src="./images/attacked.png">';
} elseif ($val['type'] == 'meeting_engagement'){
$type = '<img src="./images/combats_running.png">';
};
?>
<tr>
<td align="center"><?=$type; ?></td>
<td><?=$date; ?></td>
<td><a href="<?=$config['clan_link']; ?>maps/?province=<?=$val['provinces'][0]['id']; ?>" target="_blank"><?=$val['provinces'][0]['name']; ?></a></td>
</tr>
<?php };
if ((isset($battel['request_data'])) && (count($battel['request_data']['items']) == 0 )) { ?>
<tr>
<td colspan="3" align="center"><?=$lang['no_war']; ?></td>
</tr>
<?php
};
} else { ?>
<tr>
<td colspan="3" align="center"><?=$lang['error_1']?></td>
</tr>
<?php }; ?>
</tbody>
</table>
</div>