<div class="ui-layout-content ui-widget-content-panel">
	 <label class="lbfield95">NAMA OPERATOR</label><label class="lbcolon">:</label>
		<input id="NAMA_OPERATOR" name="NAMA_OPERATOR"   style="width:200px;margin-bottom:2px"  type="text" /><br \>
 </div> 

<script type="text/javascript">

$(document).ready(function(){
	

		$("input.numeric").numeric();		
	
	
		$("#pasi_datapart_rak_new_uom").mcautocomplete({
			showHeader: true,
			 classes: {
						"ui-autocomplete": "highlight"
						},
			columns: [	{name: 'Code', width: '60px', valueField: 'rID'},
						{name: 'Name', width: '250px', valueField: 'r1'}],
			select: function(event, ui) {
				this.value = (ui.item ? ui.item.rID : ''); 
				$("#pasi_datapart_rak_new_uom").val((ui.item ? ui.item.rID: '')); 
				return false;
			},
			 change: function( event, ui ) { 
			 }, 
			minLength: 1,
			delay: 500,
			position: { my : "left top"
					  , at: "left bottom" },
			source: function(request, response) {
				$.ajax({
					url: '<?php echo base_url().'ms_master/ct_ms_find/find_uom'; ?>',
					dataType: 'json',
					data: {
						limit: 15,
						findtext: request.term
					},
					success: function(data) {
						var result;
						if (!data || data.length === 0 || !data.rows || data.rows.length === 0) {
							result = [{label: 'No match found.'}];
							this.value = '';
							$("#pasi_datapart_rak_new_uom").val(''); 
						}
						else {
							result = data.rows;
						}
						response(result);
					}
				});
			}
		});		
       		 
		
		$("#pasi_datapart_rak_new_part_custom_no").mcautocomplete({
			showHeader: true,
			 classes: {
						"ui-autocomplete": "highlight"
						},
			columns: [	{name: 'Code', width: '120px', valueField: 'rID'},
						{name: 'Name', width: '250px', valueField: 'r1'}],
			select: function(event, ui) {
				this.value = (ui.item ? ui.item.rID : ''); 
				$("#pasi_datapart_rak_new_part_custom_no").val((ui.item ? ui.item.rID: '')); 
				$("#pasi_datapart_rak_new_part_custom_name").val((ui.item ? ui.item.r1: '')); 				
				return false;
			},
			 change: function( event, ui ) { 
			 }, 
			minLength: 1,
			delay: 500,
			position: { my : "left top"
					  , at: "left bottom" },
			source: function(request, response) {
				$.ajax({
					url: '<?php echo base_url().'ms_master/ct_ms_item_custom/find_part_custom'; ?>',
					dataType: 'json',
					data: {
						limit: 15,
						findtext: request.term
					},
					success: function(data) {
						var result;
						if (!data || data.length === 0 || !data.rows || data.rows.length === 0) {
							result = [{label: 'No match found.'}];
							this.value = '';
							$("#pasi_datapart_rak_new_part_custom_no").val(''); 
							$("#pasi_datapart_rak_new_part_custom_name").val(''); 
						}
						else {
							result = data.rows;
						}
						response(result);
					}
				});
			}
		});		
       		 
			  
		$("#pasi_datapart_rak_new_base_no").mcautocomplete({
			showHeader: true,
			 classes: {
						"ui-autocomplete": "highlight"
						},
			columns: [	{name: 'Code', width: '120px', valueField: 'rID'},
						{name: 'Name', width: '250px', valueField: 'r1'}],
			select: function(event, ui) {
				this.value = (ui.item ? ui.item.rID : ''); 
				$("#pasi_datapart_rak_new_base_no").val((ui.item ? ui.item.rID: '')); 
				$("#pasi_datapart_rak_new_base_name").val((ui.item ? ui.item.r1: '')); 				
				return false;
			},
			 change: function( event, ui ) { 
			 }, 
			minLength: 1,
			delay: 500,
			position: { my : "left top"
					  , at: "left bottom" },
			source: function(request, response) {
				$.ajax({
					url: '<?php echo base_url().'ms_master/ct_ms_find/find_base_part'; ?>',
					dataType: 'json',
					data: {
						limit: 15,
						findtext: request.term
					},
					success: function(data) {
						var result;
						if (!data || data.length === 0 || !data.rows || data.rows.length === 0) {
							result = [{label: 'No match found.'}];
							this.value = '';
							$("#pasi_datapart_rak_new_base_no").val(''); 
							$("#pasi_datapart_rak_new_base_name").val(''); 
						}
						else {
							result = data.rows;
						}
						response(result);
					}
				});
			}
		});		
       		 
			  
	 
		 
	 
		if ('<?php echo isset($row_data)?'1':'0';  ?>'=='1')
		{
			var row_data=<?php echo isset($row_data)?json_encode($row_data):'[]';  ?>; 
			
			$('#pasi_datapart_rak_new_part_no').val(row_data.r3);     
			$('#pasi_datapart_rak_new_part_name').val(row_data.r4);     
			$('#pasi_datapart_rak_new_base_no').val(row_data.r5);     
			$('#pasi_datapart_rak_new_base_name').val(row_data.r11);     
			$('#pasi_datapart_rak_new_part_custom_no').val(row_data.r6);     
			$('#pasi_datapart_rak_new_part_custom_name').val(row_data.r7);     
			$('#pasi_datapart_rak_new_uom').val(row_data.r9);      
			$('#pasi_datapart_rak_new_min_qty').val(row_data.r14);      
			$('#pasi_datapart_rak_new_sta_qty').val(row_data.r12);      
			$('#pasi_datapart_rak_new_sta_price').val(row_data.r13d);      
			$("#pasi_datapart_rak_new_consumable").prop("checked", (row_data.r10=='1')?true:false);
		} 
		
		$('#pasi_datapart_rak_new_part_no').focus();     
		
});
		  	
</script>

	
	
