<?php include'../pages/header.php'?>
<?php include'../pages/navbar.php'?>
<?php include'../../conn.php'?>
<!--//////////////////////////////veterinarySpecialties services fetch array///////////////-->
 <?php
          
    $doctorservicessql="SELECT * FROM `veterinarySpecialties`";
    $doctorservicesresult = mysqli_query($con,$doctorservicessql);
    $doctorservicesarry=array(); 
    while($doctorservicesrow = mysqli_fetch_array($doctorservicesresult)){
        $doctorservicesarry[]=$doctorservicesrow;
    }
             
 ?>
<!--//////////////////////////////veterinarySpecialties services 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/adddoctor.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 == 104)
    {
    $("#successmessage").html("Email Already Register , Please try different email ID ").fadeIn().style.color.red;
    }
   
    else{
    	$("#successmessage").html("Sucessfully Added").fadeIn();
     $("#form")[0].reset(); 
     $("#message").html("").fadeIn();
      window.location.href = "adddoctor.php?id="+data;
    }
      },
     error: function(e) 
      {
   $("#successmessage").html("Some thing went  worng").fadeIn().style.color.red;
      }          
    });
 }));
});
</script>
<!-- //////////////////register new doctor//////////////////////////// -->
<!-- ///////////////////add speciallity doctor up funcation////////////////// -->

<script>
$(document).ready(function (e) {
 $("#speciality").on('submit',(function(e) {
  e.preventDefault();
  $.ajax({
   url: "api/addspeciality.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)
    	$("#successmessage").html("Sucessfully Added").fadeIn();
     $("#form")[0].reset(); 
     $("#message").html("").fadeIn();
      window.location.href = "doctorlist.php;
    }
    else{
        alert(data)
    }
      },
     error: function(e) 
      {
   $("#successmessage").html("Some thing went  worng").fadeIn().style.color.red;
      }          
    });
 }));
});
</script>
<!-- //////////////////speciallity 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 Add</h4>

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


<div class="row">
<div class="col-md-12">
<div class="card">


<div class="card-block">
<div id="wizard">
    <?php if($_GET['id']==null){?>
    <div class="card-header">
      <div style="width:50%;color:#fff; background-color:blue; padding:10px">Step-1</div>  
     </div>
<section>
<form  action="#" method="post" id="form"  enctype="multipart/form-data" novalidate>
<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">
<label for="userName-2" class="block">name *</label>
</div>
</div>
<div class="md-group-add-on">
<span class="md-add-on">
<i class="icofont icofont-email"></i>
</span>
<div class="md-input-wrapper">
<input id="email" name="email" type="email" class="required md-form-control">
<label for="email-2" class="block">Email *</label>
</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">
<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">
<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">
<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">
<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">
<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">
<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">
<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">
<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">
<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">
<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>
<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>
</fieldset>
<div class="md-input-wrapper">
<button type="submit" id="btn" class="btn btn-primary waves-effect waves-light">Submit
</button>
</div>
</form>
</section>
<?php } else { ?>
<section>
     <div class="card-header">
      <div style="margin-left:50%; color:#fff; background-color:blue;padding:10px">Step-2</div>  
     </div>
<form  action="api/addspeciality.php" method="post" id="speciality"  enctype="multipart/form-data" novalidate>
    <input type="hidden" id="id" name="id" value="<?php echo $_GET['id']?>">
<h3> Select Servives </h3>
<fieldset>

<div class="md-group-add-on p-relative">
<div class="md-input-wrapper p-relative">
<div class=" checkbox-primary">

<?php foreach($doctorservicesarry as $data){?>

<div class="rkmd-checkbox checkbox-rotate">
<label class="input-checkbox checkbox-primary">
<input type="checkbox" id="category[]" name="category[]" value="<?php echo $data['id']?>">
<span class="checkbox"></span>
</label>
<div class="captions" ><?php echo $data['name']?></div>
</div>

<?php }?>
</div>
<span class="messages"></span>
</div>
</div>
</fieldset>

<div class="md-input-wrapper">
<button type="submit" id="btn2" class="btn btn-primary waves-effect waves-light">Submit
</button>
</div>
</form>
</section>
<?php }?>
</div>
</div>

</div>
</div>





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