GIF89a php
Current File : /home/viralhoga/public_html/adminpanel/editprofile.php
<?php
include("include/admin-main.php"); 
include("include/header.php");
 
$id = $_REQUEST['regId'];
$sql="SELECT * FROM register WHERE reg_id = '".$id."' ";
$result=mysqli_query($con,$sql);
$row= mysqli_fetch_array($result);
extract($row);

if(isset($_POST['updateProfile'])){
	
         $id = $_REQUEST['id'];
		
       $update = mysqli_query($con,"UPDATE register SET cfname = '".$_POST['cfname']."',clname = '".$_POST['clname']."',cemail = '".$_POST['cemail']."',ctel = '".$_POST['ctel']."',cadd1 = '".$_POST['cadd1']."',cadd2 = '".$_POST['cadd2']."',ccity = '".$_POST['ccity']."',cpincode = '".$_POST['cpincode']."',cstate = '".$_POST['cstate']."' WHERE reg_id = '".$id."' "); 
     if($update){?>
     <script>
	 alert('Profile has been updated successfully!');
	 window.location='<?php echo $_POST['ccompany']?>.php';
	 </script>
<?php            
         		
				
		 }
  }
?>
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="shortcut icon" href="img/favicon.png">
<title>Update Profile</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-reset.css" rel="stylesheet">
<!--external css-->
<link href="assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
<!-- Custom styles for this template -->
<link href="css/style.css" rel="stylesheet">
<link href="css/style-responsive.css" rel="stylesheet" />
<link href="../css/pro_dropdown_2.css" rel="stylesheet" type="text/css">
</head>
<body>
<?php include 'popup.php';?>
<!--header end-->
<!--sidebar start-->
<?php  include 'menu.php' ?>
<!--sidebar end-->
<!--main content start-->
<section id="main-content">
  <section class="wrapper">
    <!-- page start-->
    <div class="row">
      <div class="col-lg-12">
        <section class="panel">
		<header class="panel-heading"><b>Profile Details</b></header>
          <form method="post">
		  <input type="hidden" name="id" value="<?php echo $_REQUEST['regId']?>">
		  <input type="hidden" name="ccompany" value="<?php if($ccompany=="customer")echo "regis";else echo "vendor-regis";?>">
		  <table class="table table-striped table-advance table-hover">
            <thead>
                <tr><th>First Name</th><td><input type="text" name="cfname" class="form-control" value="<?php echo $cfname;?>"></td></tr>
				<tr><th>Last Name</th><td><input type="text" name="clname" class="form-control" value="<?php echo $clname;?>"></td></tr>
				<tr><th>Email</th><td><input type="text" name="cemail" class="form-control" value="<?php echo $cemail;?>"></td></tr>
                <tr><th>Phone</th><td><input type="text" name="ctel" class="form-control" value="<?php echo $ctel;?>"></td></tr>
                <tr><th>Address1</th><td><input type="text" name="cadd1" class="form-control" value="<?php echo $cadd1;?>"></td></tr>
				<tr><th>Address2</th><td><input type="text" name="cadd2" class="form-control" value="<?php echo $cadd2;?>"></td></tr>
				<tr><th>State</th><td><input type="text" name="cstate" class="form-control" value="<?php echo $cstate;?>"></td>
				<tr><th>City</th><td><input type="text" name="ccity" class="form-control" value="<?php echo $ccity;?>"></td>
				<tr><th>PIN Code</th><td><input type="text" name="cpincode" class="form-control" value="<?php echo $cpincode;?>"></td></tr>
				<tr><td colspan="2"><input type="submit" name="updateProfile" class="btn btn-send" value="Update Profile"></td></tr>
            </thead>
          </table>
		  </form>
        </section>
      </div>
      <!----popup ---->
      <!----end popup  ----->
    </div>
    <!-- page end-->
  </section>
</section>
<!--main content end-->
</section>
<!-- js placed at the end of the document so the pages load faster -->
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<script class="include" type="text/javascript" src="js/jquery.dcjqaccordion.2.7.js"></script>
<script src="js/jquery.scrollTo.min.js"></script>
<script src="js/jquery.nicescroll.js" type="text/javascript"></script>
<script src="js/respond.min.js" ></script>
<!--common script for all pages-->
<script src="js/common-scripts.js"></script>
</body>
</html>