<?php
|
<?php
|
|
|
include_once ("./lib/common.inc.php");
|
include_once ("./lib/common.inc.php");
|
include_header("Amendments"); |
include_header("Amendments"); |
$query = "select CNID, description, value, pvalue, (value - pvalue) as diff from contractnotice, (SELECT CNID as cn, childCN as ccn, value as pvalue FROM contractnotice where childCN > 0) a". |
$query = 'select "CNID", description, value, pvalue, (value - pvalue) as diff from contractnotice, |
" where ".$agencyQ.$yearQ."CNID = ccn AND (value - pvalue) <> 0 order by diff DESC"; |
(SELECT "CNID" as cn, "childCN" as ccn, value as pvalue FROM contractnotice where "childCN" is not null) a' . |
$result = mysql_query($query); |
' where ' . $agencyQ . $yearQ . ' "CNID" = ccn AND (value - pvalue) <> 0 order by diff DESC'; |
echo $query; |
$query = $conn->prepare($query); |
echo "<table>"; |
$query->execute(); |
if ($result) { |
databaseError($conn->errorInfo()); |
while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { |
echo "<table> <thead> |
setlocale(LC_MONETARY, 'en_US'); |
<tr> |
$value = number_format(doubleval($row['value']) , 2); |
<th>Contract</th> |
$pvalue = number_format(doubleval($row['pvalue']) , 2); |
<th>Original Value</th> |
$diff = number_format(doubleval($row['diff']) , 2); |
<th>Amended Value</th> |
echo ("<tr>"); |
<th>Difference</th> |
echo "<td><A href=\"displayContract.php?CNID={$row['CNID']}\"><b>{$row['description']}</b></a></td>"; |
</tr> |
echo "<td>\$$pvalue</td><td>\$$value</td><td>\$$diff</td></tr>"; |
</thead>"; |
|
foreach ($query->fetchAll() as $row) { |
|
setlocale(LC_MONETARY, 'en_US'); |
|
$value = number_format(doubleval($row['value']), 2); |
|
$pvalue = number_format(doubleval($row['pvalue']), 2); |
|
$diff = number_format(doubleval($row['diff']), 2); |
|
echo ("<tr>"); |
|
echo "<td><A href=\"displayContract.php?CNID={$row['CNID']}\"><b>{$row['description']}</b></a></td>"; |
|
echo "<td>\$$pvalue</td><td>\$$value</td><td>\$$diff</td></tr>"; |
}
|
}
|
} else { |
|
echo mysql_error(); |
|
} |
|
echo "</table>";
|
echo "</table>";
|
mysql_free_result($result); |
|
include_footer();
|
include_footer();
|
?>
|
?>
|
|
|