-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdbshow_body.inc.php
More file actions
93 lines (85 loc) · 3.41 KB
/
dbshow_body.inc.php
File metadata and controls
93 lines (85 loc) · 3.41 KB
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
88
89
90
91
92
93
<? if (!defined('IN_ENGINE')) {die('forbidden');}
# Output Body
switch ($outfmt) {
default:
## Inner Header
switch ($outfmt) {
case 'webpage':
if ($cp>1) {echx($fwhandle,'<tr><td colspan="0"> </td></tr>');}
break;
case 'webpage_list':
echx($fwhandle,"<tr>");
break;
case 'xml':
echx($fwhandle,"<contact>\n");
break;
case 'json':
if ($cp>1) {echx($fwhandle,",\n");}
echx($fwhandle,"{\n");
break;
}
$xnel=0;
## Inner Body
if ($shwctrls && auth_user('DELM,FAVM','|')) {
$cfk='id';
echo fmtcheckbox($outfmt,$dbey[$cfk]);
# fmtoitem($outfmt,'ID',$dbey[$cfk]));
}
# $cfk='id'; if (auth_usrvwx($cfk,$dbdat) && (!$useminimitems || ($useminimitems && in_array($cfk,$minimitems)))) { if ($dbey[$cfk] || $showeft) {$xnel++; echx($fwhandle,fmtoitem($outfmt,'ID',$dbey[$cfk]));} }
$cfk='starr'; if (auth_usrvwx($cfk,$dbdat) && (!$useminimitems || ($useminimitems && in_array($cfk,$minimitems)))) { if ($dbey[$cfk] || $showeft) {$xnel++; echx($fwhandle,fmtoitem($outfmt,'Fav',$dbey[$cfk]));} }
$cfk='name'; if (auth_usrvwx($cfk,$dbdat) && (!$useminimitems || ($useminimitems && in_array($cfk,$minimitems)))) { if ($dbey[$cfk] || $showeft) {$xnel++; echx($fwhandle,fmtoitem($outfmt,'Name',$dbey[$cfk]));} }
$cfk='lname'; if (auth_usrvwx($cfk,$dbdat) && (!$useminimitems || ($useminimitems && in_array($cfk,$minimitems)))) { if ($dbey[$cfk] || $showeft) {$xnel++; echx($fwhandle,fmtoitem($outfmt,'Last Name',$dbey[$cfk]));} }
$cfk='gend'; if (auth_usrvwx($cfk,$dbdat) && (!$useminimitems || ($useminimitems && in_array($cfk,$minimitems)))) {
switch ($dbey[$cfk]) {
case 1:
$vt='Male';
break;
case 2:
$vt='Female';
break;
default:
$vt='Unspecified';
break;
}
if ($vt || $showeft) {$xnel++; echx($fwhandle,fmtoitem($outfmt,'Gender',$vt));}
}
$cfk='bday'; if (auth_usrvwx($cfk,$dbdat) && (!$useminimitems || ($useminimitems && in_array($cfk,$minimitems)))) {
$vt=dateread($dbey[$cfk]); if ($vt || $showeft) {$xnel++; echx($fwhandle,fmtoitem($outfmt,'Birthday',$vt));}
}
$cfk='address'; if (auth_usrvwx($cfk,$dbdat) && (!$useminimitems || ($useminimitems && in_array($cfk,$minimitems)))) { if ($dbey[$cfk] || $showeft) {$xnel++; echx($fwhandle,fmtoitem($outfmt,'Address',$dbey[$cfk]));} }
$cfk='phonecell'; if (auth_usrvwx($cfk,$dbdat) && (!$useminimitems || ($useminimitems && in_array($cfk,$minimitems)))) { if ($dbey[$cfk] || $showeft) {$xnel++; echx($fwhandle,fmtoitem($outfmt,'Mobile Phone',$dbey[$cfk]));} }
$cfk='email'; if (auth_usrvwx($cfk,$dbdat) && (!$useminimitems || ($useminimitems && in_array($cfk,$minimitems)))) {
$vt=shwemail($dbey[$cfk],$user_email); if ($vt || $showeft) {$xnel++; echx($fwhandle,fmtoitem($outfmt,'E-mail',$vt));}
}
$cfk='www'; if (auth_usrvwx($cfk,$dbdat) && (!$useminimitems || ($useminimitems && in_array($cfk,$minimitems)))) { if ($dbey[$cfk] || $showeft) {$xnel++; echx($fwhandle,fmtoitem($outfmt,'Web site',$dbey[$cfk]));} }
## Inner Footer
switch ($outfmt) {
case 'webpage_list':
echx($fwhandle,"</tr>");
break;
case 'txt':
case 'html':
case 'csv':
echx($fwhandle,"\n");
break;
case 'xml':
echx($fwhandle,"</contact>\n");
break;
case 'json':
echx($fwhandle,"}\n");
break;
}
break;
# Output formats which require special handling
case 'raw':
echx($fwhandle,'# '.$cp.'. ');
$rlen=count($dbey);
for ($i=0;$i<=$rlen-1;$i++) {
// echx($fwhandle,'');
echx($fwhandle,'"'.addslashes($dbey[$i]).'"');
if ($i<$rlen) {echx($fwhandle,', ');}
}
echx($fwhandle,"\n");
break;
}
?>