
 <div class="container-fluid">
   <div class="row">
      <div class="col-sm-12 col-lg-12">
         <div class="iq-card">
            <div class="iq-card-header d-flex justify-content-between">
               <div class="iq-header-title">
                  <h4 class="card-title">Add Hospital Services</h4>
               </div>
               <span class="table-add float-right mb-3 mr-2">
                  <a href="<?php echo base_url(); ?>HospitalService/" class="btn btn-default pull-right"><i class="fa fa-arrow-left" aria-hidden="true"></i> Back</a>&emsp;
               </span>
            </div>
            <div class="iq-card-body">
               <div class="alert alert-success Add" style="display: none;">
                    <strong>Successfully Added Your Data!</strong>
                </div>
                <div class="alert alert-danger Adderror" style="display: none;">
                    <strong>Duplicate Entry!</strong>
                </div>
                <form role="form" method="post" id="addfrm">
                <div class="row">
                    
                    <div class="col-lg-8 col-md-8 col-sm-8 col-xs-12">
                        <div class="form-group">
                            <label>Hospital Service Name</label>
                            <input type="text" name="hs_name" id="hs_name" class="form-control" required="" placeholder="Enter Hospital Service Name"><br>
                        </div>
                    </div>

                    <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
                        <div class="form-group">
                            <label>Short Name</label>
                            <input type="text" name="short_name" id="short_name" class="form-control" required="" placeholder="Enter Hospital Service Short Name"><br>
                        </div>
                    </div>
                    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        <div class="form-group">
                            <label>Departments Included (Use comma ',' for separator)</label>
                            <input type="text" name="departments_include" id="departments_include" class="form-control" required="" placeholder="Example: General Medicine,Cardiology,Dermatology"><br>
                        </div>
                    </div>
                    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        <div class="form-group">
                            <label>Short Description </label>
                            <textarea name="short_desc" id="short_desc" class="form-control" required="" placeholder="Enter Depertment Name"></textarea><br>
                        </div>
                    </div>
                    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        <div class="form-group">
                            <label>Full Description</label>
                            <textarea  class="form-control summernote" name="description" required></textarea>
                            <br>
                        </div>
                    </div>
                    
                    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        <div class="form-group">
                            <label>Diagnostic & Support Facilities</label>
                            <textarea  class="form-control summernote" name="facilities" required></textarea>
                            <br>
                        </div>
                    </div>
                    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        <div class="form-group">
                            <label>Key Services Offered</label>
                            <textarea  class="form-control summernote" name="service_offered" required></textarea>
                            <br>
                        </div>
                    </div>
                    
                    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        <div class="form-group">
                            <label>Hospital Service Image </label>
                            <input type="file" name="hs_image" id="hs_image" class="form-control" required=""><br>
                        </div>
                    </div>
                    
                    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" align="right">
                        <div class="form-group">
                            <button type="reset" class="btn btn-default"><i class="fa fa-repeat" aria-hidden="true"></i> Reset</button>
                            <button type="submit" class="btn btn-primary addbtn"><i class="fa fa-floppy-o" aria-hidden="true"></i> Save</button>
                            <button class="btn btn-primary addload buttonload" style="display: none;"><i class="fa fa-spinner fa-spin" style=" margin-left: -12px; margin-right: 8px;"></i>Please Wait</button>
                        </div>
                    </div>
                    
                </div>
                </form>
            </div>
         </div>
      </div>
   </div>
</div>

<script>
// just for the demos, avoids form submit
jQuery.validator.setDefaults({
success: "valid"
});
$("#addfrm").validate({
rules: {
d_code: {
required: true
}
}
});
</script>
<script>
$(document).ready(function(e) {
$("#addfrm").on('submit', function(e) {
e.preventDefault();
var formStatus = $('#addfrm').validate().form();
if (true == formStatus) {
$.ajax({
type: 'POST',
url: '<?php echo base_url(); ?>HospitalService/save',
data: new FormData(this),
contentType: false,
cache: false,
processData: false,
beforeSend: function() {
$('.addbtn').hide();
$('.addload').show();
},
success: function(msg) {
if(msg=='Success')
{
$(".Add").show();
$('.Add').delay(3000).hide(200);
$('.addbtn').show();
$('.addload').hide();
setInterval(function() {
location.reload();
}, 3000);
}
else
{
$(".Adderror").show();
$('.Adderror').delay(3000).hide(200);
$('.addbtn').show();
$('.addload').hide();

}
}
});
}
});
});
</script>
<script>
$( "#cat_id" ).change(function() {
var cat_id=$( "#cat_id" ).val();
$.ajax({
type: "POST",
url: "<?php echo base_url(); ?>product/get_sub_cat/",
data: {cat_id : cat_id }, 
success: function(html) {
$('.sub_category').html(html);
}
});
});
</script>
                    