PHP1
Expand|Select|Wrap|Line Numbers
- <?php
- require_once 'header.php';
- ?>
- <style type="text/css">
- <!--
- .style1 {
- font-size: 24px;
- font-family: "Times New Roman", Times, serif;
- color: #FF0000;
- }
- .style7 {color: #FF0000}
- .style8 {color: #000000}
- .style10 {color: #000066}
- .style11 {color: #0000FF}
- .style12 {font-size: 24px}
- -->
- </style>
- <table width="507" height="122" border="5" align="center" bordercolor="#00FFFF">
- <tr>
- <td width="497"><div align="center" class=" style11 style12">Edit Administrator's Information </div></td>
- </tr>
- <tr>
- <form action="customeredit1.php" method="post" name="form1" id="form1">
- <td width="497" bordercolor="#00FFFF"><div align="center">
- <p class="style2"> <span class="style8">Insert Product Order's Customer Name To Modify The Information </span><br />
- <input name="txt1" type="text" id="txt1" size="50" maxlength="60" />
- </p>
- <p class="style2">
- <input name="button2" type="submit" id="button2" value="Search" />
- </p>
- <p class="style2"><span class="style2 style7">*<span class="style10">User can't modify the customer's name in this page! </span>*</span></p>
- </div></td>
- </form>
- </tr>
- </table>
- <p align="center"><a href=adminpage.php>Click here back to Main Menu</a></p>
- <p align="center" class="style1">
- <?php
- require_once 'footer.php';
- ?>
- </p>
Expand|Select|Wrap|Line Numbers
- <?php
- require_once 'header.php';
- ?>
- <style type="text/css">
- <!--
- .style12 {
- font-weight: bold;
- font-family: Arial, Helvetica, sans-serif;
- }
- .style16 {color: #CC0000}
- .style5 {font-family: Arial, Helvetica, sans-serif}
- .style19 {color: #FF0000}
- .style20 {color: #000066}
- .style17 {font-size: 12px}
- .style22 {font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: 12px; }
- -->
- </style>
- <form name="form1" method="post" action="customeredit2.php">
- <table width="717" border="1" align="center">
- <?php
- $txt = $_POST["txt1"];
- $sql = "SELECT * from mailnow where customerid LIKE '%$txt%'";
- $result = mysql_query($sql)
- or die("SQL select statement failed");
- $record=mysql_num_rows($result);
- if ($txt == "")
- {
- echo'
- <SCRIPT LANGUAGE="JavaScript">
- window.alert("Please insert name!");
- </SCRIPT>';
- require "customeredit.php";
- return;
- }
- elseif ($record==0)
- {
- echo'
- <SCRIPT LANGUAGE="JavaScript">
- window.alert("Record not found!");
- </SCRIPT>';
- require "customeredit.php";
- return;
- }
- elseif ($record)
- {
- while ($row = mysql_fetch_array($result))
- {
- $product = $row["product"];
- $mailtype = $row["mailtype"];
- $mailboxes = $row["mailboxes"];
- $price= $row["price"];
- $name= $row["name"];
- $company = $row["company"];
- $department = $row["department"];
- $address1 = $row["address1"];
- $address2 = $row["address2"];
- $city = $row["city"];
- $state = $row["state"];
- $zip = $row["zip"];
- $email = $row["email"];
- $contact = $row["contact"];
- }
- }
- ?>
- <tr>
- <td width="207" align="left" bgcolor="#9999FF"><div align="left" class="style22">Product Information </div></td>
- <td width="494" bgcolor="#9999FF"><div align="left"><?php echo("<input name='product' type='text' value='$product' size='60'/>") ; ?></div></td>
- </tr>
- <tr>
- <td align="left" bgcolor="#9999FF"><div align="left" class="style22">Type</div></td>
- <td bgcolor="#9999FF"><div align="left"><?php echo("<input name='mailtype' type='text' value='$mailtype' size='60'/>") ; ?></div></td>
- </tr>
- <tr>
- <td align="left" bgcolor="#9999FF"><span class="style22">No. of mailboxes / No.of computers : </span></td>
- <td bgcolor="#9999FF"><?php echo("<input name='mailboxes' type='text' value='$mailboxes' size='60'/>") ; ?></td>
- </tr>
- <tr>
- <td align="left" bgcolor="#9999FF"><span class="style22">Price </span></td>
- <td bgcolor="#9999FF"><?php echo("<input name='price' type='text' value='$price' size='60'/>") ; ?></td>
- </tr>
- <tr>
- <td align="left" bgcolor="#9999FF"><span class="style22">Name </span></td>
- <td bgcolor="#9999FF"><?php echo("<input name='name' type='text' value='$name' size='60'/>") ; ?></td>
- </tr>
- <tr>
- <td align="left" bgcolor="#9999FF"><span class="style22">Company</span></td>
- <td bgcolor="#9999FF"><?php echo("<input name='company' type='text' value='$company' size='60'/>") ; ?></td>
- </tr>
- <tr>
- <td align="left" bgcolor="#9999FF"><span class="style22">Department</span></td>
- <td bgcolor="#9999FF"><?php echo("<input name='department' type='text' value='$department' size='60'/>") ; ?></td>
- </tr>
- <tr>
- <td align="left" bgcolor="#9999FF"><div align="left" class="style22">Address 1</div></td>
- <td bgcolor="#9999FF"><div align="left"><?php echo("<input name='address1' type='text' value='$address1' size='60'/>") ; ?></div></td>
- </tr>
- <tr>
- <td align="left" bgcolor="#9999FF"><div align="left" class="style22"><strong>Address 2</strong></div></td>
- <td bgcolor="#9999FF"><div align="left"><?php echo("<input name='address2' type='text' value='$address2' size='60'/>") ; ?></div></td>
- </tr>
- <tr>
- <td align="left" bgcolor="#9999FF"><span class="style22">City</span></td>
- <td bgcolor="#9999FF"><?php echo("<input name='city' type='text' value='$city' size='60'/>") ; ?></td>
- </tr>
- <tr>
- <td align="left" bgcolor="#9999FF"><span class="style22">State</span></td>
- <td bgcolor="#9999FF"><?php echo("<input name='state' type='text' value='$state' size='60'/>") ; ?></td>
- </tr>
- <tr>
- <td align="left" bgcolor="#9999FF"><span class="style22">Zip</span></td>
- <td bgcolor="#9999FF"><?php echo("<input name='zip' type='text' value='$zip' size='60'/>") ; ?></td>
- </tr>
- <tr>
- <td align="left" bgcolor="#9999FF"><span class="style22">E-mail </span></td>
- <td bgcolor="#9999FF"><?php echo("<input name='email' type='text' value='$email' size='60'/>") ; ?></td>
- </tr>
- <tr>
- <td align="left" bgcolor="#9999FF"><span class="style22">Contact Number</span></td>
- <td bgcolor="#9999FF"><?php echo("<input name='contact' type='text' value='$contact' size='60'/>") ; ?></td>
- </tr>
- </table>
- <p align="center"><span class="style19">*</span> <span class="style20">This page cannot modify the administrator's name. </span><span class="style19">*</span> </p>
- <div align="center">
- <input type="submit" name="submit" value="MODIFY">
- <input type="reset" name="Submit2" value="RESET">
- <input type="submit" name="submit" value="CANCEL" />
- </div>
- </form>
- <?php
- require_once 'footer.php';
- ?>
Expand|Select|Wrap|Line Numbers
- <?php
- require_once 'header.php';
- ?>
- <?php
- $product = $_POST["product"];
- $mailtype = $_POST["mailtype"];
- $mailboxes = $_POST["mailboxes"];
- $price = $_POST["price"];
- $name = $_POST["name"];
- $company = $_POST["company"];
- $department = $_POST["department"];
- $address1 = $_POST["address1"];
- $address2 = $_POST["address2"];
- $city = $_POST['city'];
- $state = $_POST['state'];
- $zip = $_POST['zip'];
- $email = $_POST['email'];
- $contact = $_POST['contact'];
- $submit = $_POST['submit'];
- $sql = "SELECT * from mailnow where customerid = '$customerid'";
- $result = mysql_query($sql) or die("SQL select statement failed!");
- $result=mysql_query($sql);
- if ($submit=="MODIFY")
- {
- $sql = "UPDATE mailnow SET product='$product', mailtype='$mailtype', mailboxes='$mailboxes', price='$price' , name='$name' where customerid = '$customerid'";
- $result = mysql_query($sql) or die("SQL select statement failed");
- if ($result)
- {
- require "customeredit.php";
- echo'
- <SCRIPT LANGUAGE="JavaScript">
- window.alert ("Updated Success !!!");</SCRIPT>';
- }
- else { die(mysql_error()); }
- }
- elseif ($submit=="CANCEL")
- {
- require "customeredit.php";
- }
- else { die(mysql_error()); }
- ?>
- <?php
- require_once 'footer.php';
- ?>