<?php
include('../../includes/checkSession.php');
include('../../includes/con2pma3.php');
include('../../includes/topmenunewest.php');
$id = $company_id = $_SESSION['id'];
?>

<html><head><meta charset="utf-8">
<title>pmAnywhere - Scope Module</title>
<link href="03-00Scope-Styles0.css" rel="stylesheet" type="text/css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="script-select-addressee.js"></script>
<script src="03-04Scope-01WBS01JS1.js"></script>
<script src="03-04Scope-01WBS01JS2.js"></script>
<script src="sorttable.js"></script>
</head>

<style>
.actionTD a{text-decoration:none;}
</style>

<body style="backgrond-color:#E8E8E8">

<div><h5 class="msg">
                    <?php if (isset($_REQUEST["msg"])) { ?>
                    <?php echo $_REQUEST["msg"]; ?>
                    <?php } ?>
</h5></div>





<div style="overflow-x:auto;">
<div id="formdiv" >

  <?php



if(isset($_GET['Edit']) && !empty($_GET['Edit'])){

$company_id = $_SESSION['id'];

$result3 = mysql_query("SELECT WBSList_title, WBSList_code, WBSList_remarks FROM `wbslist` WHERE WBSList_id=".$_GET['Edit']. " AND WBSList_companyid='$company_id'");


$row4 = mysql_fetch_array($result3, MYSQL_ASSOC);

$editUrl="?Edit=".$_GET['Edit'];



}



    ?>
    <?php if ($uacc == "Full Control" || $uacc == "Consolidate") { ?>
<form align="center" enctype="multipart/form-data" action="03-04Scope-01WBS01DB.php<?php if(isset($editUrl)) echo $editUrl; ?>"  method="post" style="margin-top:20px">

  <fieldset>

  <legend align="center">

  <button id="hideformdiv" class="button1" title="Click to Hide">&nbsp;&nbsp;&nbsp;GWBS/ MWBS/ WBS/ ELEMENTS/ ACTIVITIES (ITEMS &amp; SUBITEMS)&nbsp;&nbsp;&nbsp;</button></legend>

<table name="entryform" align="center" class="table1" width="80%" border="0" cellpadding="0">

    <tr>
      <td width="20%" align="left" valign="top"><strong>GWBS Title</strong></td>
      <td width="78%" colspan="3" align="left"><input type="text" name="WBStitle" id="WBStitle" value="<?php if(isset($row4['WBSList_title'])) echo $row4['WBSList_title'];?>"></td>
      </tr>
    <tr>
      

      
      <td align="left" valign="top"><strong>GWBS Code*</strong></td>
      
      <td colspan="3" align="left">
          <input type="hidden" name="WBStype" value="3">
          <input type="text" required="required" size="30" name="code" id="code" value="<?php if(isset($row4['WBSList_code'])) echo $row4['WBSList_code'];?>"></td>
      
      </tr>

  <!-- <tr>
      <td align="left" valign="top"><strong>Choose a WBS Type*:</strong></td>
	   
      <td align="left">
	<select name="WBStype" class="ablks1" id="WBStype"  onchange="ImportWBS(this.value)" required>
        <option value=""> Select a WBS Type</option>
        <option value="1">Import from PManywhere</option>
        <option value="2">Import from my CSV file</option>
        <option value="3">New WBS from scratch</option>
    </select>
        </td>
	      </tr>   <!-- style="display: none"   -->
	<!--
    <tr> 
	<td align="right" valign="top" ><strong id="choose" style="display: none">
        <?php if(!isset($row4['WBSList_code'])) ; ?>
      </strong></td>
      <td align="left" id="import"></td>
    </tr>
	-->
   
	<tr>
	  <td align="left" valign="top"><strong>Remarks (if any)</strong></td>
      <td align="left"><input type="text" name="WBSR" id="WBSR" value="<?php if(isset($row4['WBSList_remarks'])) echo $row4['WBSList_remarks'];?>">
        <button style="vertical-align: bottom" class="button1" title="Save">&#x25ba;</button></td>
      </tr>

    </table>

	  </fieldset></form>

	<br></div></div>

<?php } ?>
	
<a name="activeanchor"></a>
<div style="overflow-x:auto;">
  
  <div>

<table align="center" name="tabletitle" class="table1 tableActiveFilter" width="80%" border="0" cellpadding="0">

<tr>

<th>

<div style='float: left; text-align: left'>

<!--<button id="showhiddendiv" class="button1" title="Show Hidden">&#x25bc;</button>-->
	<a href="#archiveanchor"><button class="button1" title="View Archived">&#x25bc;</button></a><button id="showformdiv" class="button1" title="Show/ Hide the Form">&#x25b2;&#x25bc;</button>

Active GWBS</div>

    <div style='float: right; text-align: right'>
        <select style="width:45%" id="PagingRows">
            <option value="10">Show 10 Rows</option>
            <option value="20"> Show 20 Rows</option>
            <option value="50" selected> Show 50 Rows</option>
            <option value="100"> Show 100 Rows</option>
            <option value="all"> Show All Rows</option>
        </select>
        <input style="width:50%" id="SearchMeasure" type="search" placeholder="Type to Search">
    </div>

</th>

</tr>

</table>

</div>

</div>



<div style="overflow-x:auto;">

<table align="center" class="table2 tableActive"  name="datatable" border="0" width="85%" cellpadding="1">

   <tr>

     <th width="10%" align="left" class="sorting" sorting="projectCode" bgcolor="#AAAAAA">Date Created<br>(yyyy.mm.dd)</th>
     <th width="10%" align="left" class="sorting" sorting="hazardID" bgcolor="#AAAAAA">GWBS<br>Code</th>
     <th width="15%" align="left" class="sorting" sorting="DateLoction" bgcolor="#AAAAAA">GWBS<br>Title</th>
     <th width="15%" align="left" class="sorting" sorting="TitleRevision1" bgcolor="#AAAAAA">GWBS<br>Type</th>
     <th width="25%" align="left" class="sorting" sorting="TitleRevision2" bgcolor="#AAAAAA">Remarks/<br>Import Filename</th>
     <th width="25%" align="right" bgcolor="#AAAAAA">Actions<br>Status</th>

  </tr>

  

   <?php

 $resultw = mysql_query("SELECT * FROM wbslist where WBSList_for=1 AND WBSList_companyid = '$id' AND WBSList_status='1'  ORDER BY WBSList_code,WBSList_title");
		while($row = mysql_fetch_array($resultw , MYSQL_ASSOC))
        {


            ?>

    <tr class="tableData" trid="<?php echo $row["WBSList_id"]; ?>">

      <td align="left" class="tdData projectCode"><?php echo $row["WBSList_datecreation"]; ?></td>

      <td align="left" class="tdData hazardID"><?php echo $row['WBSList_code']; ?>&nbsp;</td>

      <td align="left" class="tdData DateLoction"><?php echo $row['WBSList_title']; ?></td>
      <td align="left" class="tdData TitleRevision1">&nbsp;<?php if($row['WBSList_type'] =='2') echo "Imported from CSV-File"; else if($row['WBSList_type'] =='3')  echo "New from scratch"; else if($row['WBSList_type'] =='1')  echo "Imported from PM-WBS"; else if($row['WBSList_type'] =='4') echo "Imported from XER";  ?></td>
      <td align="left" class="tdData TitleRevision2"><?php echo $row['WBSList_remarks']; ?><br>
<?php if(!empty($row['WBSList_file_name'])) echo '('.$row['WBSList_file_name'].')'; ?></td>



      <td align="right" class="table2 sortable actionTD">
		  
<!--		<button id="addformdiv" class="button3"> <img src="img/add.png" width="13" height="13" alt="" title="Add"/></button>
                &nbsp;&nbsp;&nbsp;-->
          
	    <?php if ($uacc == "Full Control" || $uacc == "Consolidate") { ?>
        <a href="03-04Scope-01WBS01.php?Edit=<?php echo $row["WBSList_id"]; ?>"><img src="img/edit.png" width="13" height="13" alt="" title="Edit"/></a>&nbsp;&nbsp;&nbsp;
		  
          <?php } else { ?>&nbsp;&nbsp;&nbsp;<a href="#"><img src="img/edit.png" width="13" height="13" alt="" title="Edit"/></a>&nbsp;&nbsp;&nbsp;
        <?php } ?>

   <!--       <?php if ($uacc == "Full Control" || $uacc == "Consolidate") { ?>
       <a href="javascript:void(0)" onclick="deleteWBSl(<?php echo $row["WBSList_id"] ?>)">
        <img src="img/delete.png" width="13" height="13" alt="" title="Delete" /></a>

          <?php } else { ?>
          <img src="img/delete.png" width="13" height="13" alt="" title="Delete" />
          <?php } ?>
          <br>  -->

        <a href="03-04Scope-02WBS01.php?WID=<?php echo $row['WBSList_id']; ?>"><img src="img/expand.png" width="13" height="13" alt="" title="Expand"/></a> &nbsp;&nbsp;&nbsp;


		  
		  <?php if ($uacc == "Full Control" || $uacc == "Consolidate") { ?>
        <a href="03-04Scope-01WBS01DB.php?InActive=<?php echo $row["WBSList_id"]; ?>">

        <img src="img/hide.png" width="13" height="13" alt="" title="Archive"/></a>
          <?php } else { ?>
          <img src="img/hide.png" width="13" height="13" alt="" title="Archive"/>
          <?php } ?>
          &nbsp;&nbsp;&nbsp;
          <a href="WBSexport.php?WID=<?php echo $row['WBSList_id']; ?>&intoo=1"> <img src="img/export.png" width="13" height="13" alt="" title="Export"/></a>

          <!--<button id="showremsdiv" class="button3"> <img src="img/mymentos.png" width="13" height="13" alt="" title="Add a Reminder"/></button> -->
        &nbsp;&nbsp;&nbsp;  

   <!--    <a href="03-04Scope-01WBS01-Importview1.php"><img src="img/import.png" width="12" height="13" alt="" title="View suggestions from pmAnywhere"/></button>&nbsp;&nbsp;&nbsp; -->

      <a href="03-04Scope-01WBS01-IV01.php?WID=<?php echo $row['WBSList_id']; ?>"><img src="img/attach4.png" width="13" height="13" alt="" title="Import" /></a>&nbsp;&nbsp;&nbsp;
		
	<!--	<img src="img/export.png" width="13" height="13" alt="" title="Export"/>   -->
		
	  </td>

    </tr>

    <tr class="trid<?php echo $row["WBSList_id"]; ?> notetr">

      <td colspan="8" align="left"><em><img src="img/information.png" width="12" height="12" alt=""/></em><br>

 <div id="remsdiv" style="display:none;">
 <input type="text" style="width:30%;" name="remstextf" placeholder="Type the Title of the Reminder">
 <input type="date"  style="width:30%;" name="remsdatef" >
 <input type="time" style="width:30%;" name="remstimef" >
 <img src="img/save.png" width="12" height="12" alt=""/>
 <br></div>
      
 <div id="filesdiv" style="display:none;">
 <input type="file"  name="proce_fileff" >
 <img src="img/save.png" width="15" height="15" alt=""/>      
 <br></div>

     </td>

    </tr>

    <?php }  ?>



</table>

</div>

<table width="80%" class="table1 ActiveTablePaging" align="center" border="0" cellpadding="1">

  <tbody>

    <tr>

      <td align="right" > 

      <span class="pagingInfo"></span>

        

        &nbsp;

        <button class="button2 BtnPrev" title="Previous Page">&#9668;</button>

        &nbsp;

        <button class="button2 BtnNext" title="Next Page">&#x25ba;</button>

       <div id="pagination"></div>

        </td>

    </tr>

  </tbody>

</table>





<!-- HIDDEN TABLE-->

<a name="archiveanchor"></a><br>

<hr class="hrstyle1">

<br>







<div style="overflow-x:auto;">

<div id="hiddendiv" > <!--- style="display:none" ------>

<table align="center" name="tabletitle" class="table1 tableInActiveFilter" width="80%" border="0" cellpadding="1">

<tr>

<th>

<div style='float: left; text-align: left'>

<!--<button id="hidehiddendiv" class="button1" title="Hide">&#x25b2;</button>-->
	<button id="hidehiddendiv" class="button1" title="Hide">&nbsp;&nbsp;&nbsp;</button><a href="#activeanchor"><button class="button1" title="Show Active">&#x25b2;</button></a>&nbsp;Archived GWBS</div>

    <div style='float: right; text-align: right'>
        <select style="width:45%" id="PagingRows">
            <option value="10">Show 10 Rows</option>
            <option value="20"> Show 20 Rows</option>
            <option value="50" selected> Show 50 Rows</option>
            <option value="100"> Show 100 Rows</option>
            <option value="all"> Show All Rows</option>
        </select>
        <input style="width:50%" id="SearchMeasureHide" type="search" placeholder="Type to Search">
    </div>

</th>

</tr>

</table>

	



<table align="center" class="table2 tableInActive" name="datatable" border="0" width="80%" cellpadding="1">




    <tr>

        <th width="10%" align="left" class="sorting" sorting="projectCode" bgcolor="#AAAAAA">Date Created<br>(yyyy.mm.dd)</th>
        <th width="10%" align="left" class="sorting intData" sorting="hazardID" bgcolor="#AAAAAA">GWBS <br> Code</th>
        <th width="15%" align="left" class="sorting" sorting="DateLoction" bgcolor="#AAAAAA"> GWBS <br>Title</th>
        <th width="15%" align="left" class="sorting" sorting="TitleRevision1" bgcolor="#AAAAAA">GWBS <br>Type</th>
        <th width="40%" align="left" class="sorting" sorting="TitleRevision2" bgcolor="#AAAAAA">Remarks/<br>Import Filename</th>
        <th width="10%" align="center" bgcolor="#AAAAAA">Actions<br>Status</th>


    </tr>





        <?php
        $resultw = mysql_query("SELECT * FROM wbslist where WBSList_for=1 AND WBSList_companyid = '$id' AND WBSList_status='0' ORDER BY WBSList_code,WBSList_title");
        while($row = mysql_fetch_array($resultw , MYSQL_ASSOC))
        {



		  ?>


        <tr class="tableDataHide" trid="<?php echo $row['WBSList_id']; ?>">

            <td align="left" class="tdDataHide projectCode"><?php echo $row["WBSList_datecreation"]; ?></td>

            <td align="left" class="tdDataHide hazardID"><?php echo $row['WBSList_code']; ?></td>

            <td align="left" class="tdDataHide DateLoction"><?php echo $row['WBSList_title']; ?></td>
            <td align="left" class="tdDataHide TitleRevision1">&nbsp;&nbsp;<?php if($row['WBSList_type'] =='2') echo "Imported from CSV-File"; else if($row['WBSList_type'] =='3')  echo "New from scratch"; else if($row['WBSList_type'] =='1') echo "Imported from PM-WBS"; else if($row['WBSList_type'] =='4') echo "Imported from XER";?></td>
            <td align="left" class="tdDataHide TitleRevision2"><?php echo $row['WBSList_remarks']; ?> <?php if(!empty($row['WBSList_file_name'])) echo '('.$row['WBSList_file_name'].')'; ?>&nbsp;</td>



      <td width="9%" align="center">


          &nbsp;&nbsp;&nbsp; <?php if ($uacc == "Full Control" || $uacc == "Consolidate") { ?>

              <a href="03-04Scope-01WBS01DB.php?Active=<?php echo $row['WBSList_id']; ?>"><img src="img/show.png" width="13" height="13" alt="" title="Unhide"/></a>
          <?php } else { ?>
              <img src="img/show.png" width="13" height="13" alt="" title="Unhide"/>
          <?php } ?>&nbsp;&nbsp;&nbsp;
		  
		      <?php if ($uacc == "Full Control" || $uacc == "Consolidate") { ?>
       <a href="javascript:void(0)" onclick="deleteWBSl(<?php echo $row["WBSList_id"] ?>)">
        <img src="img/delete.png" width="13" height="13" alt="" title="Delete" /></a>

          <?php } else { ?>
          <img src="img/delete.png" width="13" height="13" alt="" title="Delete" />
          <?php } ?>



         </td>

    </tr>

    <tr class="trid<?php echo $row['WBSList_id']; ?> notetr">

      <td colspan="8" align="left">

        <em><img src="img/information.png" width="12" height="12" alt=""/></em></td>

    </tr>

    <?php }?>

    </table>

   <table width="80%" class="table1 InActiveTablePaging" align="center" border="0" cellpadding="1">

      <tbody>

        <tr>

          <td align="right" > <span class="pagingInfo"></span>

            

            &nbsp;

            <button class="button2 BtnPrev" title="Previous Page">&#9668;</button>

            &nbsp;

            <button class="button2 BtnNext" title="Next Page">&#x25ba;</button></td>

        </tr>

      </tbody>

    </table>

</div>

</div>

<br>

<br>







</body>

</html>



<SCRIPT> // to show hide the forms and hidden tables

$(document).ready(function(){

    $("#hideformdiv").click(function(){

        $("#formdiv").toggle();

    });

	$("#showformdiv").click(function(){

        $("#formdiv").toggle();

    });

	$("#addformdiv").click(function(){

        $("#formdiv").toggle();

    });

	$("#showhiddendiv").click(function(){

        $("#hiddendiv").toggle();

    });

	$("#hidehiddendiv").click(function(){

        $("#hiddendiv").toggle();

    })

	$("#shownotesdiv").click(function(){

        $("#notesdiv").toggle();

    })

	$("#showremsdiv").click(function(){

        $("#remsdiv").toggle();

    })

	$("#showfilesdiv").click(function(){

        $("#filesdiv").toggle();

    })

});	

</SCRIPT>



<?php include('../includes/footer.php'); ?>

