<?php
include('../headertop.php');
//include('../datepicker.php');
include('../db.php');

$disp = '';
$pagetitle = 'Edit Profile';

$q = "select * from user where username='".$_SESSION['user']."'";
$res = mysqli_query($dbcon,$q) or die(mysqli_error($dbcon));

$row = mysqli_fetch_array($res);

if(isset($_REQUEST['sm']))
$disp .= '<div class="smdiv">'.$_REQUEST['sm'].'</div>';
else
$disp .= '<div class="smdiv">User Details</div>';


 
$disp .= '<form method="post" action="editprofile2.php" id="editprofileform">
<div class="row">
                <div class="col-md-12">
                    <!-- Advanced Tables -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                             Make changes and click submit
                        </div>
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <tbody>
									    <tr><th>Username</th><td><input type="text" name="username" value="'.$row['username'].'" data-validation="required"></td></tr>
										<tr><th>New Password</th><td><input type="password" name="password" data-validation="required" ></td></tr>
										<tr><th>New Password Again</th><td><input type="password" name="password2"  data-validation="required" ></td></tr>
										<tr><th>Old Password *: </th><td><input type="password" name="old_password" data-validation="required"></td></tr>
<input type="hidden" name="userid" value="'.$row['id'].'">
<tr><th>Click to Submit Changes</th><td><button type="submit" name="editprofilesubmit" class="btn-success">Submit Changes</button></td></tr>
																						
                                       
                                    
                                    </tbody>
                                </table>
                            </div>
                            
                        </div>
                    </div>
                    <!--End Advanced Tables -->
                </div>
            </div>
			</form>';
			

		include('../header.php');
		include('../template.php');
			?>
		
    <!-- <script>
            $(document).ready(function () {
                $('#dataTables-example').dataTable();
            });
    </script>  -->
    <script>
                                    $.validate({
  form : '#editprofileform'
});
</script>

			
               