prepare("SELECT * FROM award_awards WHERE year='$newfairyear'"); $nq1->execute(); $nq2=$pdo->prepare("SELECT * FROM award_awards WHERE year='$currentfairyear'"); $nq2->execute(); if($nq1->rowCount()==$nq2->rowcount()) { $npq1=$pdo->prepare("SELECT * FROM award_prizes WHERE year='$newfairyear'"); $npq1->execute(); $npq2=$pdo->prepare("SELECT * FROM award_prizes WHERE year='$currentfairyear'"); $npq2->execute(); if($npq2->rowCount()>0 && $npq1->rowCount()==0) { echo "
"; echo notice(i18n("A BUG WAS IDENTIFIED IN YOUR PREVIOUS YEAR ROLLOVER WHICH CAUSED AWARD PRIZES TO NOT BE ROLLED OVER PROPERLY. THEY ARE NOW BEING RE-ROLLED OVER WITH THE PROPER PRIZE INFORMATION. THIS WILL ONLY HAPPEN ONCE."))."
"; $stmt = $pdo->prepare("DELETE FROM award_awards WHERE year='$newfairyear'"); $stmt->execute(); $stmt = $pdo->prepare("DELETE FROM award_prizes WHERE year='$newfairyear'"); $stmt->execute(); $stmt = $pdo->prepare("DELETE FROM award_contacts WHERE year='$newfairyear'"); $stmt->execute(); $stmt = $pdo->prepare("DELETE FROM award_types WHERE year='$newfairyear'"); $stmt->execute(); $stmt = $pdo->prepare("DELETE FROM award_awards_projectcategories WHERE year='$newfairyear'"); $stmt->execute(); $stmt = $pdo->prepare("DELETE FROM award_awards_projectdivisions WHERE year='$newfairyear'"); $stmt->execute(); echo i18n("Rolling awards")."
"; //awards $q=$pdo->prepare("SELECT * FROM award_awards WHERE year='$currentfairyear'"); $q->execute(); echo $pdo->errorInfo(); while($r=$q->fetch(PDO::FETCH_OBJ)) { $stmt = $pdo->prepare("INSERT INTO award_awards (award_sponsors_id,award_types_id,name,criteria,presenter,`order`,year,excludefromac,cwsfaward) VALUES ( '".$r->award_sponsors_id."', '".$r->award_types_i."', '".$r->name."', '".$r->criteria."', '".$r->presenter."', '".$r->order."', '".$newfairyear."', '".$r->excludefromac."', '".$r->cwsfaward."')"); $award_awards_id=$pdo->lastInsertId(); $q2=$pdo->prepare("SELECT * FROM award_awards_projectcategories WHERE year='$currentfairyear' AND award_awards_id='$r->id'"); $q2->execute(); echo $pdo->errorInfo(); while($r2=$q2->fetch(PDO::FETCH_OBJ)) { $stmt = $pdo->prepare("INSERT INTO award_awards_projectcategories (award_awards_id,projectcategories_id,year) VALUES ( '".$award_awards_id."', '".$r2->projectcategories_id."', '".$newfairyear."')"); $stmt->execute(); } $q2=$pdo->prepare("SELECT * FROM award_awards_projectdivisions WHERE year='$currentfairyear' AND award_awards_id='$r->id'"); $q2->execute(); echo $pdo->errorInfo(); while($r2=$q2->fetch(PDO::FETCH_OBJ)) { $stmt = $pdo->prepare("INSERT INTO award_awards_projectdivisions (award_awards_id,projectdivisions_id,year) VALUES ( '".$award_awards_id."', '".$r2->projectdivisions_id."', '".$newfairyear."')"); $stmt->execute(); } echo i18n("  Rolling award prizes")."
"; $q2=$pdo->prepare("SELECT * FROM award_prizes WHERE year='$currentfairyear' AND award_awards_id='$r->id'"); $q2->execute(); echo $pdo->errorInfo(); while($r2=$q2->fetch(PDO::FETCH_OBJ)) { $stmt = $pdo->prepare("INSERT INTO award_prizes (award_awards_id,cash,scholarship,`value`,prize,number,`order`,year,excludefromac) VALUES ( '".$award_awards_id."', '".$r2->cash."', '".$r2->scholarship."', '".$r2->value."', '".$r2->prize."', '".$r2->number."', '".$r2->order."', '".$newfairyear."', '".$r2->excludefromac."')"); } } echo i18n("Rolling award contacts")."
"; //award contacts $q=$pdo->prepare("SELECT * FROM award_contacts WHERE year='$currentfairyear'"); $q->execute(); echo $pdo->errorInfo(); while($r=$q->fetch(PDO::FETCH_OBJ)) $stmt = $pdo->prepare("INSERT INTO award_contacts (award_sponsors_id,salutation,firstname,lastname,position,email,phonehome,phonework,phonecell,fax,notes,year) VALUES ( '".$r->award_sponsors_id."', '".$r->salutation."', '".$r->firstname."', '".$r->lastname."', '".$r->position."', '".$r->email."', '".$r->phonehome."', '".$r->phonework."', '".$r->phonecell."', '".$r->fax."', '".$r->notes."', '".$newfairyear."')"); echo i18n("Rolling award types")."
"; //award types $q=$pdo->prepare("SELECT * FROM award_types WHERE year='$currentfairyear'"); $q->execute(); echo $pdo->errorInfo(); while($r=$q->fetch(PDO::FETCH_OBJ)) $stmt = $pdo->prepare("INSERT INTO award_types (id,type,`order`,year) VALUES ( '".$r->id."', '".$r->type."', '".$r->order."', '".$newfairyear."')"); $stmt->execute(); } } } ?>