当前提交
						07a9cb87bd
					
				
					共有  3 个文件被更改,包括 86 次插入 和 1 次删除
				
			
		|  | @ -283,6 +283,7 @@ class Awards extends CI_Controller { | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         $data['cq_array'] = $this->cq->get_cq_array($bands, $postdata); |         $data['cq_array'] = $this->cq->get_cq_array($bands, $postdata); | ||||||
|  |         $data['cq_summary'] = $this->cq->get_cq_summary($bands); | ||||||
| 
 | 
 | ||||||
|         // Render page
 |         // Render page
 | ||||||
|         $data['page_title'] = "Awards - CQ Magazine"; |         $data['page_title'] = "Awards - CQ Magazine"; | ||||||
|  |  | ||||||
|  | @ -212,4 +212,58 @@ class CQ extends CI_Model{ | ||||||
|         return $sql; |         return $sql; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     /* | ||||||
|  |     * Function gets worked and confirmed summary on each band on the active stationprofile | ||||||
|  |     */ | ||||||
|  |     function get_cq_summary($bands) { | ||||||
|  |         $CI =& get_instance(); | ||||||
|  |         $CI->load->model('Stations'); | ||||||
|  |         $station_id = $CI->Stations->find_active(); | ||||||
|  | 
 | ||||||
|  |         foreach ($bands as $band) { | ||||||
|  |             $worked = $this->getSummaryByBand($band, $station_id); | ||||||
|  |             $confirmed = $this->getSummaryByBandConfirmed($band, $station_id); | ||||||
|  |             $cqSummary['worked'][$band] = $worked[0]->count; | ||||||
|  |             $cqSummary['confirmed'][$band] = $confirmed[0]->count; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         return $cqSummary; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function getSummaryByBand($band, $station_id) { | ||||||
|  |         $sql = "SELECT count(distinct thcv.col_cqz) as count FROM " . $this->config->item('table_name') . " thcv"; | ||||||
|  | 
 | ||||||
|  |         $sql .= " where station_id = " . $station_id; | ||||||
|  | 
 | ||||||
|  |         if ($band == 'SAT') { | ||||||
|  |             $sql .= " and thcv.col_prop_mode ='" . $band . "'"; | ||||||
|  |         } else { | ||||||
|  |             $sql .= " and thcv.col_prop_mode !='SAT'"; | ||||||
|  |             $sql .= " and thcv.col_band ='" . $band . "'"; | ||||||
|  | 
 | ||||||
|  |         } | ||||||
|  |         $query = $this->db->query($sql); | ||||||
|  | 
 | ||||||
|  |         return $query->result(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function getSummaryByBandConfirmed($band, $station_id){ | ||||||
|  |         $sql = "SELECT count(distinct thcv.col_cqz) as count FROM " . $this->config->item('table_name') . " thcv"; | ||||||
|  | 
 | ||||||
|  |         $sql .= " where station_id = " . $station_id; | ||||||
|  | 
 | ||||||
|  |         if ($band == 'SAT') { | ||||||
|  |             $sql .= " and thcv.col_prop_mode ='" . $band . "'"; | ||||||
|  |         } else { | ||||||
|  |             $sql .= " and thcv.col_prop_mode !='SAT'"; | ||||||
|  |             $sql .= " and thcv.col_band ='" . $band . "'"; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         $sql .= " and (col_qsl_rcvd = 'Y' or col_lotw_qsl_rcvd = 'Y')"; | ||||||
|  | 
 | ||||||
|  |         $query = $this->db->query($sql); | ||||||
|  | 
 | ||||||
|  |         return $query->result(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -165,7 +165,37 @@ | ||||||
|             } |             } | ||||||
|             echo '</tr>'; |             echo '</tr>'; | ||||||
|         } |         } | ||||||
|         echo '</tfoot></table></div>'; |         echo '</table> | ||||||
|  |         <h2>Summary</h2> | ||||||
|  | 
 | ||||||
|  |         <table class="table-sm table table-bordered table-hover table-striped table-condensed text-center"> | ||||||
|  |         <thead> | ||||||
|  |         <tr><td></td>'; | ||||||
|  | 
 | ||||||
|  |         foreach($bands as $band) { | ||||||
|  |             echo '<td>' . $band . '</td>'; | ||||||
|  |         } | ||||||
|  |         echo '</tr>'; | ||||||
|  | 
 | ||||||
|  |         echo '</tr> | ||||||
|  |         </thead> | ||||||
|  |         <tbody> | ||||||
|  | 
 | ||||||
|  |         <tr><td>Total worked</td>'; | ||||||
|  | 
 | ||||||
|  |         foreach ($cq_summary['worked'] as $dxcc) {      // Fills the table with the data
 | ||||||
|  |             echo '<td style="text-align: center">' . $dxcc . '</td>'; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         echo '</tr><tr> | ||||||
|  |         <td>Total confirmed</td>'; | ||||||
|  |         foreach ($cq_summary['confirmed'] as $dxcc) {      // Fills the table with the data
 | ||||||
|  |             echo '<td style="text-align: center">' . $dxcc . '</td>'; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         echo '</tr> | ||||||
|  |         </table> | ||||||
|  |         </div>'; | ||||||
| 
 | 
 | ||||||
|     } |     } | ||||||
|     else { |     else { | ||||||
|  |  | ||||||
		正在加载…
	
		在新工单中引用