| 
 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 2010 - www.clansphere.net
 // $Id$
 
 $cs_lang = cs_translate('maps');
 $cs_post = cs_post('where,start,sort');
 $cs_get = cs_get('where,start,sort');
 $data = array();
 
 $games_id = empty($cs_get['where']) ? 0 : $cs_get['where'];
 if (!empty($cs_post['where']))  $games_id = $cs_post['where'];
 $start = empty($cs_get['start']) ? 0 : $cs_get['start'];
 if (!empty($cs_post['start']))  $start = $cs_post['start'];
 $sort = empty($cs_get['sort']) ? 1 : $cs_get['sort'];
 if (!empty($cs_post['sort']))  $sort = $cs_post['sort'];
 
 $where = !empty($games_id) ? 'games_id = "' . $games_id . '"' : 0;
 
 $cs_sort[1] = 'maps_name ASC';
 $cs_sort[2] = 'maps_name DESC';
 $cs_sort[3] = 'games_name DESC';
 $cs_sort[4] = 'games_name DESC';
 $order = $cs_sort[$sort];
 $maps_count = cs_sql_count(__FILE__,'maps',$where);
 
 
 $data['head']['count_maps'] = $maps_count;
 $data['head']['pages'] = cs_pages('maps','manage',$maps_count,$start,$games_id,$sort);
 
 $cs_games = cs_sql_select(__FILE__,'games','games_id, games_name',0,'games_name',0,0);
 $data['head']['dropdown'] = cs_dropdown('where','games_name',$cs_games,$games_id,'games_id');
 $data['head']['getmsg'] = cs_getmsg();
 
 $data['sort']['name'] = cs_sort('maps','manage',$start,$games_id,1,$sort);
 $data['sort']['game'] = cs_sort('maps','manage',$start,0,3,$sort);
 
 $tables = 'maps mp INNER JOIN {pre}_games gm ON mp.games_id = gm.games_id';
 $cells = 'mp.maps_id AS maps_id, mp.maps_name AS maps_name, mp.games_id AS games_id, gm.games_name AS games_name';
 $data['maps'] = cs_sql_select(__FILE__,$tables,$cells,$where,$order,$start,$account['users_limit']);
 $loop_maps = count($data['maps']);
 
 
 for($run=0; $run<$loop_maps; $run++){
 
 $data['maps'][$run]['id'] = $data['maps'][$run]['maps_id'];
 $data['maps'][$run]['name'] = $data['maps'][$run]['maps_name'];
 $data['maps'][$run]['game_id'] = $data['maps'][$run]['games_id'];
 $data['maps'][$run]['game_name'] = $data['maps'][$run]['games_name'];
 
 }
 
 echo cs_subtemplate(__FILE__,$data,'maps','manage');
 
 //maps/manage.tpl
 <table class="forum" cellpadding="0" cellspacing="{page:cellspacing}" style="width:{page:width}">
 <tr>
 <td class="leftb">{icon:contents} Gesamt: {head:count_maps}</td>
 <td class="rightb">{head:pages}</td>
 </tr>
 <tr>
 <td class="leftb"colspan="2">{lang:game}
 <form method="post" id="maps_manage" action="{url:maps_manage}">
 <div style="display:none;"><input type="hidden" name="cs_xsrf_key" value="3abba28cfec18a31a67dfecf54263be0" /></div>
 
 <div style="display:none;"><input type="hidden" name="cs_xsrf_key" value="4d04abba9ad17b595ddd59a5dd87bc24" /></div>
 
 {head:dropdown}
 <input type="submit" name="submit" value="Anzeigen" />
 </form>
 </td>
 </tr>
 </table>
 <br />
 {head:getmsg}
 <table class="forum" cellpadding="0" cellspacing="{page:cellspacing}" style="width:{page:width}">
 <tr>
 <td class="headb">{sort:name} Name</td>
 <td class="headb">{sort:game} {lang:game}</td>
 <td class="headb" colspan="2" style="width:20%">Optionen</td>
 </tr>{loop:maps}
 <tr>
 <td class="leftc"><a href="{url:maps_view:id={maps:id}}">{maps:name}</a></td>
 <td class="leftc"><a href="{url:games_view:id={maps:game_id}}">{maps:game_name}</a></td>
 <td class="leftc"><a href="{url:maps_edit:id={maps:id}}">{icon:edit}</a></td>
 <td class="leftc"><a href="{url:maps_remove:id={maps:id}}">{icon:editdelete}</a></td>
 </tr>{stop:maps}
 </table>
 |