<?php

include('../../includes/checkSession.php');
include('../../includes/con2pma3.php');
include('../../includes/topmenunewest.php');
$companyID = $_SESSION['id'];
/*include('04-90Evaluation-ListDB.php');*/
?>
<html>
<head>
<meta charset="utf-8">
<title>pmAnywhere - Project Closeout</title>
<link href="02-00simple01.css" rel="stylesheet" type="text/css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="04-90Evaluation-List.js"></script><!-- for sorting/ pagination etc-->
</head>

<body style="backgrond-color:#E8E8E8">
<div><br>
</div>
<div style="overflow-x:auto;">
  <div id="formdiv" >
    <form align="center" name="entryformform" method="post" action="04-90Evaluation-List.php">
      <input type="hidden" value="<?php echo $reseval['res_eval_id'];?>" name="edit_id" id="edit_id" />
      <fieldset>
        <legend align="center">
        <button id="hideformdiv" class="button1">&nbsp;&nbsp;&nbsp;RESOURCE PERFORMANCE EVALUATION&nbsp;&nbsp;&nbsp;</button>
        </legend>
        <table name="entryformtable" align="center" class="table1" width="80%" border="0" cellpadding="0">
          <tr>
            <td width="10%" align="left" valign="middle"><strong>Project Code/ Name</strong></td>
            <td width="22%" align="left" valign="middle"><select class="" name="hp_projectnamef"  id="hp_projectnamef"  required="required" style="">
                <?php
                        $result = mysql_query("SELECT projectSerial,projectCode, projectName FROM projects where companySerial = '$id' AND projStatus=1");
                        while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                            $projectSerial = $row['projectSerial'];
                            echo "<option value='$projectSerial' ".(($reseval['cplan_project_id'] == $projectSerial) ? "selected" : "").">" . $row["projectCode"] . " - " . $row["projectName"] . "</option>";
                     } ?>
              </select></td>
            <td width="10%" align="left" valign="middle"><strong>Resource Category</strong></td>
            <td width="22%" align="left" valign="middle"><select class="" name="hp_projectnamef2"  id="hp_projectnamef2"  required="required" style="">
              <?php
                        $result = mysql_query("SELECT projectSerial,projectCode, projectName FROM projects where companySerial = '$id' AND projStatus=1");
                        while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                            $projectSerial = $row['projectSerial'];
                            echo "<option value='$projectSerial' ".(($reseval['cplan_project_id'] == $projectSerial) ? "selected" : "").">" . $row["projectCode"] . " - " . $row["projectName"] . "</option>";
                     } ?>
            </select></td>
            <td width="10%" align="left" valign="middle"><strong>Resource Sub-Category</strong></td>
            <td width="22%" align="right" valign="middle"><select class="" name="hp_projectnamef3"  id="hp_projectnamef3"  required="required" style="">
              <?php
                        $result = mysql_query("SELECT projectSerial,projectCode, projectName FROM projects where companySerial = '$id' AND projStatus=1");
                        while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                            $projectSerial = $row['projectSerial'];
                            echo "<option value='$projectSerial' ".(($reseval['cplan_project_id'] == $projectSerial) ? "selected" : "").">" . $row["projectCode"] . " - " . $row["projectName"] . "</option>";
                     } ?>
            </select></td>
            <td width="4%" align="left" valign="middle">&nbsp;</td>
          </tr>
          <tr>
            <td align="left" valign="middle"><strong>Tier 1 </strong></td>
            <td align="left" valign="middle"><select class="" name="hp_projectnamef4"  id="hp_projectnamef4"  required="required" style="">
              <?php
                        $result = mysql_query("SELECT projectSerial,projectCode, projectName FROM projects where companySerial = '$id' AND projStatus=1");
                        while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                            $projectSerial = $row['projectSerial'];
                            echo "<option value='$projectSerial' ".(($reseval['cplan_project_id'] == $projectSerial) ? "selected" : "").">" . $row["projectCode"] . " - " . $row["projectName"] . "</option>";
                     } ?>
            </select></td>
            <td align="left" valign="middle"><strong>Tier 2</strong></td>
            <td align="left" valign="middle"><select class="" name="hp_projectnamef5"  id="hp_projectnamef5"  required="required" style="">
              <?php
                        $result = mysql_query("SELECT projectSerial,projectCode, projectName FROM projects where companySerial = '$id' AND projStatus=1");
                        while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                            $projectSerial = $row['projectSerial'];
                            echo "<option value='$projectSerial' ".(($reseval['cplan_project_id'] == $projectSerial) ? "selected" : "").">" . $row["projectCode"] . " - " . $row["projectName"] . "</option>";
                     } ?>
            </select></td>
            <td align="left" valign="middle"><strong>Tier 3</strong></td>
            <td align="right" valign="middle"><select class="" name="hp_projectnamef6"  id="hp_projectnamef6"  required="required" style="">
              <?php
                        $result = mysql_query("SELECT projectSerial,projectCode, projectName FROM projects where companySerial = '$id' AND projStatus=1");
                        while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                            $projectSerial = $row['projectSerial'];
                            echo "<option value='$projectSerial' ".(($reseval['cplan_project_id'] == $projectSerial) ? "selected" : "").">" . $row["projectCode"] . " - " . $row["projectName"] . "</option>";
                     } ?>
            </select></td>
            <td align="left" valign="middle">&nbsp;</td>
          </tr>
          <tr>
            <td align="left" valign="middle"><strong>Evaluation From</strong></td>
            <td align="left" valign="middle"><input value="<?php echo (($reseval['cplan_walktime']) ? date("Y-m-d",strtotime($reseval['cplan_walktime'])) : date("Y-m-d"));?>" name="hp_date1f2" type="date" id="hp_date1f2"></td>
            <td align="left" valign="middle"><strong>Evaluation To</strong></td>
            <td align="left" valign="middle"><input value="<?php echo (($reseval['cplan_walktime']) ? date("Y-m-d",strtotime($reseval['cplan_walktime'])) : date("Y-m-d"));?>" name="hp_date1f" type="date" id="hp_date1f"></td>
            <td align="left" valign="middle"><strong>Type</strong></td>
            <td align="right" valign="middle"><select name="select" id="select">
              <option>Weekly</option>
              <option>Monthly</option>
              <option>Quarterly</option>
              <option>Bi-Annually</option>
              <option>Annually</option>
            </select></td>
            <td align="left" valign="middle"><button style="vertical-align: bottom" class="button1" title="Save">&#x25ba;</button></td>
          </tr>
        </table>
      </fieldset>
    </form>
    <br>
  </div>
</div>
<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>
            <button id="showformdiv" class="button1" title="Add">&#x25b2;</button>
            Active Performance Evaluations ()</div>
            <div style='float: right; text-align: right'>
                <select style="width:30%" id="findproject">
                  <option value="">Select a Project</option> 
                  <?php
					$result2 = mysql_query("SELECT *,projects.projectName,projects.projectCode 
										  FROM reseval cp, projects 
										  WHERE cp.cplan_project_id = projects.projectSerial AND cp.companyID = '".$companyID."' AND cp.cplan_status= '1' GROUP BY projects.projectName ORDER BY `projectCode` ASC");
					
					while ($row2 = mysql_fetch_array($result2, MYSQL_ASSOC)) {
						?>
						<option value='<?php echo $row2["projectCode"]; ?>' ><?php echo $row2["projectCode"];?></option>
						<?php

					}
					?>             
                </select>
                <select style="width:30%" 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:30%" 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="80%" cellpadding="1">
    <thead>
      <tr>
        <th width="12%" align="left" bgcolor="#AAAAAA">Project<br>Code/ Name</th>
        <th width="8%" align="left" bgcolor="#AAAAAA">Plan ID/<br>Initiator/ Dated</th>
        <th width="10%" align="left" bgcolor="#AAAAAA">Number/ <br>Title of Plan<br></th>
        <th width="10%" align="left" bgcolor="#AAAAAA">SOW<br>Title</th>
        <th width="10%" align="left" bgcolor="#AAAAAA">Walkthrough/ <br>Handover</th>
        <th width="22%" align="left" bgcolor="#AAAAAA">Introduction/ <br>Description</th>
        <th width="20%" align="left" bgcolor="#AAAAAA">Proponents/<br>Stakeholders</th>
        <th width="8%" align="center" bgcolor="#AAAAAA">Actions<br>Status</th>
      </tr>
    </thead>
    <tbody>
      <?php
      while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
	  ?>
      <tr class="tableData" trid="<?php echo $row['cplan_id']?>">
        <td align="left" class="tdData srtProject">&nbsp;</td>
        <td align="left" class="tdData srtID">&nbsp;</td>
        <td align="left" class="tdData srtTitle">&nbsp;</td>
        <td align="left" class="tdData srtTest">&nbsp;</td>
        <td align="left" class="tdData srtTest">&nbsp;</td>
        <td align="left" class="tdData srtPre">&nbsp;</td>
        <td align="left" class="tdData srtStatus">&nbsp;</td>
        <td align="center" class="table2 sortable">
           <button id="addformdiv" class="button3"> <img src="img/add.png" width="13" height="13" alt="" title="Add"/></button>&nbsp;&nbsp;&nbsp;
           <a href=""><img src="img/edit.png" width="13" height="13" alt="" title="Edit"/></a> &nbsp;&nbsp;&nbsp;
           <a href="" onClick="return confirm('Are you sure you want to delete the record?');"><img src="img/delete.png" width="13" height="13" alt="" title="Delete" /></a>
           <br>
           <a href=""> <img src="img/expand.png" width="13" height="13" alt="" title="View Details"/></a> &nbsp;&nbsp;&nbsp; 
           <a href=""> <img src="img/print.png" width="13" height="13" alt="" title="Print"/></a> &nbsp;&nbsp;&nbsp; 
           <a href="100-01HandoverPlan01-List.php?statusId=<?php echo $row['cplan_id']; ?>&status=0"><img src="img/hide.png" width="13" height="13" alt="" title="Archive"/></a> <br>
           <button id="showremsdiv" class="button3"> <img src="img/mymentos.png" width="13" height="13" alt="" title="Add a Reminder"/></button>&nbsp;&nbsp;&nbsp;
           <button id="shownotesdiv" class="button3"> <img src="img/notes.png" width="13" height="13" alt="" title="Add Notes"/></button>&nbsp;&nbsp;&nbsp;
           <button id="showfilesdiv" class="button3"> <img src="img/attach.png" width="13" height="13" alt="" title="Attach" /></button></td>
      </tr>
      <tr class="trid<?php echo $row['cplan_id']?> notetr">
        <td colspan="8" align="left"><!--   <div id="div2"></div>        <br> --> 
          
          <strong>Notes/ Reminders/ Attachments:</strong><a href="../New folder/yourword.doc"></a></td>
      </tr>
      <?php
	  }
	  ?>
    </tbody>
  </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></td>
    </tr>
  </tbody>
</table>

<!-- HIDDEN TABLE (style="display:none")--> 

<br>
<hr class="hrstyle1">
<br>
<div style="overflow-x:auto;">
  <div id="hiddendiv" >

    <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>
            Archived Performance Evaluations ()</div>
          <div style='float: right; text-align: right'>
            <select style="width:30%" id="findprojectHide">
              <option value="">Select a Project</option>
              <?php
				$result2 = mysql_query("SELECT *,projects.projectName,projects.projectCode 
									  FROM reseval cp, projects 
									  WHERE cp.cplan_project_id = projects.projectSerial AND cp.companyID = '".$companyID."' AND cp.cplan_status= '0' GROUP BY projects.projectName ORDER BY `projectCode` ASC");
				
				while ($row2 = mysql_fetch_array($result2, MYSQL_ASSOC)) {
					?>
					<option value='<?php echo $row2["projectCode"]; ?>' ><?php echo $row2["projectCode"];?></option>
					<?php

				}
				?>
            </select>
            <select style="width:30%" 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:30%" 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">
      <thead>
        <tr class="table2 tableActive">
        <th width="12%" align="left" bgcolor="#AAAAAA">Project<br>Code/ Name</th>
        <th width="8%" align="left" bgcolor="#AAAAAA">Plan ID/<br>Initiator/ Dated</th>
        <th width="10%" align="left" bgcolor="#AAAAAA">Number/ <br>Title of Plan<br></th>
        <th width="10%" align="left" bgcolor="#AAAAAA">SOW<br>Title</th>
        <th width="10%" align="left" bgcolor="#AAAAAA">Walkthrough/ <br>Handover</th>
        <th width="22%" align="left" bgcolor="#AAAAAA">Introduction/ <br>Description</th>
        <th width="20%" align="left" bgcolor="#AAAAAA">Proponents/<br>Stakeholders</th>
        <th width="8%" align="center" bgcolor="#AAAAAA">Actions<br>Status</th>
        </tr>
      </thead>
      <tbody>

        <tr class="tableDataHide" trid="<?php echo $row['cplan_id']?>">
          <td align="left" class="tdData srtProject">&nbsp;</td>
          <td align="left" class="tdData srtID">&nbsp;</td>
          <td align="left" class="tdData srtTitle">&nbsp;</td>
          <td align="left" class="tdData srtTest">&nbsp;</td>
          <td align="left" class="tdData srtTest">&nbsp;</td>
          <td align="left" class="tdData srtPre">&nbsp;</td>
          <td align="left" class="tdData srtStatus">&nbsp;</td>
          <td width="9%" align="center">
            <a href="100-01HandoverPlan01-List.php?statusId=<?php echo $row['cplan_id']; ?>&status=1"><img src="img/show.png" width="13" height="13" alt="" title="Archive"/></a></td>
        </tr>
        <tr class="trid<?php echo $row['cplan_id']?> notetr">
          <td colspan="8" align="left"><strong>Notes/ Reminders/ Attachments:</strong><a href="../New folder/yourword.doc"></a></td>
        </tr>
  
      </tbody>
    </table>
  </div>
</div>
<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>
<br>
<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>