<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--reference to main.css removed-->
<?php
include('../include/session.php');
?>

<?php
$contract_card_no=$_GET['contract_card_no'];

$table_name = $_SESSION['db_prefix']."_maintenance_contracts";
$job_query = "SELECT * FROM $table_name WHERE contract_card_no = '".$contract_card_no."' ";
$job_result = mySQL_query($job_query);
//$maintenance_card_no = mysql_result($job_result, 0, "maintenance_card_no");
$cust_id = mysql_result($job_result, 0, "cust_id");
$quote_note = mysql_result($job_result, 0, "quote_note");
$value = mysql_result($job_result, 0, "value");
$order_date = mysql_result($job_result, 0, "date");
$start_date = mysql_result($job_result, 0, "start_date");
$end_date = mysql_result($job_result, 0, "end_date");
$project_description = mysql_result($job_result, 0, "project_description");
$project = mysql_result($job_result, 0, "project");

$project_no = mysql_result($job_result, 0, "project_no");
$project_place = mysql_result($job_result, 0, "project_place");
$project_area = mysql_result($job_result, 0, "project_area");
$deliver_date = mysql_result($job_result, 0, "start_date");
$cluster = mysql_result($job_result, 0, "cluster");


//$captured = mysql_result($job_result, 0, "captured");
$compiled = mysql_result($job_result, 0, "compiled");
$invoiced = mysql_result($job_result, 0, "invoiced");
$completed = mysql_result($job_result, 0, "completed");


//$table_name = $_SESSION['db_prefix']."_maintenance_job_lines";
//
//$line_query = "SELECT *  FROM $table_name WHERE  maintenance_card_no =  '".$maintenance_card_no."' ";
//$line_result = mySQL_query($line_query);
//$line_num = mysql_num_rows($line_result);

$report_name = 'Maintenance contract';

?>

<!--style sheets-->
<link href="../css/main.css" rel="stylesheet" type="text/css" />

<style>
body {
	font-family:Arial, Helvetica, sans-serif;
	font-size:12px;
}
</style>

</head>

<body  onload="window.print(); window.close();" >
<?php include('../include/print_report_header.php'); ?>
<div class="print_main_frame" style="height:auto; margin:20px;">
 
<div class="print_standard_frame"> 
          <table width="650" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="473"><label class="label_page_head">Maintenance contract</label></td>
              <td width="177" align="right">Contract no:&nbsp;<label class="label_quote_no"><?php echo $contract_card_no;  ?></label>
              </td>
            </tr>
          </table>
          </div>
          
<div class="print_standard_frame"> 
<?php 
include('../include/customer_block.php');
?>
</div>    
<div class="print_standard_frame"> 
<table width="652" id="table_details_display">
    <tr>
      <td align="left" valign="top">Project:</td>
      <td align="left" valign="top"><?php  echo $project;  ?></td>
      <td align="left" valign="top"><?php echo 'Contract card no:'; ?></td>
      <td align="left" valign="top"><?php echo $contract_card_no;  ?></td>
    </tr>
    <tr>
      <td align="left" valign="top"><?php  echo 'Order date:';?></td>
      <td width="196" align="left" valign="top"><?php  echo date("d-m-Y", strtotime($order_date));  ?></td>
      <td width="152" align="left" valign="top"><?php  echo 'Job value'; ?></td>
      <td width="162" align="left" valign="top"><?php   echo number_format($value, 2, '.', ','); ?></td>
    </tr>
    <tr>
      <td width="122" align="left" valign="top">Project place:</td>
      <td colspan="3" align="left" valign="top"><?php echo $project_no?>&nbsp;&nbsp;<?php echo $project_area?>&nbsp;&nbsp;<?php echo $project_place?></td>
    </tr>
    <tr>
      <td align="left" valign="top">Notes:</td>
      <td colspan="3" align="left" valign="top"><?php echo $quote_note ?></td>
    </tr>
  </table>
<br>
<table width="652" id="table_details_display">
  <tr>
    <td width="125">Cluster:</td>
    <td width="515"><?php  echo $cluster;  ?></td>
    </tr>
  <tr>
    <td>Contract  period:</td>
    <td><?php if ($deliver_date!='') {?>
      from: <?php echo date("d-m-Y", strtotime($deliver_date));  ?> to: <?php echo date("d-m-Y", strtotime($end_date));  ?>
      <?php } ?></td>
    </tr>
</table>
</div>  

<div class="print_standard_frame"> 
<br>
</div>      

</div>  

</body>
</html>