<?php include'../pages/header.php'?>
<?php include'../pages/navbar.php'?>
<?php include'../../../conn.php'?>

<!-- ///////////////////add 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/add.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 = "#";
    }
    else{
        alert(data);
    }
      },
     error: function(e) 
      {
   $("#successmessage").html("Some thing went  worng").fadeIn().style.color.red;
      }          
    });
 }));
});
</script>
<!-- //////////////////add 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>  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">

<section>
<form  action="#" method="post" id="form"  enctype="multipart/form-data" novalidate>
<h3> Add New  </h3>
<fieldset>

<div class="md-group-add-on">
<span class="md-add-on">
<i class="fa fa-beer"></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 icofont-ui-map"></i>
</span>
<div class="md-input-wrapper">
<input id="slug" name="slug" type="text" class="required md-form-control">
<label for="userName-2" class="block">Slug *</label>
</div>
</div>

<div class="md-group-add-on">
<span class="md-add-on">
<i class="fa fa-book"></i>
</span>
<div class="md-input-wrapper">
<textarea id="description" name="description" type="text" class="required md-form-control"></textarea>
<label for="userName-2" class="block">Description *</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>


</div>
</div>

</div>
</div>





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