2023-04-12 20:24:03 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								function loadYears() {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    $(".contestyear").empty();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    $(".contestname").empty();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    $(".contestdates").empty();
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-13 18:30:12 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    $(".additionalinfo").attr("hidden", true);
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 20:24:03 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    $.ajax({
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        url: base_url+'index.php/cabrillo/getYears',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        type: 'post',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        data: {'station_id': $("#station_id").val()},
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        success: function (data) {
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 21:01:53 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            if (data.length > 0) {
							 | 
						
					
						
							
								
									
										
										
										
											2023-11-01 08:41:58 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                $(".contestyear").append('<div class="col-md-3 control-label" for="year">' + lang_export_cabrillo_select_year + '</div>' +
							 | 
						
					
						
							
								
									
										
										
										
											2023-11-17 23:28:48 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                '<select id="year" class="form-select my-1 me-sm-2 col-md-2 w-auto" name="year">' +
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 20:24:03 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                '</select>' +
							 | 
						
					
						
							
								
									
										
										
										
											2023-11-17 23:28:48 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                '  <button onclick="loadContests();" class="btn btn-sm btn-primary w-auto" type="button">' + lang_export_cabrillo_proceed + '</button>'); 
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 20:24:03 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                $.each(data, function(key, value) {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                    $('#year')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        .append($("<option></option>")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        .attr("value",value.year)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        .text(value.year));
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                });
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 21:01:53 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            } else {
							 | 
						
					
						
							
								
									
										
										
										
											2023-10-31 04:35:42 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                $(".contestyear").append(lang_export_cabrillo_no_contests_for_stationlocation);
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 21:01:53 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            }
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 20:24:03 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    });
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 17:58:47 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								function loadContests() {
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 18:12:14 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    $(".contestname").empty();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    $(".contestdates").empty();
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 17:58:47 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    $.ajax({
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        url: base_url+'index.php/cabrillo/getContests',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        type: 'post',
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 20:24:03 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        data: {'year': $("#year").val(),
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                'station_id': $("#station_id").val()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        },
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 17:58:47 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        success: function (data) {
							 | 
						
					
						
							
								
									
										
										
										
											2023-11-01 08:41:58 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                $(".contestname").append('<div class="col-md-3 control-label" for="contestid">' + lang_export_cabrillo_select_contest + '</div>' +
							 | 
						
					
						
							
								
									
										
										
										
											2023-11-17 23:28:48 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                '<select class="form-select my-1 me-sm-2 col-md-4 w-auto" id="contestid" name="contestid">' +
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 17:58:47 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                '</select>' +
							 | 
						
					
						
							
								
									
										
										
										
											2023-11-17 23:28:48 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                '  <button onclick="loadContestDates();" class="btn btn-sm btn-primary w-auto" type="button">' + lang_export_cabrillo_proceed + '</button>'); 
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 17:58:47 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                $.each(data, function(key, value) {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                    $('#contestid')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        .append($("<option></option>")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        .attr("value",value.col_contest_id)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        .text(value.col_contest_id));
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                });
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    });
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								function loadContestDates() {
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 18:12:14 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    $(".contestdates").empty();
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 17:58:47 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    $.ajax({
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        url: base_url+'index.php/cabrillo/getContestDates',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        type: 'post',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        data: {'year': $("#year").val(),
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 20:24:03 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                'contestid': $("#contestid").val(),
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                'station_id': $("#station_id").val()},
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 17:58:47 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        success: function (data) {
							 | 
						
					
						
							
								
									
										
										
										
											2023-11-01 08:41:58 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                $(".contestdates").append('<div class="col-md-3 control-label" for="contestdates">' + lang_export_cabrillo_select_date_range + '</div>' +
							 | 
						
					
						
							
								
									
										
										
										
											2023-11-17 23:28:48 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                '<select class="form-select my-1 me-sm-2 col-md-2 w-auto" id="contestdatesfrom" name="contestdatesfrom">' +
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 21:01:53 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                '</select>' +
							 | 
						
					
						
							
								
									
										
										
										
											2023-11-17 23:28:48 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                '<select class="form-select my-1 me-sm-2 col-md-2 w-auto" id="contestdatesto" name="contestdatesto">' +
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 17:58:47 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                '</select>' +
							 | 
						
					
						
							
								
									
										
										
										
											2023-11-17 23:28:48 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                '  <button class="btn btn-sm btn-primary w-auto" onclick="addAdditionalInfo();" type="button">' + lang_export_cabrillo_proceed + '</button>'); 
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 17:58:47 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                $.each(data, function(key, value) {
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 21:01:53 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                    $('#contestdatesfrom')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        .append($("<option></option>")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        .attr("value", value.date)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        .text(value.date));
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                });
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                $.each(data, function(key, value) {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                    $('#contestdatesto')
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 17:58:47 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        .append($("<option></option>")
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 21:01:53 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                        .attr("value", value.date)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        .text(value.date));
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 17:58:47 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                });
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    });
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-13 18:30:12 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								function addAdditionalInfo() {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    $(".additionalinfo").removeAttr("hidden");
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-12 17:58:47 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}
							 |