-
Notifications
You must be signed in to change notification settings - Fork 3
/
export_directory_exc.php
75 lines (67 loc) · 2.01 KB
/
export_directory_exc.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
64
65
66
67
68
69
70
71
72
73
74
75
<? define("__HIDE_TEST__", "_KeAr_PHP_WEB_"); ?>
<?
@extract($_REQUEST);
require_once ('./connect.inc.php');
require_once ('./sess.inc.php');
require_once ('./common.inc.php');
require_once ('./common_user.inc.php');
if (!IsLoggedManager() && !IsLoggedRegistrator() && !IsLoggedSmallAdmin() && !IsLoggedAdmin())
{
header("location: ".$g_baseadr."error.php?code=21");
exit;
}
$par1 = (IsSet($par1) && is_numeric($par1)) ? $par1 : 1;
$par2 = (IsSet($par2) && is_numeric($par2)) ? $par2 : 1;
$par3 = (IsSet($par3) && is_numeric($par3)) ? $par3 : 1;
$oris = (IsSet($oris) && is_numeric($oris)) ? $oris : 0;
switch($par1)
{
case 2:
$delim = "\t";
break;
case 1:
default:
$delim = ';';
}
TXT_Header();
db_Connect();
$query = "SELECT * FROM ".TBL_USER." WHERE hidden = 0 ORDER BY sort_name ASC";
@$vysledek=query_db($query)
or die("Chyba při provádění dotazu do databáze.");
require_once ('exports.inc.php');
if ($oris == 2)
{
$users = new ORIS_Export($g_shortcut);
while ($zaznam=mysqli_fetch_array($vysledek))
{
$users->add_line_contact($zaznam['reg'],$zaznam['email'], $zaznam['tel_mobil'], $zaznam['adresa'], $zaznam['mesto'], $zaznam['psc'],$zaznam['narodnost']);
}
echo($users->generate_contacts());
}
else if ($oris == 1)
{
$users = new ORIS_Export($g_shortcut);
while ($zaznam=mysqli_fetch_array($vysledek))
{
$users->add_line_user($zaznam['prijmeni'], $zaznam['jmeno'], $zaznam['reg'], $zaznam['si_chip'], $zaznam['poh'], $zaznam['narodnost'], $zaznam['datum'], $zaznam['rc']);
}
echo($users->generate_users());
}
else if ($oris == 3)
{
$users = new ORIS_Export($g_shortcut);
while ($zaznam=mysqli_fetch_array($vysledek))
{
$users->add_line_registration($zaznam['prijmeni'], $zaznam['jmeno'], $zaznam['reg']);
}
echo($users->generate_registration());
}else
{
$users = new CSV_Export($g_shortcut,$delim,$par2,$par3);
while ($zaznam=mysqli_fetch_array($vysledek))
{
$users->add_line_user($zaznam);
}
echo($users->generate_users());
}
?>