-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCardTypesGrid.php
More file actions
190 lines (145 loc) · 5.1 KB
/
CardTypesGrid.php
File metadata and controls
190 lines (145 loc) · 5.1 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<?php
/*********************************************************************************
* Filename: CardTypesGrid.php
* Generated with CodeCharge v.1.1.19
* PHP build 02/26/2001
*********************************************************************************/
include ("./common.php");
include ("./Header.php");
include ("./Footer.php");
session_start();
$sFileName = "CardTypesGrid.php";
check_security(2);
?><html>
<head>
<title>Book Store</title>
<meta name="GENERATOR" content="YesSoftware CodeCharge v.1.1.19 using 'PHP.ccp'">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="cache-control" content="no-cache">
</head>
<body style="background-color: #FFFFFF; color: #000000; font-family: Arial, Tahoma, Verdana, Helveticabackground-color: #FFFFFF; color: #000000; font-family: Arial, Tahoma, Verdana, Helvetica">
<center>
<table>
<tr>
<td valign="top">
<? Menu_Show() ?>
</td>
</tr>
</table>
</center>
<hr>
<table>
<tr>
<td valign="top">
<? CardTypes_Show() ?>
</td>
</tr>
</table>
<center>
<hr size=1 width=60%>
<table>
<tr>
<td valign="top">
<? Footer_Show() ?>
</td>
</tr>
</table>
<center><font face="Arial"><small>This dynamic site was generated with <a href="http://www.codecharge.com">CodeCharge</a></small></font></center>
</body>
</html>
<?
//********************************************************************************
function CardTypes_Show()
{
global $sFileName; //-- name of the current page
global $db; //-- database connection
global $sCardTypesErr; //-- error string
//-- SQL for order field
$sOrder = " order by c.name Asc";
$HasParam = false;
$iSort = get_param("FormCardTypes_Sorting");
$iSorted = get_param("FormCardTypes_Sorted");
//-- process sort commands
$sDirection = "";
$sSortParams = "";
if($iSort)
{
if($iSort == $iSorted)
{
$form_sorting = "";
$sDirection = " DESC";
$sSortParams = "FormCardTypes_Sorting=" . $iSort . "&FormCardTypes_Sorted=" . $iSort . "&";
}
else
{
$form_sorting = $iSort;
$sDirection = " ASC";
$sSortParams = "FormCardTypes_Sorting=" . $iSort . "&FormCardTypes_Sorted=" . "&";
}
if ($iSort == 1) $sOrder = " order by c.name" . $sDirection;
if (!strlen($sOrder)) $sDirection = "";
}
//-- table header
?>
<table style="">
<tr>
<td style="background-color: #336699; text-align: Center; border-style: outset; border-width: 1" colspan="1"><a name="CardTypes"><font style="font-size: 12pt; color: #FFFFFF; font-weight: bold">Card Types</font></a></td>
</tr>
<tr>
<td style="background-color: #FFFFFF; border-style: inset; border-width: 0"><a href="<?=$sFileName?>?<?=$transit_params?>FormCardTypes_Sorting=1&FormCardTypes_Sorted=<?=$form_sorting?>&"><font style="font-size: 10pt; color: #CE7E00; font-weight: bold">Name</font></a></td>
</tr>
<?
$sWhere = "";
//-- populate arrays for list of values
//-- complete SQL
$sSQL = "select c.card_type_id as c_card_type_id, " .
"c.name as c_name " .
" from card_types c ";
$sSQL = $sSQL . $sWhere . $sOrder;
//-- insert button
$form_action = "CardTypesRecord.php";
//-- do SQL query
$db->query($sSQL);
$is_next_record=false;
//-- show records
if($db->next_record())
{
//-- default values
//-- display rows
do
{
//-- retrieve data from the record
$fldname = $db->f("c_name");
//-- display current record
?>
<tr>
<td style="background-color: #FFFFFF; border-width: 1"><font style="font-size: 10pt; color: #000000"><a href="CardTypesRecord.php?card_type_id=<?= tourl($db->f("c_card_type_id"))?>&<?=$transit_params?>"><font style="font-size: 10pt; color: #000000"><?= tohtml($fldname) ?></font></a> </font></td>
</tr>
<?
$is_next_record = @$db->next_record();
} while($is_next_record );
}
else //-- there are no records
{
//$db->num_rows() == 0 || ($iPage - 1)*$RecordsPerPage >= $db->num_rows())
?>
<tr><td colspan="1" style="background-color: #FFFFFF; border-width: 1"><font style="font-size: 10pt; color: #000000">No records</font></td></tr>
<tr><td colspan="1" style="background-color: #FFFFFF; border-style: inset; border-width: 0"><font style="font-size: 10pt; color: #CE7E00; font-weight: bold">
<a href="<?= $form_action ?>?<?= $transit_params ?>"><font style="font-size: 10pt; color: #CE7E00; font-weight: bold">Insert</font></a>
</table>
<?
return;
}
//-- last row of the table is for scroller and "insert" link
?>
<tr><td colspan="1" style="background-color: #FFFFFF; border-style: inset; border-width: 0"><font style="font-size: 10pt; color: #CE7E00; font-weight: bold">
<a href="<?= $form_action ?>?<?= $transit_params ?>"><font style="font-size: 10pt; color: #CE7E00; font-weight: bold">Insert</font></a>
<?
//-- the end of the last row and the end of the table
?>
</font></td></tr>
</table>
<?
}
?>