<script type="text/javascript">
jQuery("#type_operation").change(function(){
	jQuery.ajax({
		url : "<?php echo site_url('maintenance/getnameoperation'); ?>/"+jQuery("#type_operation :selected").val(),
		type: "GET",
		success: function(data, textStatus, jqXHR)
		{
			jQuery("#id_operation").empty().append(data);
		},
		error: function (jqXHR, textStatus, errorThrown)
		{
			jQuery("#alert_dialog").html('Erreur lors de la recupération des opérations');
			jQuery("#alert_dialog").dialog('open');
		}
	}); 
});

jQuery("#submitParametrageSpeed").click(function(){
	jQuery.ajax({
		url : "<?php echo site_url('parametrage/speed'); ?>/",
		type: "POST",
		data :jQuery("#frm_assets_maint").serialize(),
		success: function(data, textStatus, jqXHR)
		{
			jQuery("#alert_dialog").html('<?php echo $this->lang->line('Record_Updated_Successfully'); ?>');
			jQuery("#alert_dialog").dialog('open');
		},
		error: function (jqXHR, textStatus, errorThrown)
		{
			jQuery("#alert_dialog").html('Erreur lors du parametrage de la survitesse');
			jQuery("#alert_dialog").dialog('open');
		}
	}); 
	return false;	
}); 
		
	jQuery(document).ready(function() {

	jQuery(document).keypress(function(e) {
			if (e.keyCode == 27) {
			if(jQuery('#assets_category_form_div').css("display") != "none" &&  jQuery('#assets_category_form_div').css("display") != undefined){			
				conf_dialog_assests_catagory_assets_dopost.dialog("open");
				}
		}
	}); 

	jQuery("#loading_top").css("display","none");
			
	});
</script>
<script type="text/javascript">
loadDropdown()
</script>
<script>
jQuery(document).ready(function() {
	jQuery("input:button, input:submit, input:reset").button();	
	jQuery("#debut_alerte").datepicker({dateFormat: 'yy-mm-dd'});
	jQuery("#fin_alerte").datepicker({dateFormat: 'yy-mm-dd'});
	
	jQuery("#debut_alerte").datepicker('setDate', new Date());
	jQuery("#fin_alerte").datepicker('setDate', new Date());

	jQuery("#loading_top").css("display","none");
	jQuery("#device").html(assets_combo_opt_report);
	jQuery("#ddcl-device").css('vertical-align','middle');
	jQuery("#ddcl-device-ddw").css('overflow-x','hidden');
	jQuery("#ddcl-device-ddw").css('overflow-y','auto');
	jQuery("#ddcl-device-ddw").css('height','200px');
	jQuery(".ui-dropdownchecklist-dropcontainer").css('overflow','visible');
});

</script>
<?php if($this->form_model->assets_cat_name == ""){ ?>
<h3 class="title_black"><?php echo $this->lang->line("Create Maintenance"); ?></h3>
<?php }else{ ?>
<h3 class="title_black"><?php echo $this->lang->line("Update Maintenance"); ?></h3>
<?php } ?>
<?php $this->load->view('dashboard/system_messages'); ?>
<div id="assets_category_error" class="error" style="display:none"><?php echo $this->lang->line("Assets category Already Exist"); ?>.!</div>
<div class="content toggle" align="center">
  <form id="frm_assets_maint" method="post" action="#">
    <p id="error" class="addTips">* <?php echo $this->lang->line("Fields_are_mendatory"); ?></p>
    <table width="70%" align="center" class="formtable">
      <tbody>				
	
		<tr>
			<td width="20%"><label>
			Survitesse *
			</td>
			<td width="50%"><input type="text" value="<?php echo $speed?>" name="speed" id="speed" class="text ui-widget-content ui-corner-all"></td>
		</tr>

        <tr>
          <td align="center" colspan="2"><input type="button" id="submitParametrageSpeed" value="<?php echo $this->lang->line('submit'); ?>" name="submitParametrageSpeed"/>
            &nbsp;&nbsp;
            <input type="button" id="btn_cancel"  name="btn_cancel" value="<?php echo $this->lang->line("Back"); ?>" /></td>
        </tr>
      </tbody> 
    </table>
  </form>  
</div>
