<div style="height:40px;">
</div>
	<h1>Upload File Part List</h1>
	<br>
   <form method="post" action="" id="upload_file_part_list">
      <label for="userfile_part_list">File</label>
      <input type="file" name="userfile_part_list" id="userfile_part_list" size="40" />
      <input type="submit" name="submit" id="submit" value="Upload" />
   </form>
   <hr>
   <h2>Files</h2>
   <div id="files_part_list" style="font-weight:bold;font-size:17px;"></div>
   
<script type="text/javascript">
    
	$(document).ready(function(){
		
		$(".part_list_asset_date").datepicker({
			dateFormat: 'yy-mm-dd'
		});
		
		function refresh_files()
		{
		   $.get('<?php echo base_url().'loaderfiles/masterdata/'; ?>')
		   .success(function (data){
			  $('#files_part_list').html(data);
		   });
		};
	
		$('#userfile_part_list').live('change', function(){
			$('#files_part_list').html('<p>'+ $('#userfile_part_list').val() +'</p>'); 
		});
		
		jQuery.extend({
			handleError: function( s, xhr, status, e ) {
			// If a local callback was specified, fire it
				if ( s.error )
					s.error( xhr, status, e );
				// If we have some XML response text (e.g. from an AJAX call) then log it in the console
				else if(xhr.responseText)
					console.log(xhr.responseText);
			}
		});
		
		$(function() {
			$('#upload_file_part_list').submit(function(e) {
				e.preventDefault();
				$.ajaxFileUpload({
					url         :'./ms_master/ct_ms_upload_part_list/upload_file_part_list/',
					secureuri      :false,
					fileElementId  :'userfile_part_list',
					dataType    : 'json',
					data        : {
						'userfile_part_list'  : $('#userfile_part_list').val()
					},
					success  : function (data, status)
					{
						alert(data.des);
						if(data.sts == '00') {
						
						$('#frmupload_part_listdialog').dialog("destroy"); 
						$(".frmupload_part_listdialog_cl").remove(); 
						$("body").append('<div id="frmupload_part_listdialog" title="UPLOAD FILE PART LIST" class="frmupload_part_listdialog_cl"></div>'); 
						
						jQuery("#tblupload_part_list").trigger('reloadGrid');
						}
					}
				});
			return false;
		   });
		});
	});
		  	
</script>



	
	