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.
| 1. / 2. / ...
<?php
// ClanSphere 2009 - www.clansphere.net
// Author : The_Mumie
// $Id$
$cs_lang = cs_translate('jobs');
$data = array();
empty($_REQUEST['start']) ? $start = 0 : $start = $_REQUEST['start'];
$cs_sort[1] = 'jobs_title ASC';
$cs_sort[2] = 'jobs_title DESC';
empty($_REQUEST['sort']) ? $sort = 1 : $sort = $_REQUEST['sort'];
$order = $cs_sort[$sort];
$jobs_count = cs_sql_count(__FILE__,'jobs');
$categories_data = cs_sql_select(__FILE__,'categories','*',"categories_mod = 'jobs'",'categories_name',0,0);
$categories_loop = count($categories_data);
for($run=0; $run<$categories_loop; $run++) {
$data['categorie'][$run]['cat'] = ($categories_data[$run]['categories_name']);
$content = cs_sql_count(__FILE__,'jobs','categories_id = ' .$categories_data[$run]['categories_id']);
$data['categorie'][$run]['count_cat'] = $content;
$categories_data[$run]['categories_text'] = empty($categories_data[$run]['categories_text']) ? $cs_lang['no_cat_text'] : $categories_data[$run]['categories_text'];
$data['categorie'][$run]['cat_text'] = cs_secure($categories_data[$run]['categories_text'],1,1);
empty($_REQUEST['start']) ? $start = 0 : $start = $_REQUEST['start'];
$cs_sort[1] = 'jobs_title ASC';
$cs_sort[2] = 'jobs_title DESC';
if(!empty($_GET['where']) AND $_GET['where'] == $categories_data[$run]['categories_id']) {
$sort = $_REQUEST['sort'];
} else {
$sort = 1;
}
$order = $cs_sort[$sort];
$data['categorie'][$run]['sort'] = cs_sort('jobs','list',$start,$categories_data[$run]['categories_id'],1,$sort);
/**
* Aktuelle Wetten dieser Kategorie auslesen
*/
$select = '*';
$where = "categories_id = '" . $categories_data[$run]['categories_id'] . "'";
$cs_jobs = cs_sql_select(__FILE__,'jobs',$select,$where,$order,$start,0);
$data['categorie'][$run]['jobs'] = array();
for($run_b=0; $run_b<count($cs_jobs); $run_b++) {
$data['categorie'][$run]['jobs'][$run_b]['id'] = $cs_jobs[$run_b]['jobs_id'];
$data['categorie'][$run]['jobs'][$run_b]['order'] = $cs_jobs[$run_b]['jobs_order'];
$data['categorie'][$run]['jobs'][$run_b]['title'] = $cs_jobs[$run_b]['jobs_title'];
$data['categorie'][$run]['jobs'][$run_b]['url'] = cs_url('jobs','view','id=' . $cs_jobs[$run_b]['jobs_id']);
$count_jobs = cs_sql_count(__FILE__,'jobs','jobs_id = ' .$cs_jobs[$run_b]['jobs_id']);
$data['categorie'][$run]['jobs'][$run_b]['count'] = $count_jobs;
}
}
echo cs_subtemplate(__FILE__,$data,'jobs','list');
|