
<?php include'../pages/header.php'?>
<?php include'../pages/navbar.php'?>
<?php include'../../conn.php'?>
<!--//////////////////////////////doctor fetch array///////////////-->
 <?php
           $id=$_GET['id'];
    $usersql="select * from doctors where id='$id'";
    $userresult = mysqli_query($con,$usersql);
    $usersarry=array(); 
    while($userrow = mysqli_fetch_array($userresult)){
        $usersarry[]=$userrow;
    }
             
 ?>
<!--//////////////////////////////doctor fetch array///////////////-->
<!-- ///////////////////register new doctor up funcation////////////////// -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function (e) {
 $("#form").on('submit',(function(e) {
  e.preventDefault();
  $.ajax({
   url: "api/editusers.php",
   type: "POST",
   data:  new FormData(this),
   contentType: false,
         cache: false,
   processData:false,
   beforeSend : function()
   {
    //$("#preview").fadeOut();
    $("#err").fadeOut();
   },
   success: function(data)
      {
        //  alert(data)
    if(data == 101)
    {
     // invalid file format.
     
     $("#successmessage").html("Sucessfully Added").fadeIn();
     $("#form")[0].reset(); 
     $("#message").html("").fadeIn();
     location.reload(true);
    }
   
   
    else{
    	alert(data);
    }
      },
     error: function(e) 
      {
   $("#successmessage").html("Some thing went  worng").fadeIn().style.color.red;
      }          
    });
 }));
});
</script>
<!-- //////////////////register new doctor//////////////////////////// -->
<div class="content-wrapper">

<div class="container-fluid">

<div class="row">
<div class="col-sm-12 p-0">
<div class="main-header">
<h4> Doctors Edit</h4>

</div>
</div>
 </div>
<span class="successmessage" id="successmessage"></span>


<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<!--<h5 class="card-header-text">Form wizard with Validation</h5></div>-->
<div class="card-block">
<div id="wizard">
<section>
    <?php foreach($usersarry as $data){ ?>
<form  action="#" method="post" id="form"  enctype="multipart/form-data" novalidate>
    <input id="id" name="id" type="hidden" class="required md-form-control" value="<?php echo $data['id']?>">
<h3> Registration </h3>
<fieldset>

<div class="md-group-add-on">
<span class="md-add-on">
<i class="icofont icofont-ui-user"></i>
</span>
<div class="md-input-wrapper">
<input id="name" name="name" type="text" class="required md-form-control" value="<?php echo $data['name']?>">
<label for="userName-2" class="block">name *</label>
</div>
</div>
<div class="md-group-add-on">
    <label for="email-2" class="block">Email *</label>
<!--<span class="md-add-on">-->
<!--<i class="icofont icofont-email"></i>-->
<!--</span>-->
<div class="md-input-wrapper">
<input id="email" name="email" type="email" readonly class="required md-form-control" value="<?php echo $data['email']?>">

</div>
</div>
<!--<div class="md-group-add-on">-->
<!--<span class="md-add-on">-->
<!--<i class="icofont icofont-ui-password"></i>-->
<!--</span>-->
<!--<div class="md-input-wrapper">-->
<!--<input id="password" name="password" type="password" class="md-form-control required" value="<?php echo $data['']?>">-->
<!--<label for="password-2" class="block">Password *</label>-->
<!--</div>-->
<!--</div>-->
<!--<div class="md-group-add-on">-->
<!--<span class="md-add-on">-->
<!--<i class="icofont icofont-key"></i>-->
<!--</span>-->
<!--<div class="md-input-wrapper">-->
<!--<input id="confirm_password" name="confirm_password" type="password" class="md-form-control required">-->
<!--<label for="confirm-2" class="block">Confirm Password *</label>-->
<!--</div>-->
<!--</div>-->
</fieldset>
<h3> General information </h3>
<fieldset>

<div class="md-group-add-on">
<span class="md-add-on">
<i class="icofont icofont-ui-cell-phone"></i>
</span>
<div class="md-input-wrapper">
<input id="phone" name="phone" type="number" class="md-form-control required phone" value="<?php echo $data['phone']?>">
<label for="phone-2" class="block">Phone #</label>
</div>
</div>

<div class="md-group-add-on">
<span class="md-add-on">
<i class="icofont icofont-map-pins"></i>
</span>
<div class="md-input-wrapper">
<select class="md-form-control required" id="type">
    
    <?php if($data['type'] == 'clinic') {?>
    <option value="<?php echo $data['type']?>">Clinic</option>
    <?php } else{ ?>
    <option value="<?php echo $data['type']?>">Self"</option>
    <?php }?>

<option >Select Type</option>
<option value="clinic">Clinic</option>
<option value="self">Self Employee</option>

</select>
</div>
</div>
</fieldset>
<h3> Education </h3>
<fieldset>

<div class="md-group-add-on">
<span class="md-add-on">
<i class="icofont icofont-hat"></i>
</span>
<div class="md-input-wrapper">
<input id="degree" name="degree" type="text" class="md-form-control required phone" value="<?php echo $data['qualification']?>">
<label for="Degreelevel-2" class="block">Degree level #</label>
</div>
</div>

</fieldset>
<h3> Work experience </h3>
<fieldset>

<div class="md-group-add-on">
<span class="md-add-on">
<i class="icofont icofont-live-support"></i>
</span>
<div class="md-input-wrapper">
<input id="experience" name="experience" type="text" class="md-form-control required" value="<?php echo $data['experience']?>">
<label for="Position-2" class="block">how many year </label>
</div>
 </div>
</fieldset>
<h3>Working Charges </h3>
<fieldset>
<div class="md-group-add-on">
<span class="md-add-on">
<i class="icofont icofont-company"></i>
</span>
<div class="md-input-wrapper">
<input id="homevisit" name="homevisit" type="text" class="md-form-control required" value="<?php echo $data['homeVisit']?>">
<label for="Company-2" class="block">Home visit charage:</label>
</div>
</div>
<div class="md-group-add-on">
<span class="md-add-on">
<i class="icofont icofont-ui-map"></i>
</span>
<div class="md-input-wrapper">
<input id="clinicvisit" name="clinicvisit" type="text" class="md-form-control required" value="<?php echo $data['clinicVisit']?>">
<label for="CountryW-2" class="block">Clinic visit charage</label>
</div>
</div>
<div class="md-group-add-on">
<span class="md-add-on">
<i class="icofont icofont-live-support"></i>
</span>
<div class="md-input-wrapper">
<input id="nightvisit" name="nightvisit" type="text" class="md-form-control required" value="<?php echo $data['nightCharge']?>">
<label for="Position-2" class="block">Night visit charage</label>
</div>
 </div>
</fieldset>
<h3>Working Time </h3>
<fieldset>
<div class="md-group-add-on">
<span class="md-add-on">
<i class="icofont icofont-company"></i>
</span>
<div class="md-input-wrapper">
<input id="workingtime" name="workingtime" type="text" class="md-form-control required" value="<?php echo $data['workingTime']?>">
<label for="Company-2" class="block">6 Day working timing:</label>
</div>
</div>
<div class="md-group-add-on">
<span class="md-add-on">
<i class="icofont icofont-ui-map"></i>
</span>
<div class="md-input-wrapper">
<input id="sundaytime" name="sundaytime" type="text" class="md-form-control required" value="<?php echo $data['sundaytiming']?>">
<label for="CountryW-2" class="block">Sunday working timing</label>
</div>
</div>
<div class="md-group-add-on">
<span class="md-add-on">
<i class="icofont icofont-ui-map"></i>
</span>
<img src="<?php echo $data['image']?>" height=50; width=50>
<div class="md-input-wrapper">
<input id="image" name="image" type="file" class="md-form-control required">
<label for="CountryW-2" class="block">Image</label>
</div>
</div>
<?php }?>
</fieldset>
<div class="md-input-wrapper">
<button type="submit" id="btn" class="btn btn-primary waves-effect waves-light">Submit
</button>
</div>
</form>
</section>
</div>
</div>
</div>
</div>
</div>





<?php include'../pages/footer.php'?>
