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.  
  | 1. / 2. / ... 
 <?php 
// ClanSphere 2006 - www.clansphere.net 
// $Id: list.php 101 2006-07-12 09:36:29Z hajo $ 
 
$cs_lang = cs_translate('wars','list'); 
 
$squads_id = empty($_REQUEST['where']) ? '' : $_REQUEST['where']; 
settype($squads_id,'integer'); 
$where = empty($squads_id) ? 0 : "squads_id = '" . $squads_id . "'"; 
 
$start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start']; 
$cs_sort[1] = 'war.wars_date DESC'; 
$cs_sort[2] = 'war.wars_date ASC'; 
$cs_sort[3] = 'cln.clans_name DESC'; 
$cs_sort[4] = 'cln.clans_name ASC'; 
$cs_sort[5] = 'cat.categories_name DESC'; 
$cs_sort[6] = 'cat.categories_name ASC'; 
$sort = empty($_REQUEST['sort']) ? 1 : $_REQUEST['sort']; 
$order = $cs_sort[$sort]; 
$wars_count = cs_sql_count(__FILE__,'wars',$where); 
 
echo cs_html_table(1,'forum',1); 
echo cs_html_roco(1,'headb',0,3); 
echo $cs_lang['mod'] . ' - ' . $cs_lang['head_list']; 
echo cs_html_roco(0); 
echo cs_html_roco(1,'leftc'); 
echo sprintf($cs_lang['count'], $wars_count); 
echo cs_html_roco(2,'rightc',0,2); 
echo cs_pages('wars','list',$wars_count,$start,$squads_id,$sort); 
echo cs_html_roco(0); 
echo cs_html_roco(1,'leftc'); 
echo $cs_lang['squad']; 
echo cs_html_form(1,'wars_list','wars','list'); 
$squads_data = cs_sql_select(__FILE__,'squads','squads_name, squads_id',0,'squads_name',0,0); 
echo cs_dropdown('where','squads_name',$squads_data,$squads_id,'squads_id'); 
echo cs_html_vote('submit',$cs_lang['show'],'submit'); 
echo cs_html_form(0); 
echo cs_html_roco(3,'rightc'); 
echo cs_link($cs_lang['stats'],'wars','stats'); 
echo cs_html_roco(0); 
echo cs_html_table(0); 
echo cs_html_br(1); 
 
$select = 'war.games_id AS games_id, war.wars_date AS wars_date, war.clans_id AS clans_id, cln.clans_short AS clans_short, sq.squad_name AS squad_name, cat.categories_name AS categories_name, war.categories_id AS categories_id, war.wars_score1 AS wars_score1, war.wars_score2 AS wars_score2, war.wars_id AS wars_id'; 
$from = 'wars war INNER JOIN {pre}_categories cat ON war.categories_id = cat.categories_id '; 
$from .= 'INNER JOIN {pre}_clans cln ON war.clans_id = cln.clans_id '; 
 
$cs_wars = cs_sql_select(__FILE__,$from,$select,$where,$order,$start,$account['users_limit']); 
$wars_loop = count($cs_wars); 
 
echo cs_html_table(1,'forum',1); 
echo cs_html_roco(1,'headb'); 
echo cs_sort('wars','list',$start,$squads_id,1,$sort); 
echo $cs_lang['date']; 
echo cs_html_roco(2,'headb'); 
echo $cs_lang['squad']; 
echo cs_html_roco(3,'headb'); 
echo cs_sort('wars','list',$start,$squads_id,3,$sort); 
echo $cs_lang['enemy']; 
echo cs_html_roco(5,'headb',0,2); 
echo $cs_lang['score']; 
echo cs_html_roco(0); 
 
for($run=0; $run<$wars_loop; $run++) { 
 
  echo cs_html_roco(1,'leftb'); 
    echo cs_date('unix',$cs_wars[$run]['wars_date']); 
        echo cs_html_roco(2,'leftb'); 
  $cs_squad_name = cs_secure($cs_squads[$run]['squads_name']); 
    echo cs_html_roco(3,'leftb'); 
  $cs_clans_short = cs_secure($cs_wars[$run]['clans_short']); 
  echo cs_link($cs_clans_short,'clans','view','id=' . $cs_wars[$run]['clans_id']); 
    echo cs_html_roco(5,'centerb'); 
    $score = $cs_wars[$run]['wars_score1'] . ' : ' . $cs_wars[$run]['wars_score2']; 
  echo cs_link($score,'wars','view','id=' . $cs_wars[$run]['wars_id']); 
    echo cs_html_roco(5,'centerb'); 
    $result = $cs_wars[$run]['wars_score1'] - $cs_wars[$run]['wars_score2']; 
    $result >= 1 ? $icon = 'green' : $icon = 'red'; 
  if(empty($result)) { 
    $icon = 'grey'; 
  } 
  echo cs_html_img('symbols/clansphere/' . $icon . '.gif'); 
    echo cs_html_roco(0); 
} 
echo cs_html_table(0); 
 
?>  |