this is at the very first line in my page
Expand|Select|Wrap|Line Numbers
- if(isset($_GET['save']) && $_GET['save']=="yes" && isset($_GET['cid']))
- {
- $cust_id=$_GET['cid'];
- $edit_cname=$_POST['edit_cname'];
- $edit_caddr=$_POST['edit_caddr'];
- $edit_cphno1=$_POST['edit_cphno1'];
- $edit_cphno2=$_POST['edit_cphno2'];
- $edit_cemail=$_POST['edit_cemail'];
- $edit_web=$_POST['edit_cweb'];
- if(is_numeric($edit_cphno1) && is_numeric($edit_cphno2))
- {
- @$up=mysql_query("update pms_customer set cust_name='$edit_cname',cust_addr='$edit_caddr',cust_ph=$edit_cphno1,cust_ph1=$edit_cphno2,email='$edit_cemail',website='$edit_web' where cust_id=$cust_id") or die('Unable to perform operation');
- header("location:cust_index.php?action1=dis&cid=$cust_id");
- }
- }
- <body bgcolor="#dbdbdb">
- <?php
- if(isset($_GET['action1']) && $_GET['action1']=="dis")
- {
- include('adminlogin.php');
- $query=mysql_query("select cust_name,cust_id from pms_customer");
- ?>
- <form action="" method="post" name="cust">
- <br />
- <center>
- Select Customer Name :
- <select name="cname" id="cname" onChange="cust_display()">
- <option value="0">--Select--</option>
- <?php
- while($r=mysql_fetch_object($query))
- {
- if(isset($_GET['cid']))
- {
- $cid=$_GET['cid'];
- if($cid==$r->cust_id)
- {
- ?>
- <option value="<?php echo $r->cust_id;?>" selected="selected"><?php echo $r->cust_name;?></option>
- <?php
- }
- else
- {
- ?>
- <option value="<?php echo $r->cust_id;?>"><?php echo $r->cust_name;?></option>
- <?php
- }
- }
- else
- {
- ?>
- <option value="<?php echo $r->cust_id;?>"><?php echo $r->cust_name;?></option>
- <?php
- }
- }
- ?>
- </select>
- <?php
- if(isset($_GET['cid']))
- {
- $cust_id=$_GET['cid'];
- $query=mysql_query("select * from pms_customer where cust_id=$cust_id");
- $res=mysql_fetch_object($query);
- ?>
- [<a href="cust_index.php?action=del">Delete</a>]
- <br /><br />
- <fieldset>
- <legend>Customer Details</legend>
- <table align="center" cellspacing="9">
- <tr><td>Customer Name </td><td>:</td><td>
- <?php
- if(isset($_GET['action']) && $_GET['action']=="edit_cust")
- {
- ?>
- <input type="text" name="edit_cname" value="<?php echo $res->cust_name;?>" />
- <?php
- }
- else
- {
- echo $res->cust_name;
- }
- ?></td></tr>
- <tr><td>Address </td><td>:</td><td>
- <?php
- if(isset($_GET['action']) && $_GET['action']=="edit_cust")
- {
- ?>
- <textarea cols="25" rows="3" name="edit_caddr"><?php echo $res->cust_addr;?></textarea>
- <?php
- }
- else
- {
- echo $res->cust_addr;
- }
- ?>
- </td></tr>
- <tr><td>Phone Number1 </td><td>:</td><td>
- <?php
- if(isset($_GET['action']) && $_GET['action']=="edit_cust")
- {
- ?>
- <input type="text" name="edit_cphno1" value=<?php echo $res->cust_ph;?> />
- <?php
- }
- else
- {
- echo $res->cust_ph;
- }
- ?>
- </td></tr>
- <tr><td>Phone Number2 </td><td>:</td><td>
- <?php
- if(isset($_GET['action']) && $_GET['action']=="edit_cust")
- {
- ?>
- <input type="text" name="edit_cphno2" value="<?php echo $res->cust_ph1;?>" />
- <?php
- }
- else
- {
- echo $res->cust_ph1;
- }
- ?>
- </td></tr>
- <tr><td>Email - ID </td><td>:</td><td>
- <?php
- if(isset($_GET['action']) && $_GET['action']=="edit_cust")
- {
- ?>
- <input type="text" name="edit_cemail" value="<?php echo $res->email;?>" />
- <?php
- }
- else
- {
- echo $res->email;
- }
- ?>
- </td></tr>
- <tr><td>Web Site </td><td>:</td><td>
- <?php
- if(isset($_GET['action']) && $_GET['action']=="edit_cust")
- {
- ?>
- <input type="text" name="edit_cweb" value="<?php echo $res->website;?>" />
- <?php
- }
- else
- {
- echo $res->website;
- }
- ?>
- </td></tr>
- <tr><td colspan="3" align="center">
- <?php
- if(isset($_GET['action']) && $_GET['action']=="edit_cust")
- {
- ?>
- [<a href="cust_index.php?save=yes&cid=<?php echo $cust_id;?>">Save</a>] [<a href="cust_index.php?action1=dis&cid=<?php echo $cust_id;?>">Cancel</a>]
- <?php
- }
- else
- {
- ?>
- <tr><td colspan="3" align="center">[<a href="cust_index.php?action=edit_cust&action1=dis&cid=<?php echo $cust_id;?>">Edit Section</a>]
- <?php
- }
- ?>
- </td></tr>
- </table>