<?php
session_start();
include('../includes/con2db.php');

$parent = $_GET["parent"];
$id = $_SESSION['id'];
$WBSIDG=$_GET["q"];
$WID = $_GET["p"];
?>

<form id="addBeforeForm" name="addBeforeForm" method="post" action="../DB/GWBSDB-G.php?AddBefore=1&WID=<?php echo $WID?>&q=<?php echo $id;?>&parent=<?php echo $parent;?>">

   

      <h1>Add WBS before WBS</h1>

  

  <table width="100%">

  <tr>

    <td><font color="#666666" size="1">ADD BEFORE WBS</font></td>

    <td>
    <select name="PNode" id="PNode" >
<?php $result = mysql_query("SELECT * FROM globalwbs where gwbslist_id = '$WID' && companyID = '$id' ORDER BY WBSIDA ASC,WBSIDA ASC,WBSIDB ASC,WBSIDC ASC,WBSIDD ASC,WBSIDE ASC");
	  $count =0;
		
   		while($row = mysql_fetch_array($result , MYSQL_ASSOC))
  		{
			$WBSID = $row["WBSID"];
			
			if($WBSIDG==$WBSID){
					echo "<option selected='selected' value='$WBSID'>".$row["WBSIDA"].".".$row["WBSIDB"].".".$row["WBSIDC"].".".$row["WBSIDD"].".".$row["WBSIDE"]." - ".$row["description"]."</option>";
			}
			else
			{
					echo "<option value='$WBSID'>".$row["WBSIDA"].".".$row["WBSIDB"].".".$row["WBSIDC"].".".$row["WBSIDD"].".".$row["WBSIDE"]." - ".$row["description"]."</option>";
				}
		}			
?>
    </select>

    </td>

  </tr>

  <tr>

    <td width="40%"><font color="#666666" size="1">WBS-G DESCRIPTION</font></td>

    <td><input name="description" type="text" id="description" size="60" /></td>

  </tr>
  <tr>

    <td width="40%"><font color="#666666" size="1">WBS-G Writeup</font></td>

    <td><input name="writeupwbs" type="text" id="writeupwbs" size="60" /></td>

  </tr>

  <tr>

    <td><input type="submit" name="Submit1" value="Save" /> </td>
<td>&nbsp;</td>
    

  </tr>

</table>

    </form>