Skip to content

Commit 8f094e1

Browse files
committed
Small update to php code.
1 parent 4fb1713 commit 8f094e1

File tree

9 files changed

+36
-9
lines changed

9 files changed

+36
-9
lines changed

ahl15-16/php/html.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@
9797
if(!isset($_GET['division'])) { $_GET['division'] = "All"; } }
9898
if(!isset($_GET['act'])) { $_GET['act'] = "calendar"; }
9999
if($_GET['act']!="view" && $_GET['act']!="games" && $_GET['act']!="stats" && $_GET['act']!="calendar") { $_GET['act'] = "calendar"; }
100-
$sqldb = new SQLite3("../hockey15-16.db3");
100+
if(file_exists("./ahl15-16.db3")) {
101+
$sqldb = new SQLite3("./ahl15-16.db3"); }
102+
else {
103+
$sqldb = new SQLite3("../hockey15-16.db3"); }
101104
$sqldb->exec("PRAGMA encoding = \"UTF-8\";");
102105
$sqldb->exec("PRAGMA auto_vacuum = 1;");
103106
$sqldb->exec("PRAGMA foreign_keys = 1;");

ahl15-16/php/xhtml.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@
9898
if(!isset($_GET['division'])) { $_GET['division'] = "All"; } }
9999
if(!isset($_GET['act'])) { $_GET['act'] = "calendar"; }
100100
if($_GET['act']!="view" && $_GET['act']!="games" && $_GET['act']!="stats" && $_GET['act']!="calendar") { $_GET['act'] = "calendar"; }
101-
$sqldb = new SQLite3("../hockey15-16.db3");
101+
if(file_exists("./ahl15-16.db3")) {
102+
$sqldb = new SQLite3("./ahl15-16.db3"); }
103+
else {
104+
$sqldb = new SQLite3("../hockey15-16.db3"); }
102105
$sqldb->exec("PRAGMA encoding = \"UTF-8\";");
103106
$sqldb->exec("PRAGMA auto_vacuum = 1;");
104107
$sqldb->exec("PRAGMA foreign_keys = 1;");

ahl15-16/php/xml.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,10 @@
445445
if(!isset($_GET['division'])) { $_GET['division'] = "All"; } }
446446
if(!isset($_GET['act'])) { $_GET['act'] = "view"; }
447447
if($_GET['act']!="view" && $_GET['act']!="games" && $_GET['act']!="stats" && $_GET['act']!="calendar") { $_GET['act'] = "view"; }
448-
$sqldb = new SQLite3("../hockey15-16.db3");
448+
if(file_exists("./ahl15-16.db3")) {
449+
$sqldb = new SQLite3("./ahl15-16.db3"); }
450+
else {
451+
$sqldb = new SQLite3("../hockey15-16.db3"); }
449452
$sqldb->exec("PRAGMA encoding = \"UTF-8\";");
450453
$sqldb->exec("PRAGMA auto_vacuum = 1;");
451454
$sqldb->exec("PRAGMA foreign_keys = 1;");

echl15-16/php/html.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@
9898
if(!isset($_GET['division'])) { $_GET['division'] = "All"; } }
9999
if(!isset($_GET['act'])) { $_GET['act'] = "calendar"; }
100100
if($_GET['act']!="view" && $_GET['act']!="games" && $_GET['act']!="stats" && $_GET['act']!="calendar") { $_GET['act'] = "calendar"; }
101-
$sqldb = new SQLite3("../hockey15-16.db3");
101+
if(file_exists("./echl15-16.db3")) {
102+
$sqldb = new SQLite3("./echl15-16.db3"); }
103+
else {
104+
$sqldb = new SQLite3("../hockey15-16.db3"); }
102105
$sqldb->exec("PRAGMA encoding = \"UTF-8\";");
103106
$sqldb->exec("PRAGMA auto_vacuum = 1;");
104107
$sqldb->exec("PRAGMA foreign_keys = 1;");

echl15-16/php/xhtml.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@
9999
if(!isset($_GET['division'])) { $_GET['division'] = "All"; } }
100100
if(!isset($_GET['act'])) { $_GET['act'] = "calendar"; }
101101
if($_GET['act']!="view" && $_GET['act']!="games" && $_GET['act']!="stats" && $_GET['act']!="calendar") { $_GET['act'] = "calendar"; }
102-
$sqldb = new SQLite3("../hockey15-16.db3");
102+
if(file_exists("./echl15-16.db3")) {
103+
$sqldb = new SQLite3("./echl15-16.db3"); }
104+
else {
105+
$sqldb = new SQLite3("../hockey15-16.db3"); }
103106
$sqldb->exec("PRAGMA encoding = \"UTF-8\";");
104107
$sqldb->exec("PRAGMA auto_vacuum = 1;");
105108
$sqldb->exec("PRAGMA foreign_keys = 1;");

echl15-16/php/xml.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,10 @@
446446
if(!isset($_GET['division'])) { $_GET['division'] = "All"; } }
447447
if(!isset($_GET['act'])) { $_GET['act'] = "view"; }
448448
if($_GET['act']!="view" && $_GET['act']!="games" && $_GET['act']!="stats" && $_GET['act']!="calendar") { $_GET['act'] = "view"; }
449-
$sqldb = new SQLite3("../hockey15-16.db3");
449+
if(file_exists("./echl15-16.db3")) {
450+
$sqldb = new SQLite3("./echl15-16.db3"); }
451+
else {
452+
$sqldb = new SQLite3("../hockey15-16.db3"); }
450453
$sqldb->exec("PRAGMA encoding = \"UTF-8\";");
451454
$sqldb->exec("PRAGMA auto_vacuum = 1;");
452455
$sqldb->exec("PRAGMA foreign_keys = 1;");

nhl15-16/php/html.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@
9797
if(!isset($_GET['division'])) { $_GET['division'] = "All"; } }
9898
if(!isset($_GET['act'])) { $_GET['act'] = "calendar"; }
9999
if($_GET['act']!="view" && $_GET['act']!="games" && $_GET['act']!="stats" && $_GET['act']!="calendar") { $_GET['act'] = "calendar"; }
100-
$sqldb = new SQLite3("../hockey15-16.db3");
100+
if(file_exists("./nhl15-16.db3")) {
101+
$sqldb = new SQLite3("./nhl15-16.db3"); }
102+
else {
103+
$sqldb = new SQLite3("../hockey15-16.db3"); }
101104
$sqldb->exec("PRAGMA encoding = \"UTF-8\";");
102105
$sqldb->exec("PRAGMA auto_vacuum = 1;");
103106
$sqldb->exec("PRAGMA foreign_keys = 1;");

nhl15-16/php/xhtml.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@
9898
if(!isset($_GET['division'])) { $_GET['division'] = "All"; } }
9999
if(!isset($_GET['act'])) { $_GET['act'] = "calendar"; }
100100
if($_GET['act']!="view" && $_GET['act']!="games" && $_GET['act']!="stats" && $_GET['act']!="calendar") { $_GET['act'] = "calendar"; }
101-
$sqldb = new SQLite3("../hockey15-16.db3");
101+
if(file_exists("./nhl15-16.db3")) {
102+
$sqldb = new SQLite3("./nhl15-16.db3"); }
103+
else {
104+
$sqldb = new SQLite3("../hockey15-16.db3"); }
102105
$sqldb->exec("PRAGMA encoding = \"UTF-8\";");
103106
$sqldb->exec("PRAGMA auto_vacuum = 1;");
104107
$sqldb->exec("PRAGMA foreign_keys = 1;");

nhl15-16/php/xml.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,10 @@
445445
if(!isset($_GET['division'])) { $_GET['division'] = "All"; } }
446446
if(!isset($_GET['act'])) { $_GET['act'] = "view"; }
447447
if($_GET['act']!="view" && $_GET['act']!="games" && $_GET['act']!="stats" && $_GET['act']!="calendar") { $_GET['act'] = "view"; }
448-
$sqldb = new SQLite3("../hockey15-16.db3");
448+
if(file_exists("./nhl15-16.db3")) {
449+
$sqldb = new SQLite3("./nhl15-16.db3"); }
450+
else {
451+
$sqldb = new SQLite3("../hockey15-16.db3"); }
449452
$sqldb->exec("PRAGMA encoding = \"UTF-8\";");
450453
$sqldb->exec("PRAGMA auto_vacuum = 1;");
451454
$sqldb->exec("PRAGMA foreign_keys = 1;");

0 commit comments

Comments
 (0)