<!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" />
<!--jscript-->
<script language="JavaScript">
   function submitForm(){
              document.form1.mySubmit.click();
    }
</script>
<script language="JavaScript" src="../jscript/gen_validatorv4_2.js"  type="text/javascript" xml:space="preserve"></script>
<script language="JavaScript" src="../jscript/go_to_url.js"  type="text/javascript"></script>
<script>window.close();</script>

<?php

include('../include/session.php');	

$job_no = $_GET['job_no'];
$customer = $_GET['customer'];
$location = $_GET['location'];

$table_name = $_SESSION['db_prefix']."_quotation_notes";
$notes_query = "SELECT *  FROM $table_name WHERE quote_number = '".$job_no."' ORDER BY note_date DESC ";
$notes_result = mySQL_query($notes_query);
$notes_num = mysql_num_rows($notes_result);


?>
<style>
select.store_item_select {
	width: 230px;
}
select.store_item_select option {
	width: 220px;
}
label.label_std {
	margin-left: 5px;
	line-height: 20px;
	padding-top: 6px;
	color: #000;
	text-shadow: 1px 1px 1px #fff;
	font: bold 12px Arial;
}
input.imagebutton {
	background-color: #E1E1E1;
	width: 100px;
	height: 24px;
	border: solid;
	border-width: 1px;
	border-color: #FB6808;
	cursor: pointer;
	color: #000000;
	font: bold 12px Arial;
	-moz-border-radius: 5px;
	-webkit-border-radius: 5px;
	border-radius: 5px;
	-moz-box-shadow: 0px 0px 0px #CCC;
	-webkit-box-shadow: 0px 0px 0px #CCC;
	box-shadow: 0px 0px 0px #CCC;
}
</style>
<style >
input.imagebutton {
	background-color: #E1E1E1;
	width: 100px;
	height: 24px;
	border: solid;
	border-width: 1px;
	border-color: #FB6808;
	cursor: pointer;
	color: #000000;
	font: bold 12px Arial;
	-moz-border-radius: 5px;
	-webkit-border-radius: 5px;
	border-radius: 5px;
	-moz-box-shadow: 0px 0px 0px #CCC;
	-webkit-box-shadow: 0px 0px 0px #CCC;
	box-shadow: 0px 0px 0px #CCC;
}
input.imagebutton:hover {
	background-color: #E4E4E4;
	width: 100px;
	height: 24px;
	border: solid;
	border-width: 2px;
	border-color: #FB6808;
	cursor: pointer;
	color: #000000;
	font: bold 12px Arial;
	-moz-border-radius: 5px;
	-webkit-border-radius: 5px;
	border-radius: 5px;
	-moz-box-shadow: 5px 5px 5px #666;
	-webkit-box-shadow: 5px 5px 5px #666;
	box-shadow: 5px 5px 5px #666;
}

#table_display {
	font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
	color:#000;
	font-size:12px;
	font-weight:normal;
	
	border-collapse:collapse;
	border:1px solid #999;
	
    -webkit-border-radius: 5px;
    border-radius: 5px;
    
    -webkit-box-shadow:0px 0px 0px #aaa;
    box-shadow:0px 0px 0px #aaa;
}

#table_display th{
	font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
	font-weight:normal;
	color:#000;
	border-collapse:collapse;
	background-color:#FB6808;
    border:1px solid #999;
	padding:5px;
	font-weight:bold;
	
	-webkit-border-radius: 5px;
    border-radius: 5px;
	
}

#table_display tr td{
	font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
	font-weight:normal;
	color:#000;
	border-collapse:collapse;
	background-color:#FFF;
    border:1px solid #999;
	padding-left:5px;
	padding-right:2px;
	
	-webkit-border-radius: 5px;
    border-radius: 5px;
	
}
</style>


</head>
<body>
<form action="note_add_save.php" method="get" name="form2" id="form2" target="_top">
  <table width="530" border="0" align="left" cellpadding="0" cellspacing="0" class="list2" id="select_table">
    <tr>
      <td height="38" align="center">
        <label class="label_std">Notes for project<br /><?php echo $job_no ?>&nbsp;for&nbsp;<?php echo $customer ?></label>
        </td>
    </tr>
    <table width="525" id="table_display">
  <thead>
  <tr>
    <th>Date</th>
    <th>Note</th>
    <th>Entry</th>
  </tr>
  </thead>
  <?php
  $i=0;
  while ($i<$notes_num) {
	  $date = mysql_result($notes_result, $i, "note_date");
	  $note_text = mysql_result($notes_result, $i, "note_text");
	  $entry_by = mysql_result($notes_result, $i, "seller");
  ?>
  <tr>
    <td valign="top"><?php echo date("d-m-Y", strtotime($date)) ?></td>
    <td valign="top"><?php echo $note_text ?></td>
    <td valign="top"><?php echo $entry_by ?></td>
  </tr>
  <?php 
  $i++;
  }
  ?>
</table>

    
    <tr>
      <td align="center"><br />
      <input name="location_text" type="hidden" value="<?php echo $location ?>" />
      <input name="job_no_text" type="hidden" value="<?php echo $job_no ?>" />
      <input name="button" type="button" id="button" class="imagebutton" value="Close" onClick="MM_goToURL('parent','<?php echo $location ?>');return document.MM_returnValue"/>
        </td>
    </tr>
  </table>
</form>
<script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("form2");
  frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("store_item_select","req","Please select item.");
  frmvalidator.addValidation("quantity_text","req","Please enter quantity.");
</script>
</body>
</html>