Commit c5bd3b28 authored by f4eyq's avatar f4eyq

update framework 31/12 1

parent af6468bd
------------------------
CRX FRAMEWORK
Current version:2.0.1
Update:10/2018
Update:12/2018
Date:01/2008
------------------------
Update 31/12/2018
------------------------
- minor change on ham mode lib.
- remove bug into sql generator into ham and 11m spots lib.
------------------------
Update 08/10/2018
------------------------
......
......@@ -330,10 +330,9 @@ class crxCore{
throw new crxException("ERROR : loadPackage() => $error");
return false;
}
$cache = $_SESSION['class_xml_stack'];
$cache = array();
if(isset($_SESSION['class_xml_stack']))
$cache = $_SESSION['class_xml_stack'];
if(!isset($cache[$key_namespace])){
$cache[$key_namespace]=$this->loadPackageCreateNameSpaceDataSource($xml_dir_namespace);
......
......@@ -16,6 +16,26 @@
var $_force_insert_with_pk_field_set = 0;
function setTableName($t){
$this->_table = $t;
}
function getTableName(){
return $this->_table;
}
function getTablePrefix(){
return $this->c_db -> dbi -> Prefix;
}
public function __set($key, $value) {
$this->itemsProperties[0][$key]=$value;
......@@ -243,25 +263,7 @@
}
function setTableName($t){
$this->_table = $t;
}
function getTableName(){
return $this->_table;
}
function getTablePrefix(){
return $this->c_db -> dbi -> Prefix;
}
function updateSchema(){
......
<?php
/*
**********************************************************************
* Crx-cms powered by CRX-PHP-FRAMEWORK http://git.crx.cloud/crx-php/crx-framework
* Crx-cms powered by CRX-PHP-FRAMEWORK https://project.crx.cloud/crx-framework-doc
* Copyright (c) Bastien Barbe and contributors. All rights
* reserved.
* Crx-cms is free software; you can redistribute it and/or modify
......
......@@ -59,6 +59,8 @@ extends crxHtmlInterface{
}
} // end (new) FastTemplate ()
......
<?xml version="1.0" encoding="ISO-8859-1"?>
<global>
<item>
<version>1.0</version>
<class_name>crxLoaderForLib</class_name>
<class_group>library</class_group>
<class_desc>Using to load librairy based on composer and co.</class_desc>
<class_file>crxLoaderForLib.php</class_file>
<is_load>1</is_load>
</item>
<item>
<version>1.0</version>
<class_name>crxMath</class_name>
......
<?php
// extends generic_crxItem
// v112018
// v122018
class abstractDxClusterSpot{
var $_debug_details = '';
......
<?php
/**
* @date 01/01/2005
* @revision 11112018
* @revision 122018
* @lib radioamator
* @copyright see header
*/
......@@ -17,7 +17,6 @@ extends abstractDxClusterSpot{
var $xmlClusterShema = array();
var $debug = FALSE;
var $c_db = FALSE;
function getDxClusterStatsDxSpotBestTimeForDx(
$time_select=array('start','end'),
......@@ -173,20 +172,12 @@ extends abstractDxClusterSpot{
function getDataFromParameters($params){
//crxFile::setFileContent('/home/hosting/www_root/ham.crx.cloud/logs/test','params:'.dumper($params));
$this->initGetDataFromParameters($params);
$sql_limit_result = $this->display_filters_start_pointer.",".$this->display_filters_end_pointer;
if(
$this->display_use_dxcc_filter &&
is_array($this->display_filters_send_filter) &&
is_array($this->display_filters_spot_filter)
){
$sep=',';
......@@ -201,47 +192,42 @@ extends abstractDxClusterSpot{
$string_filter_dxcc .= $v.$sep;
}
}
$string_filter_dxcc=crxString::removeCharEndOfStr($string_filter_dxcc,1);
if($string_filter_sender && $string_filter_dxcc){
$sql_set_filter = 'WHERE (truncate( callsign_sender, 0 ) IN ( '.$string_filter_sender.' ))';
$sql_set_filter .= 'AND (truncate( country_id_dx, 0 ) IN ( '.$string_filter_dxcc.' ))';
//$sql_set_filter = 'WHERE (truncate( callsign_sender, 0 ) IN ( '.$string_filter_sender.' )) AND (truncate( callsign_dx, 0 ) IN ( '.$string_filter_dxcc.' ))';
$sql_set_filter .= ' AND (truncate( country_id_dx, 0 ) IN ( '.$string_filter_dxcc.' ))';
}
}
if(is_array($this->bands_filtering_selected)){
$c=0;
foreach($this->bands_filtering_selected as $k=>$v){
if($v<>1){unset($this->bands_filtering_selected[$k]);}
if($v==1)$c++;
}
if($string_filter_sender && $string_filter_dxcc){
$sql_set_filter .= " AND ";
}
else{
if($c<>0)$sql_set_filter .= " WHERE ";
}
$i=0;$bands=0;
foreach($this->bands_filtering_selected as $k=>$v){
if($v==1)$sql_set_filter .= ' band = "'.$k.'" ';
if($i>=0 && $i<=(count($this->bands_filtering_selected)-2)){
$sql_set_filter .= 'OR';
$band_is_selected=0;
foreach($this->bands_filtering_selecte as $k=>$s){if($s==1){$band_is_selected=1;break;}}
if($band_is_selected){
$c=0;
foreach($this->bands_filtering_selected as $k=>$v){
if($v<>1){unset($this->bands_filtering_selected[$k]);}
if($v==1)$c++;
}
if($string_filter_sender && $string_filter_dxcc){
$sql_set_filter .= " AND ";
}
else{
if($c<>0)$sql_set_filter .= " WHERE ";
}
$i=0;$bands=0;
foreach($this->bands_filtering_selected as $k=>$v){
if($v==1)$sql_set_filter .= ' band = "'.$k.'" ';
if($i>=0 && $i<=(count($this->bands_filtering_selected)-2)){
$sql_set_filter .= 'OR';
}
$bands++;
$i++;
}
$bands++;
$i++;
}
}
$sql_get_data='SELECT * FROM `'.$this->display_tbl_crx_spots.'`';
$sql_set_filter_columns_settings=NULL;
//$sql_set_filter_columns_settings=NULL;
if($this->display_use_dxnodes_filter){
......@@ -260,20 +246,26 @@ extends abstractDxClusterSpot{
}
$j=0;foreach($this->display_use_dxnodes_filter as $k=>$v){
if($v==1){
if($j==0)$sql_set_filter_columns_settings.=$join_this_filter.' ( `source` = \''.$k.'\'';
if($j==0)$sql_set_filter.=$join_this_filter.' ( `source` = \''.$k.'\'';
if($j<>0 && $j>$i)$sql_set_filter_columns_settings.=' OR `source` = \''.$k.'\'';
elseif($j>0)$sql_set_filter_columns_settings.=' OR `source` = \''.$k.'\'';
if($j<>0 && $j>$i)$sql_set_filter.=' OR `source` = \''.$k.'\'';
elseif($j>0)$sql_set_filter.=' OR `source` = \''.$k.'\'';
$j++;
}
}if($j>0)$sql_set_filter_columns_settings.=' )';
}if($j>0)$sql_set_filter.=' )';
$join_this_filter='';
}
if($this->display_use_modes_filter){
//if($sql_set_filter_columns_settings==NULL) $join_this_filter=' WHERE';
//else $join_this_filter=' AND';
$i=0;foreach($this->display_use_modes_filter as $k=>$v){
if($v==1){ $i++; }
}
......@@ -282,6 +274,7 @@ extends abstractDxClusterSpot{
$i=-1;
}
if($i<>-1){
if($sql_set_filter){
$sql_set_filter .= " AND ";
......@@ -396,21 +389,21 @@ extends abstractDxClusterSpot{
}
}
$sql_limit_result=" ORDER BY ".$this->display_filters_order_by." DESC LIMIT ".$sql_limit_result;
$final_querie_get_dxcluster_spots = $sql_get_data." ".$sql_set_filter.$sql_set_filter_columns_settings." ".$sql_limit_result;
if($debug)var_dump($final_querie_get_dxcluster_spots);
$this->c_db -> query = $final_querie_get_dxcluster_spots;
//var_dump($final_querie_get_dxcluster_spots);
//if($this->debug)crxFile::setFileContent('/home/hosting/www_root/ham.crx.cloud/logs/test','DEBUG:'.dumper($final_querie_get_dxcluster_spots));
/*
var_dump($final_querie_get_dxcluster_spots);
die();
*/
$spots = $this->c_db -> getArrayOfResult();
return $spots;
//if($this->debug)crxFile::setFileContent('/home/hosting/www_root/ham.crx.cloud/logs/test','DEBUG:'.dumper($final_querie_get_dxcluster_spots));
return $this->c_db -> getArrayOfResult();
}
function computeGeoInformation($user_info=array()){
......
<?php
//Interface class to use dxClusterSpot HAM or 11M.
//u:112018
//u:122018
class dxClusterSpot {
......
<?php
/**
* @creation date 082014
* @revision 11112018
* @revision 04122018
* @module dxClusterWeb/dxClusterSpotHam
*/
class dxClusterSpotHam
......@@ -699,7 +699,7 @@ extends abstractDxClusterSpot{
}
function getDxClusterStatsContinentDxSpotRepartition($time_select=array('start','end'),$user_continent='EU',$nb_total_spots=0,$user_band_selected='ALL'){
$sql_qrg_filter = '';
if($user_band_selected<>'ALL'){
$bd=$user_band_selected;
......@@ -1013,9 +1013,6 @@ extends abstractDxClusterSpot{
if(is_array($this->bands_filtering_selected))
foreach($this->bands_filtering_selected as $k=>$v){if($v=='1'){$selected=1;break;}}
//@DEBUG :
//$_SESSION['cache-spots']['band_filter_info']['all_without_checked_any']=NULL;
if(!$selected){
$list_band_user_filter=array();
......@@ -1035,9 +1032,8 @@ extends abstractDxClusterSpot{
}
if(is_array($this->bands_filtering_selected)){
$user_select_all_band=0;
$user_select_all_band=0;
//all bands are selected :
if(count($this->bands_filtering_selected)==22){
......@@ -1074,28 +1070,19 @@ extends abstractDxClusterSpot{
}
$qrg=new spotQrg();
$i=0;$bands=0;
$i=0;
if(isset($this->display_band_part_filter)){
$bd=$this->display_band_part_filter;//ssb cw phone digit space
}else{
$bd='band';//View all the band by default.
}
//echo "<b>$display_band_part_filter</b>";
//sql_set_filter => ( QRG )
$bands=1;
if(empty($this->bands_filtering_selected)){
//var_dump($this->bands_filtering_selected);
//var_dump($_SESSION['cache-spots']['band_filter_info']['list_band_user_filter']);
$this->bands_filtering_selected = $_SESSION['cache-spots']['band_filter_info']['list_band_user_filter'];
//var_dump($this->bands_filtering_selected);
}
else{
......@@ -1105,7 +1092,7 @@ extends abstractDxClusterSpot{
if(isset($_SESSION['cache-spots']['band_filter_info'])){
$cache = $_SESSION['cache-spots']['band_filter_info'];
$cache = $_SESSION['cache-spots']['band_filter_info'];
$list_band_user_filter = $cache['list_band_user_filter'];
......@@ -1113,6 +1100,7 @@ extends abstractDxClusterSpot{
}
if($limit_band_display_filter){
$list_band_user_filter2=$list_band_user_filter;
......@@ -1125,76 +1113,92 @@ extends abstractDxClusterSpot{
if(count($list_band_user_filter)>0){$this->bands_filtering_selected = $list_band_user_filter;}
else{$this->bands_filtering_selected = $list_band_user_filter2;}
}
$bands=0;
foreach($this->bands_filtering_selected as $k=>$v){
$selected_band_section = array();
$cache = array();
$selected_band_section = array();
$cache = array();
if(isset($_SESSION['cache-spots']['band_filter_info']))
$cache = $_SESSION['cache-spots']['band_filter_info'];
if(isset($cache['selected_band_section'][$k]) && $cache['selected_band_section'][$k]){
if(isset($_SESSION['cache-spots']['band_filter_info']))
$cache = $_SESSION['cache-spots']['band_filter_info'];
$selected_band_section = $cache['selected_band_section'][$k];
}
else{
if(isset($cache['selected_band_section'][$k]) && $cache['selected_band_section'][$k]){
$selected_band_section = $cache['selected_band_section'][$k];
$q="SELECT * FROM `crx_cluster_dxcc_filter_bands` WHERE `user_id` = '".$user_id."' AND band_id = '".$k."'";
$this->c_db->execSql($q);
while($r=$this->c_db->returnLine()){$selected_band_section[]=$r['band_section_id'];}
if(empty($selected_band_section)){$selected_band_section['band']='band';}
$cache['selected_band_section'][$k]=$selected_band_section;
$_SESSION['cache-spots']['band_filter_info']=$cache;
}
$bvl=$qrg->getBandValues($k);
$sections_count=count($selected_band_section);
$cpts=0;foreach($selected_band_section as $km=>$section){$cpts++;}
}
else{
$q="SELECT * FROM `crx_cluster_dxcc_filter_bands` WHERE `user_id` = '".$user_id."' AND band_id = '".$k."'";
$this->c_db->execSql($q);
while($r=$this->c_db->returnLine()){$selected_band_section[]=$r['band_section_id'];}
if(empty($selected_band_section)){$selected_band_section['band']='band';}
$cache['selected_band_section'][$k]=$selected_band_section;
$_SESSION['cache-spots']['band_filter_info']=$cache;
}
$bvl=$qrg->getBandValues($k);
$sections_count=count($selected_band_section);
$cpts=0;foreach($selected_band_section as $km=>$section){$cpts++;}
$nb=count($bvl)-1;
$nb=count($bvl)-1;
if($nb==$cpts){
$use_all_band_segment=1;
}else{
$use_all_band_segment=0;
}
if($nb==$cpts){
$use_all_band_segment=1;
}else{
$use_all_band_segment=0;
}
if(!$use_all_band_segment){
$i=1;foreach($selected_band_section as $k=>$section){
if($sections_count==$i){$sep=' ';}
else $sep=' OR ';
$bd=$section;
$l=$bvl[$bd][0];
$h=$bvl[$bd][1];
if(!$use_all_band_segment){
if($v && $l && $h)
//if($v==1 && $l && $h)
$nb_selected_band_section=1;
foreach($selected_band_section as $k=>$section){
$sep=' OR ';
if($sections_count==$nb_selected_band_section){$sep=' ';}
if(($bands <> count($this->bands_filtering_selected) - 1 ))$sep=' OR ';
$bd=$section;
$l=$bvl[$bd][0];
$h=$bvl[$bd][1];
if($v && $l && $h)
//if($v==1 && $l && $h)
$sql_set_filter .= "\n". '( freq >= '.$l.' AND freq <= '.$h.')'.$sep;
$i++;
$nb_selected_band_section++;
}
}
}
else{
$sep='';
else{
$sep=' OR ';
if(($bands == count($this->bands_filtering_selected) - 1 ))$sep='';
$l=$bvl['band'][0];
$h=$bvl['band'][1];
if($l && $h)
$sql_set_filter .= '( freq >= '.$l.' AND freq <= '.$h.')'.$sep;
}
if($bands <= (count($this->bands_filtering_selected) -1) ){
$sql_set_filter .= ' OR';
}
$bands++;
}
}
/*
if(!$use_all_band_segment && $bands<>0 && ($bands <> count($this->bands_filtering_selected) - 1 ) ){
$sql_set_filter .= ' OR';
}
*/
$bands++;
}//foreach($this->bands_filtering_selected as $k=>$v)
}
......@@ -1476,9 +1480,15 @@ extends abstractDxClusterSpot{
}
//if($this->debug)crxFile::setFileContent('/home/hosting/www_root/ham.crx.cloud/logs/test','DEBUG:'.dumper($final_querie_get_dxcluster_spots));
$this->_dsql=$final_querie_get_dxcluster_spots;
/*
var_dump($final_querie_get_dxcluster_spots);
die();
*/
if($exec_final_sql){
$this->c_db -> query = $final_querie_get_dxcluster_spots;
......@@ -1489,6 +1499,10 @@ extends abstractDxClusterSpot{
}
$this->_dsql=$final_querie_get_dxcluster_spots;
$this->_debug_sql=0;
if($this->_debug_sql){
$uid=crxFramework::getGlobalValue('userId');
......
......@@ -17,13 +17,15 @@ class spotMode{
'FM'=>'FM',
'DSTAR'=>'DSTAR',
'PSK31'=>'PSK31',
'PSK31'=>'PSK31'
'PSK63'=>'PSK63',
'PSK125'=>'PSK125',
'SIM31'=>'SIM31',
'SSTV'=>'SSTV',
'ROS'=>'ROS',
'JT65'=>'JT65',
'OLIVIA'=>'OLIVIA',
'AMTORFEC'=>'AMTORFEC',
......@@ -36,14 +38,9 @@ class spotMode{
'DOMINO'=>'DOMINO',
'DOMINOF'=>'DOMINOF',
'FT8'=>'FT8',
'FAX'=>'FAX',
'FMHELL'=>'FMHELL',
'FSK31'=>'FSK31',
'FSK441'=>'FSK441',
......@@ -51,11 +48,17 @@ class spotMode{
'HELL'=>'HELL',
'HELL80'=>'HELL80',
'HFSK'=>'HFSK',
'FT8'=>'FT8',
'JS8'=>'JS8',
'JT65'=>'JT65',
'JT44'=>'JT44',
'JT65A'=>'JT65A',
'JT6M'=>'JT6M',
'MFSK8'=>'MFSK8',
'MFSK16'=>'MFSK16',
'MSK144'=>'MSK144',
'MT63'=>'MT63',
'PAC'=>'PAC',
......@@ -103,13 +106,13 @@ class spotMode{
'phone' => array('SSB','AM','FM'),
'digit' => array(
'PSK31', 'DSTAR', 'ROS', 'JT65',
'PSK31', 'SIM31', 'DSTAR', 'ROS', 'JT65',
'OLIVIA', 'AMTORFEC', 'ASCI', 'ATV',
'CHIP64', 'CHIP128', 'CLO', 'CONTESTI', 'DOMINO',
'DOMINOF', 'FAX', 'FMHELL', 'FSK31', 'FSK441',
'GTOR', 'HELL', 'HELL80', 'HFSK', 'JT44', 'JT65A',
'GTOR', 'HELL', 'HELL80', 'HFSK', 'JT44',
'JT65A', 'FT8', 'JS8',
'JT6M', 'MFSK8', 'MFSK16', 'MT63', 'PAC',
'PAC2', 'PAC3', 'PAX', 'PAX2', 'PCW', 'PKT',
'PSK10', 'PSK63', 'PSK63F', 'PSK125', 'PSKAM10',
......
......@@ -1342,17 +1342,13 @@ extends crxSchema{
!empty($display['AND_filter_value'])
)
{
if(!isset($display['AND_filter_operator']))$display['AND_filter_operator']='=';
$append_sql_where .= ' AND '.$sys_tag.$display['AND_filter_key'].$sys_tag.' '.$display['AND_filter_operator'].' "'.$display['AND_filter_value'].'"';
}
if(
isset($display['AND__filter_key']) &&
isset($display['AND__filter_value'])
......@@ -1401,8 +1397,6 @@ extends crxSchema{
if($enableCursorDisplay)$query.=' LIMIT ' .$display['cursor_begin'].' , '.$display['cursor_end'];
}
if( $method == 'UPDATE' ){
......@@ -1484,8 +1478,6 @@ extends crxSchema{
if( $method == 'INSERT' ){
if($this->_force_insert_with_pk_field_set){
foreach($this->tableShema as $k=>$v){
if($v=='pk'){
......@@ -1496,8 +1488,6 @@ extends crxSchema{
$this->tableShema=$tmp;
}
$query = 'INSERT INTO '.$tableName.' VALUES ( ';
$numberOfField=sizeof($this->tableShema);
foreach($this->tableShema as $k=>$fieldName){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment