Commit 636e591f authored by PkSM3's avatar PkSM3

using generic db

parent eeb7aca2
......@@ -2,7 +2,7 @@
* Customize as you want ;)
*/
function callGeomap(){
db=JSON.stringify('php/community_fixed.db');
db=JSON.stringify('php/community.db');
if(is_empty(selections)){
// jsonparams='["all"]';
jsonparams='["unique_id"]&unique_id='+getUrlParam.nodeidparam;
......
AD Andorra
AE United Arab Emirates
AF Afghanistan
AL Albania
AM Armenia
AO Angola
AR Argentina
AT Austria
AU Australia
AZ Azerbaijan
BA Bosnia and Herzegovina
BD Bangladesh
BE Belgium
BF Burkina Faso
BG Bulgaria
BI Burundi
BJ Benin
BN Brunei Darussalam
BO Plurinational State of Bolivia
BR Brazil
BT Bhutan
BW Botswana
BY Belarus
BZ Belize
CA Canada
CD The Democratic Republic of the Congo
CF Central African Republic
CG Congo
CH Switzerland
CI Ivory Coast
CL Chile
CM Cameroon
CN China
CO Colombia
CR Costa Rica
CU Cuba
CY Cyprus
CZ Czech Republic
DE Germany
DJ Djibouti
DK Denmark
DO Dominican Republic
DZ Algeria
EC Ecuador
EE Estonia
EG Egypt
EH Western Sahara
ER Eritrea
ES Spain
ET Ethiopia
FI Finland
FJ Fiji
FK Falkland Islands (Malvinas)
FR France
GA Gabon
GB United Kingdom
GE Georgia
GF French Guiana
GH Ghana
GL Greenland
GM Gambia
GN Guinea
GQ Equatorial Guinea
GR Greece
GT Guatemala
GW Guinea-Bissau
GY Guyana
HN Honduras
HR Croatia
HT Haiti
HU Hungary
ID Indonesia
IE Ireland
IL Israel
IN India
IQ Iraq
IR Islamic Republic of Iran
IS Iceland
IT Italy
JM Jamaica
JO Jordan
JP Japan
KE Kenya
KG Kyrgyzstan
KH Cambodia
KP Democratic People's Republic of Korea
KR Republic of Korea
KW Kuwait
KZ Kazakhstan
LA Lao People's Democratic Republic
LB Lebanon
LK Sri Lanka
LR Liberia
LS Lesotho
LT Lithuania
LU Luxembourg
LV Latvia
LY Libyan Arab Jamahiriya
MA Morocco
MD Republic of Moldova
MG Madagascar
MK The Former Yugoslav Republic of Macedonia
ML Mali
MM Myanmar
MN Mongolia
MR Mauritania
MW Malawi
MX Mexico
MY Malaysia
MZ Mozambique
NA Namibia
NC New Caledonia
NE Niger
NG Nigeria
NI Nicaragua
NL Netherlands
NO Norway
NP Nepal
NZ New Zealand
OM Oman
PA Panama
PE Peru
PG Papua New Guinea
PH Philippines
PK Pakistan
PL Poland
PR Puerto Rico
PS Occupied Palestinian Territory
PT Portugal
PY Paraguay
QA Qatar
RO Romania
RS Serbia
RU Russian Federation
RW Rwanda
SA Saudi Arabia
SB Solomon Islands
SD Sudan
SE Sweden
SG Singapore
SI Slovenia
SJ Svalbard and Jan Mayen
SK Slovakia
SL Sierra Leone
SN Senegal
SO Somalia
SR Suriname
SV El Salvador
SY Syrian Arab Republic
SZ Swaziland
TD Chad
TG Togo
TH Thailand
TJ Tajikistan
TL Timor-Leste
TM Turkmenistan
TN Tunisia
TR Turkey
TW Province of China Taiwan
TZ Tanzania
UA Ukraine
UG Uganda
US United States
UY Uruguay
UZ Uzbekistan
VE Bolivarian Republic of Venezuela
VN Viet Nam
VU Vanuatu
XK Kosovo
YE Yemen
ZA South Africa
ZM Zambia
ZW Zimbabwe
AE u arab emirates
AF afghanistan
AL
AM armenia
AO
AR argentina
AT austria
AU australia Norfolk Island
AZ
BA bosnia and herzegovina
BD bangladesh
BE belgium
BF burkina faso
BG bulgaria
BI burundi
BJ benin
BN
BO la paz - bolivia Bolivia
BR 883 fundos sidil divinópolis mg brasil rua meaipe . condominio valparaiso i. bloco c1. apt 204. laranjeiras - serra- es rua itapecerica avenida josé assis de vasconcelos brazil brasil viçosa mg 325 - bethânia - ipatinga - minas gerais - brasil rio de janeiro 883 sidil divinópolis mg brasil
BT
BW botswana btbswb
BY belarus
BZ
CA canada
CD
CF
CG democratic republic of the congo democratic republic of congo congo democratic republic of
CH switzerland geneva
CI
CL chile
CM cameroun cameroon
CN shanghai china hong kong 中国
CO colombia
CR costa rica
CU
CY
CZ
DE germany
DJ
DK denmark
DO dominican republic
DZ
EC
EE
EG egypt
EH
ER
ES spain
ET ethiopia
FI
FJ
FK
FR france guadeloupe ile de france
GA
GB united kingdom united kingdon england u.k. uk britain
GE
GF
GH ghana accraghana
GL
GM the gambia
GN
GQ
GR greece
GT guatemala guatemala city
GW
GY
HN honduras
HR
HT haiti
HU
ID yogyakarta indonesia
IE ireland
IL israel
IN 184-1 thiruvikanagar street tamilnadu st.india 184/1 thiruvikanagar .harur tk.dharmapuri.tamilnadu st dist.udalguri.p.o. dimakuchi.vill.no 2 sonajuli dharmapuri dt nagaland india harur tk & po state assam india
IQ
IR iran
IS
IT italy
JM
JO jordan
JP
KE kenyan kenya kenya.
KG kyrgyzstan
KH cambodia
KP
KR south korea
KW
KZ
LA
LB lebanon
LK sri lanka
LR
LS
LT lithuania
LU Luxemburg
LV
LY
MA
MD moldova
MG
MK macedonia
ML mali
MM
MN
MR
MW malawi
MX dona ana méxico osvaldoalbuquerque65@hotmail.com mexico
MY malaysia
MZ mozambique
NA namibia
NC
NE
NG abuja-nigeria nigeria nigeria/australia
NI
NL the netherlands and egypt netherlands the netherlands
NO norway
NP nepal
NZ new zealand
OM oman
PA panama
PE peru
PG papua new guinea
PH philippines
PK pakistan
PL
PR
PS palestine
PT
PY paraguay
QA qatar
RO romania
RS republic of serbia serbia
RU russian federation
RW rwanda
SA
SB
SD
SE sverige sweden
SG singapore
SI slovenia
SJ
SK
SL
SN
SO somalia united state somalia diaspora
SR
SV el salvador
SY
SZ swaziland
TD
TG togo
TH thailand
TJ
TL
TM
TN
TR uftu turkey
TW taiwan
TZ tanzania in east africa tanzania usa & tanzania
UA Украина.Одесса
UG uganda-africa uganda
US united state of america united states of america 17 dennison st usa united states atlanta ga waltham ma us u.s.a. america
UY
UZ
VE venezuela
VN vietnam
VU
XK kosovo
YE
ZA republic of south africa south africa
ZM zambia and south africa zambia
ZW zimbabwe
......@@ -15,7 +15,7 @@ include('countries_iso3166.php');
$sql="";
$table="scholars";
$column="norm_country";
$column="country";
$query = str_replace( '__and__', '&', $_GET["query"] );
$query = str_replace( 'D::', '', $query );
$elems = json_decode($query);
......@@ -23,8 +23,6 @@ $elems = json_decode($query);
$unique_id = "";
$scholar_array = array();
$singularnick= "scholar";
$pluralnick = "scholars";
......@@ -59,7 +57,7 @@ if(count($elems)==1){
$elems = array();
foreach($scholar_array as $key=>$value){
array_push($elems, utf8_decode($key));
array_push($elems, $key);
}
}
break;
......@@ -70,23 +68,41 @@ if(count($elems)==1){
$norm_country = array();
$InvIndCC = array();
$directory = '.';
if (! is_dir($directory)) {
exit('Invalid diretory path');
}
foreach (scandir($directory) as $file) {
if ('.' === $file) continue;
if ('..' === $file) continue;
if(pathinfo($file, PATHINFO_EXTENSION)=="txt") {
extractIndexes( $file );
}
}
if($selectiveQuery){
$countries_temp=array();
foreach($elems as $e){
$sql="SELECT ".$column." FROM ".$table." where id=".$e;
if($unique_id!="")
$sql="SELECT ".$column." FROM ".$table." where unique_id=\"".$e."\"";
$sql="SELECT ".$column." FROM ".$table." where unique_id=\"".$e."\"";
// echo $sql."\n";
foreach ($base->query($sql) as $row) {
if($countries_temp[$row[$column]]) $countries_temp[$row[$column]]+=1;
else $countries_temp[$row[$column]]=1;
$cc = $InvIndCC [ $row[$column] ];
// echo "\t".$row[$column]."\n";
if($countries_temp[$cc]) $countries_temp[$cc]+=1;
else $countries_temp[$cc]=1;
}
}
arsort($countries_temp);
// var_dump($countries_temp);
foreach ($countries_temp as $key => $value) {
$code = strtoupper($key);
if($CC[$code]){
......@@ -205,6 +221,7 @@ if($selectiveQuery){
}
}
$occToCC = array();
foreach ($norm_country as $c) {
if (!$occToCC[$c["value"]]) {
......@@ -213,9 +230,6 @@ foreach ($norm_country as $c) {
array_push($occToCC[$c["value"]], $c["code"]);
}
krsort($occToCC);
$countries_occ_DESC = array();
foreach ($occToCC as $key => $value) {
......@@ -332,4 +346,27 @@ function pr($msg) {
echo $msg . "\n";
}
function extractIndexes( $dictname ) {
$myfile = fopen($dictname, "r");
global $InvIndCC;
while(!feof($myfile)) {
$line = fgets($myfile);
$line = str_replace("\n","",$line);
$raw = array_filter( explode("\t", $line) , "strlen" );
foreach ($raw as $key=>$value) {
if($key>0) {
$InvIndCC[$value] = $raw[0];
}
}
}
fclose($myfile);
}
?>
No preview for this file type
......@@ -454,7 +454,8 @@ function theListeners(){
if(is_empty(actualSel) || i==0){
pr("cursor radius ON, mouseDown -> selecciones vacias");
cancelSelection(false);
cancelSelection(false);
// $("#names").html("");
// $("#opossiteNodes").html("");
......@@ -474,6 +475,7 @@ function theListeners(){
}
partialGraph.draw();
trackMouse();
}
......
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