		<style type="text/css">
			body .modal {
	    /* new custom width */
	    width: 750px;
	    /* must be half of the width, minus scrollbar on the left (30px) */
	    margin-left: -375px;
			}
			</style>
            <form role="form" class="form-horizontal" id="create_item_form" action="#" method="post">
<input type="hidden" value="<?php echo $type;?>" name="type" id="type"/>
<input type="hidden" value="<?php echo $item_id;?>" name="item_id" id="item_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 class="errorHandler alert alert-danger no-display">
            <i class="fa fa-times-sign"></i> You have some form errors. Please check below.
        </div>
    </div>              
            <div class="modal-body">
                <div class="row">
                <div class="col-md-12">
                    <div class="col-md-12">
                    <div class="form-group">
                  
                        <h5>
                        <label class="control-label">
							 Code*
						</label></h5>
                            <input type="text" <?php echo (isset($item_list['item_code']))?'value="'.$item_list['item_code'].'"':null;?> class="form-control" name="item_code" id="item_code">
                    </div>
                    <div class="form-group">
                        <h5>
                        <label class="control-label">
							 Name*
						</label></h5>
                            <input type="text" <?php echo (isset($item_list['item_name']))?'value="'.$item_list['item_name'].'"':null;?> class="form-control" name="item_name" id="item_name">
                    </div>
                    
                    <div class="form-group">
                        <h5>
                        <label class="control-label">
							 Unit
						</label></h5>
                            <select id="item_unit" class="form-control" name="item_unit">
                  <!--<option value="">-- Select Warehouse --</option>-->
                  <?php 
																
                                                              foreach ($unit_list as $row)
                                                              {
																  $sel='';
																  if($item_list['item_unit']==$row['unit_id'])
																  {
																	  $sel=' selected="selected"';
																  }
                                                              ?>
                  <option <?php echo $sel?> value="<?php echo $row['unit_id']; ?>"> <?php echo $row['unit_name']; ?> </option>
                  <?php }?>
                </select>
                    </div>
                    
                    <div class="form-group">
                        <h5>
                        <label class="control-label">
							 Extra Item
						</label></h5>
                            <select id="item_extra" class="form-control" name="item_extra">
                  <!--<option value="">-- Select Warehouse --</option>-->
               <option value=""  <?php if(isset($item_list['item_extra']) && $item_list['item_extra']=='') echo 'selected="selected"'; ?>>No</option>
                  <option value="Extra" <?php if(isset($item_list['item_extra']) && $item_list['item_extra']=='Extra') echo 'selected="selected"'; ?>>Yes</option>
                  
                 
                </select>
                    </div>
                    
                    <div class="form-group" <?php if (!is_avalable_link($this->session->userdata('ss_group_id'),1)) echo 'style="display:none;"';?>>
                        <h5>
                        <label class="control-label">
							 Tamarind Price*
						</label></h5>
                            <input type="text" <?php echo (isset($item_list['item_price_1']))?'value="'.$item_list['item_price_1'].'"':null;?> class="form-control" name="item_price_1" id="item_price_1">
                    </div>
                    <div class="form-group">
                        <h5>
                        <label class="control-label" <?php if (!is_avalable_link($this->session->userdata('ss_group_id'),2)) echo 'style="display:none;"';?>>
							 River House Price*
						</label></h5>
                            <input type="text" <?php echo (isset($item_list['item_price_2']))?'value="'.$item_list['item_price_2'].'"':null;?> class="form-control" name="item_price_2" id="item_price_2">
                    </div>
                    
                   
                                                      
                    </div>
                </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_item.js"></script>
<!-- end: JAVASCRIPTS REQUIRED FOR THIS PAGE ONLY  VALIDATION-->

	<script>
        jQuery(document).ready(function() {
            FormValidator.init();
        });
    </script>
    
<script type="text/javascript">
function insertItemData(){
//	alert(22);


var type=$('#type').val();

var item_id=$('#item_id').val();
var item_code=$('#item_code').val();
var item_name=$('#item_name').val();
var item_price_1=$('#item_price_1').val();
var item_price_2=$('#item_price_2').val();
var item_image=$('#item_image').val();
var item_unit=$('#item_unit').val();
var item_extra=$('#item_extra').val();

//alert(item_price_1);
					 
	$.post( "<?php echo base_url("menu_item/save_menu_item"); ?>", {item_price_1:item_price_1, item_price_2:item_price_2, type:type,item_unit:item_unit,item_extra:item_extra, item_id:item_id, item_code:item_code, item_name:item_name})
	.done(function( data ) {
		
	  var obj = jQuery.parseJSON(data);
	   // alert(obj.type); //last id

	  $('div#ajax-modal').modal('hide');
	  loadGrid();// load location data
	  
	  
	  if(obj.type=='E'){
		  
		   displayNotice('page','Menu has been updated successfully!')
		   setTimeout(explode, 1000);
		     
	  }
	  
	  function explode(){
  		location.reload()
		}

	  if(obj.type=='A'){
		  displayNotice('page','Menu has been added successfully!');
		  setTimeout(explode, 1000);  
			
	  }
	  
	  })
	    .fail(function() {
    //alert( "error" );
  })
  .always(function() {
    //alert( "finished" );
});
	  
return false;
}
    </script>