diff --git a/admin/award_awards.php b/admin/award_awards.php index 5af4f4a4..2e193006 100644 --- a/admin/award_awards.php +++ b/admin/award_awards.php @@ -81,8 +81,8 @@ switch ($_GET['action']) { */ $q .= ",name=" . $pdo->quote($_POST['name']) . ", criteria='" . iconv('UTF-8', 'ISO-8859-1', stripslashes($_POST['criteria'])) . "'"; - if (intval($_POST['sponsors_id']) != -1) { - $q .= "sponsors_id='" . $sponsors_id . "' "; + if (isset($_POST['sponsors_id']) || $_POST['sponsors_id'] != '' || intval($_POST['sponsors_id']) != -1) { + $q .= ", sponsors_id=" . intval($_POST['sponsors_id']) . " "; } } @@ -96,7 +96,6 @@ switch ($_GET['action']) { } catch (PDOException $exception) { error_('Award not created'); error_('Award information failed to save'); - error_log("Here"); error_log($exception); } exit; @@ -579,7 +578,7 @@ function update_prizeinfo() ""+p.scholarship+""+ ""+p.value+""+ ""+ - " /images/16/edit.\"> "+ + "/images/16/edit.\"> "+ "/images/16/button_cancel.\">"+ ""); } @@ -627,6 +626,7 @@ function prize_save() function prize_delete(id) { + console.log("hi" + id); var confirm = confirmClick('Are you sure you want to delete this prize?'); if(confirm == true) { $("#prizeinfo_info").load("?action=prize_delete&id="+id,null, @@ -908,7 +908,7 @@ while ($dr = $dq->fetch(PDO::FETCH_OBJ)) {
- +
diff --git a/register_participants_spawards.php b/register_participants_spawards.php index 98a63456..35124596 100644 --- a/register_participants_spawards.php +++ b/register_participants_spawards.php @@ -110,6 +110,7 @@ if ($_POST['action'] == 'save') { if (!$readonly) { $splist = array(); $noawards = false; + if (is_array($_POST['spaward'])) $splist = $_POST['spaward']; @@ -131,7 +132,7 @@ if ($_POST['action'] == 'save') { ?, ?, ?)'); - $stmt->execute([$s, $project->id, $config['FAIRYEAR']]); + $stmt->execute([$spaward, $project->id, $config['FAIRYEAR']]); show_pdo_errors_if_any($pdo); } if ($num) {