From 81461c060128b933f4e7ae17071381a21f9a3898 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 8 Apr 2010 20:03:21 +0000 Subject: [PATCH] Add "complete or paymentpending" dropdown as options when viewing the registration list or registration stats --- admin/registration_list.php | 12 +++++++++++- admin/registration_stats.php | 20 +++++++++++++++----- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/admin/registration_list.php b/admin/registration_list.php index e67718e..9857c4d 100644 --- a/admin/registration_list.php +++ b/admin/registration_list.php @@ -319,6 +319,7 @@ $(document).ready(function() { //if there is no reg fee, then we dont need to show this status, because nobody will ever be in this status $status_str = array('' => 'Any Status', 'complete' => 'Complete', 'paymentpending' => ($config['regfee']>0) ? 'Payment Pending' : '', + 'completeorpaymentpending' => ($config['regfee']>0) ? 'Complete or Payment Pending' : '', 'open' => 'Open', 'new' => 'New'); $showstatus = $_GET['showstatus']; @@ -334,7 +335,16 @@ $(document).ready(function() { 0) $status_str['paymentpending'] = i18n("Payment Pending"); + if($config['regfee']>0) { + $status_str['paymentpending'] = i18n("Payment Pending"); + $status_str['completeorpaymentpending'] = i18n("Complete or Payment Pending"); + } $status_str['open'] = i18n("Open"); $status_str['new'] = i18n("New"); @@ -66,10 +69,18 @@ $q=mysql_query("SELECT * FROM projectdivisions WHERE year='$year' ORDER BY id"); while($r=mysql_fetch_object($q)) $divs[$r->id]=$r->division; -if($showstatus) $wherestatus="AND status='$showstatus' "; +if($showstatus) { + switch($showstatus) { + case "complete": $wherestatus="AND status='complete' "; break; + case "paymentpending": $wherestatus="AND status='paymentpending' "; break; + case "completeorpaymentpending": $wherestatus="AND (status='complete' OR status='paymentpending') "; break; + case "open": $wherestatus="AND status='open' "; break; + case "new": $wherestatus="AND status='new' "; break; + default: $wherestatus=""; + } +} else $wherestatus=""; - switch($_GET['sort']) - { + switch($_GET['sort']) { case 'status': $ORDERBY="registrations.status DESC, projects.title"; break; case 'num': $ORDERBY="registrations.num"; break; case 'projnum': $ORDERBY="projects.projectsort, projects.projectnumber"; break; @@ -77,7 +88,6 @@ else $wherestatus=""; case 'cat': $ORDERBY="projects.projectcategories_id, projects.title"; break; case 'div': $ORDERBY="projects.projectdivisions_id, projects.title"; break; default: $ORDERBY="registrations.status DESC, projects.title"; break; - } $q=mysql_query("SELECT registrations.id AS reg_id,