added user list with export
This commit is contained in:
@@ -256,6 +256,14 @@ class page {
|
|||||||
# CRON FUTTATÁSA
|
# CRON FUTTATÁSA
|
||||||
include('include_expire_check.php');
|
include('include_expire_check.php');
|
||||||
break;
|
break;
|
||||||
|
case 'userlist':
|
||||||
|
# GYEREK ADATLISTA
|
||||||
|
include('include_userlist.php');
|
||||||
|
break;
|
||||||
|
case 'export_users':
|
||||||
|
# GYEREKLISTA EXPORTÁLÁSA
|
||||||
|
include('include_export_users.php');
|
||||||
|
break;
|
||||||
case 'delete_training_type':
|
case 'delete_training_type':
|
||||||
# EDZÉS TÍPUS TÖRLÉS
|
# EDZÉS TÍPUS TÖRLÉS
|
||||||
include('include_delete_training_type.php');
|
include('include_delete_training_type.php');
|
||||||
|
|||||||
@@ -569,12 +569,17 @@ img.no-lease {
|
|||||||
filter: alpha(opacity=30); /* For IE8 and earlier */
|
filter: alpha(opacity=30); /* For IE8 and earlier */
|
||||||
}
|
}
|
||||||
|
|
||||||
.apply_table {
|
.apply_table, .user_export {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
min-width: 800px;
|
min-width: 800px;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
margin: 0px 0px 20px 0px;
|
margin: 0px 0px 20px 0px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user_export, .user_export td {
|
||||||
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.smaller {
|
.smaller {
|
||||||
@@ -588,7 +593,7 @@ img.no-lease {
|
|||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.apply_table td {
|
.apply_table td, .user_export td {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -615,6 +620,13 @@ h1.apply {
|
|||||||
margin: 30px auto 50px auto;
|
margin: 30px auto 50px auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.outer.export {
|
||||||
|
height: calc(100vh - 200px);
|
||||||
|
width: 95%;
|
||||||
|
display: block;
|
||||||
|
margin: 10px auto;
|
||||||
|
}
|
||||||
|
|
||||||
#footer_control {
|
#footer_control {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
|||||||
45
_include/include_export_users.php
Normal file
45
_include/include_export_users.php
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$userAssocArray = $sql->assoc_array("
|
||||||
|
SELECT
|
||||||
|
uk_name AS 'Név',
|
||||||
|
GROUP_CONCAT(trt_name) as 'Szint',
|
||||||
|
sc_name as 'Iskola',
|
||||||
|
uk_email as 'Email',
|
||||||
|
uk_phone as 'Telefonszám',
|
||||||
|
p1.up_name as 'Szülő1',
|
||||||
|
p1.up_email as 'Sz1_Email',
|
||||||
|
p1.up_phone as 'Sz1_Telefonszám',
|
||||||
|
p2.up_name as 'Szülő2',
|
||||||
|
p2.up_email as 'Sz2_Email',
|
||||||
|
p2.up_phone as 'Sz2_Telefonszám'
|
||||||
|
FROM
|
||||||
|
user_kid
|
||||||
|
LEFT JOIN
|
||||||
|
user_parent p1 ON p1.up_id = uk_parent_1
|
||||||
|
LEFT JOIN
|
||||||
|
user_parent p2 ON p2.up_id = uk_parent_2
|
||||||
|
LEFT JOIN
|
||||||
|
school ON sc_id = uk_school_sc_id
|
||||||
|
LEFT JOIN
|
||||||
|
user_kid_training_type ON uktt_user_kid_uk_id = uk_id
|
||||||
|
LEFT JOIN
|
||||||
|
training_type ON trt_id = uktt_training_type_tt_id
|
||||||
|
WHERE
|
||||||
|
uk_deleted = 0 AND uk_is_active = 1
|
||||||
|
GROUP BY uk_name
|
||||||
|
ORDER BY uk_name;
|
||||||
|
");
|
||||||
|
|
||||||
|
$filename = "taglista.csv";
|
||||||
|
ob_end_clean();
|
||||||
|
$fp = fopen('php://output', 'w');
|
||||||
|
|
||||||
|
fputcsv($fp, array_keys(reset($userAssocArray)), ';');
|
||||||
|
|
||||||
|
header('Content-type: application/csv');
|
||||||
|
header('Content-Disposition: attachment; filename='.$filename);
|
||||||
|
|
||||||
|
foreach($userAssocArray as $row) {
|
||||||
|
fputcsv($fp, $row, ';');
|
||||||
|
}
|
||||||
35
_include/include_userlist.php
Normal file
35
_include/include_userlist.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$userAssocArray = $sql->assoc_array("
|
||||||
|
SELECT
|
||||||
|
uk_name AS 'Név',
|
||||||
|
GROUP_CONCAT(trt_name) as 'Szint',
|
||||||
|
sc_name as 'Iskola',
|
||||||
|
uk_email as 'Email',
|
||||||
|
uk_phone as 'Telefonszám',
|
||||||
|
p1.up_name as 'Szülő1',
|
||||||
|
p1.up_email as 'Sz1_Email',
|
||||||
|
p1.up_phone as 'Sz1_Telefonszám',
|
||||||
|
p2.up_name as 'Szülő2',
|
||||||
|
p2.up_email as 'Sz2_Email',
|
||||||
|
p2.up_phone as 'Sz2_Telefonszám'
|
||||||
|
FROM
|
||||||
|
user_kid
|
||||||
|
LEFT JOIN
|
||||||
|
user_parent p1 ON p1.up_id = uk_parent_1
|
||||||
|
LEFT JOIN
|
||||||
|
user_parent p2 ON p2.up_id = uk_parent_2
|
||||||
|
LEFT JOIN
|
||||||
|
school ON sc_id = uk_school_sc_id
|
||||||
|
LEFT JOIN
|
||||||
|
user_kid_training_type ON uktt_user_kid_uk_id = uk_id
|
||||||
|
LEFT JOIN
|
||||||
|
training_type ON trt_id = uktt_training_type_tt_id
|
||||||
|
WHERE
|
||||||
|
uk_deleted = 0 AND uk_is_active = 1
|
||||||
|
GROUP BY uk_name
|
||||||
|
ORDER BY uk_name;
|
||||||
|
");
|
||||||
|
|
||||||
|
$smarty->assign("users", $userAssocArray);
|
||||||
|
$smarty->display("user_export_list.tpl");
|
||||||
38
template/templates/user_export_list.tpl
Normal file
38
template/templates/user_export_list.tpl
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<div class="buttons">
|
||||||
|
<a href="/admin/members" class="addbutton big">Vissza</a>
|
||||||
|
<a href="/admin/export_users" class="addbutton add-big">Exportálás CSV-be</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="outer export">
|
||||||
|
<table class="user_export">
|
||||||
|
<tr>
|
||||||
|
<th>Név</th>
|
||||||
|
<th>Szint</th>
|
||||||
|
<th>Iskola</th>
|
||||||
|
<th>Email</th>
|
||||||
|
<th>Telefonszám</th>
|
||||||
|
<th>Szülő 1</th>
|
||||||
|
<th>Email</th>
|
||||||
|
<th>Telefonszám</th>
|
||||||
|
<th>Szülő 2</th>
|
||||||
|
<th>Email</th>
|
||||||
|
<th>Telefonszám</th>
|
||||||
|
</tr>
|
||||||
|
{foreach $users as $user}
|
||||||
|
<tr>
|
||||||
|
<td>{$user['Név']}</td>
|
||||||
|
<td>{$user['Szint']}</td>
|
||||||
|
<td>{$user['Iskola']}</td>
|
||||||
|
<td>{$user['Email']}</td>
|
||||||
|
<td>{$user['Telefonszám']}</td>
|
||||||
|
<td>{$user['Szülő1']}</td>
|
||||||
|
<td>{$user['Sz1_Email']}</td>
|
||||||
|
<td>{$user['Sz1_Telefonszám']}</td>
|
||||||
|
<td>{$user['Szülő2']}</td>
|
||||||
|
<td>{$user['Sz2_Email']}</td>
|
||||||
|
<td>{$user['Sz2_Telefonszám']}</td>
|
||||||
|
</tr>
|
||||||
|
{/foreach}
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
<a href="/admin/cities" class="addbutton add-big">Települések</a>
|
<a href="/admin/cities" class="addbutton add-big">Települések</a>
|
||||||
<a href="/admin/schools" class="addbutton add-big">Iskolák</a>
|
<a href="/admin/schools" class="addbutton add-big">Iskolák</a>
|
||||||
<a href="/admin/regions" class="addbutton add-big">Diákolimpia körzetek</a>
|
<a href="/admin/regions" class="addbutton add-big">Diákolimpia körzetek</a>
|
||||||
|
<a href="/admin/userlist" class="addbutton add-big">Lista export</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user