[ PHPXref.com ] [ Generated: Sun Jul 20 20:12:55 2008 ] [ Scout Tracker 0.13 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/includes/ -> misc_requirements.php (source)

   1  <?php
   2  if ($script_name = basename($HTTP_SERVER_VARS["SCRIPT_NAME"]) == "misc_requirements.php" ) {
   3   print "<meta http-equiv=\"refresh\" content=\"0; URL=../index.php\">";
   4   exit;
   5  }
   6  print "</center>";
   7  
   8  
   9  if ($misc_req_update == 'Y' && $user_group <= 2) {
  10   foreach ($misc_title as $misc_title_key => $misc_title_data) {
  11    if ($misc_title_key == '000' && $misc_title_data != '') {
  12     mysql_query("insert into tbl_misc_requirements
  13                   (scout_key
  14                   ,title
  15                   ,description
  16                   ) values
  17                   (\"$rowid\"
  18                   ,\"" . $misc_title_data . "\"
  19                   ,\"" . $misc_description[$misc_title_key] . "\"
  20                   )
  21                 ");
  22    }
  23    if ($misc_title_key != '000') {
  24     if ($delete[$misc_title_key] == 'Y') {
  25      mysql_query("delete from tbl_misc_requirements
  26                    where record_key = \"$misc_title_key\"
  27                  ");
  28     } else {
  29      mysql_query("update tbl_misc_requirements
  30                    set
  31                    title = \"" . $misc_title_data . "\"
  32                    ,description = \"" . $misc_description[$misc_title_key] . "\"
  33                    where record_key = \"$misc_title_key\"
  34                  ");  
  35     }
  36    } 
  37   }
  38  }
  39  
  40  $sql = mysql_query("select first_name, last_name from tbl_scout where record_key=$rowid");
  41  extract(mysql_fetch_assoc($sql));
  42  mysql_free_result($sql);
  43  $sql = mysql_query("select position from tbl_scout_leadership where scout_key=$rowid and enddate='0000-00-00'");
  44  extract(mysql_fetch_assoc($sql));
  45  mysql_free_result($sql);
  46  print "<center><h3>$position $first_name $last_name</h3></center>";
  47  print "<center><b>Miscellaneous Requirements</b></center>";
  48  
  49  if ($user_group < 2 && $print != 'Y') {
  50   print "\n<form method=POST action=./index.php>
  51   <input type=hidden name=rowid value=$rowid>
  52   <input type=hidden name=misc_requirements value=Y>
  53   <input type=hidden name=misc_req_update value=Y>";
  54  }
  55  
  56  $sql = mysql_query("select record_key as misc_key,title as misc_title,description as misc_description from tbl_misc_requirements where scout_key = $rowid order by record_key");
  57  
  58  while ($row = mysql_fetch_assoc($sql)) {
  59   extract($row);
  60   if ($user_group == 2 || $print == 'Y') {
  61    print "\n<br><b>Name:</b>$misc_title\n<br>Description:</b><ol>$misc_description</ol>";
  62   }
  63   if ($user_group < 2 && $print != 'Y') {
  64    print "\n<br><b>Name:</b><br><input type=text length=25 name=misc_title[$misc_key] value=\"$misc_title\">
  65    <input type=checkbox name=delete[$misc_key] value=Y><b>Check to Delete</b>
  66    <br><b>Description:</b><br><textarea name=misc_description[$misc_key] rows=5 cols=51>$misc_description</textarea><br>";
  67   }
  68  }
  69  mysql_free_result($sql);
  70  if ($user_group < 2 && $print != 'Y') {
  71   print "\n<br>Add:<br>
  72   <b>Name:</b><br><input type=text length=25 name=misc_title[000] value=\"\">
  73   <br><b>Description:</b><br><textarea name=misc_description[000] rows=5 cols=51></textarea><br>";
  74   
  75   print "\n<input type=submit value=Submit></form>";
  76  }
  77  
  78  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]