<?php require_once('head.php'); ?>

  <body>
  <!-- container section start -->
  <section id="container" class="">
      
	<?php require_once('header.php'); ?>	

	<?php require_once('sidebar.php'); ?>
      
      <!--main content start-->
      <section id="main-content">
          <section class="wrapper">

			  <div class="row">
                  <div class="col-lg-12">
                      <!--breadcrumbs start -->
                      <ul class="breadcrumb">
                          <li><a href="dashboard.php"><i class="icon_house_alt"></i> Home</a></li>
						  <li><a href="accounts.php"><i class="icon-signal"></i> Accounts</a></li>
                          <li class="active"> Edit</li>
						  <li class="pull-right"> <i class="icon_calendar"></i>
							 <?php echo date('l jS F Y'); ?></li>
                      </ul>
                      <!--breadcrumbs end -->
                  </div>
              </div>
			  
			  
			  <div class="row">
					<div class="col-lg-12">
					<section class="panel panel-body">
					<h3><?php echo WEB_NAME ?></h3>
					<h4>EDIT ACCOUNT PROFILE</h4>
					<p></p>
					</section>
					</div>
              </div>
			  

			<?php
			dbconnect();
			$sql = "SELECT * FROM `".USERS_TABLE_NAME."` WHERE user_id='{$_GET['user']}'";
			$stmt = $pdo->query($sql);
			$row = $stmt->fetch(PDO::FETCH_ASSOC);
			?>
			  
			  <!-- Recent Transactions Starts -->
			  <div class="row">
                  <div class="col-lg-12">
					  				  
					  <section class="panel">
                          <header class="panel-heading">
                              User ID: <?php echo $row['user_name']; ?> | Account Number: <?php echo $row['user_acc']; ?>
                          </header>
                          
						  <div class="panel-body">
						  
						  <!-- Error Message -->
							<?php if (!empty($_GET['error'])): ?>
							<div class="alert fade in alert-danger">
								<button data-dismiss="alert" class="close close-sm" type="button">
								<i class="icon-remove"></i>
								</button>
								<?php echo $_GET['error']?>
							</div>
							<?php endif ?>
							
							<!-- Success Message -->
							<?php if (!empty($_GET['msg'])): ?>
							<div class="alert fade in alert-success">
								<button data-dismiss="alert" class="close close-sm" type="button">
								<i class="icon-remove"></i>
								</button>
								<?php echo $_GET['msg']?>
							</div>
							<?php endif ?>
						  
						  <form method="post" enctype="multipart/form-data" class="form-validate form-horizontal" id="app-form" action="updated.php">
								<div class="form-group">
									<label class="col-md-12">
									Please fill and submit this form to activate account
									</label>
								</div>
								
								<div class="form-group">
<label class="col-md-4 control-label"></label>
<div class="col-md-6">PERSONAL INFORMATION</div>
</div>
								
<div class="form-group">
									<label class="col-md-4 control-label">Passport Photograph</label>
									<div class="col-md-6">
										<img alt="<?php echo $row['first_name']; ?> <?php echo $row['last_name']; ?>" src="../users/<?php echo $row['user_photo']; ?>">
									</div>
								</div>
								
								<div class="form-group">
									<label class="col-md-4 control-label">Surname</label>
									<div class="col-md-6">
										<input type="text" name="fname" class="form-control required" value="<?php echo $row['first_name']; ?>" placeholder="Enter First Name" required>
									</div>
								</div>
								
								<div class="form-group">
									<label class="col-md-4 control-label">First Name</label>
									<div class="col-md-6">
										<input type="text" name="lname" class="form-control required" value="<?php echo $row['last_name']; ?>" placeholder="Enter Last Name" required>
									</div>
								</div>
								
								<div class="form-group">
									<label class="col-md-4 control-label">Date of Birth</label>
									<div class="col-md-6">
										<input type="text" id="dpYears" name="dob" class="form-control" data-date-format="yyyy-mm-dd" data-date-viewmode="years" value="<?php if ($row['dob'] == "0000-00-00") { echo '1976-12-02';} else { echo $row['dob'];} ?>" placeholder="Date of birth" required>
									</div>
								</div>
								
								<div class="form-group">
									<label class="col-md-4 control-label">Gender</label>
									<div class="col-md-6">
										<select name="gender" class="form-control required" placeholder="Select Gender">
											<?php $gender = $row['user_gender']; ?>
					<option value="">Gender</option>
					<option value="Male" <?php if($gender == "Male"){ echo "selected='selected'";} ?>>Male</option>
					<option value="Female" <?php if($gender == "Female"){ echo "selected='selected'";} ?>>Female</option>
                  </select>
									</div>
								</div>
								
								<div class="form-group">
									<label class="col-md-4 control-label">E-Mail</label>
									<div class="col-md-6">
										<input type="text" name="email" class="form-control required" value="<?php echo $row['user_email']; ?>" placeholder="Enter Email" required>
									</div>
								</div>
								
								<div class="form-group">
									<label class="col-md-4 control-label">Phone</label>
									<div class="col-md-6">
										<input type="text" name="phone" class="form-control required" value="<?php echo $row['user_phone']; ?>" placeholder="Enter Phone Number" required>
									</div>
								</div>
								
								<div class="form-group">
									<label class="col-md-4 control-label">Address</label>
									<div class="col-md-6">
										<input type="text" name="address" class="form-control required" value="<?php echo $row['user_add']; ?>" placeholder="Enter Address" required>
									</div>
								</div>
								
								<div class="form-group">
									<label class="col-md-4 control-label">City</label>
									<div class="col-md-6">
										<input type="text" name="city" class="form-control required" value="<?php echo $row['user_city']; ?>" placeholder="Enter City" required>
									</div>
								</div>
								
								<div class="form-group">
									<label class="col-md-4 control-label">State</label>
									<div class="col-md-6">
										<input type="text" name="state" class="form-control required" value="<?php echo $row['user_state']; ?>" placeholder="Enter State" required>
									</div>
								</div>
								
								<div class="form-group">
									<label class="col-md-4 control-label">Zip Code</label>
									<div class="col-md-6">
										<input type="text" name="postcode" class="form-control required" value="<?php echo $row['postcode']; ?>" placeholder="Enter Post Code" required>
									</div>
								</div>
								
								<div class="form-group">
									<label class="col-md-4 control-label">Country</label>
									<div class="col-md-6">
										<input type="tel" id="country" name="country" class="form-control required" value="<?php echo $row['country']; ?>" placeholder="Select Country" required>
									</div>
								</div>
								
								<div class="form-group">
<label class="col-md-4 control-label"></label>
<div class="col-md-6">PERSONAL IDENTIFICATION</div>
</div>
								
								<div class="form-group">
									<label class="col-md-4 control-label">Identification Type</label>
									<div class="col-md-6">
										<select name="identification" class="form-control required" placeholder="Identification Type">
											<?php $idtype = $row['id_type']; ?>
					<option value="">Identification Type</option>
					<option value="Passport" <?php if($idtype == "Passport"){ echo "selected='selected'";} ?>>International Passport</option>
					<option value="Driver's Licence" <?php if($idtype == "Driver's Licence"){ echo "selected='selected'";} ?>>Driver's Licence</option>
					<option value="Social Security Number" <?php if($idtype == "Social Security Number"){ echo "selected='selected'";} ?>>Social Security Number</option>
                  </select>
									</div>
								</div>
								
								<div class="form-group">
									<label class="col-md-4 control-label">Identification Number</label>
									<div class="col-md-6">
										<input type="text" name="idno" class="form-control required" value="<?php echo $row['id_number']; ?>" placeholder="Enter Identification Number" required>
									</div>
								</div>
								
								<div class="form-group">
									<label class="col-md-4 control-label">Expiry Date</label>
									<div class="col-md-6">
										<input type="text" id="dp1" name="expiry" class="form-control" data-date-format="yyyy-mm-dd" data-date-viewmode="years" value="<?php if ($row['id_expiry'] == "0000-00-00") { echo '2015-12-02';} else { echo $row['id_expiry'];} ?>" placeholder="Expiry Date" required>
									</div>
								</div>

								<div class="form-group">
<label class="col-md-4 control-label"></label>
<div class="col-md-6">ACCOUNT INFORMATION</div>
</div>
								<div class="form-group">
									<label class="col-md-4 control-label">Account Number</label>
									<div class="col-md-6">
										<input type="text" name="acc"  value="<?php echo $row['user_acc']; ?>" placeholder="Enter Account Number" class="form-control required" disabled="disabled">
									</div>
								</div>
								<div class="form-group">
									<label class="col-md-4 control-label">User ID </label>
									<div class="col-md-6">
										<input type="text" name="user" value="<?php echo $row['user_name']; ?>" class="form-control required" placeholder="Enter User ID" disabled="disabled">
									</div>
								</div>
								<div class="form-group">
									<label class="col-md-4 control-label">Password </label>
									<div class="col-md-6">
										<input type="text" name="pass" class="form-control required" value="<?php echo $row['user_word']; ?>" placeholder="Enter Password" required>
									</div>
								</div>
								<div class="form-group">
									<label class="col-md-4 control-label">PIN </label>
									<div class="col-md-6">
										<input type="text" name="pin" value="<?php echo $row['user_pin']; ?>" class="form-control required" placeholder="Enter PIN" required>
									</div>
								</div>
                                <div class="form-group">
									<label class="col-md-4 control-label"><?php echo CODE1_NAME ?> </label>
									<div class="col-md-6">
										<input type="text" name="code1" value="<?php echo $row['user_code1']; ?>" class="form-control required" placeholder="Enter <?php echo CODE1_NAME ?>" required>
									</div>
								</div>
                                <div class="form-group">
									<label class="col-md-4 control-label"><?php echo CODE2_NAME ?> </label>
									<div class="col-md-6">
										<input type="text" name="code2" value="<?php echo $row['user_code2']; ?>" class="form-control required" placeholder="Enter <?php echo CODE2_NAME ?>" required>
									</div>
								</div>
                                <div class="form-group">
									<label class="col-md-4 control-label"><?php echo CODE3_NAME ?> </label>
									<div class="col-md-6">
										<input type="text" name="code3" value="<?php echo $row['user_code3']; ?>" class="form-control required" placeholder="Enter <?php echo CODE3_NAME ?>" required>
									</div>
								</div>
								<div class="form-group">
									<label class="col-md-4 control-label">Account Status </label>
									<div class="col-md-6">
										<select name="status" class="form-control required" placeholder="Select Account Status">
										<option value='' selected="selected">Account Status</option>
											<?php $status = $row['user_active']; ?>
                        					<option value="active" <?php if($status == "active"){ echo "selected='selected'";} ?>>Active</option>
                        					<option value="inactive" <?php if($status == "inactive"){ echo "selected='selected'";} ?>>Inactive</option>
                                            <option value="on-hold" <?php if($status == "on-hold"){ echo "selected='selected'";} ?>>On Hold</option>
                                            <option value="suspended" <?php if($status == "suspended"){ echo "selected='selected'";} ?>>Suspended</option>
                        					<option value="dormant" <?php if($status == "dormant"){ echo "selected='selected'";} ?>>Dormant</option>
										</select>
									</div>
								</div>
								<div class="form-group">
									<label class="col-md-4 control-label">Account Type</label>
									<div class="col-md-6">
										<input type="text" name="type" class="form-control required" value="<?php echo $row['acc_type']; ?>" placeholder="Select Account Type" required>
									</div>
								</div>
								
<div class="form-group">
									<label class="col-md-4 control-label">Currency</label>
									<div class="col-md-6">
										<select name="currency" class="form-control required"  placeholder="Select Account Currency">
										<option value='' selected="selected">Currency</option>
									<?php
						$ucurrency = $row['currency'];
						foreach($currency as $key)
						{
						$currency = htmlspecialchars($currency);
						if($key == $ucurrency){
						echo '<option value="'. $key .'" selected="selected">'. $key .'</option>';
						}else{
						echo '<option value="'. $key .'">'. $key .'</option>';}
						}
					?>
									</select>
									</div>
								</div>
	
								<div class="form-group">
<label class="col-md-4 control-label"></label>
<div class="col-md-6">PASSPORT PHOTO</div>
</div>
								
								
<div class="form-group">
									<label class="col-md-4 control-label">Passport Photograph</label>
									<div class="col-md-6">
										<input type="file" name="photo" id="photo" class="form-control" accept="image/*" data-style="fileinput"  placeholder="Upload Passport Photo">
									</div>
								</div>
		
								<div class="form-group">
									<label class="col-md-4 control-label"></label>
									<div class="col-md-6">
									<input type="hidden" name="user_id" value="<?php echo $row['user_id']; ?>">
			
<input type="hidden" name="user" value="<?php echo $row['user_name']; ?>">
									<input type="submit" id="submit" name="submit" value="Update" class="btn btn-primary pull-left">
									</div>
								</div>
							</form>
						</div>
						
						
						
                      </section>
					  
                  </div>
              </div>
			  <!-- Recent Transactions end -->

              

          </section>
      </section>
      <!--main content end-->
  </section>
  <!-- container section start -->

    <!-- javascripts -->
    <script src="../js/jquery.js"></script>
    <script src="../js/bootstrap.min.js"></script>
    <!-- nice scroll -->
    <script src="../js/jquery.scrollTo.min.js"></script>
    <script src="../js/jquery.nicescroll.js" type="text/javascript"></script>
    <!-- jquery validate js -->
    <script type="text/javascript" src="../js/jquery.validate.min.js"></script>
	
	<!-- jquery ui -->
    <script src="../js/jquery-ui-1.9.2.custom.min.js"></script>
	
	<!--custom checkbox & radio-->
    <script type="text/javascript" src="../js/ga.js"></script>
	
	<!--custom switch-->
    <script src="../js/bootstrap-switch.js"></script>
    <!--custom tagsinput-->
    <script src="../js/jquery.tagsinput.js"></script>
    
    <!-- colorpicker -->
    <script type="text/javascript" src="../assets/bootstrap-colorpicker/js/bootstrap-colorpicker.js"></script>
	
	<!-- bootstrap-datepicker -->
    <script type="text/javascript" src="../assets/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
    <script type="text/javascript" src="../assets/bootstrap-daterangepicker/date.js"></script>
    <script type="text/javascript" src="../assets/bootstrap-daterangepicker/daterangepicker.js"></script>
	
	<script src="../js/countrySelect.js"></script>
	<script>
		$("#country").countrySelect({
			//defaultCountry: "jp",
			//onlyCountries: ['us', 'gb', 'ch', 'ca', 'do'],
			//preferredCountries: ['ca', 'gb', 'us']
		});
	</script>
  

    <!-- custom form validation script for this page-->
    <script src="../js/form-validation-script.js"></script>
	<!-- custom form component script for this page-->
    <script src="../js/form-component.js"></script>
    <!--custom script for all page-->
    <script src="../js/scripts.js"></script>

  </body>
</html>