<!--<table style="width:100%; text-align: center;" border=0>
	<tr>
		<td style="border-radius:0px 20px 0 0;">
			Hello world !!<br>
			<img src="https://app.agritun.com/uploads/user/20211005022118-2019-01-28.png" width="10%"/>
		</td>
	</tr>
</table>
-->
<center>
<div id="hideinwebversion">
<a href="https://docs.google.com/forms/d/e/1FAIpQLSdMxotjVmUjiZYgK2di79VPnO5h3qgVHf3C_gkr8BaIvnquIg/viewform">
	<img src="https://app.agritun.com/api/banner.png" width="100%" style="border-radius: 25px"/>
</a>
<a href="tel:28833242" class="contactusnew" style="display:none;">إتصل بنا للحصول على إشتراك!</a>
</div>

</center>

<style>
.contactusnew {
  background-color: #4CAF50; /* Green */
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
  border-radius:20px;
}
    .sm-days.columns{		text-align: center;
		border-left: 1px solid #4f5373;
		border-right: none;
		width: 25%;
		margin: 0px;
		display: inline-block;
		padding: 10px;
		border-top: 4px solid transparent !important;
		margin-left: -5px;
	}
	.current-gouv-prevision{
		margin-top: 35px;
	}
	.sm-four.columns.current-city-weather img {
		float: left;
		width: 120px;
		margin-top: -50px;
	}	.weather-widget{		zoom:70%;	}
	</style>

<?php
header('Access-Control-Allow-Origin: *');
$thehost=(explode('.', $_SERVER['HTTP_HOST']))[0];
	$region='PG_1801';
	$regionname='صفاقس';
switch ($thehost) {
    case 'app':
		$region='PG_0101';
		$regionname='تونس';
        break;
    case 'abdelrrazek':
		$region='PG_1801';
		$regionname='صفاقس';
		break;
	case 'test':
		$region='PG_0101';
		$regionname='تونس';
		break;
}
/*
if ($_GET['region']=="sfax"){
	$region='PG_1801';
	$regionname='صفاقس';
}
if ($_GET['region']=="tunis"){
	$region='PG_0101';
	$regionname='تونس';
}
*/

$url = "https://www.meteo.tn/ar/prevision_gouv/".$region."/".$regionname."?_wrapper_format=drupal_ajax";

$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$headers = array(
   "Accept: application/json",
   "Content-Type: application/json",
   "Content-Length: 0",
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
//for debug only!
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
curl_close($curl);
$re= json_decode($resp, true);
echo $re[3]['data']; 
?>