Jump to content

Shorter Version


Nuker_Viper
 Share

Recommended Posts

i created this section of code to accept a multi award system... i am trying to find a shorter way to run through the check list.

<?phpif($submit) {/// Multiple Award Script / Function ///$ga = getHasItInfo($award, $member);$man = $medal_award_number;$ma = getMedalInfo('multi_awardable', $award);$max = getMedalInfo('max_awardable', $award);if($ma == 1 AND $man < $max) {  /// Creates a Loop to make sure the award number is correct. ///   /// Gets A checks List   $check1 = getHasItInfo($award, $member_id);    if($check1 > 0) { $tf1 == "T"; }    else { $tf1 == "F";}   $check2 = getHasItInfo($award.1, $member_id);    if($check2 > 0) { $tf2 == "T"; }    else { $tf2 == "F";}   $check3 = getHasItInfo($award.2, $member_id);    if($check3 > 0) { $tf3 == "T"; }    else { $tf3 == "F";}   $check4 = getHasItInfo($award.3, $member_id);    if($check4 > 0) { $tf4 == "T"; }    else { $tf4 == "F";}   $check5 = getHasItInfo($award.4, $member_id);    if($check5 > 0) { $tf5 == "T"; }    else { $tf5 == "F";}   $check6 = getHasItInfo($award.5, $member_id);    if($check6 > 0) { $tf6 == "T"; }    else { $tf6 == "F";}   $check7 = getHasItInfo($award.6, $member_id);    if($check7 > 0) { $tf7 == "T"; }    else { $tf7 == "F";}   $check8 = getHasItInfo($award.7, $member_id);    if($check8 > 0) { $tf8 == "T"; }    else { $tf8 == "F";}   $check9 = getHasItInfo($award.8, $member_id);    if($check9 > 0) { $tf9 == "T"; }    else { $tf9 == "F";}   $check10 = getHasItInfo($award.9, $member_id);    if($check10 > 0) { $tf10 == "T"; }    else { $tf10 == "F";}   $check11 = getHasItInfo($award.10, $member_id);    if($check11 > 0) { $tf11 == "T"; }    else { $tf11 == "F";}   $check12 = getHasItInfo($award.11, $member_id);    if($check12 > 0) { $tf12 == "T"; }    else { $tf12 == "F";}   $check13 = getHasItInfo($award.12, $member_id);    if($check13 > 0) { $tf13 == "T"; }    else { $tf13 == "F";}   $check14 = getHasItInfo($award.13, $member_id);    if($check14 > 0) { $tf14 == "T"; }    else { $tf14 == "F";}   $check15 = getHasItInfo($award.14, $member_id);    if($check15 > 0) { $tf15 == "T"; }    else { $tf15 == "F";}   $check16 = getHasItInfo($award.15, $member_id);    if($check16 > 0) { $tf16 == "T"; }    else { $tf16 == "F";}   $check17 = getHasItInfo($award.16, $member_id);    if($check17 > 0) { $tf17 == "T"; }    else { $tf17 == "F";}   $check18 = getHasItInfo($award.17, $member_id);    if($check18 > 0) { $tf18 == "T"; }    else { $tf18 == "F";}   $check19 = getHasItInfo($award.18, $member_id);    if($check19 > 0) { $tf19 == "T"; }    else { $tf19 == "F";}   $check20 = getHasItInfo($award.19, $member_id);    if($check20 > 0) { $tf20 == "T"; }    else { $tf20 == "F";}   $check21 = getHasItInfo($award.20, $member_id);    if($check21 > 0) { $tf21 == "T"; }    else { $tf21 == "F";}   $check22 = getHasItInfo($award.21, $member_id);    if($check22 > 0) { $tf22 == "T"; }    else { $tf22 == "F";}   $check23 = getHasItInfo($award.22, $member_id);    if($check23 > 0) { $tf23 == "T"; }    else { $tf23 == "F";}   $check24 = getHasItInfo($award.23, $member_id);    if($check24 > 0) { $tf24 == "T"; }    else { $tf24 == "F";}   $check25 = getHasItInfo($award.24, $member_id);    if($check25 > 0) { $tf25 == "T"; }    else { $tf25 == "F";}   $check26 = getHasItInfo($award.25, $member_id);    if($check26 > 0) { $tf26 == "T"; }    else { $tf26 == "F";}  /// Processes the Check List till the right award number is found to be awarded then ends the search..   if($tf1 == "T" AND $tf2 == "F" AND $tf3 == "F" AND $tf4 == "F" AND $tf5 == "F" AND $tf6 == "F" AND $tf7 == "F" AND $tf8 == "F" AND $tf9 == "F" AND $tf10 == "F" AND $tf11 == "F" AND $tf12 == "F" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {    $newAward = ($award+.1);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "F" AND $tf4 == "F" AND $tf5 == "F" AND $tf6 == "F" AND $tf7 == "F" AND $tf8 == "F" AND $tf9 == "F" AND $tf10 == "F" AND $tf11 == "F" AND $tf12 == "F" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {    $newAward = ($award+.2);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "F" AND $tf5 == "F" AND $tf6 == "F" AND $tf7 == "F" AND $tf8 == "F" AND $tf9 == "F" AND $tf10 == "F" AND $tf11 == "F" AND $tf12 == "F" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {    $newAward = ($award+.3);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "F" AND $tf6 == "F" AND $tf7 == "F" AND $tf8 == "F" AND $tf9 == "F" AND $tf10 == "F" AND $tf11 == "F" AND $tf12 == "F" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {    $newAward = ($award+.4);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "F" AND $tf7 == "F" AND $tf8 == "F" AND $tf9 == "F" AND $tf10 == "F" AND $tf11 == "F" AND $tf12 == "F" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {    $newAward = ($award+.5);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "F" AND $tf8 == "F" AND $tf9 == "F" AND $tf10 == "F" AND $tf11 == "F" AND $tf12 == "F" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {    $newAward = ($award+.6);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "F" AND $tf9 == "F" AND $tf10 == "F" AND $tf11 == "F" AND $tf12 == "F" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {    $newAward = ($award+.7);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "F" AND $tf10 == "F" AND $tf11 == "F" AND $tf12 == "F" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {    $newAward = ($award+.8);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "F" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "F" AND $tf11 == "F" AND $tf12 == "F" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {    $newAward = ($award+.9;    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "F" AND $tf12 == "F" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {    $newAward = ($award+.10);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "F" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {    $newAward = ($award+.11);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "F" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {    $newAward = ($award+.12);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "F" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {    $newAward = ($award+.13);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "F" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {    $newAward = ($award+.14);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "F" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {    $newAward = ($award+.15);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "T" AND $tf17 == "F" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {    $newAward = ($award+.16);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "T" AND $tf17 == "T" AND $tf18 == "F" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {    $newAward = ($award+.17);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "T" AND $tf17 == "T" AND $tf18 == "T" AND $tf19 == "F" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {    $newAward = ($award+.18);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "T" AND $tf17 == "T" AND $tf18 == "T" AND $tf19 == "T" AND $tf20 == "F" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {     $newAward = ($award+.19);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "T" AND $tf17 == "T" AND $tf18 == "T" AND $tf19 == "T" AND $tf20 == "T" AND $tf21 == "F" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {     $newAward = ($award+.20);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "T" AND $tf17 == "T" AND $tf18 == "T" AND $tf19 == "T" AND $tf20 == "T" AND $tf21 == "T" AND $tf22 == "F" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {     $newAward = ($award+.21);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "T" AND $tf17 == "T" AND $tf18 == "T" AND $tf19 == "T" AND $tf20 == "T" AND $tf21 == "T" AND $tf22 == "T" AND $tf23 == "F" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {     $newAward = ($award+.22);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "T" AND $tf17 == "T" AND $tf18 == "T" AND $tf19 == "T" AND $tf20 == "T" AND $tf21 == "T" AND $tf22 == "T" AND $tf23 == "T" AND $tf24 == "F" AND $tf25 == "F" AND $tf26 == "F") {     $newAward = ($award+.23);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "T" AND $tf17 == "T" AND $tf18 == "T" AND $tf19 == "T" AND $tf20 == "T" AND $tf21 == "T" AND $tf22 == "T" AND $tf23 == "T" AND $tf24 == "T" AND $tf25 == "F" AND $tf26 == "F") {     $newAward = ($award+.24);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "T" AND $tf17 == "T" AND $tf18 == "T" AND $tf19 == "T" AND $tf20 == "T" AND $tf21 == "T" AND $tf22 == "T" AND $tf23 == "T" AND $tf24 == "T" AND $tf25 == "T" AND $tf26 == "F") {     $newAward = ($award+.25);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }   elseif($tf1 == "T" AND $tf2 == "T" AND $tf3 == "T" AND $tf4 == "T" AND $tf5 == "T" AND $tf6 == "T" AND $tf7 == "T" AND $tf8 == "T" AND $tf9 == "T" AND $tf10 == "T" AND $tf11 == "T" AND $tf12 == "T" AND $tf13 == "T" AND $tf14 == "T" AND $tf15 == "T" AND $tf16 == "T" AND $tf17 == "T" AND $tf18 == "T" AND $tf19 == "T" AND $tf20 == "T" AND $tf21 == "T" AND $tf22 == "T" AND $tf23 == "T" AND $tf24 == "T" AND $tf25 == "T" AND $tf26 == "T") {     $newAward = ($award+.26);    $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";    $result = mysql_query($query)	 or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";    $result = mysql_query($query)	 or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";    $result = mysql_query($query)	 or die(mysql_error());	 echo "	  <div style='display: none' id='successBox'>	   <p align='center'>	    SUCCESS! -- <br>	    Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>	    Request for Award Was Approved and Deleted!	   </p>	  </div>	  <script type='text/javascript'>	   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');	  </script>	 ";   }  }elseif($ma != 1) {  $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";  $result = mysql_query($query)    or die(mysql_error());   echo "   <div style='display: none' id='successBox'>    <p align='center'>	 ERROR - Member Already has selected Award. <br>	 Award IS NOT a Multi-Aceievable Award. <br>	 Request for Award Was Deined and Deleted!    </p>   </div>   <script type='text/javascript'>    popupDialog('Award Request: Error', 'console.php?pid=$pid&p=ManageAll', 'successBox');   </script>   ";}elseif($ma == 1 AND $man >= $max) {  $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";  $result = mysql_query($query)   or die(mysql_error());    echo "   <div style='display: none' id='successBox'>    <p align='center'>	 ERROR - Member Already has selected Award.<br>	 Award IS a Multi-Aceievable Award, but the member has the Maximum Amount allowed.<br>	 Request for Award Was Deined and Deleted!    </p>   </div>   <script type='text/javascript'>    popupDialog('Award Request: Error', 'console.php?pid=$pid&p=ManageAll', 'successBox');   </script>   ";}}?>

Link to comment
Share on other sites

This looks a little crazy. So much repeated code. Well, an idea of how to start is to condense the first part of the code into a loop:

$tr = array();for($i = 0; $i < 26; $i++) {	$n = $i ? $i : "";	// I have no idea where $award is coming from but there probably is a better way than concatenating numbers to its value	// I don't know what getHasItInfo() is but it probably has something in it that could be optimized.	$check = getHasItInfo($award . $n, $member_id);	if($check > 0) {		$tf[i] = true;	} else {		$tf[i] = false;	}}

The second part seems to do the same thing in every condition except for one difference.

$value = 0;$i = 0;// Count the amount of consecutive true valueswhile($tf[$i]) $i++; if($i > 0) {   // Did you really mean to use the + operator?   // Because of that, we need to turn $i into a decimal number   while($i > 1) $i /= 10;   $newAward = ($award+$i);    // This code was the same in all your conditions   $query = "UPDATE {$dbprefix}medals_members SET medal_award_number = '-1' WHERE medal_id = '$award' AND member_id = '$member'";   $result = mysql_query($query) or die(mysql_error());    $query = "INSERT INTO {$dbprefix}medals_members (medal_id, medal_award_number, medalcat_id, member_id, dateawarded, awarder_id) VALUES ('$newAward', '1', '$awardcat', '$member', '$time', '$awarder')";   $result = mysql_query($query) or die(mysql_error());    $query = "DELETE FROM {$dbprefix}medals_request WHERE id = '$reqid'";	$result = mysql_query($query) or die(mysql_error()); 	echo "		  <div style='display: none' id='successBox'>		   <p align='center'>			SUCCESS! -- <br>			Award IS a Multi-Aceievable Award so an attachment has been added to this award!<br>			Request for Award Was Approved and Deleted!		   </p>		  </div>		  <script type='text/javascript'>		   popupDialog('Award Request: Approved', 'console.php?pid=$pid&p=ManageAll', 'successBox');		  </script>		 ";}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...