Improved Error reporting on ADIF upload and display the maxmium file size for upload the web server supports
这个提交包含在:
		
							父节点
							
								
									78b16e921b
								
							
						
					
					
						当前提交
						9a49b1c207
					
				
					共有  3 个文件被更改,包括 22 次插入 和 3 次删除
				
			
		|  | @ -104,10 +104,13 @@ class adif extends CI_Controller { | ||||||
| 
 | 
 | ||||||
| 		if ( ! $this->upload->do_upload()) | 		if ( ! $this->upload->do_upload()) | ||||||
| 		{ | 		{ | ||||||
| 		    //print $this->upload->display_errors();
 |  | ||||||
| 		    //exit(0);
 |  | ||||||
| 			$data['error'] = $this->upload->display_errors(); | 			$data['error'] = $this->upload->display_errors(); | ||||||
| 
 | 
 | ||||||
|  | 			$max_upload = min(ini_get('post_max_size'), ini_get('upload_max_filesize')); | ||||||
|  | 			$max_upload = str_replace('M', '', $max_upload); | ||||||
|  | 
 | ||||||
|  | 			$data['max_upload'] = $max_upload * 1024; | ||||||
|  | 
 | ||||||
| 			$this->load->view('interface_assets/header', $data); | 			$this->load->view('interface_assets/header', $data); | ||||||
| 			$this->load->view('adif/import'); | 			$this->load->view('adif/import'); | ||||||
| 			$this->load->view('interface_assets/footer'); | 			$this->load->view('interface_assets/footer'); | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| 
 | 
 | ||||||
| <div class="container"> | <div class="container adif"> | ||||||
| 
 | 
 | ||||||
| 	<h1>ADIF Functions</h1> | 	<h1>ADIF Functions</h1> | ||||||
| 
 | 
 | ||||||
|  | @ -11,6 +11,12 @@ | ||||||
| 	    <h5 class="card-title"></h5> | 	    <h5 class="card-title"></h5> | ||||||
| 	    <p class="card-text">Please make sure there is no extra text at the top of the ADIF file as the import will fail.</p> | 	    <p class="card-text">Please make sure there is no extra text at the top of the ADIF file as the import will fail.</p> | ||||||
| 
 | 
 | ||||||
|  | 	    <?php if(isset($error)) { ?>
 | ||||||
|  | 			<div class="alert alert-danger" role="alert"> | ||||||
|  | 			  <?php echo $error; ?>
 | ||||||
|  | 			</div> | ||||||
|  | 	    <?php } ?>
 | ||||||
|  | 
 | ||||||
| 	    <p><span class="label important">Important</span> Log files must have the file type .adi</p> | 	    <p><span class="label important">Important</span> Log files must have the file type .adi</p> | ||||||
| 
 | 
 | ||||||
| 		<form class="form-inline" action="<?php echo site_url('adif/import'); ?>" method="post" enctype="multipart/form-data"> | 		<form class="form-inline" action="<?php echo site_url('adif/import'); ?>" method="post" enctype="multipart/form-data"> | ||||||
|  | @ -19,6 +25,9 @@ | ||||||
| 
 | 
 | ||||||
| 		  <button type="submit" class="btn btn-primary mb-2" value="Upload">Upload</button> | 		  <button type="submit" class="btn btn-primary mb-2" value="Upload">Upload</button> | ||||||
| 		</form> | 		</form> | ||||||
|  | 
 | ||||||
|  | 		<p><span class="badge badge-warning">Warning</span> Maximum file upload size is <?php echo $max_upload; ?> Megabytes.</p>
 | ||||||
|  | 
 | ||||||
| 	  </div> | 	  </div> | ||||||
| 	</div> | 	</div> | ||||||
| 
 | 
 | ||||||
|  | @ -28,10 +37,12 @@ | ||||||
|   <div class="card-header"> |   <div class="card-header"> | ||||||
|     ADIF Export |     ADIF Export | ||||||
|   </div> |   </div> | ||||||
|  | 
 | ||||||
|   <div class="card-body"> |   <div class="card-body"> | ||||||
|     <h5 class="card-title">Take your logbook file anywhere!</h5> |     <h5 class="card-title">Take your logbook file anywhere!</h5> | ||||||
|     <p class="card-text">Exporting ADIFs allows you to import contacts into third party applications like LoTW, Awards or just for keeping a backup.</p> |     <p class="card-text">Exporting ADIFs allows you to import contacts into third party applications like LoTW, Awards or just for keeping a backup.</p> | ||||||
| 
 | 
 | ||||||
|  |      | ||||||
|     <a href="<?php echo site_url('adif/exportall'); ?>" title="Export All" target="_blank" class="btn btn-outline-secondary btn-sm">Export All QSOs</a> |     <a href="<?php echo site_url('adif/exportall'); ?>" title="Export All" target="_blank" class="btn btn-outline-secondary btn-sm">Export All QSOs</a> | ||||||
|      |      | ||||||
|     <br><br> |     <br><br> | ||||||
|  |  | ||||||
|  | @ -34,6 +34,11 @@ | ||||||
| 	padding-top: 15px; | 	padding-top: 15px; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | .adif .alert p { | ||||||
|  |     margin-bottom: 0rem; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| TD.qsl{ | TD.qsl{ | ||||||
|     width: 20px; |     width: 20px; | ||||||
| } | } | ||||||
|  |  | ||||||
		正在加载…
	
		在新工单中引用