System: Windows NT WINDOWS18 10.0 build 17763 (Windows Server 2016) AMD64 | User: IWPD_3544(appclien)

Path: D:\Inetpub\vhosts\appclients.in\fruits-vegitables.nmvm.org\vendor

[Back to List]
<?php
    include("include/admin-main.php"); 
    include("include/header.php");
	$obj=new admin();
    $id = $_REQUEST['regId'];
    $reg_details=$obj->select_objData("register","where reg_id = '".$id."'");
	$row = mysqli_fetch_array($reg_details);
    @extract($row); 

function upload($source, $dest)
{
  //move_uploaded_file
  if(@copy($source,$dest)== false){
    return (':( Sorry...');
  } else {
    return  ':) success';
  }

}

if(isset($_POST['updateProfile'])){
	
         $id = $_REQUEST['id'];
		 $companyname = $_POST['companyname'];
		 $gstno = $_POST['gstno'];
		 $tmpName = $_FILES['addressproof']['tmp_name'];
		 if(is_uploaded_file($tmpName)){
		   $addressproof = md5(rand()).$_FILES['addressproof']['name'];
		   move_uploaded_file($tmpName,"img/".$addressproof);
		 }else{
		  $addressproof=$_POST['imgName'];
		 }
		
       $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']."',companyname = '".$companyname."',gstno = '".$gstno."',addressproof = '".$addressproof."' WHERE reg_id = '".$id."' "); 
     if($update){?>
     <script>
	 alert('Your Profile has been updated successfully!');
	 window.location='regis.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" enctype="multipart/form-data">
		  <input type="hidden" name="id" value="<?php echo $_REQUEST['regId']?>">
		  <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><th>Company Name</th><td><input type="text" name="companyname" class="form-control" value="<?php echo $companyname;?>"></td></tr>
				<tr><th>GST No.</th><td><input type="text" name="gstno" class="form-control" value="<?php echo $gstno;?>"></td></tr>
				<tr><th><input type="hidden" name="imgName" value="<?php echo $addressproof?>" /><img src="img/<?php echo $addressproof?>" style="height:50px; padding:5px" />Addhar Card/PAN Card</th><td><input type="file" name="addressproof" class="form-control"></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>