forked from science-ation/science-ation
- More accurate info in fair_stats
- Enable the new fields in the fair editor
This commit is contained in:
parent
4eea632521
commit
ee978816b2
@ -193,7 +193,7 @@
|
||||
}
|
||||
|
||||
|
||||
echo notice(i18n('Getting statistics request and existing stats data from server %1', array($fair['url'])));
|
||||
echo notice(i18n('Getting stats request and downloading existing stats from server %1', array($fair['url'])));
|
||||
/* Query the server to see what stats we need */
|
||||
$xmldata=array("sfiab"=>array(
|
||||
"username"=>$fair['username'],
|
||||
|
@ -27,6 +27,16 @@
|
||||
require_once("user.inc.php");
|
||||
require_once("fair.inc.php");
|
||||
|
||||
function yesno($name, $val)
|
||||
{
|
||||
echo "<select name=\"$name\">";
|
||||
$sel = ($val == 'yes') ? 'selected="selected"' : '';
|
||||
echo "<option $sel value=\"yes\">".i18n("Yes")."</option>";
|
||||
$sel = ($val == 'no') ? 'selected="selected"' : '';
|
||||
echo "<option $sel value=\"no\">".i18n("No")."</option>";
|
||||
echo "</select>";
|
||||
}
|
||||
|
||||
|
||||
if($_SESSION['embed'] == true) {
|
||||
$u = user_load($_SESSION['embed_edit_id']);
|
||||
@ -50,14 +60,22 @@
|
||||
$name = mysql_escape_string(stripslashes($_POST['name']));
|
||||
$abbrv = mysql_escape_string(stripslashes($_POST['abbrv']));
|
||||
$url = mysql_escape_string($_POST['url']);
|
||||
$website = mysql_escape_string($_POST['website']);
|
||||
$type = array_key_exists($_POST['type'], $fair_type) ? $_POST['type'] : '';
|
||||
$username = mysql_escape_string(stripslashes($_POST['username']));
|
||||
$password = mysql_escape_string(stripslashes($_POST['password']));
|
||||
$enable_stats = ($_POST['enable_stats'] == 'yes') ? 'yes' : 'no';
|
||||
$enable_awards = ($_POST['enable_awards'] == 'yes') ? 'yes' : 'no';
|
||||
$enable_winners = ($_POST['enable_winners'] == 'yes') ? 'yes' : 'no';
|
||||
|
||||
$q = mysql_query("UPDATE fairs SET `name`='$name',
|
||||
`abbrv`='$abbrv', `url`='$url',
|
||||
`website`='$website',
|
||||
`type`='$type' , `username`='$username',
|
||||
`password`='$password'
|
||||
`password`='$password',
|
||||
`enable_stats`='$enable_stats',
|
||||
`enable_awards`='$enable_awards',
|
||||
`enable_winners`='$enable_winners'
|
||||
WHERE id=$id");
|
||||
|
||||
$u['fairs_id'] = $id;
|
||||
@ -116,12 +134,26 @@ if($_SESSION['embed'] == true) {
|
||||
if($f['url'] == '') $f['url'] = 'http://';
|
||||
echo "<input type=\"text\" name=\"url\" value=\"{$f['url']}\" size=\"40\" />";
|
||||
echo '</td></tr>';
|
||||
echo '<tr><td>'.i18n('Website').'</td><td>';
|
||||
if($f['website'] == '') $f['website'] = 'http://';
|
||||
echo "<input type=\"text\" name=\"webiste\" value=\"{$f['webiste']}\" size=\"40\" />";
|
||||
echo '</td></tr>';
|
||||
echo '<tr><td>'.i18n('Username').'</td><td>';
|
||||
echo "<input type=\"text\" name=\"username\" value=\"{$f['username']}\" size=\"20\" />";
|
||||
echo '</td></tr>';
|
||||
echo '<tr><td>'.i18n('Password').'</td><td>';
|
||||
echo "<input type=\"text\" name=\"password\" value=\"{$f['password']}\" size=\"15\" />";
|
||||
echo '</td></tr>';
|
||||
echo '<tr><td>'.i18n('Enable stats').'</td><td>';
|
||||
yesno('enable_stats', $f['enable_stats']);
|
||||
echo '</td></tr>';
|
||||
echo '<tr><td>'.i18n('Enable awards download').'</td><td>';
|
||||
yesno('enable_awards', $f['enable_awards']);
|
||||
echo '</td></tr>';
|
||||
echo '<tr><td>'.i18n('Enable winners upload').'</td><td>';
|
||||
yesno('enable_winners', $f['enable_winners']);
|
||||
echo '</td></tr>';
|
||||
|
||||
|
||||
echo "</table>";
|
||||
echo "<br />";
|
||||
|
Loading…
Reference in New Issue
Block a user