<?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="../includes/js/jquery.min.js"></script>
    <script src="03-01Scope-01Standards01.js"></script>
</head>
<style>     .actionTD a{text-decoration:none;} </style>
	
<body style="backgrond-color:#E8E8E8">
<!----------------------- Div For errors and warnings--------------------------------->

<!----------------------- Div For errors and warnings--------------------------------->

<!----------------------- Div For errors and warnings--------------------------------->
<div><h5 class="msg">
        <?php if (isset($_REQUEST["msg"])) { ?>
            <?php echo $_REQUEST["msg"]; ?>
        <?php } ?>
    </h5></div>



<script>

    function showConfirm(did) {

        if (confirm("Are you sure to delete? Press OK to Delete.") )

        {

            window.location.href = "03-01Scope-01Standards01DB.php?del=" + did;

        }

    }


</script>

<div style="overflow-x:auto;">
   <?php if ($uacc == "Full Control" || $uacc == "Consolidate") { ?>
    <div id="formdiv" > <!--div for the form (style="display:none;")-->

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

             <tr>

              <th>

              <div style='float: left; text-align: left'><button id="hideformdiv" class="button1">&#x25bc;</button>

              Add</div>

              <div style='float: right; text-align: right'>&nbsp;</div>

              </th>

            </tr>

          </table>-->





        <?php



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



            $SID = $_REQUEST['Edit'];
            $result = mysql_query("SELECT * FROM scope_std where stdId ='$SID'");

            $row = mysql_fetch_array($result, MYSQL_ASSOC);

            $stdID = $row['stdId'];
            $stdName = $row['stdName'];
            $stdPrefix = $row['stdPrefix'];
            $stdCode = $row['stdCode'];
            $stdNotes = $row['stdNotes'];
            //$stdFiles = $row['stdFile'];


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



        }

?>



        <form align="center" action="03-01Scope-01Standards01DB.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;STANDARDS&nbsp;&nbsp;&nbsp;</button></legend>

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

                    <tr>

                        <td width="13%" align="left"><strong>Standard Prefix</strong></td>

                        <td align="left"> <select  name="stdprefix"  id="stdprefix">

                    
					<option <?php if(isset($stdPrefix)) if ($stdPrefix == "AASHTO") { ?> selected="selected" <?php } ?>
                                value="AASHTO">AASHTO - American Association of State Highway and Transportation Officials</option>
							
					<option <?php if(isset($stdPrefix)) if ($stdPrefix == "ACI") { ?> selected="selected" <?php } ?>
                                value="ACI">ACI - American Concrete Institute </option>
							
                    <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "AISI") { ?> selected="selected" <?php } ?>
                               value="AISI">AISI - American Iron and Steel Institute</option>
							
                    <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "AISC") { ?> selected="selected" <?php } ?>
                               value="AISC">AISC - American Institute of Steel Construction</option>
							
                    <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "ANSI") { ?> selected="selected" <?php } ?>
                              value="ANSI">ANSI - American National Standards Institute</option>
							
					<option  <?php if(isset($stdPrefix)) if ($stdPrefix == "API") { ?> selected="selected" <?php } ?>
                              value="API">API - American Petroleum Institute</option>
							
                    <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "ASHRAE") { ?> selected="selected" <?php } ?>
                               value="ASHRAE">ASHRAE - American Society of Heating, Refrigerating and Air Conditioning Engineers</option>
							
                    <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "ASCE") { ?> selected="selected" <?php } ?>
                               value="ASCE">ASCE - American Society of Civil Engineers</option>
							
					<option  <?php if(isset($stdPrefix)) if ($stdPrefix == "ASME") { ?> selected="selected" <?php } ?>
                               value="ASME">ASME - American Society of Mechanical Engineers</option>
							
                    <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "ASTM") { ?> selected="selected" <?php } ?>
                               value="ASTM">ASTM - American Society for Testing and Materials</option>
							
                    <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "AWS") { ?> selected="selected" <?php } ?>
                                value="AWS">AWS - American Welding Society</option>
							
                    <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "BICSI") { ?> selected="selected" <?php } ?>value="BICSI">BICSI - Building Industry Consulting Service International</option>
							
                    <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "BS") { ?> selected="selected" <?php } ?>value="BS">BS - British Standards</option>
                                
                    <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "BSRIA") { ?> selected="selected" <?php } ?>value="BSRIA">BSRIA - Building Services Research and Information Association</option>
                               
                    <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "CEN") { ?> selected="selected" <?php } ?>value="CEN">CEN - Comite Europeen de Normalisation (European Committee for Standardization)</option> 
							
		            <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "DIN") { ?> selected="selected" <?php } ?>value="DIN">DIN - Deutsches Institut fur Normung (German Institute for Standardization)</option>
                                
                    <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "EIA") { ?> selected="selected" <?php } ?>
                                value="EIA">EIA - Electronic Industries Alliance</option>
							
					             
                    <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "EN") { ?> selected="selected" <?php } ?>
                                value="EN">EN - European Norm</option>
									
					
					<option  <?php if(isset($stdPrefix)) if ($stdPrefix == "ETSI") { ?> selected="selected" <?php } ?>
                                value="ETSI">ETSI - European Telecommunications Standards Institute</option>
							
							                    
                    <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "FIRA") { ?> selected="selected" <?php } ?>
							value="FIRA">FIRA - Furniture Industry Research Association</option> 
							
                     <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "IBC") { ?> selected="selected" <?php } ?>
                                value="IBC">IBC - International Building Code</option>
							
												
							<option  <?php if(isset($stdPrefix)) if ($stdPrefix == "ICMS") { ?> selected="selected" <?php } ?>
                                value="ICMS">ICMS - International Construction Measurement Standards</option>
							
				
							
                     <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "ICS") { ?> selected="selected" <?php } ?>
                               value="ICS">ICS - International Classification for Standards</option>
							
									
                     <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "IEC") { ?> selected="selected" <?php } ?>
                               value="IEC">IEC - International Electro-techncical Commission</option>
							
							
							
					<option  <?php if(isset($stdPrefix)) if ($stdPrefix == "IEEE") { ?> selected="selected" <?php } ?>
                               value="IEEE">IEEE - Institute of Electrical and Electronics Engineers</option>	
							
	                 <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "ISO") { ?> selected="selected" <?php } ?>
							 value="ISO">ISO - International Organization for Standardization</option>
							 
					<option  <?php if(isset($stdPrefix)) if ($stdPrefix == "IMC") { ?> selected="selected" <?php } ?>
                                value="IMC">IMC - International Mechanical Code</option>
							 
                                value="ISO">ISO - International Organization for Standardization</option>
                     <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "ITU") { ?> selected="selected" <?php } ?>
                                value="ITU">ITU - International Telecommunication Union</option>
                                <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "NEC") { ?> selected="selected" <?php } ?>
                                value="NEC">NEC - National Electrical Code</option>
                                <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "NEMA") { ?> selected="selected" <?php } ?>value="NEMA">NEMA - National Electrical Manufacturers Association</option>
                                <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "NFPA") { ?> selected="selected" <?php } ?>value="NFPA">NFPA - National Fire Protection Association</option>
							
							 <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "NORSOK") { ?> selected="selected" <?php } ?>value="NORSOK">NORSOK - Norsk Sokkels Konkurranseposisjon</option>
                                
                                 <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "OSHA") { ?> selected="selected" <?php } ?>value="OSHA">OSHA - Occupational Safety and Health Administration</option>
                                
                                <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "PCI") { ?> selected="selected" <?php } ?>
                                value="PCI">PCI - Precast/Prestressed Concrete Institute</option>

							 <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "SMACNA") { ?> selected="selected" <?php } ?>
                                value="SMACNA">SMACNA - Sheet Metal and Air Conditioning Contractors National Association Inc</option>
							
                                <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "TIA") { ?> selected="selected" <?php } ?>
                                value="TIA">TIA - Telecommunications Industry Association</option>
                                <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "UBC") { ?> selected="selected" <?php } ?>
                                value="UBC">UBC - Universal Building Code</option>
                                <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "UL") { ?> selected="selected" <?php } ?>
                                value="UL">UL - Underwriters Laboratories</option>
					
					     <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "UOP") { ?> selected="selected" <?php } ?>
                                value="UOP">UOP- Universal Oil Products</option>
					
							    <option  <?php if(isset($stdPrefix)) if ($stdPrefix == "WHO") { ?> selected="selected" <?php } ?>
                                value="WHO">WHO - World Health Organization</option>
							
                                </select>
                        </td>

                    </tr>
                    <tr>
                      <td align="left"><strong>Standard Code/ No*</strong></td>
                      <td align="left"><input name="stdcode" type="text" required="required"  id="stdcode" value="<?php if(isset($stdPrefix)) echo $stdCode; ?>"></td>
                    </tr>
                    <tr>
                      <td align="left"><strong>Title</strong></td>
     <td align="left"><input name="stdname" type="text"  id="stdname" value="<?php if(isset($stdPrefix)) echo $stdName;?>"><button style="vertical-align: bottom" class="button1" title="Save">&#x25ba;</button><a href="03-01Scope-01Standards01-IV01.php" class="button1" title="View Suggestions from pmAnywhere">&#x25bc;</a>
                      
                      </td>
                    </tr>



                </table>

            </fieldset></form>

        <br></div>
    <?php } ?>
</div>




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

        $result = mysql_query("SELECT * FROM scope_std
WHERE scope_std.stdCompany = '$id'
AND scope_std.stdStatus=1 ORDER BY stdPrefix,stdCode,stdName");

            ?>

    <div>
        <table align="center" name="tabletitle" class="table1 tableActiveFilter" width="80%" border="0" cellpadding="0">
            <tr>
                <th>
                    <div style='float: left; text-align: left'>
             <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>&nbsp;Active Standards (<?php echo mysql_num_rows($result);?>)</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"> Show 50 Rows</option>
                            <option value="100" selected> 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="80%" cellpadding="1">

        <tr>

            <th align="left" class="sorting" sorting="projectCode" bgcolor="#AAAAAA">Date Created<br>
                (yyyy.mm.dd)&nbsp;&#x21c5;</th>

            <th align="left" class="sorting intData" sorting="hazardID" bgcolor="#AAAAAA">Standard<br />
                Code&nbsp;&#x21c5;</th>

            <th align="left" class="sorting" sorting="DateLoction" bgcolor="#AAAAAA"> Standard <br />
                Name&nbsp;&#x21c5;</th>

            <th align="center" bgcolor="#AAAAAA">Actions<br>Status</th>

        </tr>


        <?php

        while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {

            ?>

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

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

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

                <td align="left" class="tdData DateLoction"><?php echo $row['stdName']; ?>

       <td align="center" class="table2 sortable actionTD">
		   
		   

       <!--  		   <button id="addformdiv" class="button3"> <img src="img/add.png" width="13" height="13" alt="" title="Add"/></button> -->

            <?php if ($uacc == "Full Control" || $uacc == "Consolidate") { ?>
                    <a href="03-01Scope-01Standards01.php?Edit=<?php echo $row['stdId']; ?>"><img src="img/edit.png" width="13" height="13" alt="" title="Edit"/></a>&nbsp;&nbsp;&nbsp;
            <?php } else { ?>
                    &nbsp;&nbsp;&nbsp; <a href="javascript:void(0)"><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="showConfirm('<?php echo $row['stdId']; ?>')">

                        <img src="img/delete.png" width="13" height="13" alt="" title="Delete" />

                    </a>
                    <?php } else { ?>
                    <a href="javascript:void(0)" >

                        <img src="img/delete.png" width="13" height="13" alt="" title="Delete" />

                    </a>
                    <?php } ?>   -->


          <!--             <br>

                 <a href="#"><img src="img/expand.png" width="13" height="13" alt="" title="Expand"/></a> &nbsp;&nbsp;&nbsp;

                    <a href="#"> <img src="img/print.png" width="13" height="13" alt="" title="Print"/></a>  -->

                    &nbsp;&nbsp;&nbsp;
                    <?php if ($uacc == "Full Control" || $uacc == "Consolidate") { ?>
                    <a href="03-01Scope-01Standards01DB.php?InActive=<?php echo $row['stdId']; ?>">
                        <img src="img/hide.png" width="13" height="13" alt="" title="Archive"/></a>
                    <?php } else { ?>
                    <a href="javascript:void(0)">
                        <img src="img/hide.png" width="13" height="13" alt="" title="Archive"/></a>
                    <?php } ?>

        <!--            <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['stdId']; ?> notetr">

                <td colspan="8" align="left"><em> <img src="img/information.png" width="12" height="12" alt=""/></em></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;">
	            <?php
            $result = mysql_query("SELECT * FROM scope_std
WHERE scope_std.stdCompany = '$id'
AND scope_std.stdStatus=0 ORDER BY stdPrefix,stdCode,stdName");
                ?>
	
    <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">&nbsp;&nbsp;&nbsp;</button><a href="#activeanchor"><button class="button1" title="Show Active">&#x25b2;</button></a>&nbsp;Archived Standards (<?php echo mysql_num_rows($result);?>)</div>


<!--
                        <select id="searchProject" style="width:30%">  	<option value="0">Select a Standard</option>
                            <?php
                        /*    $result = mysql_query("SELECT * FROM scope_std
WHERE scope_std.stdCompany = '$id'
AND scope_std.stdStatus=1");

                            while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {

                                ?>
                                <option value='<?php  echo $row['stdName'];  ?>'> <?php   echo $row['stdName']; ?></option>
                                <?php

                            }
*/
                            ?>

                        </select>
-->
                        <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 selected 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 align="left" class="sorting" sorting="projectCode" bgcolor="#AAAAAA">Date Created<br>
                    (yyyy.mm.dd)&nbsp;&#x21c5;</th>
                <th align="left" class="sorting intData" sorting="hazardID" bgcolor="#AAAAAA">Standard<br />
                    Code&nbsp;&#x21c5;</th>
                <th align="left" class="sorting" sorting="DateLoction" bgcolor="#AAAAAA">Standard <br />
                    Name&#x21c5;</th>

                <th align="center" bgcolor="#AAAAAA">Actions<br>
                    Status</th>
            </tr>

            <?php
            while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                ?>

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

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

                    <td align="left" class="tdDataHide hazardID"><?php echo $row['stdPrefix'] . " - " . $row['stdCode']; ?>&nbsp;</td>

                    <td align="left" class="tdDataHide DateLoction"><?php echo $row['stdName']; ?>



                    <td width="9%" align="center">
                        <?php if ($uacc == "Full Control" || $uacc == "Consolidate") { ?>
                        <a href="03-01Scope-01Standards01DB.php?Active=<?php echo $row['stdId']; ?>"><img src="img/show.png" width="13" height="13" alt="" title="Unhide"/></a>
                        <?php } else { ?>
                        <a href="javascript:void(0)"><img src="img/show.png" width="13" height="13" alt="" title="Unhide"/></a>
                        <?php } ?>
						
						&nbsp;&nbsp;&nbsp;
						
						
				<?php if ($uacc == "Full Control" || $uacc == "Consolidate") { ?>
                    <a href="javascript:void(0)" onClick="showConfirm('<?php echo $row['stdId']; ?>')">

                        <img src="img/delete.png" width="13" height="13" alt="" title="Delete" />

                    </a>
                    <?php } else { ?>
                    <a href="javascript:void(0)" >

                        <img src="img/delete.png" width="13" height="13" alt="" title="Delete" />

                    </a>
                    <?php } ?>		
						
						
                    </td>

                </tr>

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

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

                        <em>

                            <!--   <div id="div2"></div>        <br> --><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'); ?>

