-
Notifications
You must be signed in to change notification settings - Fork 3
/
mn_smn_list.inc.php
63 lines (54 loc) · 1.94 KB
/
mn_smn_list.inc.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
<?php /* trenerova stranka - editace clenu oddilu */
if (!defined("__HIDE_TEST__")) exit; /* zamezeni samostatneho vykonani */ ?>
<?
DrawPageTitle('Přehled malých trenérů');
?>
<CENTER>
<script language="JavaScript">
<!--
/* "status=yes,width=600,height=460" */
javascript:set_default_size(600,600);
//-->
</script>
<?
require_once "./common_user.inc.php";
$data_tbl = new html_table_mc();
$col = 0;
$data_tbl->set_header_col($col++,'Poř.č.',ALIGN_CENTER);
$data_tbl->set_header_col($col++,'Příjmení',ALIGN_LEFT);
$data_tbl->set_header_col($col++,'Jméno',ALIGN_LEFT);
$data_tbl->set_header_col_with_help($col++,'Reg.č.',ALIGN_CENTER,"Registrační číslo");
$data_tbl->set_header_col($col++,'Počet',ALIGN_CENTER);
$data_tbl->set_header_col($col++,'Možnosti',ALIGN_CENTER);
echo $data_tbl->get_css()."\n";
echo $data_tbl->get_header()."\n";
echo $data_tbl->get_header_row()."\n";
//vytazeni malych treneru a poctu jejich sverencu
//ifnull je tam kvuli malym trenerum, kteri nemaji zadne sverence
//posledni subselect vytahne id_accounts pouze malych treneru
$select = "select u.id, u.jmeno, u.prijmeni, u.reg, ifnull(ucn.cnt,0) `mbr_cnt`, u.hidden from ".TBL_USER." u left join
(select count(1) cnt, chief_id cid from ".TBL_USER." group by chief_id) as ucn on u.id = ucn.cid
where u.id in
(select u.id from ".TBL_ACCOUNT." a inner join ".TBL_USER." u on a.id_users = u.id
where a.policy_mng = "._MNG_SMALL_INT_VALUE_.") order by u.sort_name";
@$vysl=query_db($select);
$i=1;
while ($zazn=mysqli_fetch_array($vysl))
{
if ($zazn != FALSE && !$zazn['hidden'])
{
$row = array();
$row[] = $i++;
$row[] = $zazn['prijmeni'];
$row[] = $zazn['jmeno'];
$row[] = RegNumToStr($zazn['reg']);
$num = $zazn['mbr_cnt'];
$row[] = $num;
$row[] = ($num > 0) ? "<A HREF=\"javascript:open_win('./mng_smng_view.php?id=".$zazn['id']."','')\">Zobraz</A>" : '';
echo $data_tbl->get_new_row_arr($row)."\n";
}
}
echo $data_tbl->get_footer()."\n";
?>
<BR>
</CENTER>