Skip to content

Instantly share code, notes, and snippets.

@oshanz
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oshanz/8820325 to your computer and use it in GitHub Desktop.
Save oshanz/8820325 to your computer and use it in GitHub Desktop.
island report
//https://drive.google.com/file/d/0B-zS4yAhFGgEYTZzeVJlTkVmUlk/edit?usp=sharing
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of mapsearch
*
* @author Waruna Oshan Wisumperuma
* @contact warunaoshan@gmail.com
*/
?>
<style type = "text/css">
.Location {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
font-style: normal;
line-height: normal;
font-weight: bold;
font-variant: normal;
color: #000;
background-color: #FFF;
position: absolute;
padding: 3px;
margin: 0px;
text-align:center;
opacity:0.8;
filter:alpha(opacity = 80);
}
.Location:hover {
color:#000;
cursor:pointer;
cursor:hand;
font-size: 13px;
z-index:500;
border:dotted 1px #000;
-webkit-box-shadow: 0px 0px 10px 0px #000;
box-shadow: 0px 0px 10px 0px #000;
opacity:1;
filter:alpha(opacity = 100);
}
.Location span {
font-size: 11px;
font-weight:normal;
}
.Green{
color: #090;
}
.Green:hover {
color:#090;
cursor:pointer;
cursor:hand;
font-size: 13px;
z-index:500;
border:dotted 1px #090;
-webkit-box-shadow: 0px 0px 10px 0px #090;
box-shadow: 0px 0px 10px 0px #090;
opacity:1;
filter:alpha(opacity = 100);
}
.RED{
color: #F00;
}
.RED:hover {
color:#F00;
cursor:pointer;
cursor:hand;
font-size: 13px;
z-index:500;
border:dotted 1px #F00;
-webkit-box-shadow: 0px 0px 10px 0px #f00;
box-shadow: 0px 0px 10px 0px #f00;
opacity:1;
filter:alpha(opacity = 100);
}
</style>
<?php
$_instance = $this->get_instance();
$from = filter_input(INPUT_POST, 'from', FILTER_SANITIZE_STRING);
$to = filter_input(INPUT_POST, 'to', FILTER_SANITIZE_STRING);
$data = $_instance->getData($from, $to);
$totalSale = 0;
?>
<table width="1068" border="1" align="center" >
<tr>
<td width="1024" height="1448" style="background-image:url(<?= URL ?>public/images/island_map.jpg);position:relative;vertical-align:top;padding:0px;background-repeat:no-repeat;" >
<?php
foreach ($data as $value) {
?>
<p class="Location <?php
if ($value->total > 0.00) {
echo 'Green';
} else if ($value->total < 0.00) {
echo 'RED';
}
?>" style="left:<?=$value->map_left?>px;top:<?=$value->map_top?>px;"><?=$value->area?><br /><span><?= $value->total; ?></span></p>
<?php
$totalSale+=$value->total;
}
?>
</td>
</tr>
<tr>
<td style="font-family:Verdana, Geneva, sans-serif;font-size:12px;text-align:right;"><strong>Total Sale :</strong> <?php echo 'Rs. ' . number_format($totalSale, 2, '.', ','); ?></td>
</tr>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment