From 7635670078d953ad050b1bcf7731adc725e00a17 Mon Sep 17 00:00:00 2001 From: Armanveer Gill Date: Thu, 5 Dec 2024 19:06:52 -0500 Subject: [PATCH] Implement prototype --- common.inc.php | 172 +++-- css/input.css | 3 + css/output.css | 681 ++++++++++++++++++ tailwind.config.js | 11 + .../images/ui-bg_flat_0_aaaaaa_40x100.png | Bin 0 -> 180 bytes .../images/ui-bg_flat_0_d0d0ff_40x100.png | Bin 0 -> 180 bytes .../images/ui-bg_flat_0_eeeeff_40x100.png | Bin 0 -> 180 bytes .../images/ui-bg_flat_0_ffffff_40x100.png | Bin 0 -> 178 bytes .../images/ui-bg_flat_75_eeeeff_40x100.png | Bin 0 -> 180 bytes .../images/ui-bg_glass_55_fbf9ee_1x400.png | Bin 0 -> 120 bytes .../ui-bg_highlight-hard_75_d0d0ff_1x100.png | Bin 0 -> 113 bytes .../ui-bg_inset-soft_95_fef1ec_1x100.png | Bin 0 -> 123 bytes .../images/ui-icons_222222_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_2e83ff_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_454545_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_888888_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_cd0a0a_256x240.png | Bin 0 -> 4369 bytes theme/classic copy/jquery-ui-1.7.2.custom.css | 406 +++++++++++ theme/classic copy/sfiab.css | 444 ++++++++++++ theme/classic copy/theme.php | 27 + theme/default/sfiab.css | 36 - .../images/ui-bg_flat_55_999999_40x100.png | Bin 0 -> 180 bytes .../images/ui-bg_flat_75_aaaaaa_40x100.png | Bin 0 -> 180 bytes .../images/ui-bg_glass_45_0078ae_1x400.png | Bin 0 -> 136 bytes .../images/ui-bg_glass_55_f8da4e_1x400.png | Bin 0 -> 131 bytes .../images/ui-bg_glass_75_79c9ec_1x400.png | Bin 0 -> 177 bytes .../ui-bg_gloss-wave_45_e14f1c_500x100.png | Bin 0 -> 3649 bytes .../ui-bg_gloss-wave_50_6eac2c_500x100.png | Bin 0 -> 4256 bytes .../ui-bg_gloss-wave_75_2191c0_500x100.png | Bin 0 -> 3457 bytes .../ui-bg_inset-hard_100_fcfdfd_1x100.png | Bin 0 -> 88 bytes .../images/ui-icons_0078ae_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_056b93_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_d8e7f3_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_e0fdff_256x240.png | Bin 0 -> 5355 bytes .../images/ui-icons_f5e175_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_f7a50d_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_fcd113_256x240.png | Bin 0 -> 4369 bytes theme/old-default/jquery-ui-1.7.2.custom.css | 406 +++++++++++ theme/old-default/sfiab.css | 444 ++++++++++++ theme/old-default/theme.php | 27 + 40 files changed, 2546 insertions(+), 111 deletions(-) create mode 100644 css/input.css create mode 100644 css/output.css create mode 100644 tailwind.config.js create mode 100644 theme/classic copy/images/ui-bg_flat_0_aaaaaa_40x100.png create mode 100644 theme/classic copy/images/ui-bg_flat_0_d0d0ff_40x100.png create mode 100644 theme/classic copy/images/ui-bg_flat_0_eeeeff_40x100.png create mode 100644 theme/classic copy/images/ui-bg_flat_0_ffffff_40x100.png create mode 100644 theme/classic copy/images/ui-bg_flat_75_eeeeff_40x100.png create mode 100644 theme/classic copy/images/ui-bg_glass_55_fbf9ee_1x400.png create mode 100644 theme/classic copy/images/ui-bg_highlight-hard_75_d0d0ff_1x100.png create mode 100644 theme/classic copy/images/ui-bg_inset-soft_95_fef1ec_1x100.png create mode 100644 theme/classic copy/images/ui-icons_222222_256x240.png create mode 100644 theme/classic copy/images/ui-icons_2e83ff_256x240.png create mode 100644 theme/classic copy/images/ui-icons_454545_256x240.png create mode 100644 theme/classic copy/images/ui-icons_888888_256x240.png create mode 100644 theme/classic copy/images/ui-icons_cd0a0a_256x240.png create mode 100644 theme/classic copy/jquery-ui-1.7.2.custom.css create mode 100644 theme/classic copy/sfiab.css create mode 100644 theme/classic copy/theme.php create mode 100644 theme/old-default/images/ui-bg_flat_55_999999_40x100.png create mode 100644 theme/old-default/images/ui-bg_flat_75_aaaaaa_40x100.png create mode 100644 theme/old-default/images/ui-bg_glass_45_0078ae_1x400.png create mode 100644 theme/old-default/images/ui-bg_glass_55_f8da4e_1x400.png create mode 100644 theme/old-default/images/ui-bg_glass_75_79c9ec_1x400.png create mode 100644 theme/old-default/images/ui-bg_gloss-wave_45_e14f1c_500x100.png create mode 100644 theme/old-default/images/ui-bg_gloss-wave_50_6eac2c_500x100.png create mode 100644 theme/old-default/images/ui-bg_gloss-wave_75_2191c0_500x100.png create mode 100644 theme/old-default/images/ui-bg_inset-hard_100_fcfdfd_1x100.png create mode 100644 theme/old-default/images/ui-icons_0078ae_256x240.png create mode 100644 theme/old-default/images/ui-icons_056b93_256x240.png create mode 100644 theme/old-default/images/ui-icons_d8e7f3_256x240.png create mode 100644 theme/old-default/images/ui-icons_e0fdff_256x240.png create mode 100644 theme/old-default/images/ui-icons_f5e175_256x240.png create mode 100644 theme/old-default/images/ui-icons_f7a50d_256x240.png create mode 100644 theme/old-default/images/ui-icons_fcd113_256x240.png create mode 100644 theme/old-default/jquery-ui-1.7.2.custom.css create mode 100644 theme/old-default/sfiab.css create mode 100644 theme/old-default/theme.php diff --git a/common.inc.php b/common.inc.php index b647df43..fa1d6cd2 100644 --- a/common.inc.php +++ b/common.inc.php @@ -22,14 +22,13 @@ */ ?> *'); @@ -87,7 +86,7 @@ else $dsn = "mysql:host=db;dbname=sfiab;charset=utf8mb4"; -$pdo = new PDO($dsn,$DBUSER,$DBPASS); +$pdo = new PDO($dsn,$DBUSER,$DBPASS,$dsn_options); if(!$pdo) { @@ -196,6 +195,8 @@ require_once("theme/{$config['theme_icons']}/icons.php"); require_once("committee.inc.php"); +session_start(); + if($config['SFIABDIRECTORY'] == '') { session_name("SFIABSESSID"); session_set_cookie_params(0,'/'); @@ -204,8 +205,6 @@ if($config['SFIABDIRECTORY'] == '') { session_set_cookie_params(0,$config['SFIABDIRECTORY']); } -session_start(); - //detect the browser first, so we know what icons to use - we store this in the config array as well //even though its not configurable by the fair if(stristr($_SERVER['HTTP_USER_AGENT'],"MSIE")) @@ -231,7 +230,6 @@ else } } //now if no language has been set yet, lets set it to the default language - if(!$_SESSION['lang']) { //first try the default language, if that doesnt work, use "en" @@ -243,15 +241,16 @@ if(!$_SESSION['lang']) //only allow debug to get set if we're using a development version (odd numbered ending) if(substr($config['version'], -1) % 2 != 0) - if(get_value_from_array($_GET, 'debug')) $_SESSION['debug']=$_GET['debug']; + if($_GET['debug']) $_SESSION['debug']=$_GET['debug']; //if the user has switched languages, go ahead and switch the session variable -if(array_key_exists('switchlanguage', $_GET)) +if($_GET['switchlanguage']) { //first, make sure its a valid language: if($config['languages'][$_GET['switchlanguage']]) { $_SESSION['lang']=$_GET['switchlanguage']; + } else { @@ -391,15 +390,28 @@ function send_header($title="", $nav=null, $icon=null, $titletranslated=false) //do this so we can use send_header() a little more loosly and not worry about it being sent more than once. if($HEADER_SENT) return; else $HEADER_SENT=true; + + //FIXME UTF-8? + echo "\n"; ?> - - -<? //if($title && !$titletranslated) echo i18n($title); else if($title) echo $title; else echo i18n($config['fairname']); ?> +<? //if($title && !$titletranslated) echo i18n($title); else if($title) echo $title; else echo i18n($config['fairname']); ?> +/css/output.css' /> - + + + + @@ -424,7 +436,7 @@ if(substr(getcwd(),-6)=="/admin" || substr(getcwd(),-7)=="/config" || substr(get if(file_exists($prependdir."data/logo-100.gif")) echo ""; -echo "

".i18n($config['fairname'])."

"; +echo "

".i18n($config['fairname'])."

"; echo "
"; if(isset($_SESSION['users_type'])) { $types = array('volunteer' => 'Volunteer', 'judge' => 'Judge', @@ -459,7 +471,6 @@ echo "
";
"; //only display it if a date is set to begin with. if($config['dates']['postparticipants'] && $config['dates']['postparticipants']!="0000-00-00 00:00:00") { - $q= $pdo->prepare("SELECT (NOW()>'".$config['dates']['regclose']."') AS test"); - $q->execute(); - $r=$q->fetch(PDO::FETCH_OBJ); + $q=("SELECT (NOW()>'".$config['dates']['regclose']."') AS test"); + $r=$q->fetch(); if($r->test==1) { $registrationconfirmationlink="
  • ".i18n("Confirmed Participants")."
  • "; @@ -477,26 +487,35 @@ echo ""; } ?> -
    +
    \n"; - echo "
  • ".i18n("Fundraising")."

  • \n"; - echo "
  • ".i18n("Fundraising Dashboard").'
  • '; - echo "
  • ".i18n("Fundraising Setup").'
  • '; - echo "
  • ".i18n("Manage Appeals").'
  • '; - echo "
  • ".i18n("Manage Donors/Sponsors").'
  • '; - echo "
  • ".i18n("Fundraising Reports").'
  • '; - echo "
    \n"; - } + switch($navkeys[2]) { + case "Fundraising": + echo "
    \n"; + break; + default: + //no special menu + break; + } } ?> -
    -
    Debug...
    +
    Debug...
    @@ -674,16 +699,17 @@ function send_popup_header($title="") echo "\n"; ?> - - - - -<?=i18n($title)?> + + +<?=i18n($title)?> + + + @@ -826,8 +852,7 @@ function emit_minute_selector($name,$selected="") function emit_time_selector($name,$selected="") { - global $hour; - global $minute; + if($selected) { list($hour,$minute,$second)=explode(":",$selected); @@ -845,10 +870,8 @@ function emit_time_selector($name,$selected="") function emit_province_selector($name,$selected="",$extra="") { global $config; - global $pdo; - $q=$pdo->prepare("SELECT * FROM provinces WHERE countries_code='".$config['country']."' ORDER BY province"); - $q->execute(); - if($q->rowCount()==1) + $q=("SELECT * FROM provinces WHERE countries_code='".mysql_escape_string($config['country'])."' ORDER BY province"); + if(mysql_num_rows($q)==1) { $r = $q->fetch(); echo ""; @@ -1091,7 +1114,7 @@ function output_page_text($textname) } //if it looks like we have HTML content, dont do a nl2br, if there's no html, then do the nl2br - if($r->text !== null and strlen($r->text)==strlen(strip_tags($r->text))) + if(strlen($r->text)==strlen(strip_tags($r->text))) echo nl2br($r->text); else echo $r->text; @@ -1107,16 +1130,16 @@ function output_page_cms($filename) if($q->rowCount()) { $r = $q->fetch(); - send_header($r['title'],null,null,true); + send_header($r->title,null,null,true); - if(file_exists("data/logo-200.gif") && $r['showlogo'] == 1) + if(file_exists("data/logo-200.gif") && $r->showlogo==1) echo ""; //if it looks like we have HTML content, dont do a nl2br, if there's no html, then do the nl2br - if($r['text'] !== null and strlen($r['text'])==strlen(strip_tags($r['text']))) - echo nl2br($r['text']); + if(strlen($r->text)==strlen(strip_tags($r->text))) + echo nl2br($r->text); else - echo $r['text']; + echo $r->text; } else { send_header("Error: File not found"); @@ -1164,12 +1187,11 @@ function committee_warnings() //properly :) + $q = $pdo->prepare("SELECT DATE_ADD('".$config['dates']['fairdate']."', INTERVAL 4 MONTH) < NOW() AS rollovercheck"); $q->execute(); - $r = $q->fetch(PDO::FETCH_OBJ); - - // FIXME Clear out Important Dates as part of rollover + $r = $q->fetch(); if($r->rollovercheck) { echo error(i18n("It has been more than 4 months since your fair. In order to prepare the system for the next year's fair, you should go to the SFIAB Configuration page, and click on 'Rollover Fair Year'. Do not start updating the system with new information until the year has been properly rolled over.")); } @@ -1183,14 +1205,14 @@ function committee_warnings() /* The bug was that the external_identifier was set to the prize name.. so only display the warning * if we find that case for a non-sfiab external fair */ while(($p = $q->fetch(PDO::FETCH_ASSOC) )) { - $qq = ("SELECT * FROM award_awards $r->rollovercheck + $qq = ("SELECT * FROM award_awards LEFT JOIN fairs ON fairs.id=award_awards.award_source_fairs_id WHERE award_awards.id='{$p['award_awards_id']}' AND year='{$config['FAIRYEAR']}' AND award_awards.award_source_fairs_id IS NOT NULL AND fairs.type='ysc' "); echo pdo->errorInfo(); - if($qq->rowCount() > 0) { + if(mysql_num_rows($qq) > 0) { $warn; break; @@ -1254,13 +1276,13 @@ function format_datetime($dt) { } function format_money($n,$decimals=true) -{ global $neg; +{ if($n<0){ $neg=true; $n=$n*-1; } //get the part before the decimal - $before=floor(get_value_or_default($n, 0)); + $before=floor($n); $out=""; //space it out in blocks of three @@ -1319,7 +1341,7 @@ function error_($str, $i18n_array=array(), $timeout=-1) function debug_($str) { - if(get_value_from_array($_SESSION, 'debug') != true) return; + if($_SESSION['debug'] != true) return; $s = str_replace("\n", "", nl2br(htmlspecialchars($str))).'
    '; echo "