@@ -84,11 +84,10 @@ function jsonentity($adif) {
8484 echo json_encode ($ return , JSON_PRETTY_PRINT );
8585 }
8686
87- function json ($ tempcallsign , $ temptype , $ tempband , $ tempmode , $ tempstation_id = null ) {
87+ function json ($ tempcallsign , $ tempband , $ tempmode , $ tempstation_id = null ) {
8888 session_write_close ();
8989 // Cleaning for security purposes
9090 $ callsign = $ this ->security ->xss_clean ($ tempcallsign );
91- $ type = $ this ->security ->xss_clean ($ temptype );
9291 $ band = $ this ->security ->xss_clean ($ tempband );
9392 $ mode = $ this ->security ->xss_clean ($ tempmode );
9493 $ station_id = $ this ->security ->xss_clean ($ tempstation_id );
@@ -134,7 +133,7 @@ function json($tempcallsign, $temptype, $tempband, $tempmode, $tempstation_id =
134133
135134 $ lookupcall =$ this ->get_plaincall ($ callsign );
136135
137- $ return ['partial ' ] = $ this ->partial ($ lookupcall );
136+ $ return ['partial ' ] = $ this ->partial ($ lookupcall, $ band );
138137
139138 $ callbook = $ this ->logbook_model ->loadCallBook ($ callsign , $ this ->config ->item ('use_fullname ' ));
140139
@@ -152,8 +151,8 @@ function json($tempcallsign, $temptype, $tempband, $tempmode, $tempstation_id =
152151 $ return ['qsl_manager ' ] = $ this ->nval ($ callbook ['qslmgr ' ] ?? '' , $ this ->logbook_model ->call_qslvia ($ callsign ));
153152 $ return ['callsign_state ' ] = $ this ->nval ($ callbook ['state ' ] ?? '' , $ this ->logbook_model ->call_state ($ callsign ));
154153 $ return ['callsign_us_county ' ] = $ this ->nval ($ callbook ['us_county ' ] ?? '' , $ this ->logbook_model ->call_us_county ($ callsign ));
155- $ return ['workedBefore ' ] = $ this ->worked_grid_before ($ return ['callsign_qra ' ], $ type , $ band , $ mode );
156- $ return ['confirmed ' ] = $ this ->confirmed_grid_before ($ return ['callsign_qra ' ], $ type , $ band , $ mode );
154+ $ return ['workedBefore ' ] = $ this ->worked_grid_before ($ return ['callsign_qra ' ], $ band , $ mode );
155+ $ return ['confirmed ' ] = $ this ->confirmed_grid_before ($ return ['callsign_qra ' ], $ band , $ mode );
157156 $ return ['timesWorked ' ] = $ this ->logbook_model ->times_worked ($ lookupcall );
158157
159158 if ($ this ->session ->userdata ('user_show_profile_image ' )) {
@@ -201,7 +200,7 @@ function nval($val1, $val2) {
201200 return (($ val2 ?? "" ) === "" ? ($ val1 ?? "" ) : ($ val2 ?? "" ));
202201 }
203202
204- function confirmed_grid_before ($ gridsquare , $ type , $ band , $ mode ) {
203+ function confirmed_grid_before ($ gridsquare , $ band , $ mode ) {
205204 if (strlen ($ gridsquare ) < 4 )
206205 return false ;
207206
@@ -235,7 +234,7 @@ function confirmed_grid_before($gridsquare, $type, $band, $mode) {
235234 }
236235
237236
238- if ($ type == "SAT " ) {
237+ if ($ band == "SAT " ) {
239238 $ this ->db ->where ('COL_PROP_MODE ' , 'SAT ' );
240239 if ($ extrawhere != '' ) {
241240 $ this ->db ->where ('( ' .$ extrawhere .') ' );
@@ -270,7 +269,7 @@ function confirmed_grid_before($gridsquare, $type, $band, $mode) {
270269 return false ;
271270 }
272271
273- function worked_grid_before ($ gridsquare , $ type , $ band , $ mode )
272+ function worked_grid_before ($ gridsquare , $ band , $ mode )
274273 {
275274 if (strlen ($ gridsquare ) < 4 )
276275 return false ;
@@ -279,7 +278,7 @@ function worked_grid_before($gridsquare, $type, $band, $mode)
279278 $ logbooks_locations_array = $ this ->logbooks_model ->list_logbook_relationships ($ this ->session ->userdata ('active_station_logbook ' ));
280279
281280 if (!empty ($ logbooks_locations_array )) {
282- if ($ type == "SAT " ) {
281+ if ($ band == "SAT " ) {
283282 $ this ->db ->where ('COL_PROP_MODE ' , 'SAT ' );
284283 } else {
285284 $ this ->db ->where ('COL_MODE ' , $ this ->logbook_model ->get_main_mode_from_mode ($ mode ));
@@ -625,7 +624,7 @@ function view($id) {
625624 $ this ->load ->view ('interface_assets/footer ' );
626625 }
627626
628- function partial ($ id ) {
627+ function partial ($ id, $ band = null ) {
629628 $ this ->load ->model ('user_model ' );
630629 if (!$ this ->user_model ->authorize ($ this ->config ->item ('auth_mode ' ))) { return ; }
631630
@@ -855,7 +854,7 @@ function partial($id) {
855854 }
856855 if (isset ($ data ['callsign ' ]['gridsquare ' ])) {
857856 $ this ->load ->model ('logbook_model ' );
858- $ callsign ['grid_worked ' ] = $ this ->logbook_model ->check_if_grid_worked_in_logbook (strtoupper (substr ($ data ['callsign ' ]['gridsquare ' ],0 ,4 )), 0 , $ this ->session ->userdata ('user_default_band ' ));
857+ $ callsign ['grid_worked ' ] = $ this ->logbook_model ->check_if_grid_worked_in_logbook (strtoupper (substr ($ data ['callsign ' ]['gridsquare ' ],0 ,4 )), 0 , $ this ->session ->userdata ('user_default_band ' ))-> num_rows () ;
859858 }
860859 if (isset ($ callsign ['callsign ' ]['dxcc ' ])) {
861860 $ this ->load ->model ('logbook_model ' );
@@ -879,7 +878,7 @@ function partial($id) {
879878
880879 if (isset ($ callsign ['callsign ' ]['gridsquare ' ])) {
881880 $ this ->load ->model ('logbook_model ' );
882- $ callsign ['grid_worked ' ] = $ this ->logbook_model ->check_if_grid_worked_in_logbook (strtoupper (substr ($ callsign ['callsign ' ]['gridsquare ' ],0 ,4 )), 0 , $ this -> session -> userdata ( ' user_default_band ' ) );
881+ $ callsign ['grid_worked ' ] = $ this ->logbook_model ->check_if_grid_worked_in_logbook (strtoupper (substr ($ callsign ['callsign ' ]['gridsquare ' ],0 ,4 )), 0 , $ band )-> num_rows ( );
883882 }
884883 if (isset ($ callsign ['callsign ' ]['error ' ])) {
885884 $ callsign ['error ' ] = $ callsign ['callsign ' ]['error ' ];
@@ -935,7 +934,7 @@ function search_result($id="", $id2="") {
935934
936935 $ data ['callsign ' ] = $ this ->qrz ->search ($ id , $ this ->session ->userdata ('qrz_session_key ' ), $ this ->config ->item ('use_fullname ' ));
937936 if (isset ($ data ['callsign ' ]['gridsquare ' ])) {
938- $ data ['grid_worked ' ] = $ this ->logbook_model ->check_if_grid_worked_in_logbook (strtoupper (substr ($ data ['callsign ' ]['gridsquare ' ],0 ,4 )), 0 , $ this ->session ->userdata ('user_default_band ' ));
937+ $ data ['grid_worked ' ] = $ this ->logbook_model ->check_if_grid_worked_in_logbook (strtoupper (substr ($ data ['callsign ' ]['gridsquare ' ],0 ,4 )), 0 , $ this ->session ->userdata ('user_default_band ' ))-> num_rows () ;
939938 }
940939 if (isset ($ data ['callsign ' ]['dxcc ' ])) {
941940 $ entity = $ this ->logbook_model ->get_entity ($ data ['callsign ' ]['dxcc ' ]);
@@ -962,7 +961,7 @@ function search_result($id="", $id2="") {
962961 $ data ['callsign ' ] = $ this ->hamqth ->search ($ id , $ this ->session ->userdata ('hamqth_session_key ' ));
963962 }
964963 if (isset ($ data ['callsign ' ]['gridsquare ' ])) {
965- $ data ['grid_worked ' ] = $ this ->logbook_model ->check_if_grid_worked_in_logbook (strtoupper (substr ($ data ['callsign ' ]['gridsquare ' ],0 ,4 )), 0 , $ this ->session ->userdata ('user_default_band ' ));
964+ $ data ['grid_worked ' ] = $ this ->logbook_model ->check_if_grid_worked_in_logbook (strtoupper (substr ($ data ['callsign ' ]['gridsquare ' ],0 ,4 )), 0 , $ this ->session ->userdata ('user_default_band ' ))-> num_rows () ;
966965 }
967966 if (isset ($ data ['callsign ' ]['dxcc ' ])) {
968967 $ entity = $ this ->logbook_model ->get_entity ($ data ['callsign ' ]['dxcc ' ]);
0 commit comments