<style>
.select-nirmala{
    width: 100%;
    font-size: 15px;
    height: 35px;
    border: 1px solid #d5d5d5;
}
</style>
<form role="form" class="form-horizontal" id="create_service_form" action="#" method="post">

<input type="hidden" value="<?php echo $type;?>" name="type" id="type"/>
<input type="hidden" value="<?php echo $service_id;?>" name="service_id" id="service_id"/>
<div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title"><?php echo $pageName ?></h4>
            <font style="color:#333;">Please fill in the information below. The field labels marked with * are required input fields.</font>
            </div>
    <div class="col-md-12">
        
    </div>              
            <div class="modal-body">
            <div id="error"></div>
                <div class="row">
                <div class="col-md-12" style="padding:30px;">
                 
                  
                    <div class="form-group">
                        <h5>
                        <label class="control-label">
                        Service*						</label></h5>
                            <input type="text" <?php echo (isset($services['mstserdtl_name']))?'value="'.$services['mstserdtl_name'].'"':null;?> class="form-control" name="title" id="title">
                    </div>
                  
                    <div class="form-group">
                        <h5>
                        <label class="control-label">
							 Type*
						</label></h5>
                        <select class="select-nirmala" id="service_type">
              
                        <?php foreach($types as $row){
                            $selected="";
                            if(isset($services['mstserdtpe_id']) && $services['mstserdtpe_id']==$row['mstserdtpe_id']){
                                $selected="selected";
                            }
                        echo   '<option '.$selected.' value="'.$row['mstserdtpe_id'].'">'.$row['mstserdtpe_name'].'</option>';
                        } ?>
                            
                      
                       
                            </select>
                            
                    </div>
                    <script>
               
    </script> 
                  
                                                 
                  
                </div>
            </div>
            <div class="modal-footer">
            <input type="submit" name="add_category" value="<?php echo $btnText; ?>" class="btn btn-primary">
            </div>
            </div> <!--/.col-md-12-->
</form>

<!-- start: JAVASCRIPTS REQUIRED FOR THIS PAGE ONLY VALIDATION-->
<script src="<?php echo asset_url(); ?>js/form-validation-create_service_detail.js"></script>
<!-- end: JAVASCRIPTS REQUIRED FOR THIS PAGE ONLY  VALIDATION-->

<script>
   jQuery(document).ready(function() {
        FormValidator.init();
   });
</script>
    
<script type="text/javascript">
function insertLocationData(){
    var type=$('#type').val();
    var service_id=$('#service_id').val();    
            var title=$('#title').val();
            var service_type=$('#service_type').val();
            
                                
                $.post( "<?php echo base_url('service_details/save_service'); ?>", {type:type,service_id:service_id,title:title,service_type:service_type })
                .done(function( data ) {
                    
                var obj = jQuery.parseJSON(data);
                // alert(obj.type); //last id
                
                if (obj.status==0) 
                {
                    $('div#error').html('<div class="alert alert-block alert-danger fade in"><button type="button" class="close" data-dismiss="alert">×</button><h4 class="alert-heading"><i class="fa fa-times-circle"></i> Error!</h4>'+obj.validation+'</div>');
                    $('body').modalmanager('removeLoading');
                    $('body').attr('class','');
                }
                else {

                $('div#ajax-modal').modal('hide');
                loadGrid();// load location data
                
                if(obj.type=='E'){
                    
                    displayNotice('page','Page has been updated successfully!')
                }
                if(obj.type=='A'){
                        displayNotice('page','Page has been added successfully!')    
                }
                }
                });
            return false;
}
</script>