- change ysf to ysc in the code too

This commit is contained in:
dave 2009-09-19 06:13:22 +00:00
parent ed04710018
commit b5430b08b3
5 changed files with 14 additions and 14 deletions

View File

@ -44,7 +44,7 @@
echo i18n("Checking %1 for awards...",array($fair['name'])); echo i18n("Checking %1 for awards...",array($fair['name']));
echo "<br />"; echo "<br />";
if($fair['type'] == 'ysf') { if($fair['type'] == 'ysc') {
$req=array("awardrequest"=>array( $req=array("awardrequest"=>array(
"username"=>$r->username, "username"=>$r->username,
"password"=>$r->password, "password"=>$r->password,

View File

@ -28,7 +28,7 @@
require_once('xml.inc.php'); require_once('xml.inc.php');
function curl_query($fair, $data, $ysf_url='') function curl_query($fair, $data, $ysc_url='')
{ {
global $output; global $output;
switch($fair['type']) { switch($fair['type']) {
@ -40,11 +40,11 @@
'password' => $fair['password']); 'password' => $fair['password']);
$str = json_encode(array_merge($d, $data)); $str = json_encode(array_merge($d, $data));
break; break;
case 'ysf': case 'ysc':
if($ysf_url == '') if($ysc_url == '')
$url = $fair['url']; $url = $fair['url'];
else else
$url = $ysf_url; $url = $ysc_url;
$var = 'xml'; $var = 'xml';
$output=""; $output="";
xmlCreateRecurse($data); xmlCreateRecurse($data);
@ -73,7 +73,7 @@
case 'sfiab': case 'sfiab':
$ret=json_decode(urldecode($datastream), true); $ret=json_decode(urldecode($datastream), true);
break; break;
case 'ysf': case 'ysc':
$datastream = str_replace(" standalone=\"yes\"","",$datastream); $datastream = str_replace(" standalone=\"yes\"","",$datastream);
/* Return is plaintext, make a return array */ /* Return is plaintext, make a return array */
$ret['error'] = 0; $ret['error'] = 0;

View File

@ -29,9 +29,9 @@
require_once('stats.inc.php'); require_once('stats.inc.php');
require_once('curl.inc.php'); require_once('curl.inc.php');
function stats_to_ysf($fair, $stats) function stats_to_ysc($fair, $stats)
{ {
if($fair['type'] == 'ysf') { if($fair['type'] == 'ysc') {
/* Map data into YSF tags */ /* Map data into YSF tags */
$y=array(); $y=array();
$y["numschoolstotal"]=$stats['schools_total']; $y["numschoolstotal"]=$stats['schools_total'];
@ -95,8 +95,8 @@
$stats[$k] = $_POST[$k]; $stats[$k] = $_POST[$k];
} }
$stats['year'] = $year; $stats['year'] = $year;
if($fair['type'] == 'ysf') { if($fair['type'] == 'ysc') {
$st = stats_to_ysf($fair, $stats); $st = stats_to_ysc($fair, $stats);
$req = array('affiliation' => array( $req = array('affiliation' => array(
"ysf_region_id"=>$fair['username'], "ysf_region_id"=>$fair['username'],
"ysf_region_password"=>$fair['password'], "ysf_region_password"=>$fair['password'],
@ -126,7 +126,7 @@
echo "<form name=\"fairselect\" action=\"$PHPSELF\" method=\"get\">"; echo "<form name=\"fairselect\" action=\"$PHPSELF\" method=\"get\">";
$q=mysql_query("SELECT * FROM fairs WHERE `type`='sfiab' OR `type`='ysf'"); $q=mysql_query("SELECT * FROM fairs WHERE `type`='sfiab' OR `type`='ysc'");
echo "<select name=\"id\" \">"; echo "<select name=\"id\" \">";
echo "<option value=\"\">".i18n("Choose a fair")."</option>\n"; echo "<option value=\"\">".i18n("Choose a fair")."</option>\n";
while($r=mysql_fetch_object($q)) { while($r=mysql_fetch_object($q)) {
@ -154,7 +154,7 @@
exit; exit;
} }
if($fair['type'] == 'ysf') { if($fair['type'] == 'ysc') {
$data['statconfig'] = array('participation'); $data['statconfig'] = array('participation');
} else { } else {
echo notice(i18n('Getting stats request and downloading existing stats from server %1', array($fair['url']))); echo notice(i18n('Getting stats request and downloading existing stats from server %1', array($fair['url'])));

View File

@ -25,7 +25,7 @@
require_once('../user.inc.php'); require_once('../user.inc.php');
require_once('../fair.inc.php'); require_once('../fair.inc.php');
$fair_type = array('feeder' => 'Feeder Fair', 'sfiab' => 'SFIAB Upstream', 'ysf' => 'YSF/CWSF Upstream'); $fair_type = array('feeder' => 'Feeder Fair', 'sfiab' => 'SFIAB Upstream', 'ysc' => 'YSC/CWSF Upstream');
$stats = array('participation' => 'Particpation Numbers', $stats = array('participation' => 'Particpation Numbers',
'schools_ext' => 'Extra school participation data, number of public/private school students', 'schools_ext' => 'Extra school participation data, number of public/private school students',
'minorities' => 'Data on minority group participation', 'minorities' => 'Data on minority group participation',

View File

@ -27,7 +27,7 @@
require_once("user.inc.php"); require_once("user.inc.php");
require_once("fair.inc.php"); require_once("fair.inc.php");
$fair_type = array('feeder' => 'Feeder Fair', 'sfiab' => 'SFIAB Upstream', 'ysf' => 'YSF/CWSF Upstream'); $fair_type = array('feeder' => 'Feeder Fair', 'sfiab' => 'SFIAB Upstream', 'ysc' => 'YSC/CWSF Upstream');
function yesno($name, $val) function yesno($name, $val)
{ {