Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP
Author Message
Donovan
Client



Joined: Oct 07, 2003
Posts: 735
Location: Ohio

PostPosted: Mon Jul 03, 2006 8:57 pm Reply with quote

I don't know why my column of checkboxes dissapeared from this page. I still have values in my db table. I cannot see the checkboxes anymore.



Code:
define('INDEX_FILE', true);

$index = 1;
require_once("mainfile.php");
include_once("header.php");
global $module_name, $db, $prefix, $bgcolor1, $bgcolor2;
@include("modules/MILPACS/includes/milpacs.inc.php");
$warid = $_GET['warid'];

if ($op == "saveWar") {
   // Validations go here   

   $result1 = $db->sql_query("SELECT * FROM vwar" . $n . " v JOIN vwar" . $n . "_opponents vo JOIN vwar" . $n . "_matchtype vmt WHERE v.status = 1 AND v.oppid = vo.oppid AND warid = '$warid'");
   if (!$result1) {
          echo("<p>Error accessing war data!" . mysql_error() . "</p>");
   }
   while ($row = $db->sql_fetchrow($result1)) {
      $oppid = $row["oppid"];
      $sql = "SELECT mm.uniqueid, mm.unit_id, mm.position, mr.rank_abbr, mm.u_name FROM " . $prefix . "_milpacs_members mm JOIN " . $prefix . "_milpacs_ranks mr WHERE mm.rank_id = mr.rank_id AND mm.unit_id != '' AND mm.status IN ('Active','LOA') ORDER BY mr.rank_order ";
      $result = $db->sql_query($sql);   
      while ( $row = $db->sql_fetchrow($result) ) {
         $uniqueid = $row["uniqueid"];
          if ($warstatus[$uniqueid] == "Yes") {
            $result2 = $db->sql_query ("SELECT * FROM " . $prefix."_milpacs_combat WHERE warid = '$warid' AND uniqueid='$uniqueid'");
                if ($myrow2 = $db->sql_fetchrow($result2)){
            } else {
               $sql = "INSERT INTO " . $prefix . "_milpacs_combat (
                   warid,  uniqueid,     oppid ) VALUES ( $warid,  $uniqueid, $oppid)";
               $result3 = $db->sql_query ($sql);
            }
          } else {
            $result2 = $db->sql_query ("SELECT * FROM " . $prefix."_milpacs_combat WHERE warid = " . $warid . " AND uniqueid = " . $uniqueid);
                if ($myrow2 = $db->sql_fetchrow($result2)){
               $result3 = $db->sql_query ("DELETE FROM " . $prefix . "_milpacs_combat WHERE warid = '$warid' AND uniqueid = '$uniqueid'");
                }
            }
      }
   }

}
$result1 = $db->sql_query("SELECT * FROM vwar" . $n . " v JOIN vwar" . $n . "_opponents vo JOIN vwar" . $n . "_matchtype vmt WHERE v.status = 1 AND v.oppid = vo.oppid AND warid = '$warid' AND v.matchtypeid = vmt.matchtypeid");
if (!$result1) {
       echo("<p>Error accessing war data!" . mysql_error() . "</p>");
}
while ($row = $db->sql_fetchrow($result1)) {
$date = date("F j, Y", $row["dateline"]);
$oppname = $row["oppname"];
$matchtypename = $row["matchtypename"];
}

$result = $db->sql_query("SELECT * FROM " . $prefix . "_milpacs_main");
$info = $db->sql_fetchrow($result);
$unit_name = $info[unit_name];
$unit_tag = $info[unit_tag];

OpenTable();
echo "<p><a href=\"admin.php?op=milpacs\">Return to Main Administration</a></p>"
// Load members
. "<form name=\"editwar\" action=\"admin.php?op=EditWar&warid=$warid\" method=\"POST\">"
. "<div align=\"center\">"
. "<label><H2>$unit_tag War Report</H2></label>"
. "<HR>"
. "</div>"
. "<br>"
. "<p>"
. "<strong>War Date: $date</strong>"
. "<br>"
. "<strong>Enemy Engaged: $oppname</strong>"
. "<br>"
. "<strong>Matchtype: $matchtypename</strong>"
. "<br>"
. "<table border=\"0\" width=\"100%\" cellpadding=\"5\"><tr>"
. "<table border=\"0\" width=\"100%\" cellpadding=\"3\"><tr><th width=\"5%\">Rank</th><th width=\"20%\">Name</th><th width=\"15%\"><b>Position</b></th><th width=\"10%\">Present</th>"
. "</tr>"
. "</table>"
. "<table border=\"0\" width=\"100%\" cellpadding=\"5\">";

$sql = "SELECT mm.uniqueid, mm.unit_id, mm.position, mr.rank_abbr, mm.u_name FROM " . $prefix . "_milpacs_members mm JOIN " . $prefix . "_milpacs_ranks mr WHERE mm.rank_id = mr.rank_id AND mm.unit_id != '' AND mm.status IN ('Active','LOA') ORDER BY mr.rank_order ";
$result = $db->sql_query($sql);   
while ( $row = $db->sql_fetchrow($result) ) {
   $id = $row["uniqueid"];
   $rank = $row["rank_abbr"];
   $u_name = $row["u_name"];
   $position = $row["position"];

    $result2 = $db->sql_query ("SELECT * FROM " . $prefix."_milpacs_combat WHERE warid = " . $warid . " AND uniqueid = '$id'");
    if ($myrow2 = $db->sql_fetchrow($result2)){ $checked = "checked"; } else { $checked = ""; }
echo "<tr>"
   ."<td align=\"center\" width=\"5%\"><b><font class=\"content\">$rank</font></b></td>"
   ."<td align=\"center\" width=\"20%\"><b><font class=\"content\">$u_name</font></b></td>"
   ."<td align=\"center\" width=\"15%\"><b><font class=\"content\">$position</font></b></td>"      
   ."<td align=\"center\" width=\"10%\"><input=$checked name=\"warstatus[=$id]\" type=\"checkbox\" id=\"warstatus\" value=\"Yes\"></td>"      
   ."</tr>";   
}
echo "</table>"
."<input type=\"submit\" align=\"center\" name=\"Submit\" value=\"Save\"/>"
."<input type=\"hidden\" name=\"op\" value=\"saveWar\"/>"
."<input type=\"hidden\" name=\"warid\" value=\"$warid\"/>"
."</form>";
CloseTable();
include("footer.php");
?>
 
View user's profile Send private message Visit poster's website ICQ Number
hitwalker
Sells PC To Pay For Divorce



Joined:
Posts: 5661

PostPosted: Tue Jul 04, 2006 6:33 am Reply with quote

changed anything lately?
edited something?
added a module or something else ?
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©