| 
									
										
										
										
											2020-03-02 02:08:17 +08:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Eqsl_images extends CI_Model { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-14 19:28:50 +08:00
										 |  |  | 	function __construct() | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		parent::__construct(); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2020-03-02 02:08:17 +08:00
										 |  |  | 	function get_image($qso_id) { | 
					
						
							|  |  |  | 		$this->db->where('qso_id', $qso_id); | 
					
						
							|  |  |  | 		$query = $this->db->get('eQSL_images');  | 
					
						
							|  |  |  | 		 | 
					
						
							|  |  |  | 		$row = $query->row(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		if(isset($row)) { | 
					
						
							|  |  |  | 			return $row->image_file; | 
					
						
							|  |  |  | 		} else { | 
					
						
							|  |  |  | 			return "No Image"; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	function save_image($qso_id, $image_name) { | 
					
						
							|  |  |  | 		$data = array( | 
					
						
							|  |  |  | 		        'qso_id' => $qso_id, | 
					
						
							|  |  |  | 		        'image_file' => $image_name, | 
					
						
							|  |  |  | 		); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		$this->db->insert('eQSL_images', $data); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ?>
 |