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

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

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


    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Add WBS, Before WBS</h4>
      </div>
      <div class="modal-body">
        <table class="table3" width="100%">

  <tr>

    <td>Hierarchy/ Codes</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>Description</td>

    <td><input name="description" type="text" id="description" /> <BUTTON class="ignore-css" name="submit" value="submit" type="submit"><img src="img/add.png" width="15" height="15" alt=""/></BUTTON></td>
  </tr>
 

</table>
      </div>
     
    </div>
    </form>

