forked from science-ation/science-ation
- Pretty it up a bit
This commit is contained in:
parent
5ec38a7314
commit
b7a30542d9
@ -75,6 +75,7 @@ function get_winners($awardid)
|
|||||||
$award=mysql_fetch_assoc($q);
|
$award=mysql_fetch_assoc($q);
|
||||||
|
|
||||||
$winners=array( 'prizes' => array(),
|
$winners=array( 'prizes' => array(),
|
||||||
|
'award_name' => $award['name'],
|
||||||
'external_identifier' => $award['external_identifier'],
|
'external_identifier' => $award['external_identifier'],
|
||||||
'postback' => $award['external_postback']);
|
'postback' => $award['external_postback']);
|
||||||
|
|
||||||
@ -143,7 +144,7 @@ case 'award_upload':
|
|||||||
$q = mysql_query("SELECT * FROM fairs WHERE id='{$a['award_source_fairs_id']}'");
|
$q = mysql_query("SELECT * FROM fairs WHERE id='{$a['award_source_fairs_id']}'");
|
||||||
$fair = mysql_fetch_assoc($q);
|
$fair = mysql_fetch_assoc($q);
|
||||||
|
|
||||||
echo 'Award<br />';
|
echo '<br />';
|
||||||
if($winners == false) {
|
if($winners == false) {
|
||||||
echo notice(i18n('No winners selected for this award'));
|
echo notice(i18n('No winners selected for this award'));
|
||||||
} else {
|
} else {
|
||||||
@ -151,8 +152,8 @@ case 'award_upload':
|
|||||||
$req=array("awardwinners"=>array(
|
$req=array("awardwinners"=>array(
|
||||||
"username"=>$fair['username'],
|
"username"=>$fair['username'],
|
||||||
"password"=>$fair['password'],
|
"password"=>$fair['password'],
|
||||||
"identifier"=>$winners['external_identifier'];
|
"identifier"=>$winners['external_identifier'],
|
||||||
"prizes"=>$winners;
|
"prizes"=>$winners,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$url = $winners['external_postback'];
|
$url = $winners['external_postback'];
|
||||||
@ -161,13 +162,17 @@ case 'award_upload':
|
|||||||
$req['award_upload']['year'] = $config['FAIRYEAR'];
|
$req['award_upload']['year'] = $config['FAIRYEAR'];
|
||||||
$url = ''; /* url is ignored for type = sfiab */
|
$url = ''; /* url is ignored for type = sfiab */
|
||||||
}
|
}
|
||||||
|
echo i18n("Sending %1 winners to %2...", array('<b>'.$winners['award_name'].'</b>',
|
||||||
|
'<b>'.$fair['name'].'</b>'));
|
||||||
|
echo '<br />';
|
||||||
|
|
||||||
$data = curl_query($fair, $req, $url);
|
$data = curl_query($fair, $req, $url);
|
||||||
|
|
||||||
if($data['error'] != 0) {
|
if($data['error'] != 0) {
|
||||||
echo error("Server said: $data");
|
echo error("Server said: $data");
|
||||||
} else {
|
} else {
|
||||||
echo notice("Server Said: $data");
|
echo notice("{$fair['name']} server said: <pre>".join("\n", $data['notice'])."</pre>");
|
||||||
|
echo happy(i18n("Upload completed successfully"));
|
||||||
}
|
}
|
||||||
echo "<pre>";
|
echo "<pre>";
|
||||||
print_r($winners);
|
print_r($winners);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user