<!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>Untitled Document</title>

<script language="JavaScript" src="gen_validatorv4.js"  type="text/javascript" xml:space="preserve"></script>
<?php

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

$line_id = $_GET['line_id'];

if ($line_id!="new") {
$edit_value=1;
$table_name = $_SESSION['db_prefix']."_quotation_lines";
$line_query = "SELECT * FROM $table_name WHERE line_id ='".$line_id."' ";
$line_result = mySQL_query($line_query);
$quote_no = mysql_result($line_result, 0, "quote_number");
$text = mysql_result($line_result, 0, "quote_item_text");
$price = mysql_result($line_result, 0, "quote_item_price");
}
else {
	
$edit_value=2;
$quote_no = $_GET['quote_no'];	
$table_name = $_SESSION['db_prefix']."_quotation_lines";
$line_query = "SELECT line_id FROM $table_name ORDER BY line_id DESC LIMIT 1 ";
$line_result = mySQL_query($line_query);
$line_id = mysql_result($line_result, 0, "line_id");
$line_id = $line_id + 1; 
$price="";
$text="";
}



?>
<script type="text/javascript">
function stopRKey(evt) {
  var evt = (evt) ? evt : ((event) ? event : null);
  var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
  if ((evt.keyCode == 13) && (node.type=="text"))  {return false;}
}
document.onkeypress = stopRKey;
</script> 

<script type="text/javascript">
<!--
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
//-->
</script>
<style>
label.label_std{
	margin-left:5px;
    line-height:20px;
	padding-top:6px;
    color:#000;
    text-shadow:1px 1px 1px #fff;
    font:bold 12px Arial;
}

textarea.text_box{
	font-family:Arial, Helvetica, sans-serif;
	font-size:12px;
    background:#FFF;
    border: 1px solid #E6E6E6;
    padding: 2px;
    color:#000;    
}

input.text100{
    background:#FFF;
    border: 1px solid #E6E6E6;
    padding: 2px;
    width:100px;
	height:20px;
	color:#000;
}

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;
	
}

</style>
 
</head>

<body >
<form action="../sales/quotation_details_edit.php" method="get" name="form1" target="_top" id="form1">
<table width="450" border="0">
  <tr>
    <td height="50" colspan="2" align="center"><label class="label_std">
      Edit the value and click "Edit"<br />
If you don't want to change, click "cancel"</label></td>
  </tr>
  <tr>
    <td width="275" valign="bottom"><textarea name="item_text" cols="50" rows="3" class="text_box" id="item_text"><?php echo $text ?></textarea></td>
    <td width="165" valign="bottom"><input name="edit" type="hidden" id="edit" value="<?php echo $edit_value ?>"  />
      <input name="price_text" type="text" class="text100" id="price_text" value="<?php echo $price ?>" onchange=" this.value = this.value.replace (/(\...).*/, '$1')" onkeypress="return isNumberKey(event)" style="text-align:right" onfocus = "this.select();"/>
<input name="quote_no" type="hidden" id="quote_no" value="<?php echo $quote_no ?>" />
    <input name="line_id" type="hidden" id="line_id" value="<?php echo $line_id ?>" /></td>
  </tr>
  <tr>
    <td height="45" colspan="2" align="center"><input name="input" type="submit" value="Edit" class="imagebutton"  />
    <input name="button" type="button" class="imagebutton" id="button" onclick="MM_goToURL('parent','../sales/quotation_details_edit.php?quote_no=<?php echo $quote_no ?>&edit=0');return document.MM_returnValue"  value="Cancel" /></td>
  </tr>
</table>
</form>
</body>
</html>