<?php
session_start();
include 'include/db.php';
include 'session_check.php';
?>
		<head>
    <meta charset="UTF-8">
    <title>AdminLTE 2 | Dashboard</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <!-- Bootstrap 3.3.2 -->
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />    
    <!-- FontAwesome 4.3.0 -->
   <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <!-- Ionicons 2.0.0 -->
    <link href="https://code.ionicframework.com/ionicons/2.0.0/css/ionicons.min.css" rel="stylesheet" type="text/css" />    
    <!-- Theme style -->
    <link href="dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
    <!-- AdminLTE Skins. Choose a skin from the css/skins 
         folder instead of downloading all of them to reduce the load. -->
    <link href="dist/css/skins/_all-skins.min.css" rel="stylesheet" type="text/css" />
    <!-- iCheck -->
    <link href="plugins/iCheck/flat/blue.css" rel="stylesheet" type="text/css" />
    <!-- Morris chart -->
    <!--<link href="plugins/morris/morris.css" rel="stylesheet" type="text/css" />-->
    <!-- jvectormap -->
    <link href="plugins/jvectormap/jquery-jvectormap-1.2.2.css" rel="stylesheet" type="text/css" />
    <!-- Date Picker -->
    <link href="plugins/datepicker/datepicker3.css" rel="stylesheet" type="text/css" />
    <!-- Daterange picker -->
    <link href="plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
    <!-- bootstrap wysihtml5 - text editor -->
    <link href="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css" rel="stylesheet" type="text/css" />

   <!-----		sweet alert css and js link	---->
	<link rel="stylesheet" href="dist/sweetalert.css">
	<script src="dist/sweetalert.min.js"> </script>
   
	<link rel="stylesheet" type="text/css" href="custom/custom.css">
	<!---- Ck editor-->
	 <script src="ckeditor/ckeditor.js"></script>
	 
  </head>



<?php
include 'include/header.php';
include 'include/left-nav.php';
?>
      <!-- Right side column. Contains the navbar and content of the page -->
      <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>
            Profile Tables
            
          </h1>
          <ol class="breadcrumb">
            <li><a href="dashboard.php"><i class="fa fa-dashboard"></i> Home</a></li>
            <li class="active">profile table</li>
          </ol>
        </section>

        <!-- Main content -->
        <section class="content">
          <div class="row">
            <div class="col-sm-6 col-sm-offset-3 well">
              <div class="">
                <div class="box-header">
                </div><!-- /.box-header -->
                <div class="box-body">
                 
					<?php
					if(isset($_SESSION['login_id']))
					{
						$id=$_SESSION['login_id'];
					}
					$slt="select * from registration where login_session='$id'";
					$connection=mysqli_query($conn,$slt);
					if(mysqli_num_rows($connection)>0)
					{
						while($rows=mysqli_fetch_array($connection))
						{
						 $unique_id=$rows['unique_user_id'];
						  
						    //   check user exits or not 
						    $qry2="select images from registration where unique_user_id='$unique_id'";
						    $connection3=mysqli_query($conn,$qry2);
						    $num_rows=mysqli_num_rows($connection3);
						    while($row12=mysqli_fetch_array($connection3))
						    {
						      $result=$row12['images'];
						    }
					?>
					<form method="POST" id="uploadimage" enctype="multipart/form-data">
					<div class="row">
					        <div class="col-sm-12">
					                <div id="img_prev">
					                   <?php if($result!='')
					                   {
					                   ?>
					                     <img src="<?php echo $result;?>"  id="img2" class="form-control" alt="no-user-image" style="width: 100px; height: 110px" />
					                   <?php
					                   }
					                   else
					                   {
					                   ?>
					                   <img src="images/no-user-img.jpg"  id="img2" class="form-control" alt="no-user-image" style="width: 100px; height: 110px" />
					                   <?php
					                   }
					                   ?>
					               </div>
					       </div>
					</div>
					<div class="row">
					        <div class="col-sm-6">
					            <label for="file1" style="margin: 5px 13px" class="btn btn-default" id="file_upload_btn">
					               Upload
					                <input type="file" style="margin-left: 15px; display: none" id="file1" class="form-control" name="file1">
					            </label>
					       </div>
					 </div>
					 </form>
					</div>
					<div class="row">
                        <div class="col-sm-12" style="font-size: 19px; font-weight: 600; padding: 10px 20px">
                                User details
                        </div>
                    </div>
					<table id="example2" class="table table-bordered table-hover">
                    <tbody>
                      <tr style="">
                        <td style="width: 300px;">Name :</td>
						<td> <?php echo $rows['user_name'];?> </td>
                      </tr>
					   <tr>
                        <td>Address :</td>
						<td> <?php echo $rows['user_address'];?>  </td>
                      </tr>
                      <tr>
                        <td>Gender :</td>
						<td> <?php echo $rows['gender'];?> 
                      </tr>
					   <tr>
                        <td>Email :</td>
						<td> <?php echo $rows['user_email'];?> 
                      </tr>
					   <tr>
                        <td>Phone :</td>
						<td> <?php echo $rows['user_mobile'];?>  </td>
                      </tr>
					  </tr>
					   <tr>
                        <td>Account created date :</td>
						<td> 
							<?php 
							$cdate=explode(' ',$rows['created_date']);
							echo $cdate['0'];
							?>
						</td>
                      </tr>
					  <tr>
                        <td>Account modified date :</td>
						<td> 
							<?php 
							$mdate=explode(' ',$rows['modified_date']);
								echo $mdate['0'];
							?>  
						</td>
                      </tr>
                      </tbody>
                  </table>
					  <?php
						}
					}
					  ?>
					  
					<?php
					$slt2="select * from bank_details where user_unique_id='".$unique_id."' ";
					$connection2=mysqli_query($conn,$slt2);
					
					?>
					<div class="row">
                        <div class="col-sm-12" style="font-size: 19px; font-weight: 600; padding: 10px 20px">
                                Bank account details
                        </div>
                    </div>
					<table id="example2" class="table table-bordered table-hover">
					 <?php
					 if(mysqli_num_rows($connection2)>0)
					 {
    				 	while($rows=mysqli_fetch_array($connection2))
    					{
					 ?>
                    <tbody>
                      <tr>
                        <td style="width: 300px;">Account no :</td>
						<td> <?php echo $rows['ac'];?> </td>
                      </tr>
                      <tr>
                        <td style="width: 300px;">Adhar/id no :</td>
						<td> <?php echo $rows['adhar'];?> </td>
                      </tr>
					   <tr>
                        <td>Pan :</td>
						<td> <?php echo $rows['pan'];?>  </td>
                      </tr>
					   <tr>
                        <td>Holder name :</td>
						<td> <?php echo $rows['holder_name'];?>  &nbsp &nbsp 
					   <tr>
                        <td>Ifsc :</td>
						    	<td> <?php echo $rows['ifsc'];?>  </td>
                      </tr>
					  <tr>
                        <td>Nominee :</td>
							<td> <?php echo $rows['nominee'];?>  </td>
                      </tr>
                      </tbody>
                      <?php
    					}
					 }
					 else
					 {
                      ?>
                      <tbody>
                      <tr style="">
                        <td style="width: 300px;">Adhar/id no :</td>
						<td>  </td>
                      </tr>
					   <tr>
                        <td>Pan :</td>
						<td>   </td>
                      </tr>
					   <tr>
                        <td>Holder name :</td>
						<td> </td>
					   <tr>
                        <td>Ifsc :</td>
						    	<td>   </td>
                      </tr>
					  <tr>
                        <td>Nominee :</td>
							<td>   </td>
                      </tr>
                      </tbody>
                     <?php
					 }
                     ?>
                  </table>
					  
					  
					  
					  
					  
					  
                     
                </div><!-- /.box-body -->
              </div><!-- /.box -->

           
            </div><!-- /.col -->
          </div><!-- /.row -->
        </section><!-- /.content -->
      </div><!-- /.content-wrapper -->

	 <!-- jQuery 2.1.3 -->
    <script src="plugins/jQuery/jQuery-2.1.3.min.js"></script>
    <!-- jQuery UI 1.11.2 -->
    <script src="https://code.jquery.com/ui/1.11.2/jquery-ui.min.js" type="text/javascript"></script>
    <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
    <script>
      $.widget.bridge('uibutton', $.ui.button);
    </script>
    <!-- Bootstrap 3.3.2 JS -->
    <script src="bootstrap/js/bootstrap.min.js" type="text/javascript"></script>    
    <!-- Morris.js charts -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
    <!--<script src="plugins/morris/morris.min.js" type="text/javascript"></script>-->
    <!-- Sparkline -->
    <script src="plugins/sparkline/jquery.sparkline.min.js" type="text/javascript"></script>
    <!-- jvectormap -->
    <script src="plugins/jvectormap/jquery-jvectormap-1.2.2.min.js" type="text/javascript"></script>
    <script src="plugins/jvectormap/jquery-jvectormap-world-mill-en.js" type="text/javascript"></script>
    <!-- jQuery Knob Chart -->
    <script src="plugins/knob/jquery.knob.js" type="text/javascript"></script>
    <!-- daterangepicker -->
    <script src="plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
    <!-- datepicker -->
    <script src="plugins/datepicker/bootstrap-datepicker.js" type="text/javascript"></script>
    <!-- Bootstrap WYSIHTML5 -->
    <script src="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js" type="text/javascript"></script>
    <!-- iCheck -->
    <script src="plugins/iCheck/icheck.min.js" type="text/javascript"></script>
    <!-- Slimscroll -->
    <script src="plugins/slimScroll/jquery.slimscroll.min.js" type="text/javascript"></script>
    <!-- FastClick -->
    <script src='plugins/fastclick/fastclick.min.js'></script>
    <!-- AdminLTE App -->
    <script src="dist/js/app.min.js" type="text/javascript"></script>

    <!-- AdminLTE dashboard demo (This is only for demo purposes) -->
   <!-- <script src="dist/js/pages/dashboard.js" type="text/javascript"></script>-->
	
	  <script>
	  $('#file1').change(function(){
	   
	 var fd = new FormData();  
    var files = $('#file1')[0].files[0];
               // console.log(files);
                fd.append('file',files);
    var id='<?php echo $unique_id?>';
	    $.ajax({
                    url:"ajax_php_file.php?id="+id,
                    type:'post',
                    data:fd,
                    contentType: false,
                    processData: false,
                    success:function(response){
                        if(response != 0){
                           
                            $("#img2").attr("src",response);
                           // $('.preview img').show();
                           //$("#img_prev").append(response);
                        }else{
                            alert('File not uploaded');
                        }
                       // alert(response);
                    //    console.log(response)
                    }
                });
	
	
	
	
	
	  });
	    
	    
     /*$(function () {
        $("#example1").dataTable();
        $('#example2').dataTable({
          "bPaginate": true,
          "bLengthChange": false,
          "bFilter": false,
          "bSort": true,
          "bInfo": true,
          "bAutoWidth": false
        });
      });*/
    </script>
	
<?php
include 'include/footer.php';
?>