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: Tue Jun 27, 2006 1:26 pm Reply with quote

I am adding a field called ismember smallint(1) to my checkuser.php script.

I am adding either a 1 or 0 depending on if they still belong to the unit. nukeusername along with ismember will both verify if they can access viewdrill and the drillreport.php pages.

I am still getting errors with checkuser but think this way may solves my problems.

When I addsoldier.php I can add the value to ismember no probelm, but my editsoldier page does not reflect the value back.

Here is what I did.

Code:
// If not saving, load values from database

if ($op != "SaveSoldier") {
   $id = intval($_GET['id']);
   $result = $db->sql_query("SELECT * FROM " . $prefix . "_milpacs_members mm
   INNER JOIN (" . $prefix . "_milpacs_units mu) ON (mm.unit_id = mu.unit_id)
   LEFT JOIN " . $prefix . "_milpacs_weapons mw ON (mw.weapon_id = mm.weapon_id)
   WHERE mm.uniqueid ='$id'");
   $info = $db->sql_fetchrow($result);

   if ($info['ismember']==1) { $ismember = "checked"; } else { $ismember = ""; }
   if (!$result) {
      echo("<p>Error performing query: " . mysql_error() . "</p>");
      exit();
   } else {

etc
etc


Further down my page is where I have the checkbox:

Code:
<tr>

      <td align="center"> Is Member: <input type="checkbox" name="ismember" value="<?php echo $ismember ?>"></td>
   </tr>


So in my editsolder page if they are a member and the value for ismember ==1 then I need the checkbox to reflect this.

Any help is appreciated.
 
View user's profile Send private message Visit poster's website ICQ Number
gregexp
The Mouse Is Extension Of Arm



Joined: Feb 21, 2006
Posts: 1497
Location: In front of a screen....HELP! lol

PostPosted: Tue Jun 27, 2006 1:38 pm Reply with quote

Have you tried running the query with a known output and then echoed $ismember

Might be the root of the coding

I also dont think it should be value=$ismember
I think it should be checked=$ismember

_________________
For those who stand shall NEVER fall and those who fall shall RISE once more!! 
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Donovan







PostPosted: Tue Jun 27, 2006 1:43 pm Reply with quote

darklord wrote:

I also dont think it should be value=$ismember
I think it should be checked=$ismember


But this makes them all a checked value in the page regardless if ismember has "1" or not.
 
gregexp







PostPosted: Tue Jun 27, 2006 1:49 pm Reply with quote

then that shows a fundamental problem with the way its defining the ismember

basically, try this


<td align="center"> Is Member: <input type="checkbox" name="ismember" checked="<?php echo "checked" ?>"></td>

now this should yeild a checked box

then try this
<td align="center"> Is Member: <input type="checkbox" name="ismember" checked=""></td>

this should yeild nothing, if this is correct, then its how its defining the variable, the only other thing that has me a little bugged is the way ur using the echo


I wish i could get the whole code to help if possible.

With the code, I could put it on my site and test the code to see if I am correct but without it im left handling nothing and shooting in the dark.
 
Donovan







PostPosted: Tue Jun 27, 2006 1:58 pm Reply with quote

Code:
<?php

/************************************************************************/
/* MILPACS (Military Personell and Classification System)               */
/* Author::Donovan [3rd ID]                                    */
/* Copyright (c) 2005 by Steven Donovan AKA Donovan [3rd ID]         */
/* Email:: [ Only registered users can see links on this board! Get registered or login! ]
/* Homepage::http://www.3rd-infantry-division.net                  */
/*                                                      */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/*                                                                      */
/* This program is distributed in the hope that it will be useful, but  */
/* WITHOUT ANY WARRANTY; without even the implied warranty of           */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU     */
/* General Public License for more details.                             */
/*                                                                      */
/* If you want a copy of the GNU General Public License write to the    */
/* Free Software Foundation, Inc.                              */
/* 59 Temple Place, Suite 330, Boston, MA 02111-1307               */
/* USA                                                                  */
/************************************************************************/
/*********************************************************/
/* Edit Soldier                                          */
/*********************************************************/

if (!defined('ADMIN_FILE')) {
die ("Access Denied");
}

define('INDEX_FILE', true);
$index = 1;
include_once("header.php");
global $module_name, $db, $prefix, $admin_file, $bgcolor1, $bgcolor2;
$IMAGEPATH = $_SERVER['DOCUMENT_ROOT'];

   if ($op == "SaveSoldier") {
   // Validations go here
   // If all validations passed, save and exit, otherwise, redisplay with errors
   $id = intval($_POST['id']);
   $ismember = intval($ismember);
   $rank_id = intval($rank_id);
   $unit_id = intval($unit_id);
   $weapon_id = intval($weapon_id);
   $subunit_id = intval($subunit_id);
   $adminunits;
   $num_of_adminunits = sizeof($_POST[admin_unit_id]);
   $k = 0;
   for ($i=0; $i < $num_of_adminunits; $i++) {
      $ifDuplicated = false;
      $test_for_duplication = explode(",",$adminunits);
      if ($_POST[admin_unit_id][$i]) {
         for ($j=0; $j < sizeof($test_for_duplication); $j++) {
            if ($_POST[admin_unit_id][$i] == $test_for_duplication[$j])
               $ifDuplicated = true;
         }
         if (!$ifDuplicated) {
            if ($k > 0)
               $adminunits .= ",";
            $adminunits .= $_POST[admin_unit_id][$i];
            $k++;
         }
      }
   }
//      Order in increasing numerical order
   $admin_array = explode(",",$adminunits);
   sort($admin_array);
   $adminunits = "";
   for ($i=0; $i <= sizeof($admin_array); $i++) {
      if ($admin_array[$i] != "")
         $adminunits .= $admin_array[$i] . ",";
   }
//   $email = addslashes($email);
   $bio = addslashes($bio);
   $sql = "UPDATE " . $prefix . "_milpacs_members set
      uniform = '$uniform',
      rank_id = '$rank_id',
      ismember = '$ismember',
      flag = '$flag',
      u_name = '$soldierName',
      nukeusername = '$nukeusername',
      location = '$location',
      status = '$status',
      p_mos = '$p_mos',
      unit_id = '$unit_id',
      subunit_id = '$subunit_id',
      adminunits = '$adminunits',
      reports = '$reports',
      position = '$position',
      weapon_id = '$weapon_id',
      enlistment_dt = '$enlistment_dt',
      promotion_dt = '$promotion_dt',
      icq = '$icq',
      email = '$email',
      bio = '$bio'
      WHERE uniqueid ='$id'";
   $update = $db->sql_query($sql);
}

   // If not saving, load values from database
if ($op != "SaveSoldier") {
   $id = intval($_GET['id']);
   $result = $db->sql_query("SELECT * FROM " . $prefix . "_milpacs_members mm
   INNER JOIN (" . $prefix . "_milpacs_units mu) ON (mm.unit_id = mu.unit_id)
   LEFT JOIN " . $prefix . "_milpacs_weapons mw ON (mw.weapon_id = mm.weapon_id)
   WHERE mm.uniqueid ='$id'");
   $info = $db->sql_fetchrow($result);
   if ($info['ismember']==1) { $checked = "checked"; } else { $checked = ""; }
   if (!$result) {
      echo("<p>Error performing query: " . mysql_error() . "</p>");
      exit();
   } else {
      $soldierName = $info['u_name'];
      $nukeusername = $info['nukeusername'];
      $ismember = $info['ismember'];
      $uniform = $info['uniform'];
      $rank_id = $info['rank_id'];
      $flag = $info['flag'];
      $location = $info['location'];
      $status = $info['status'];
      $p_mos = $info['p_mos'];
      $unit_id = $info['unit_id'];
      $subunit_id = $info['subunit_id'];
      $adminunits = $info['adminunits'];
      $reports = $info['reports'];
      $position = $info['position'];
      $weapon_id = $info['weapon_id'];
      $qual = $info['qual'];
      $enlistment_dt = $info['enlistment_dt'];
      $promotion_dt = $info['promotion_dt'];
      $icq = $info['icq'];
      $email = $info['email'];
      $bio = stripslashes($info['bio']);
   }
}

// Load Uniform images (Rank, Flag)
$urlofimages="$IMAGEPATH/modules/MILPACS/images/uniform/";
$uniformselecthtml = "<select name=\"uniform\">";
$uniformselecthtml .= "<option value=\"\">Select Uniform Image</option>";
if ($handle=@opendir($urlofimages)) {
   while ($imgfile = readdir($handle)) {
      if ($imgfile != "." && $imgfile != ".." && $imgfile != "" && $imgfile != "index.html" && $imgfile != "WS_FTP.LOG" && $imgfile != "Thumbs.db") {
         if ($imgfile==$uniform) {
            $uniformselecthtml .= "<option value =\"$imgfile\" selected>$imgfile</option>";
         } else {
            $uniformselecthtml .= "<option value =\"$imgfile\" >$imgfile</option>";
         }
      }
   }
   @closedir($handle);
}
$uniformselecthtml .= "</select>";
// Load Ranks
$rankselecthtml = "<select name=\"rank_id\">";
$rankselecthtml .= "<option value=\"\">Select Rank</option>";
$result2 = $db->sql_query("SELECT * FROM " . $prefix . "_milpacs_ranks order by rankname");
while ($rankrow = $db->sql_fetchrow($result2)) {
   if ($rankrow[rank_id]==$rank_id) {
      $rankselecthtml .= "<option value =\"$rankrow[rank_id]\" selected>$rankrow[rankname]</option>";
   } else {
      $rankselecthtml .= "<option value =\"$rankrow[rank_id]\" >$rankrow[rankname]</option>";
   }
}
$rankselecthtml .= "</select>";
// Load Flag images
$urlofimages="$IMAGEPATH/modules/MILPACS/images/flags/";
$flagselecthtml = "<select name=\"flag\">";
$flagselecthtml .= "<option value=\"\">Select Flag Image</option>";
if ($handle=@opendir($urlofimages)) {
   while ($imgfile = readdir($handle)) {
      if ($imgfile != "." && $imgfile != ".." && $imgfile != "" && $imgfile != "index.html" && $imgfile != "WS_FTP.LOG" && $imgfile != "Thumbs.db") {
         if ($imgfile==$flag) {
            $flagselecthtml .= "<option value =\"$imgfile\" selected>$imgfile</option>";
         } else {
            $flagselecthtml .= "<option value =\"$imgfile\" >$imgfile</option>";
         }
      }
   }
   @closedir($handle);
}
$flagselecthtml .= "</select>";

// Load Weapons
$weaponselecthtml = "<select name=\"weapon_id\">";
$weaponselecthtml .= "<option value=\"\">Select Weapon</option>";
$result3 = $db->sql_query("SELECT * FROM " . $prefix . "_milpacs_weapons order by make");
while ($weaponrow = $db->sql_fetchrow($result3)) {
   if ($weaponrow[weapon_id]==$weapon_id) {
      $weaponselecthtml .= "<option value =\"$weaponrow[weapon_id]\" selected>$weaponrow[make]</option>";
   } else {
      $weaponselecthtml .= "<option value =\"$weaponrow[weapon_id]\" >$weaponrow[make]</option>";
   }
}
$weaponselecthtml .= "</select>";

// Load Unit
$unitselecthtml = "<select name=\"unit_id\">";
$unitselecthtml .= "<option value=\"\">Select Unit</option>";
$result4 = $db->sql_query("SELECT * FROM " . $prefix . "_milpacs_units order by unit_name");
while ($unitrow = $db->sql_fetchrow($result4)) {
   if ($unitrow[unit_id]==$unit_id) {
      $unitselecthtml .= "<option value =\"$unitrow[unit_id]\" selected>$unitrow[unit_name]</option>";
   } else {
      $unitselecthtml .= "<option value =\"$unitrow[unit_id]\" >$unitrow[unit_name]</option>";
   }
}
$unitselecthtml .= "</select>";

// Load Status
$statusselecthtml = "<select name=\"status\">\n<option value=\"\">Select Status</option>";
$wStatus = array("Active", "LOA", "Long Term LOA", "Retired", "Discharged");
for ($i=0; $i < sizeof($wStatus); $i++) {
   if ($status == $wStatus[$i])
      $statusselecthtml .= "<option value='$wStatus[$i]' selected>$wStatus[$i]</option>";
   else
      $statusselecthtml .= "<option value='$wStatus[$i]'>$wStatus[$i]</option>";
}
$statusselecthtml .= "</select>";

// Load Reporting Official
// Not Used!!
//$reportselecthtml = "<select name=\"uniqueid\">";
//$reportselecthtml .= "<option value=\"\">Select Reporting Official</option>";
//$result6 = $db->sql_query("SELECT u_name, uniqueid, report_id FROM " . $prefix . "_milpacs_members WHERE status IN ('Active','LOA','Long Term LOA'");
//while ($reportrow = $db->sql_fetchrow($result6)) {
//   if ($reportrow[report_id]==$uniqueid) {
//      $reportselecthtml .= "<option value =\"$reportrow[uniqueid]\" selected>$reportrow[u_name]</option>";
//   } else {
//      $reportselecthtml .= "<option value =\"$reportrow[uniqueid]\" >$reportrow[u_name]</option>";
//   }
//}
//$reportselecthtml .= "</select>";


// Load Subunit
$subunitselecthtml = "<select name=\"subunit_id\">\n<option value=\"\">Select Subunit</option>";
$result5 = $db->sql_query("SELECT * FROM " . $prefix . "_milpacs_subunit WHERE unit_id = '$unit_id' ORDER BY subunit_name");
while ($subunit_row2 = $db->sql_fetchrow($result5)) {
   if ($subunit_row2[subunit_id] == $subunit_id)
      $subunitselecthtml .= "<option value =\"$subunit_row2[subunit_id]\" selected>$subunit_row2[subunit_name]</option>";
   else
      $subunitselecthtml .= "<option value =\"$subunit_row2[subunit_id]\">$subunit_row2[subunit_name]</option>";
}
$subunitselecthtml .= "</select>";

// Load Admin Units
$num_of_admin_units = 0;
$adminunitselecthtml = "";
$result8 = $db->sql_query("SELECT * FROM " . $prefix . "_milpacs_adminunit");
while ( $adminunits_row = $db->sql_fetchrow($result8) ) {
   $num_of_admin_units++;
}
$adminunitarray = explode(",",$adminunits);
$noa_admin_units = sizeof($adminunitarray);
for ($i=0; $i < $noa_admin_units; $i++) {
   if ($i > 0)
      $adminunitselecthtml .= "<br>\n";
   $adminunitselecthtml .= "<select name=\"admin_unit_id[]\">\n<option value=\"\">Add New Admin Unit</option>";
   $result7 = $db->sql_query("SELECT * FROM " . $prefix . "_milpacs_adminunit ORDER BY admin_unit_name");
   while ( $adminunit_row = $db->sql_fetchrow($result7) ) {
      $adminunit_id[$i] = $adminunit_row[admin_unit_id];
      $adminunit_name[$i] = $adminunit_row[admin_unit_name];
      if ($adminunit_id[$i] == $adminunitarray[$i-1])
         $adminunitselecthtml .= "<option value=\"$adminunit_id[$i]\" selected>$adminunit_name[$i]</option>";
      else
         $adminunitselecthtml .= "<option value=\"$adminunit_id[$i]\">$adminunit_name[$i]</option>";
   }
   $adminunitselecthtml .= "</select>";
}

OpenTable();
echo "<p><a href=\"admin.php?op=milpacs\">Return to Main Administration</a></p>";
echo " <form name=\"editsoldier\" action=\"".$admin_file.".php\" method=\"post\">";
?>
<table width="100%" border="2" cellpadding="2" align="center" cellspacing="0" style="border-collapse: collapse;" bordercolor="#111111">
   <tr>
      <td align="center" bgcolor= "<?php echo $bgcolor2 ?>"><b><font class="title">Personnel File of <?php echo $soldierName ?></font></b></td>
   </tr>   
   <tr>
      <td align="center"> Uniform image: <?php echo $uniformselecthtml ?></td>
   </tr>
   <tr>
      <td align="center"> Rank image: <?php echo $rankselecthtml ?></td>
   </tr>
   <tr>
      <td align="center"> Flag image: <?php echo $flagselecthtml ?></td>
   </tr>
   <tr>
      <td align="center"> Is Member: <input type="checkbox" name="ismember" value="<?php echo $ismember ?>"></td>
   </tr>
</table>
<table width="100%" border="2" cellpadding="2" align="center" cellspacing="0" style="border-collapse: collapse;" bordercolor="#111111">
   <tr>
      <td height="25" colspan="2" align="left" bgcolor= <?php echo $bgcolor1 ?>><b><font class="title">Vital Statistics</font></b></td>
   </tr>
   <tr>
      <td align="center">
<table width="100%" border="1" cellpadding="2" cellspacing="1" style="border-collapse: collapse;" id="AutoNumber1" bordercolor="#111111">
      </td>
   <tr>
      <td width="50%" align="right"><b><font class="content">Name:</font></b></td>
      <td width="50%"><input type="text" name="soldierName" value="<?php echo $soldierName ?>"/></td>
   </tr>
   <tr>
          <td width="50%" align="right"><b><font class="content">(For Drill Access) Nuke Name:</font></b></td>
        <td width="50%"><input type="text" name="nukeusername" value="<?php echo $nukeusername ?>"/></td>
    </tr>
   <tr>
      <td width="50%" align="right"><b><font class="content">Location:</font></b></td>
      <td width="50%"><input type="text" name="location" value="<?php echo $location ?>"/></td>
   </tr>
   <tr>
      <td width="50%" align="right"><b><font class="content">Status:  </font></b></td>
      <td width="50%"><?php echo $statusselecthtml ?></td>
   </tr>
   <tr>
      <td width="50%" align="right"><b><font class="content"><b>Primary MOS:</b></font></td>
      <td width="50%"><input type="text" name="p_mos" value="<?php echo $p_mos ?>"/></td>
   </tr>
   <tr>
      <td width="50%" align="right"><b><font class="content">Combat Unit:</font></b></td>
      <td width="50%"><?php echo $unitselecthtml ?></td>
   </tr>
   <tr>
      <td width="50%" align="right"><b><font class="content">Combat Subunit:</font></b></td>
      <td width="50%"><?php echo $subunitselecthtml ?></td>
   </tr>
   <tr>
      <td width="50%" align="right"><b><font class="content">Admin Units:</font></b></td>
      <td width="50%"><?php echo $adminunitselecthtml ?></td>
   </tr>
   <tr>
      <td width="50%" align="right"><b><font class="content">Reports to:</font></b></td>
      <td width="50%"><input type="text" name="reports" value="<?php echo $reports ?>"/></td>      
   </tr>
   <tr>
      <td width="50%" align="right"><b><font class="content">Position:</font></b></td>
      <td width="50%"><input type="text" name="position" value="<?php echo $position ?>"/></td>
   </tr>
   <tr>
      <td width="50%" align="right"><b><font class="content"><b>Weapon:</b></font></td>
      <td width="50%"><?php echo $weaponselecthtml ?></td>
   </tr>
   <tr>
      <td width="50%" align="right"><b><font class="content"><b>Qualifications:</b></font></td>
      <td width="50%"><input type="text" name="qual" value="<?php echo $qual ?>"/></td>
   </tr>
   <tr>
      <td width="50%" align="right"><b><font class="content">Enlisted Date:</font></b></td>
      <td width="50%"><input type="text" name="enlistment_dt" value="<?php echo $enlistment_dt ?>"/>
      <a href="javascript:showCal('Enlistment');"><img src="modules/MILPACS/images/icon_calendar.gif" title="Select Date" alt="Select Date"></a>
      </td>
   </tr>
   <tr>
      <td width="50%" align="right"><b><font class="content">Promoted Date:</font></b></td>
      <td width="50%"><input type="text" name="promotion_dt" value="<?php echo $promotion_dt ?>"/>
      <a href="javascript:showCal('Promoted');"><img src="modules/MILPACS/images/icon_calendar.gif" title="Select Date" alt="Select Date"></a>
      </td>
   </tr>
   <tr>
      <td width="50%" align="right"><b><font class="content">ICQ#:  </font></b></td>
      <td width="50%"><input type="text" name="icq" value="<?php echo $icq ?>"/></td>
   </tr>
   <tr>
      <td width="50%" align="right"><b><font class="content">E-mail:</font></b></td>
      <td width="50%"><input type="text" name="email" size="35" maxlength="35" value="<?php echo $email ?>"/></td>
   </tr>
</table>
</table>
<table width="100%" border="2" cellpadding="2" align="center" cellspacing="0" style="border-collapse: collapse;" bordercolor="#111111">
   <tr>
      <td align="left" bgcolor= "<?php echo $bgcolor1 ?>"><b><font class="title">Personal Bio</font></b></td>
   </tr>
   <tr>
      <td align="left"><textarea name="bio" cols="80" colspan="1" rows="8"><?php echo $bio ?></textarea></td>
   </tr>
</table>
<br>
<input type="hidden" name="op" value="SaveSoldier"/>
<input type="hidden" name="profilename" value="<?php echo $soldierName ?>"/>
<input type="hidden" name="nukename" value="<?php echo $nukeusername ?>"/>
<input type="hidden" name="id" value="<?php echo $id ?>"/>
<input type="submit" class="button" align="center" value="Update"/>
</form>
<?php
CloseTable();
include_once("footer.php");
?>
 
Donovan







PostPosted: Tue Jun 27, 2006 2:04 pm Reply with quote

I set up a demo account for people to checkout the progress of my module.
[ Only registered users can see links on this board! Get registered or login! ]

Login: Admin
Password: demo
 
gregexp







PostPosted: Tue Jun 27, 2006 2:06 pm Reply with quote

One more thing, can you give me the database insert to make the tables I need?
 
gregexp







PostPosted: Tue Jun 27, 2006 2:33 pm Reply with quote

as i originally thought. It is not comparing the 2 tables the way ud like, im goin to try somethin to see if i can rise somethin out of this.
 
gregexp







PostPosted: Tue Jun 27, 2006 5:45 pm Reply with quote

I'll be playing with this code for a bit but i think it would be better to make indicual sql calls instead of one sql call as it seems you have 4.
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Tue Jun 27, 2006 9:07 pm Reply with quote

Sorry, don't mean to butt in here. What happens if you change your IF to:

if ($info['ismember']=="1") { $ismember = "checked"; } else { $ismember = ""; }

Note the double quotes around the check for equality. OR, you may want to try reversing that and check for =="" for the "unchecked" state.

Anyways, I am sure darklord will be better able to help... just thought I'd throw that in for good measure. Laughing

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
gregexp







PostPosted: Tue Jun 27, 2006 9:32 pm Reply with quote

Actually I'm fighting this code 3-ways from sunday, I'm trying to understand what exactly your trying to accomplish with the Join statements.
Are you trying to verify that this person is a member?
And what determines if he/she is a member and what is the weapon code for?

I just simply dont want to run in circles here overwriting or altering variables preset in other files.
 
Donovan







PostPosted: Wed Jun 28, 2006 7:48 am Reply with quote

darklord wrote:
Actually I'm fighting this code 3-ways from sunday, I'm trying to understand what exactly your trying to accomplish with the Join statements.


The JOIN statements pull from the members, units, and weapons tables to display all pertinent info to edit in editsoldier. They may not be assigned to a unit or a weapon so that is why I have INNER and LEFT JOINS.

darklord wrote:

Are you trying to verify that this person is a member?
And what determines if he/she is a member and what is the weapon code for?


The variable ismember in conjunction with nukeusername will only be used to validate if the person should have access to viewdrill and drillreport.
 
Donovan







PostPosted: Wed Jun 28, 2006 2:34 pm Reply with quote

Ok
This seems to work for my checkuser code.

Code:
$nukeusername = $userinfo['username']; 


$sql = "SELECT * FROM ".$prefix."_milpacs_members WHERE nukeusername = '$nukeusername' AND ismember = '1'";
   $result = $db->sql_query($sql);
   if  ($db->sql_numrows($result) > 0) {       
       session_start();
       $_SESSION['loggedin1'] = 1;       
       Header("Location: modules.php?name=MILPACS&file=viewdrill");
      } else {         
       session_start();
       $_SESSION['loggedin1'] = 0;       
       Header("Location: modules.php?name=MILPACS&file=accessdenied");
    }    


Now I just need to get the editsoldier working to update a soldier record with the ismember flag.
 
Donovan







PostPosted: Wed Jun 28, 2006 3:09 pm Reply with quote

This works in my editsoldier code:

Code:
<tr>   

   <td align="center">Is Member: <input type="checkbox" name="ismember" <?php if($ismember == "1"){echo " CHECKED";}?>>    
   </tr>


When I try to update would this work?


Code:
if ($op == "SaveSoldier") {

   $id = intval($_POST['id']);
   $ismember = intval($ismember);



Code:
$sql = "UPDATE " . $prefix . "_milpacs_members set

      uniform = '$uniform',
      rank_id = '$rank_id',
      ismember = '$ismember',
 
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 ©