Bug fixes for conference managament "wizard".

This commit is contained in:
jacob 2011-12-20 15:21:48 +00:00
parent 80ec239bd9
commit 01589a1518

View File

@ -908,33 +908,39 @@ function copy_conference($params){
if($errorMessage != ''){ wizard_draw_step('error', 'SQL error before line #' . __LINE__ . ': <br/>' . $errorMessage); rollback($newConfId, $completedTables); return false; }
// timeslots and rounds
$q = mysql_query("SELECT snoobaloo * FROM judges_timeslots WHERE conferences_id='$oldConfId' AND round_id='0'");
$q = mysql_query("SELECT * FROM judges_timeslots WHERE conferences_id='$oldConfId' AND round_id='0'");
$errorMessage = mysql_error();
while($errorMessage == '' && $r=mysql_fetch_assoc($q)) {
if($params['rollDates'] == 'yes'){
mysql_query("INSERT INTO judges_timeslots (`conferences_id`,`round_id`,`type`,`date`,`starttime`,`endtime`,`name`)
$queryText = "INSERT INTO judges_timeslots (`conferences_id`,`round_id`,`type`,`date`,`starttime`,`endtime`,`name`)
VALUES ('$newConfId','0','{$r['type']}',DATE_ADD('{$r['date']}', INTERVAL 1 YEAR),
'{$r['starttime']}','{$r['endtime']}','{$r['name']}')");
'{$r['starttime']}','{$r['endtime']}','{$r['name']}')";
}else{
mysql_query("INSERT INTO judges_timeslots (`conferences_id`,`round_id`,`type`,`date`,`starttime`,`endtime`,`name`)
$queryText = "INSERT INTO judges_timeslots (`conferences_id`,`round_id`,`type`,`date`,`starttime`,`endtime`,`name`)
VALUES ('$newConfId','0','{$r['type']}','{$r['date']}',
'{$r['starttime']}','{$r['endtime']}','{$r['name']}')");
'{$r['starttime']}','{$r['endtime']}','{$r['name']}')";
}
mysql_query($queryText);
$errorMessage .= mysql_error();
$round_id = mysql_insert_id();
$qq = mysql_query("SELECT * FROM judges_timeslots WHERE round_id='{$r['id']}'");
if($params['rollDates'] == 'yes'){
while($rr=mysql_fetch_assoc($qq) && mysql_error() == '')
mysql_query("INSERT INTO judges_timeslots (`conferences_id`,`round_id`,`type`,`date`,`starttime`,`endtime`)
while(($rr=mysql_fetch_assoc($qq)) && $errorMessage == ''){
$queryText = "INSERT INTO judges_timeslots (`conferences_id`,`round_id`,`type`,`date`,`starttime`,`endtime`)
VALUES ('$newConfId','$round_id','timeslot',DATE_ADD('{$rr['date']}', INTERVAL 1 YEAR),
'{$rr['starttime']}','{$rr['endtime']}')");
'{$rr['starttime']}','{$rr['endtime']}')";
mysql_query($queryText);
$errorMessage .= mysql_error();
}
}else{
while($rr=mysql_fetch_assoc($qq) && mysql_error() == '')
mysql_query("INSERT INTO judges_timeslots (`conferences_id`,`round_id`,`type`,`date`,`starttime`,`endtime`)
while(($rr=mysql_fetch_assoc($qq)) && $errorMessage == ''){
$queryText = "INSERT INTO judges_timeslots (`conferences_id`,`round_id`,`type`,`date`,`starttime`,`endtime`)
VALUES ('$newConfId','$round_id','timeslot','{$rr['date']}',
'{$rr['starttime']}','{$rr['endtime']}')");
'{$rr['starttime']}','{$rr['endtime']}')";
mysql_query($queryText);
$errorMessage .= mysql_error();
}
}
$errorMessage .= mysql_error();
}
$completedTables[] = 'judges_timeslots';
if($errorMessage != ''){ wizard_draw_step('error', 'SQL error before line #' . __LINE__ . ': <br/>' . $errorMessage); rollback($newConfId, $completedTables); return false; }