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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Project Brief</title>

<?php $BID = isset($_GET['BID']) ? $_GET['BID'] : 0;
$cid = $_SESSION['id'];
$scope = 'project-brief';
$result = mysql_query("SELECT briefP.*,projects.projectName,projects.projectCode,client.clientName FROM projects,client,briefP where briefP.companyID='$id' AND briefP_id='$BID' AND (briefP.briefP_status='1' OR briefP.briefP_status='3') AND projects.projectSerial=briefP.project_id AND client.clientSerial=briefP.client_id ");
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$bstatus = $row["briefP_status"];
$PreparedBy = "";
if ($row["PreparedBy"] == 0) {
    $resultPre = mysql_query("SELECT firstName, lastName FROM login where loginId='" . $id . "'");
    $PreparedBy .= mysql_result($resultPre, 0, 0);
    $PreparedBy .=" " . mysql_result($resultPre, 0, 1);
} else {
    $resultPre = mysql_query("SELECT internal_personnel_firstName, internal_personnel_lastName FROM internal_personnel where internal_personnel_id='" . $row["PreparedBy"] . "'");
    $PreparedBy .= mysql_result($resultPre, 0, 0);
    $PreparedBy .=" " . mysql_result($resultPre, 0, 1);
}
?>

<style>
.table1 td {
    border-bottom: 1px solid #000;
}

.table2 td {
    border-bottom: 1px solid #BBBBBB;
}
</style>

<strong>
<h1>PROJECT BRIEF</h1></strong>
<table width="100%" class="table1" border="0">
  <tbody>
    <tr>
      <td width="15%"><em>Project Name</em></td>
		<td width="35%"><strong><?php echo $row["projectName"] ; ?></strong></td>
      <td width="15%"><em>Project Code</em></td>
      <td width="35%"><strong><?php echo $row["projectCode"]; ?></strong></td>
    </tr>
    <tr>
      <td><em>Prepared By</em></td>
      <td><strong><?php echo $PreparedBy; ?></strong></td>
      <td><em>Submitted To</em></td>
      <td><strong><?php echo $row["clientName"]; ?>&nbsp;</strong></td>
    </tr>
    <tr>
      <td><em>Title</em></td>
      <td><strong><?php echo $row["briefP_name"]; ?></strong></td>
      <td><em>DB Code</em></td>
	  <td><strong>PBRF&nbsp;<?php echo $row["briefP_id"]; ?></strong></td>
    </tr>
    <tr>
      <td><em>Dated</em></td>
      <td><strong><?php echo $row["creationDate"]; ?></strong></td>
      <td><em>Revision</em></td>
      <td><strong><?php echo $row["briefP_rev"]; ?></strong></td>
    </tr>
  </tbody>
</table>
<br>
<br>
	
<!-- shows fixed headings which is not ncecessary  -->	
<?php
    //                    $query = "SELECT heading, id from scope_brief WHERE scope_type='$scope' AND (company_id= 0 OR company_id = '$cid') AND (brief_id= 0 OR brief_id = '$BID') ";
      //                  $result = mysql_query($query);
      //                  $i = 1;
                        ?>

<?php
                        $query = "SELECT heading, id from scope_brief WHERE scope_type='$scope' AND company_id = '$cid' AND brief_id = '$BID' AND parent = 0 ";
                        $result = mysql_query($query);
                        $k = 1;
                        ?>
                        <?php while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { ?>
	
<table width="100%" class="table2" border="0">
  <tbody>
    <tr>
      <td><strong><?php echo $k  ?>. <?php echo $row['heading'] ?></strong></td>
    </tr>
  </tbody>
</table>
<?php
                                    $query2 = "SELECT description from scope_brief_description WHERE `heading_id` = '" . $row['id'] . "' AND `brief_id` ='" . $BID . "' AND company_id= '$cid'";
                                    $results = mysql_query($query2);
                                    $row2 = mysql_fetch_object($results);
                                    ?> 
							<?php echo @$row2->description ?>
<br />

                            <!--     sub heading -->
                            <?php
// code for custom headings
                            $resultH = mysql_query("SELECT * FROM scope_brief WHERE parent = ".$row['id']." AND scope_type='$scope' AND  company_id = '$cid' AND brief_id = '$BID' ");

                            $i = 1;

                            while( $rowH = mysql_fetch_object($resultH) ) {
                                $queryHD = "SELECT * from scope_brief_description WHERE `heading_id` = '" . $rowH->id . "' AND `brief_id` ='" . $BID . "' AND company_id= '$cid'";
                                $resultHD = mysql_query($queryHD);
                                $rowHD = mysql_fetch_object($resultHD);

                                ?>
                                <table width="100%" class="table2" border="0">
                                    <tbody>
                                    <tr>
                                        <td><strong style="margin-left:15px"><?php echo $k . '.' . $i . '. ' . $rowH->heading; ?></strong></td>
                                    </tr>
                                    </tbody>
                                </table>
                                <?php echo @$rowHD->description; $i++; ?><br/>

                                <?php
                            }



                            $k = $k + 1;

 } ?>
 
 <!--
<table width="100%" border="0" class="table2">
  <tbody>
    <tr>
      <td><strong>2. DESIGNERS CREDENTIALS</strong></td>
    </tr>
  </tbody>
</table>
dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr vv dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr v v v dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr v dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr.<br />
<br />
<table width="100%" border="0" class="table2">
  <tbody>
    <tr>
      <td><strong>3. ENVIRONMENTAL PARAMETERS</strong></td>
    </tr>
  </tbody>
</table>
dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr vv dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr v v v dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghw hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr v dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr.<br />
<br />
<table width="100%" border="0" class="table2">
  <tbody>
    <tr>
      <td><strong>4. DESIGN STANDARDS</strong></td>
    </tr>
  </tbody>
</table>
 dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr vv dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr v v v dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg  rthrh wr.<br />
<br />
<table width="100%" border="0" class="table2">
  <tbody>
    <tr>
      <td><strong>5. DESIGN PARAMETERS</strong></td>
    </tr>
  </tbody>
</table>
Not Applicable
<br />
<br />
<table width="100%" border="0" class="table2">
  <tbody>
    <tr>
      <td><strong>5. LOADS AND LOAD COMBINATIONS</strong></td>
    </tr>
  </tbody>
</table>
5dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr vv dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr v v v dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg  rthrh wr.<br />
<br />
<table width="100%" border="0" class="table2">
  <tbody>
    <tr>
      <td><strong>7. SERVICEABILITY REQUIREMENTS</strong></td>
    </tr>
  </tbody>
</table>
 5dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr vv dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr v v v dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg  rthrh wr.<br />
<br />
<table width="100%" border="0" class="table2">
  <tbody>
    <tr>
      <td><strong>8. EXISTING CONDITIONS</strong></td>
    </tr>
  </tbody>
</table>
 5dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr vv dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr v v v dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg  rthrh wr.<br />
 <br />
 <table width="100%" border="0" class="table2">
   <tbody>
     <tr>
       <td><strong>9. SPACE DESCRIPTION</strong></td>
     </tr>
   </tbody>
</table>
5dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr vv dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr v v v dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg  rthrh wr.<br />
<br />
<table width="100%" border="0" class="table2">
  <tbody>
    <tr>
      <td><strong>10. INFRASTRUCTURE SYSTEMS</strong></td>
    </tr>
  </tbody>
</table>
5dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr vv dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr v v v dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg  rthrh wr.<br />
<br />
<table width="100%" border="0" class="table2">
  <tbody>
    <tr>
      <td><strong>11. PRODUCTS AND MATERIALS</strong></td>
    </tr>
  </tbody>
</table>
5dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr vv dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr v v v dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg  rthrh wr.<br />
<br />
<table width="100%" border="0" class="table2">
  <tbody>
    <tr>
      <td><strong>12. FINISHING DETAILS</strong></td>
    </tr>
  </tbody>
</table>
5dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr vv dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr v v v dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg  rthrh wr.<br />
<br />
<table width="100%" border="0" class="table2">
  <tbody>
    <tr>
      <td><strong>13. CONSTRAINTS AND CONFLICTS</strong></td>
    </tr>
  </tbody>
</table>
5dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr vv dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr v v v dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg  rthrh wr.<br />
<br />
<table width="100%" border="0" class="table2">
  <tbody>
    <tr>
      <td><strong>14. SCHEDULE AND MILESTONES</strong></td>
    </tr>
  </tbody>
</table>
5dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr vv dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr v v v dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg  rthrh wr.<br />
<br />
<table width="100%" border="0" class="table2">
  <tbody>
    <tr>
      <td><strong>15. RISKS/ RISK ANALYSIS</strong></td>
    </tr>
  </tbody>
</table>
5dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr vv dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr v v v dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg  rthrh wr.<br />
<br />
<table width="100%" border="0" class="table2">
  <tbody>
    <tr>
      <td><strong>16. BENEFITS ANALYSIS</strong></td>
    </tr>
  </tbody>
</table>
5dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr vv dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr v v v dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg  rthrh wr.<br />
<br />
<table width="100%" border="0" class="table2">
  <tbody>
    <tr>
      <td><strong>17. EVALUATION AND CONCLUSION</strong></td>
    </tr>
  </tbody>
</table>
5dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr vv dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr v v v dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg  rthrh wr.<br />
<br />
<table width="100%" border="0" class="table2">
  <tbody>
    <tr>
      <td><strong>18. APENDICES AND ATTACHMENTS</strong></td>
    </tr>
  </tbody>
</table>
5dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr vv dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr v v v dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg rn hhj hjj hjj hwd adfhdfghwe shrt rthrh wr dswg  rthrh wr.<br />
<br />
<br />
 <br />
 
 -->
