From e5e863e3f72dfb35b79c0cd28ddc37007cfad0d0 Mon Sep 17 00:00:00 2001 From: james Date: Mon, 3 Nov 2008 05:15:03 +0000 Subject: [PATCH] Update winners entry and award_downloader for award_sponsors->sponsors conversion --- admin/award_download.php | 12 ++++++------ admin/winners.php | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/admin/award_download.php b/admin/award_download.php index a709520..7e3c2b4 100644 --- a/admin/award_download.php +++ b/admin/award_download.php @@ -119,18 +119,18 @@ //check if the sponsor exists, if not, add them - $sponsorq=mysql_query("SELECT * FROM award_sponsors WHERE organization='".mysql_escape_string($award['sponsor'][0])."'"); + $sponsorq=mysql_query("SELECT * FROM sponsors WHERE organization='".mysql_escape_string($award['sponsor'][0])."'"); if($sponsorr=mysql_fetch_object($sponsorq)) { $sponsor_id=$sponsorr->id; } else { - mysql_query("INSERT INTO award_sponsors (organization,year,notes,confirmed) VALUES ('".mysql_escape_string($award['sponsor'][0])."','$year','".mysql_escape_string("Imported from external source: $r->name")."','yes')"); + mysql_query("INSERT INTO sponsors (organization,year,notes,confirmed) VALUES ('".mysql_escape_string($award['sponsor'][0])."','$year','".mysql_escape_string("Imported from external source: $r->name")."','yes')"); $sponsor_id=mysql_insert_id(); } mysql_query("UPDATE award_awards SET - award_sponsors_id='$sponsor_id', + sponsors_id='$sponsor_id', name='".mysql_escape_string($award['name_en'][0])."', criteria='".mysql_escape_string($award['criteria_en'][0])."', external_postback='".mysql_escape_string($postback)."' @@ -210,20 +210,20 @@ echo mysql_error(); } else { //check if the sponsor exists, if not, add them - $sponsorq=mysql_query("SELECT * FROM award_sponsors WHERE organization='".mysql_escape_string($award['sponsor'][0])."'"); + $sponsorq=mysql_query("SELECT * FROM sponsors WHERE organization='".mysql_escape_string($award['sponsor'][0])."'"); if($sponsorr=mysql_fetch_object($sponsorq)) { $sponsor_id=$sponsorr->id; } else { - mysql_query("INSERT INTO award_sponsors (organization,year,notes,confirmed) VALUES ('".mysql_escape_string($award['sponsor'][0])."','$year','".mysql_escape_string("Imported from external source: $r->name")."','yes')"); + mysql_query("INSERT INTO sponsors (organization,year,notes,confirmed) VALUES ('".mysql_escape_string($award['sponsor'][0])."','$year','".mysql_escape_string("Imported from external source: $r->name")."','yes')"); $sponsor_id=mysql_insert_id(); } echo i18n("Award does not exists, adding...")."
"; mysql_query("INSERT INTO award_awards ( award_types_id, - award_sponsors_id, + sponsors_id, name, criteria, year, diff --git a/admin/winners.php b/admin/winners.php index 249dea6..cbce6c9 100644 --- a/admin/winners.php +++ b/admin/winners.php @@ -28,8 +28,8 @@ user_auth_required('committee', 'admin'); - if($_GET['award_sponsors_id']) $award_sponsors_id=$_GET['award_sponsors_id']; - else if($_POST['award_sponsors_id']) $award_sponsors_id=$_POST['award_sponsors_id']; + if($_GET['sponsors_id']) $sponsors_id=$_GET['sponsors_id']; + else if($_POST['sponsors_id']) $sponsors_id=$_POST['sponsors_id']; if($_GET['award_types_id']) $award_types_id=$_GET['award_types_id']; else if($_POST['award_types_id']) $award_types_id=$_POST['award_types_id']; @@ -274,16 +274,16 @@ else award_awards.name, award_awards.order AS awards_order, award_types.type, - award_sponsors.organization + sponsors.organization FROM award_awards, award_types, - award_sponsors + sponsors WHERE award_awards.year='".$config['FAIRYEAR']."' AND award_awards.award_types_id=award_types.id AND award_types.year='".$config['FAIRYEAR']."' - AND award_awards.award_sponsors_id=award_sponsors.id + AND award_awards.sponsors_id=sponsors.id ORDER BY awards_order"); echo mysql_error();