-
Notifications
You must be signed in to change notification settings - Fork 4
/
addEventC.php
125 lines (101 loc) · 2.89 KB
/
addEventC.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
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
<?php
$page_title = "Select a customer";
require_once 'header.php';
require_once 'inc_OnlineStoreDB.php';
//PROCEDURAL
//$DBConnect = @mysqli_connect('localhost', 'root', 'Itsmeagain007#', 'kc');
$query = "select CustNo, CustFN, CustLN from customer ORDER BY custLN";
echo $query;
/*$result = mysql_query($query) or die(mysql_error());
if (!$result) {
echo "Could not successfully run query ($query) from DB: " . mysql_error();
exit;
}
//echo "<br>result:<br>".$result."<br><br>";
echo "<br><br>";
if (mysql_num_rows($result) == 0) {
echo "No rows found, nothing to print so am exiting";
exit;
}
*/
// While a row of data exists, put that row in $row as an associative array
// Note: If you're expecting just one row, no need to use a loop
// Note: If you put extract($row); inside the following loop, you'll
// then create $userid, $fullname, and $userstatus
?>
<b><br><font size = "4" type="arial">Add event/Work In Progress/Unconfirmed Order for Customer</b></font>
</br>
</br>
<form name="Editcust" action="addEventCustProcess.php" method="post">
<select name="mydropdownEC" onchange='this.form.submit()'>
<option value="_no_selection_">Select Customer</option>";
<?php
echo "<br>firstWhile:<br><br>";
//print "<option value='$item'>$item";
//print " </option>";
//while ($row = mysql_fetch_assoc($result)) {
if ($result = mysqli_query($DBConnect, $query)) {
while ($row = mysqli_fetch_assoc($result)) {
$item1 = $row["CustNo"];
$item2 = $row["CustLN"];
$item3 = $row["CustFN"];
print "<option value='$item1'>$item2";
print "_".$item1;
print "_".$item3;
//print "<option value='$item2'>$item2";
//print "<option value='$item3'>$item3";
print " </option>";
//echo $row["CustNo"];//case sensitive!
//echo $row["CustFN"];//case sensitive!
//echo $row["CustLN"];//case sensitive!
}
$result->free();
//mysql_free_result($result);
}
/* close connection */
//$mysqli->close();
?>
<input type="submit" name="btn_submit" value="select customer" />
</select></p>
<?php
require_once 'view_event_all.php';
/*
echo "<br>2ndWhile:<br><br>";
echo "<br>";
while($row=mysql_fetch_assoc($result))
{
echo '<option value = "'.$row['CustNo'].'">'.$row['CustFN'].'</option>';
}
*/
//$num=mysql_numrows($result);
//mysql_close();
//$i=0;
/*while($i<$num) {
$zone=mysql_result($result,$i,"zone");
$spot_name=mysql_result($result,$i,"spot_name");
echo "<option value="$spot_name">$spot_name</option>";
$i++;
*/
//
//echo "<br>3rdWhile:<br><br>";
/*
while ($row = mysql_fetch_array($result)) {
echo "The max no CustNo in customer table is: ". $row[0];
echo "&nbps;";
//$daNextNo = intval($row[0])+1;
}
*/
?>
<?php
/*echo "<br>4thWhile:<br><br>";
while ($row = mysql_fetch_array($result))
{
//$var_term;
foreach($row as $item)
{
print "<option value='$item'>$item";
print " </option>";
}
}
*/
?>