forked from science-ation/science-ation
A few more tweaks to the date config - if we have a conference year should be 0, if we dont have a conference, conference should be 0 and year should be set.
This commit is contained in:
parent
b47b88ab9b
commit
cf05b063c1
@ -54,7 +54,7 @@ $error_ids = array();
|
|||||||
$d = mysql_escape_string(stripslashes($val));
|
$d = mysql_escape_string(stripslashes($val));
|
||||||
$t =mysql_escape_string(stripslashes($_POST['savetimes'][$key]));
|
$t =mysql_escape_string(stripslashes($_POST['savetimes'][$key]));
|
||||||
$v="$d $t";
|
$v="$d $t";
|
||||||
mysql_query("UPDATE dates SET date='$v' WHERE year='".$config['FAIRYEAR']."' AND conferences_id='".$conference['id']."' AND id='$key'");
|
mysql_query("UPDATE dates SET date='$v' WHERE id='$key'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo happy(i18n("Dates successfully saved"));
|
echo happy(i18n("Dates successfully saved"));
|
||||||
@ -142,13 +142,25 @@ foreach($dates as $dn=>$d) {
|
|||||||
if(!$d['id']) {
|
if(!$d['id']) {
|
||||||
$def=$defaultdates[$dn];
|
$def=$defaultdates[$dn];
|
||||||
//hmm if we dont have a record for this date this year, INSERT the sql from the default
|
//hmm if we dont have a record for this date this year, INSERT the sql from the default
|
||||||
|
if($conference['id']>0) {
|
||||||
|
mysql_query("INSERT INTO dates (date,name,description,year,conferences_id) VALUES (
|
||||||
|
'".mysql_real_escape_string($def->date)."',
|
||||||
|
'".mysql_real_escape_string($dn)."',
|
||||||
|
'".mysql_real_escape_string($def->description)."',
|
||||||
|
0,
|
||||||
|
'".$conference['id']."'
|
||||||
|
)");
|
||||||
|
echo mysql_error();
|
||||||
|
}
|
||||||
|
else {
|
||||||
mysql_query("INSERT INTO dates (date,name,description,year,conferences_id) VALUES (
|
mysql_query("INSERT INTO dates (date,name,description,year,conferences_id) VALUES (
|
||||||
'".mysql_real_escape_string($def->date)."',
|
'".mysql_real_escape_string($def->date)."',
|
||||||
'".mysql_real_escape_string($dn)."',
|
'".mysql_real_escape_string($dn)."',
|
||||||
'".mysql_real_escape_string($def->description)."',
|
'".mysql_real_escape_string($def->description)."',
|
||||||
'".$config['FAIRYEAR']."',
|
'".$config['FAIRYEAR']."',
|
||||||
'".$conference['id']."'
|
0
|
||||||
)");
|
)");
|
||||||
|
}
|
||||||
$d['id']=mysql_insert_id();
|
$d['id']=mysql_insert_id();
|
||||||
$d['description']=$def->description;
|
$d['description']=$def->description;
|
||||||
$d['date']=$def->date;
|
$d['date']=$def->date;
|
||||||
|
Loading…
Reference in New Issue
Block a user