الفصل الخامس
154
البرنامج النصي admin.php (تابع)
130. $to = $r_cust["email"];
mail($to, COMPANY_NAME. " Order!", $message, "From: COMPANY_NAME
131.
132.
?>
COMPANY_EMAIL
">");
133. <h3>Status Changed!</h3>
134.
<p>The status has been updated and an email has been sent to the customer.
135. <p>Click <a href="admin.php">here</a> to return to the administration page.
136.
<?
137. } //end update_order_process
138.
139. function get_customer ($id) {
140. global $dbconn;
141.
142.
143.
144.
145.
$sql = "select from customers where id= '$id'"; $result = $dbconn->query($sql);
errortrap($result);
$result->fetchinto ($row);
return $row;
146. } //end get_customer
147.
148. function display_customer ($r_cust) {
<h3>Customer Details</h3>
149.
?>
150.
151.
152.
153.
154.
155.
156. 157.
158.
159.
160.
161.
<table border=1 cellpadding=5 cellspacing=0> <tr><td>Customer ID</td><td><?=$r_cust["id"]?></td></tr> <tr><td>First Name </td><td><?=$r_cust["first"]?></td></tr> <tr><td>Middle Initial </td><td><?=$r_cust["mi"]?></td></tr> <tr><td>Last Name </td><td><?=$r_cust ["last"]?></td></tr> <tr><td>Address </td><td><?=$r_cust["address1"]?></td></tr> <tr><td>Address 2 </td><td><?=$r_cust["address2"]?></td></tr> <tr><td>City </td><td><?=$r_cust["city"]?></td></tr> <tr><td>State </td><td><?=$r_cust["state"]?></td></tr>
<tr><td>Zip </td><td><?=$r_cust["zip"]?></td></tr>
<tr><td>Country </td><td><?=$r_cust["country"]?></td></tr>
162. <tr><td>Ship to Billing Address?
</td><td><?=$r_cust["shiptobilling"]?></td></tr>
ص١٥٤