Logging is working. Contest exchange is being logged. Basic contest logging is now working.
这个提交包含在:
		
							父节点
							
								
									e557d92c47
								
							
						
					
					
						当前提交
						2229a1579b
					
				
					共有  4 个文件被更改,包括 60 次插入 和 60 次删除
				
			
		|  | @ -104,41 +104,7 @@ class QSO extends CI_Controller { | ||||||
| 	 */ | 	 */ | ||||||
| 	public function saveqso() { | 	public function saveqso() { | ||||||
|         $this->load->model('logbook_model'); |         $this->load->model('logbook_model'); | ||||||
|         // Add QSO
 |  | ||||||
|         // $this->logbook_model->add();
 |  | ||||||
|         //change to create_qso function as add and create_qso duplicate functionality
 |  | ||||||
|         $this->logbook_model->create_qso(); |         $this->logbook_model->create_qso(); | ||||||
| 
 |  | ||||||
|         // Store Basic QSO Info for reuse
 |  | ||||||
|         // Put data in an array first, then call set_userdata once.
 |  | ||||||
|         // This solves the problem of CI dumping out the session
 |  | ||||||
|         // cookie each time set_userdata is called.
 |  | ||||||
|         // For more info, see http://bizhole.com/codeigniter-nginx-error-502-bad-gateway/
 |  | ||||||
|         $qso_data = array( |  | ||||||
|             'start_date' => $this->input->post('start_date'), |  | ||||||
|             'start_time' => $this->input->post('start_time'), |  | ||||||
|             'time_stamp' => time(), |  | ||||||
|             'band' => $this->input->post('band'), |  | ||||||
|             'freq' => $this->input->post('freq_display'), |  | ||||||
|             'freq_rx' => $this->input->post('freq_display_rx'), |  | ||||||
|             'mode' => $this->input->post('mode'), |  | ||||||
|             'sat_name' => $this->input->post('sat_name'), |  | ||||||
|             'sat_mode' => $this->input->post('sat_mode'), |  | ||||||
|             'prop_mode' => $this->input->post('prop_mode'), |  | ||||||
|             'radio' => $this->input->post('radio'), |  | ||||||
|             'station_profile_id' => $this->input->post('station_profile'), |  | ||||||
|             'transmit_power' => $this->input->post('transmit_power') |  | ||||||
|         ); |  | ||||||
| 
 |  | ||||||
|         setcookie("radio", $qso_data['radio'], time()+3600*24*99); |  | ||||||
|         setcookie("station_profile_id", $qso_data['station_profile_id'], time()+3600*24*99); |  | ||||||
| 
 |  | ||||||
|         $this->session->set_userdata($qso_data); |  | ||||||
| 
 |  | ||||||
|         // If SAT name is set make it session set to sat
 |  | ||||||
|         if($this->input->post('sat_name')) { |  | ||||||
|             $this->session->set_userdata('prop_mode', 'SAT'); |  | ||||||
|         } |  | ||||||
|     } |     } | ||||||
| 	 | 	 | ||||||
| 	function edit() { | 	function edit() { | ||||||
|  |  | ||||||
|  | @ -22,6 +22,26 @@ class Logbook_model extends CI_Model { | ||||||
|         $prop_mode = "SAT"; |         $prop_mode = "SAT"; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     // Contest exchange, need to separate between serial and other type of exchange
 | ||||||
|  |     if($this->input->post('exchangeradio')) { | ||||||
|  |         if($this->input->post('exchangeradio') == "serial") { | ||||||
|  |             $srx = $this->input->post('exch_recv'); | ||||||
|  |             $stx = $this->input->post('exch_sent'); | ||||||
|  |             $srx_string = null; | ||||||
|  |             $stx_string = null; | ||||||
|  |         } else { | ||||||
|  |             $srx = null; | ||||||
|  |             $stx = null; | ||||||
|  |             $srx_string = $this->input->post('exch_recv'); | ||||||
|  |             $stx_string = $this->input->post('exch_sent'); | ||||||
|  |         } | ||||||
|  |     } else { | ||||||
|  |         $srx_string = null; | ||||||
|  |         $stx_string = null; | ||||||
|  |         $srx = null; | ||||||
|  |         $stx = null; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     if($this->session->userdata('user_locator')){ |     if($this->session->userdata('user_locator')){ | ||||||
|         $locator = $this->session->userdata('user_locator'); |         $locator = $this->session->userdata('user_locator'); | ||||||
|     } else { |     } else { | ||||||
|  | @ -108,8 +128,10 @@ class Logbook_model extends CI_Model { | ||||||
|             'COL_AGE' => null, |             'COL_AGE' => null, | ||||||
|             'COL_TEN_TEN' => null, |             'COL_TEN_TEN' => null, | ||||||
|             'COL_TX_PWR' => $tx_power, |             'COL_TX_PWR' => $tx_power, | ||||||
|             'COL_STX' => null, |             'COL_STX' => $stx, | ||||||
|             'COL_SRX' => null, |             'COL_SRX' => $srx, | ||||||
|  |             'COL_STX_STRING' => $stx_string, | ||||||
|  |             'COL_SRX_STRING' => $srx_string, | ||||||
|             'COL_NR_BURSTS' => null, |             'COL_NR_BURSTS' => null, | ||||||
|             'COL_NR_PINGS' => null, |             'COL_NR_PINGS' => null, | ||||||
|             'COL_MAX_BURSTS' => null, |             'COL_MAX_BURSTS' => null, | ||||||
|  |  | ||||||
|  | @ -97,7 +97,6 @@ | ||||||
|                                     <div class="form-group col-md-3"> |                                     <div class="form-group col-md-3"> | ||||||
|                                         <label for="callsign">Callsign</label> |                                         <label for="callsign">Callsign</label> | ||||||
|                                         <input type="text" class="form-control form-control-sm" id="callsign" name="callsign" required> |                                         <input type="text" class="form-control form-control-sm" id="callsign" name="callsign" required> | ||||||
|                                         <small id="callsign_info" class="badge badge-secondary"></small> <small id="lotw_info" class="badge badge-light"></small> |  | ||||||
|                                     </div> |                                     </div> | ||||||
| 
 | 
 | ||||||
|                                     <div class="form-group col-md-1"> |                                     <div class="form-group col-md-1"> | ||||||
|  | @ -152,9 +151,6 @@ | ||||||
|             <div class="card log"> |             <div class="card log"> | ||||||
|                 <div class="card-header"><h5 class="card-title">Logbook (for this logging session)</h5></div> |                 <div class="card-header"><h5 class="card-title">Logbook (for this logging session)</h5></div> | ||||||
| 
 | 
 | ||||||
|                 <div id="qso-last-table"> |  | ||||||
| 
 |  | ||||||
|                     <div class="table-responsive"> |  | ||||||
|                         <table class="table-sm table qsotable table-bordered table-hover table-striped table-condensed text-center"> |                         <table class="table-sm table qsotable table-bordered table-hover table-striped table-condensed text-center"> | ||||||
|                             <thead> |                             <thead> | ||||||
|                             <tr class="log_title titles"> |                             <tr class="log_title titles"> | ||||||
|  | @ -172,8 +168,6 @@ | ||||||
| 
 | 
 | ||||||
|                             </tbody> |                             </tbody> | ||||||
|                         </table> |                         </table> | ||||||
|                     </div> |  | ||||||
|                 </div> |  | ||||||
|             </div> |             </div> | ||||||
|         </div> |         </div> | ||||||
|     </div> |     </div> | ||||||
|  |  | ||||||
|  | @ -2439,6 +2439,29 @@ function deleteQsl(id) { | ||||||
| <?php if ($this->uri->segment(1) == "contesting") { ?>
 | <?php if ($this->uri->segment(1) == "contesting") { ?>
 | ||||||
|     <script> |     <script> | ||||||
| 
 | 
 | ||||||
|  |         // Callsign always has focus on load
 | ||||||
|  |         $("#callsign").focus(); | ||||||
|  | 
 | ||||||
|  |         // Init serial sent as 1 when lading page
 | ||||||
|  |         $("#exch_sent").val(1); | ||||||
|  | 
 | ||||||
|  |         // realtime clock
 | ||||||
|  |         $(function($) { | ||||||
|  |             var options = { | ||||||
|  |                 utc: true, | ||||||
|  |                 format: '%H:%M:%S' | ||||||
|  |             } | ||||||
|  |             $('.input_time').jclock(options); | ||||||
|  |         }); | ||||||
|  | 
 | ||||||
|  |         $(function($) { | ||||||
|  |             var options = { | ||||||
|  |                 utc: true, | ||||||
|  |                 format: '%d-%m-%Y' | ||||||
|  |             } | ||||||
|  |             $('.input_date').jclock(options); | ||||||
|  |         }); | ||||||
|  | 
 | ||||||
|         // We don't want spaces to be written in callsign
 |         // We don't want spaces to be written in callsign
 | ||||||
|         $(function() { |         $(function() { | ||||||
|             $('#callsign').on('keypress', function(e) { |             $('#callsign').on('keypress', function(e) { | ||||||
|  | @ -2466,10 +2489,8 @@ function deleteQsl(id) { | ||||||
|             reset_log_fields(); |             reset_log_fields(); | ||||||
|         } else if ((e.keyCode == 10 || e.keyCode == 13) && (e.ctrlKey || e.metaKey)) { |         } else if ((e.keyCode == 10 || e.keyCode == 13) && (e.ctrlKey || e.metaKey)) { | ||||||
|             logQso(); |             logQso(); | ||||||
|         } else if (e.ctrlKey && e.altKey && e.which == 89) { |         } else if (e.which == 27) { | ||||||
|             alert("Ctrl + Alt + Y shortcut combination was pressed"); |             reset_log_fields(); | ||||||
|         } else if (e.ctrlKey && e.altKey && e.shiftKey && e.which == 85) { |  | ||||||
|             alert("Ctrl + Alt + Shift + U shortcut combination was pressed"); |  | ||||||
|         // Space to jump to either callsign or sent exchange
 |         // Space to jump to either callsign or sent exchange
 | ||||||
|         } else if (e.which == 32) { |         } else if (e.which == 32) { | ||||||
|             if ($(document.activeElement).attr("id") == "callsign") { |             if ($(document.activeElement).attr("id") == "callsign") { | ||||||
|  | @ -2483,7 +2504,6 @@ function deleteQsl(id) { | ||||||
| 
 | 
 | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
|     // On Key up check and suggest callsigns
 |     // On Key up check and suggest callsigns
 | ||||||
|     $("#callsign").keyup(function() { |     $("#callsign").keyup(function() { | ||||||
|         var call = $(this).val(); |         var call = $(this).val(); | ||||||
|  | @ -2513,7 +2533,7 @@ function deleteQsl(id) { | ||||||
|             $('.callsign-suggestions').text(""); |             $('.callsign-suggestions').text(""); | ||||||
|             $(".qsotable tbody").prepend('<tr>' + |             $(".qsotable tbody").prepend('<tr>' + | ||||||
|                 '<td>'+$("#start_date").val()+ ' ' + $("#start_time").val() + '</td>' + |                 '<td>'+$("#start_date").val()+ ' ' + $("#start_time").val() + '</td>' + | ||||||
|                 '<td>'+$("#callsign").val()+'</td>' + |                 '<td>'+$("#callsign").val().toUpperCase()+'</td>' + | ||||||
|                 '<td>'+$("#band").val()+'</td>' + |                 '<td>'+$("#band").val()+'</td>' + | ||||||
|                 '<td>'+$("#mode").val()+'</td>' + |                 '<td>'+$("#mode").val()+'</td>' + | ||||||
|                 '<td>'+$("#rst_sent").val()+'</td>' + |                 '<td>'+$("#rst_sent").val()+'</td>' + | ||||||
|  | @ -2522,16 +2542,6 @@ function deleteQsl(id) { | ||||||
|                 '<td>'+$("#exch_recv").val()+'</td>' + |                 '<td>'+$("#exch_recv").val()+'</td>' + | ||||||
|                 '</tr>'); |                 '</tr>'); | ||||||
| 
 | 
 | ||||||
|             $('#name').val(""); |  | ||||||
| 
 |  | ||||||
|             $('#callsign').val(""); |  | ||||||
|             $('#comment').val(""); |  | ||||||
|             $('#exch_recv').val(""); |  | ||||||
|             if ($('input[name=exchangeradio]:checked', '#qso_input').val() == "serial") { |  | ||||||
|                 $("#exch_sent").val(+$("#exch_sent").val() + 1); |  | ||||||
|             } |  | ||||||
|             $("#callsign").focus(); |  | ||||||
| 
 |  | ||||||
|             var baseURL= "<?php echo base_url();?>"; |             var baseURL= "<?php echo base_url();?>"; | ||||||
|             var formdata = new FormData(document.getElementById("qso_input")); |             var formdata = new FormData(document.getElementById("qso_input")); | ||||||
|             $.ajax({ |             $.ajax({ | ||||||
|  | @ -2542,7 +2552,15 @@ function deleteQsl(id) { | ||||||
|                 contentType: false, |                 contentType: false, | ||||||
|                 enctype: 'multipart/form-data', |                 enctype: 'multipart/form-data', | ||||||
|                 success: function (html) { |                 success: function (html) { | ||||||
|                     alert("logged"); |                     $('#name').val(""); | ||||||
|  | 
 | ||||||
|  |                     $('#callsign').val(""); | ||||||
|  |                     $('#comment').val(""); | ||||||
|  |                     $('#exch_recv').val(""); | ||||||
|  |                     if ($('input[name=exchangeradio]:checked', '#qso_input').val() == "serial") { | ||||||
|  |                         $("#exch_sent").val(+$("#exch_sent").val() + 1); | ||||||
|  |                     } | ||||||
|  |                     $("#callsign").focus(); | ||||||
|                 } |                 } | ||||||
|             }); |             }); | ||||||
|         } |         } | ||||||
|  |  | ||||||
		正在加载…
	
		在新工单中引用