JezK
Edit File: vendorprofile.php
<?php include('vendor_header.php'); include_once 'databaseConn.php'; include_once './lib/requestHandler.php'; $DatabaseCo = new DatabaseConn(); $percentPicture = ""; if(isset($_POST['imgFlag'])) { $bgImage = ""; $flag = 0; $result = 0; if($_FILES['picture']['size'] > 0) { $bgImage = $_FILES['picture']['name']; $bgImage = str_replace(' ','_',$bgImage); $path = ''; $targetDirectory = 'userPics/'; $bgImageFileName=time().$bgImage; $bgImageName = $targetDirectory.$bgImageFileName; if(move_uploaded_file($_FILES['picture']['tmp_name'], $path.$bgImageName)) //upload success { $bgImage = $bgImageFileName; $flag = 1; } else //error in upload picture.please check folder permissions { $flag = 0; echo "<script>alert('Error!!! Unable to upload picture.')</script>"; echo "<script>location.replace('profile.php')</script>";exit; } } if($flag == 1) //picture uploaded succesfully { $result = $userobj->uploadPicture($userID,$bgImage); } if($result == -3) //error saving picture in db { echo "<script>alert('Error!!! Unable to save picture.')</script>"; } elseif($result == 1) //picture saved successfully { $_SESSION['profilePicture'] = 'userPics/'.$bgImage; echo "<script>alert('Picture uploaded successfully.')</script>"; echo "<script>location.replace('profile.php')</script>";exit; } } $modal="data-toggle='modal' data-target='#sessionModal'"; $link="href='#'"; if(isset($_SESSION['email']) && isset($_SESSION['gender123'])) { if($_SESSION['email']!='' && $_SESSION['gender123']) { $link="href='messages.php'"; $modal=''; }else { $link="href='#'"; $modal="data-toggle='modal' data-target='#sessionModal'"; } } ?> <div class="row"> <div class="col-sm-3"> <div class="parent"> <img id="blah" src="img/ne-no-photo-img.png" alt="" class="profilepic" /> <input type="hidden" name="prfoldimg" id="prfoldimg" value="<?php echo $_SESSION['profilePicture']; ?>"/> </div> <!-- file upload end --> <div> <div id="uploaded_images" class="uploaded-images"> <div id="error_div"> </div> <div id="success_div"> </div> </div> <a href="#" style="display: block;text-align: center;line-height: 45px;" class="updateProfile">Upload multiple photos </a> <input type="button" value="Update Profile" class="updateProfile"> </div> <div class="loading"> <h2 class="hdng2">100% of Profile Updated</h2> </div> <?php //include "page-parts/quick_search_home.php";?> </div> <div class="col-sm-9"> <div class="row"> <a href="#"><div class="col-sm-6 col-md-4"> <section class="blueBox"> <img src="img/messages.png"> <h1>Message</h1> </section> </div> </a> <a href="#"><div class="col-sm-6 col-md-4"> <section class="greenBox"> <img src="img/chat.png"> <h1>Chat</h1> </section> </div></a> <a href="#"><div class="col-sm-6 col-md-4"> <section class="greenBox2"> <img src="img/noti.png"> <h1>Notifications</h1> </section> </div></a> <a href="#"><div class="col-sm-6 col-md-4"> <section class="viletBox"> <img src="img/upgrade.png"> <h1>Upgrade</h1> </section> </div></a> <a href="#"> <div class="col-sm-6 col-md-4"> <section class="yellowBox"> <img src="img/events.png"> <h1>Services</h1> </section> </div></a> <a href="#"><div class="col-sm-6 col-md-4"> <section class="orangeBox"> <img src="img/help.png"> <h1>Help</h1> </section> </div> </a> </div> <?php include ('bottom.php'); ?> </div> </div> <?php include ('footer.php'); ?> <script> </script> <script> function getRegionsData() { $.ajax({ url: "ajaxcheck", type:"POST", data:"mode="+"searchRegions", success: function(result) { if(result!='') { $('#gentextbox').hide(); $('#relegion').html(''); $('#relegion').html(result); $('#relegion').show(); } else { alert('No regions available'); } } }); } function getSData() { var generalsearch=$('#generalsearch').val(); var relegion=$("#relegion option:selected").val(); if(generalsearch=='' && relegion=='') { alert('Search field is not empty'); return false; } else { if(generalsearch!='') { var s1=generalsearch.replace(/ /g,"+"); window.location.href='quicksearch?s='+s1; } else if(relegion!='') { window.location.href='quicksearch?rg='+relegion; } } } </script>