<style>
.newWindow:before {
      position: absolute;
      top: -3px;
      right: -3px;
      content: " ";
      border: 4px solid white;
    }

a[target="_blank"] {
         position: relative;
    }

a[target="_blank"]:after {
     position: absolute;
     /*top: 3px;*/
     right: -15px;
     content: url(images/arrow_link.jpg);
     font-size: 13px;
     color: black;
     line-height: 3px;
     height: 5px;
     width: 5px;
    /* border-right: 2px solid white;*/
    /* border-top: 2px solid white;*/
}

a[target="_blank"]:before {
     position: absolute;
     top: -4px;
     right: -17px;
     content: url(images/arrow_link.jpg);
     /*border: 1px solid black;*/
     width: 8px;
     height: 8px;
}
 

</style>
<?php  
$current_date=date("Y-m-d");
$lastyear = date("Y-m-d", strtotime("-1 years"));
?>
<table id="suspended_sales_table" style="border:1px solid #0d96cb;box-shadow: 0px 8px 8px #000;" width="100%">
	<tr>
		<td style="text-align:center;border:1px solid #0d96cb;background-color:#FF0000;font-weight:bold;width:200px; font-size:16px;color:#FFFFFF;">
		Oops, something went wrong during loading data.
		</td>
	</tr>
	
	<tr>
		<td style="text-align:center;border:1px solid #0d96cb;font-weight:bold;">
		The connection to the database is failed. A network-related  or large database-related error occurred while connecting the server. We are working on getting this fixed as soon as we can. Please be patient, we will inform you after the correction.
		</td>
		
	</tr>
</table>

<!--<table id="suspended_sales_table" style="border:1px solid #0d96cb;box-shadow: 0px 8px 8px #000;" width="100%">
	<tr>
		<td style="text-align:right;border:1px solid #0d96cb;background-color:#2163a8;font-weight:bold;width:200px; color:#FFFFFF;">
		Today Sale Amount (TS)&nbsp;
		</td>
		<td style="text-align:left;border:1px solid #0d96cb;font-weight:bold;">
		&nbsp;<?php echo number_format($total_sale_amount_today,2,".","");?>&nbsp;
		<a class="open_link" href="<?php echo LOCAL_PATH;?>/index.php/reports/summary_sales/<?php echo $current_date."/".$current_date; ?>" target="_blank">Open</a>
		</td>
	</tr>
	<tr>
		<td style="text-align:right;border:1px solid #0d96cb;background-color:#e3e0e0;font-weight:bold;width:200px;">
		Today Sale Qty&nbsp;
		</td>
		<td style="text-align:left;border:1px solid #0d96cb;">
		&nbsp;<?php echo number_format($total_sale_qty_today,2,".","");?>&nbsp;
		</td>
	</tr>
	<tr>
		<td style="text-align:right;border:1px solid #0d96cb;background-color:#e3e0e0;font-weight:bold;width:200px;">
		Today Invoice Count &nbsp;
		</td>
		<td style="text-align:left;border:1px solid #0d96cb;">
		&nbsp;<?php echo $today_invoice_count;?>&nbsp;
		</td>
	</tr>
	
	<tr>
		<td style="text-align:right;border:1px solid #0d96cb;background-color:#2163a8;font-weight:bold;width:200px; color:#FFFFFF;">
		Grameen Check (GC)&nbsp;
		</td>
		<td style="text-align:left;border:1px solid #0d96cb;font-weight:bold;">
		&nbsp;<?php echo number_format($gc_fabric_amount_today,2,".","");?>&nbsp;
		</td>
	</tr>

	<tr>
		<td style="text-align:right;border:1px solid #0d96cb;background-color:#2163a8;font-weight:bold;width:200px; color:#FFFFFF;">
		Handicraft (HC)&nbsp;
		</td>
		<td style="text-align:left;border:1px solid #0d96cb;font-weight:bold;">
		&nbsp;<?php echo number_format($handicraft_amount_today,2,".","");?>&nbsp;
		</td>
	</tr>

	<tr>
		<td style="text-align:right;border:1px solid #0d96cb;background-color:#2163a8;font-weight:bold;width:200px; color:#FFFFFF;">
		Healthcare Material (H/M)&nbsp;
		</td>
		<td style="text-align:left;border:1px solid #0d96cb;font-weight:bold;">
		&nbsp;<?php echo number_format($health_care_amount_today,2,".","");?>&nbsp;
		</td>
	</tr>
	<tr>
		<td style="text-align:right;border:1px solid #0d96cb;background-color:#2163a8;font-weight:bold;width:200px; color:#FFFFFF;">
		Stock In Amount (SI)&nbsp;
		</td>
		<td style="text-align:left;border:1px solid #0d96cb;font-weight:bold;">
		&nbsp;<?php echo number_format($stock_in_amount,2,".","");?>&nbsp;<a href="<?php echo LOCAL_PATH;?>/index.php/reports/summary_stock_transactions/<?php echo $current_date."/".$current_date; ?>" target="_blank">Open</a>
		</td>
	</tr>

	<tr>
		<td style="text-align:right;border:1px solid #0d96cb;background-color:#e3e0e0;font-weight:bold;width:200px;">
		Stock In Qty&nbsp;
		</td>
		<td style="text-align:left;border:1px solid #0d96cb;">
		&nbsp;<?php echo number_format($stock_in_qty,2,".","");?>&nbsp;
		</td>
	</tr>
	
	<tr>
		<td style="text-align:right;border:1px solid #0d96cb;background-color:#e3e0e0;font-weight:bold;width:200px;">
		Opening Stock Amount&nbsp;
		</td>
		<td style="text-align:left;border:1px solid #0d96cb;">
		&nbsp;<?php echo number_format($opening_amount,2,".","");?>&nbsp;
		</td>
	</tr>
	<tr>
		<td style="text-align:right;border:1px solid #0d96cb;background-color:#e3e0e0;font-weight:bold;width:200px;">
		Opening Stock Qty&nbsp;
		</td>
		<td style="text-align:left;border:1px solid #0d96cb;">
		&nbsp;<?php echo number_format($opening_qty,2,".","");?>&nbsp;
		</td>
	</tr>
	<tr>
		<td style="text-align:right;border:1px solid #0d96cb;background-color:#2163a8;font-weight:bold;width:200px; color:#FFFFFF;">
		Closing Stock Amount (CS)&nbsp;
		</td>
		<td style="text-align:left;border:1px solid #0d96cb;font-weight:bold;">
		&nbsp;<?php echo number_format($closing_amount,2,".","");?>&nbsp;<a href="<?php echo LOCAL_PATH;?>/index.php/reports/summary_stock_transactions/<?php echo $current_date."/".$current_date; ?>" target="_blank">Open</a>
		</td>
	</tr>
	<tr>
		<td style="text-align:right;border:1px solid #0d96cb;background-color:#e3e0e0;font-weight:bold;width:200px;">
		Closing Stock Qty&nbsp;
		</td>
		<td style="text-align:left;border:1px solid #0d96cb;">
		&nbsp;<?php echo number_format($closing_qty,2,".","");?>&nbsp;
		</td>
	</tr>
  <tr>
		<td style="text-align:right;border:1px solid #0d96cb;background-color:#2163a8;font-weight:bold;width:200px; color:#FFFFFF;">
		Last Year Today Sale Amount (LY)&nbsp;
		</td>
		<td style="text-align:left;border:1px solid #0d96cb;font-weight:bold;">
		&nbsp;<?php echo number_format($last_year_total_sale,2,".","");?>&nbsp;<a href="<?php echo LOCAL_PATH;?>/index.php/reports/summary_sales/<?php echo $lastyear."/".$lastyear; ?>" target="_blank">Open</a>
		</td>
	</tr>
	<tr>
		<td style="text-align:right;border:1px solid #0d96cb;background-color:#e3e0e0;font-weight:bold;width:200px;">
		Last Year Today Sale Qty&nbsp;
		</td>
		<td style="text-align:left;border:1px solid #0d96cb;">
		&nbsp;<?php echo number_format($last_year_total_qty,2,".","");?>&nbsp;
		</td>
	</tr>
	
	<?php 
	$pecentage=number_format((($synced_total_sale*100)/$total_sale_amount_today),2,".","");

	if($pecentage==100){
		$bg_color="#34b928";
	}elseif($pecentage>0 AND $pecentage<100){
		$bg_color="#ec8e16";
	}else{
		$bg_color="#ca0a0a";
	}
	?>

	<tr>
		<td style="text-align:right;border:1px solid #0d96cb;background-color:<?php echo $bg_color;?>;font-weight:bold;width:200px; color:#FFFFFF;">
		Today Sync Data to Live &nbsp;
		</td>
		<td style="text-align:left;border:1px solid #0d96cb;font-weight:bold;">
		&nbsp;<?php echo number_format($synced_total_sale,2,".","");?>&nbsp;/&nbsp;<?php echo number_format($total_sale_amount_today,2,".","");?>
		&nbsp;<font style="color:#FFFFFF;background-color:<?php echo $bg_color;?>;padding-top:2px;">(<?php echo number_format($pecentage,2,".","");?>%)</font>
		</td>
	</tr>
	<?php 

	if($previous_non_synced==0){
		$prebg_color="#34b928";
	}else{
		$prebg_color="#ca0a0a";
	}
	?>
	<tr>
		<td style="text-align:right;border:1px solid #0d96cb;background-color:<?php echo $prebg_color;?>;font-weight:bold;width:200px; color:#FFFFFF;">
		Previous Non Sync Data &nbsp;
		</td>
		<td style="text-align:left;border:1px solid #0d96cb;font-weight:bold;">
		&nbsp;<?php echo number_format($previous_non_synced,2,".","");?>
		</td>
	</tr>
</table>-->