| [ PHPXref.com ] | [ Generated: Sun Jul 20 20:12:55 2008 ] | [ Scout Tracker 0.13 ] |
| [ Index ] [ Variables ] [ Functions ] [ Classes ] [ Constants ] [ Statistics ] | ||
[Summary view] [Print] [Text view]
1 <?php 2 if ($script_name = basename($HTTP_SERVER_VARS["SCRIPT_NAME"]) == "all_requirements.php" ) { 3 print "<meta http-equiv=\"refresh\" content=\"0; URL=./index.php\">"; 4 exit; 5 } 6 7 print "<center><h3>All Scouts Requirements Update</h3></center></center>\n"; 8 9 if ($requirement != "") { 10 list($rank_sel,$req_sel) = explode(",",$requirement); 11 $sql = mysql_query("select a.rank_name,b.req_description 12 from tbl_rank as a 13 left join tbl_rank_requirements as b on a.record_key = b.rank_key 14 where a.record_key = $rank_sel and b.req_num = \"$req_sel\""); 15 extract(mysql_fetch_assoc($sql)); 16 mysql_free_result($sql); 17 } 18 19 if ($group_add_req == "Y" && $user_group <=2) { 20 $check_date = verifydate($req_date); 21 if ($check_date == '0000-00-00') { 22 print "<center><h2>Invalid Date $req_date</h2></center>\n<br>"; 23 } else { 24 print "<center><h2>Adding $check_date on $rank_name - $req_sel $req_description for:</h2></center>"; 25 foreach ($completed as $rowid => $completed) { 26 if ($completed == "Y") { 27 $sql_insert = mysql_query("insert into tbl_scout_rank 28 (scout_key 29 ,rank_key 30 ,req_num 31 ,date 32 ) values 33 (\"$rowid\" 34 ,\"$rank_sel\" 35 ,\"$req_sel\" 36 ,\"$check_date\" 37 ) 38 "); 39 $sql = mysql_query("select last_name, first_name from tbl_scout where record_key=$rowid"); 40 extract(mysql_fetch_assoc($sql)); 41 mysql_free_result($sql); 42 print "$first_name,$last_name<br>\n"; 43 } 44 } 45 $requirement = ""; 46 } 47 } 48 49 print "\n<form method=POST action=./index.php><input type=hidden name=all_requirements value=Y>\n 50 <center>\n"; 51 if ($requirement != "") { 52 print "<input type=hidden name=group_add_req value=Y>\n"; 53 print "<input type=hidden name=requirement value=$requirement>\n"; 54 print "Select the Scouts that completed:<br><b>$rank_name - $req_sel $req_description</b>"; 55 } else { 56 print "<select name=requirement>\n"; 57 58 $sql = mysql_query("select a.rank_name, b.req_num, b.req_description, b.rank_key, b.record_key 59 from tbl_rank as a 60 inner join tbl_rank_requirements as b 61 on a.record_key = b.rank_key 62 where b.req_description not in (\"RMB\",\"MB\",\"Rank Complete\") 63 order by b.rank_key, b.record_key"); 64 65 while ($row = mysql_fetch_assoc($sql)) { 66 extract($row); 67 print "<option value=\"$rank_key,$req_num\">$rank_name - $req_num - $req_description</option>\n"; 68 } 69 mysql_free_result($sql); 70 71 print "</select></center>"; 72 } 73 if ($requirement == "") { 74 print "<center><input type=submit value=Submit></form></center>"; 75 } 76 if ($requirement != "") { 77 list($rank_sel,$req_sel) = explode(",",$requirement); 78 $sql_req_comp = mysql_query("select scout_key from tbl_scout_rank where rank_key = $rank_sel and req_num = \"$req_sel\""); 79 80 if ($row = mysql_fetch_assoc($sql_req_comp)) { 81 $scout_comp = $row["scout_key"]; 82 $comp_scout_req = $scout_comp; 83 } 84 $i = 2; 85 while($row = mysql_fetch_assoc($sql_req_comp)) { 86 $scout_comp = $row["scout_key"]; 87 $comp_scout_req = $comp_scout_req . "," . $scout_comp; 88 } 89 mysql_free_result($sql_req_comp); 90 if ($comp_scout_req != "") { 91 $where = "where record_key not in ($comp_scout_req)"; 92 } else { 93 $where = ""; 94 } 95 96 print "<table border=1 align=center class=white><tr align=center><td><h3>Scout</td><td><h3>Completed</td>"; 97 print "</tr>"; 98 99 $sql = mysql_query("select first_name ,last_name ,record_key as rowid from tbl_scout $where "); 100 while ($row = mysql_fetch_assoc($sql)) { 101 extract($row); 102 $i = $i + 1; 103 print "<tr><td>$first_name $last_name</td>"; 104 print "<td align=center><input type=checkbox name=completed[$rowid] value=Y></td>"; 105 print "</tr>\n"; 106 } 107 mysql_free_result($sql); 108 109 print "</table>"; 110 111 if ($user_group < "2" ) { 112 $i = $i + 1; 113 print "<center><hr width=50%>Complete Date: <input type=text name=req_date size=10 114 onChange=\"var box=document.forms[0].req_date;var d=parseDate(box.value); 115 if(d==null){ 116 alert('Date string not recognizable!'); 117 box.value=''; 118 box.focus(); 119 } else { 120 box.value=formatDate(d,'yyyy-MM-dd'); 121 }\"><br> 122 <input type=submit value=Submit></form>"; 123 } 124 } 125 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| [ Powered by PHPXref - Served by Debian GNU/Linux ] |