استان گیلان استان گیلان

0){ if (strpos($forecastTXT, "[[") !== false){ $FC1 = substr($forecastTXT,strpos($forecastTXT,"[[")+2,strlen($forecastTXT)); $FC1 = substr($FC1,0,strpos($FC1,"]]")); $FC2 = substr($forecastTXT,strpos($forecastTXT,"[[[")+3,strlen($forecastTXT)); $FC2 = substr($FC2,0,strpos($FC2,"]]]")); } if (strpos($forecastTXT, "[99302=") !== false){ $fc99302 = substr($forecastTXT,strpos($forecastTXT,"[99302=")+7,strlen($forecastTXT)); $fc99302 = substr($fc99302,0,strpos($fc99302,"-")); if ($fc99302 == "/"){ $fc99302 = "00"; } }else { $fc99302 = "00"; } if (strpos($forecastTXT, "[40805=") !== false){ $fc40805 = substr($forecastTXT,strpos($forecastTXT,"[40805=")+7,strlen($forecastTXT)); $fc40805 = substr($fc40805,0,strpos($fc40805,"-")); if ($fc40805 == "/"){ $fc40805 = "00"; } }else { $fc40805 = "00"; } if (strpos($forecastTXT, "[99281=") !== false){ $fc99281 = substr($forecastTXT,strpos($forecastTXT,"[99281=")+7,strlen($forecastTXT)); $fc99281 = substr($fc99281,0,strpos($fc99281,"-")); if ($fc99281 == "/"){ $fc99281 = "00"; } }else { $fc99281 = "00"; } if (strpos($forecastTXT, "[99317=") !== false){ $fc99317 = substr($forecastTXT,strpos($forecastTXT,"[99317=")+7,strlen($forecastTXT)); $fc99317 = substr($fc99317,0,strpos($fc99317,"-")); if ($fc99317 == "/"){ $fc99317 = "00"; } }else { $fc99317 = "00"; } if (strpos($forecastTXT, "[99268=") !== false){ $fc99268 = substr($forecastTXT,strpos($forecastTXT,"[99268=")+7,strlen($forecastTXT)); $fc99268 = substr($fc99268,0,strpos($fc99268,"-")); if ($fc99268 == "/"){ $fc99268 = "00"; } }else { $fc99268 = "00"; } if (strpos($forecastTXT, "[99282=") !== false){ $fc99282 = substr($forecastTXT,strpos($forecastTXT,"[99282=")+7,strlen($forecastTXT)); $fc99282 = substr($fc99282,0,strpos($fc99282,"-")); if ($fc99282 == "/"){ $fc99282 = "00"; } }else { $fc99282 = "00"; } if (strpos($forecastTXT, "[99249=") !== false){ $fc99249 = substr($forecastTXT,strpos($forecastTXT,"[99249=")+7,strlen($forecastTXT)); $fc99249 = substr($fc99249,0,strpos($fc99249,"-")); if ($fc99249 == "/"){ $fc99249 = "00"; } }else { $fc99249 = "00"; } if (strpos($forecastTXT, "[40720=") !== false){ $fc40720 = substr($forecastTXT,strpos($forecastTXT,"[40720=")+7,strlen($forecastTXT)); $fc40720 = substr($fc40720,0,strpos($fc40720,"-")); if ($fc40720 == "/"){ $fc40720 = "00"; } }else { $fc40720 = "00"; } if (strpos($forecastTXT, "[99276=") !== false){ $fc99276 = substr($forecastTXT,strpos($forecastTXT,"[99276=")+7,strlen($forecastTXT)); $fc99276 = substr($fc99276,0,strpos($fc99276,"-")); if ($fc99276 == "/"){ $fc99276 = "00"; } }else { $fc99276 = "00"; } if (strpos($forecastTXT, "[99272=") !== false){ $fc99272 = substr($forecastTXT,strpos($forecastTXT,"[99272=")+7,strlen($forecastTXT)); $fc99272 = substr($fc99272,0,strpos($fc99272,"-")); if ($fc99272 == "/"){ $fc99272 = "00"; } }else { $fc99272 = "00"; } if (strpos($forecastTXT, "[40719=") !== false){ $fc40719 = substr($forecastTXT,strpos($forecastTXT,"[40719=")+7,strlen($forecastTXT)); $fc40719 = substr($fc40719,0,strpos($fc40719,"-")); if ($fc40719 == "/"){ $fc40719 = "00"; } }else { $fc40719 = "00"; } if (strpos($forecastTXT, "[40718=") !== false){ $fc40718 = substr($forecastTXT,strpos($forecastTXT,"[40718=")+7,strlen($forecastTXT)); $fc40718 = substr($fc40718,0,strpos($fc40718,"-")); if ($fc40718 == "/"){ $fc40718 = "00"; } }else { $fc40718 = "00"; } if (strpos($forecastTXT, "[40709=") !== false){ $fc40709 = substr($forecastTXT,strpos($forecastTXT,"[40709=")+7,strlen($forecastTXT)); $fc40709 = substr($fc40709,0,strpos($fc40709,"-")); if ($fc40709 == "/"){ $fc40709 = "00"; } }else { $fc40709 = "00"; } if (strpos($forecastTXT, "[LOW=") !== false){ $fcLOW = substr($forecastTXT,strpos($forecastTXT,"[LOW=")+7,strlen($forecastTXT)); $fcLOW = substr($fcLOW,0,strpos($fcLOW,"-")); if ($fcLOW == "/"){ $fcLOW = "00"; } }else { $fcLOW = "00"; } } } ///////////////////////////////////////////////////////////////////////////// پايان پيش بينی ///////////////////////////////////////////////////////////////////////////// آغاز پارامترهای شهرها $gilan1 = "aaaa/cities/gilan1.txt"; $missing = "aaaa/cities/missing.txt"; $gilan1data = ""; $gilan1data2 = ""; if (file_exists($missing) == 1){ if ($fh = fopen($missing, 'r')) { $gilan1data2 = "[[" . gmdate("H") . "]]" . fread($fh, filesize($missing)); } fclose($fh); } $rain6hXXXXX = substr($gilan1data2, strpos($gilan1data2, "rain string")+15, strlen($gilan1data2)); $rain6hXXXXX = substr($rain6hXXXXX, 0, strrpos($rain6hXXXXX, "]")+1); if (file_exists($gilan1) == 1){ if ($fh = fopen($gilan1, 'r')) { $gilan1data = fread($fh, filesize($gilan1)); } fclose($fh); $reciveHH = substr($gilan1data,6,2); $timeiran_file = "aaaa/timeiran.txt"; $myfile = fopen($timeiran_file, "r") or die("Unable to open file!"); $timeiran_str = fread($myfile,filesize($timeiran_file)); fclose($myfile); if ($timeiran_str == "4") { if ($reciveHH == "23"){ $reciveHH = "03:30"; $reciveHH2 = "04:30"; } elseif ($reciveHH == "00"){ $reciveHH = "04:30"; $reciveHH2 = "05:30"; } elseif ($reciveHH == "01"){ $reciveHH = "05:30"; $reciveHH2 = "06:30"; } elseif ($reciveHH == "02"){ $reciveHH = "06:30"; $reciveHH2 = "07:30"; } elseif ($reciveHH == "03"){ $reciveHH = "07:30"; $reciveHH2 = "08:30"; } elseif ($reciveHH == "04"){ $reciveHH = "08:30"; $reciveHH2 = "09:30"; } elseif ($reciveHH == "05"){ $reciveHH = "09:30"; $reciveHH2 = "10:30"; } elseif ($reciveHH == "06"){ $reciveHH = "10:30"; $reciveHH2 = "11:30"; } elseif ($reciveHH == "07"){ $reciveHH = "11:30"; $reciveHH2 = "12:30"; } elseif ($reciveHH == "08"){ $reciveHH = "12:30"; $reciveHH2 = "13:30"; } elseif ($reciveHH == "09"){ $reciveHH = "13:30"; $reciveHH2 = "14:30"; } elseif ($reciveHH == "10"){ $reciveHH = "14:30"; $reciveHH2 = "15:30"; } elseif ($reciveHH == "11"){ $reciveHH = "15:30"; $reciveHH2 = "16:30"; } elseif ($reciveHH == "12"){ $reciveHH = "16:30"; $reciveHH2 = "17:30"; } elseif ($reciveHH == "13"){ $reciveHH = "17:30"; $reciveHH2 = "18:30"; } elseif ($reciveHH == "14"){ $reciveHH = "18:30"; $reciveHH2 = "19:30"; } elseif ($reciveHH == "15"){ $reciveHH = "19:30"; $reciveHH2 = "20:30"; } elseif ($reciveHH == "16"){ $reciveHH = "20:30"; $reciveHH2 = "21:30"; } elseif ($reciveHH == "17"){ $reciveHH = "21:30"; $reciveHH2 = "22:30"; } elseif ($reciveHH == "18"){ $reciveHH = "22:30"; $reciveHH2 = "23:30"; } elseif ($reciveHH == "19"){ $reciveHH = "23:30"; $reciveHH2 = "00:30"; } elseif ($reciveHH == "20"){ $reciveHH = "00:30"; $reciveHH2 = "01:30"; } elseif ($reciveHH == "21"){ $reciveHH = "01:30"; $reciveHH2 = "02:30"; } elseif ($reciveHH == "22"){ $reciveHH = "02:30"; $reciveHH2 = "03:30"; } }else if ($timeiran_str == "3") { if ($reciveHH == "00"){ $reciveHH = "03:30"; $reciveHH2 = "04:30"; } elseif ($reciveHH == "01"){ $reciveHH = "04:30"; $reciveHH2 = "05:30"; } elseif ($reciveHH == "02"){ $reciveHH = "05:30"; $reciveHH2 = "06:30"; } elseif ($reciveHH == "03"){ $reciveHH = "06:30"; $reciveHH2 = "07:30"; } elseif ($reciveHH == "04"){ $reciveHH = "07:30"; $reciveHH2 = "08:30"; } elseif ($reciveHH == "05"){ $reciveHH = "08:30"; $reciveHH2 = "09:30"; } elseif ($reciveHH == "06"){ $reciveHH = "09:30"; $reciveHH2 = "10:30"; } elseif ($reciveHH == "07"){ $reciveHH = "10:30"; $reciveHH2 = "11:30"; } elseif ($reciveHH == "08"){ $reciveHH = "11:30"; $reciveHH2 = "12:30"; } elseif ($reciveHH == "09"){ $reciveHH = "12:30"; $reciveHH2 = "13:30"; } elseif ($reciveHH == "10"){ $reciveHH = "13:30"; $reciveHH2 = "14:30"; } elseif ($reciveHH == "11"){ $reciveHH = "14:30"; $reciveHH2 = "15:30"; } elseif ($reciveHH == "12"){ $reciveHH = "15:30"; $reciveHH2 = "16:30"; } elseif ($reciveHH == "13"){ $reciveHH = "16:30"; $reciveHH2 = "17:30"; } elseif ($reciveHH == "14"){ $reciveHH = "17:30"; $reciveHH2 = "18:30"; } elseif ($reciveHH == "15"){ $reciveHH = "18:30"; $reciveHH2 = "19:30"; } elseif ($reciveHH == "16"){ $reciveHH = "19:30"; $reciveHH2 = "20:30"; } elseif ($reciveHH == "17"){ $reciveHH = "20:30"; $reciveHH2 = "21:30"; } elseif ($reciveHH == "18"){ $reciveHH = "21:30"; $reciveHH2 = "22:30"; } elseif ($reciveHH == "19"){ $reciveHH = "22:30"; $reciveHH2 = "23:30"; } elseif ($reciveHH == "20"){ $reciveHH = "23:30"; $reciveHH2 = "00:30"; } elseif ($reciveHH == "21"){ $reciveHH = "00:30"; $reciveHH2 = "01:30"; } elseif ($reciveHH == "22"){ $reciveHH = "01:30"; $reciveHH2 = "02:30"; } elseif ($reciveHH == "23"){ $reciveHH = "02:30"; $reciveHH2 = "03:30"; } } $in = findALLpara($gilan1data,$gilan1data2,"[40719=","[121*T="); $PWW40719 = $in['PWW']; $FF40719 = $in['FF']; $TDRY40719 = $in['TDRY']; $HM40719 = $in['HM']; $in = findALLpara($gilan1data,$gilan1data2,"[99272=","[126*T="); $PWW99272 = $in['PWW']; $FF99272 = $in['FF']; $TDRY99272 = $in['TDRY']; $HM99272 = $in['HM']; $in = findALLpara($gilan1data,$gilan1data2,"[40709=","[119*T="); $PWW40709 = $in['PWW']; $FF40709 = $in['FF']; $TDRY40709 = $in['TDRY']; $HM40709 = $in['HM']; $in = findALLpara($gilan1data,$gilan1data2,"[40718=","[120*T="); $PWW40718 = $in['PWW']; $FF40718 = $in['FF']; $TDRY40718 = $in['TDRY']; $HM40718 = $in['HM']; $in = findALLpara($gilan1data,$gilan1data2,"[99249=","[124*T="); $PWW99249 = $in['PWW']; $FF99249 = $in['FF']; $TDRY99249 = $in['TDRY']; $HM99249 = $in['HM']; $in = findALLpara($gilan1data,$gilan1data2,"[40805=","[123*T="); $PWW40805 = $in['PWW']; $FF40805 = $in['FF']; $TDRY40805 = $in['TDRY']; $HM40805 = $in['HM']; $in = findALLpara($gilan1data,$gilan1data2,"[99302=","[130*T="); $PWW99302 = $in['PWW']; $FF99302 = $in['FF']; $TDRY99302 = $in['TDRY']; $HM99302 = $in['HM']; $in = findALLpara($gilan1data,$gilan1data2,"[99317=","[131*T="); $PWW99317 = $in['PWW']; $FF99317 = $in['FF']; $TDRY99317 = $in['TDRY']; $HM99317 = $in['HM']; $in = findALLpara($gilan1data,$gilan1data2,"[99282=","[129*T="); $PWW99282 = $in['PWW']; $FF99282 = $in['FF']; $TDRY99282 = $in['TDRY']; $HM99282 = $in['HM']; $in = findALLpara($gilan1data,$gilan1data2,"[99268=","[125*T="); $PWW99268 = $in['PWW']; $FF99268 = $in['FF']; $TDRY99268 = $in['TDRY']; $HM99268 = $in['HM']; $in = findALLpara($gilan1data,$gilan1data2,"[99276=","[127*T="); $PWW99276 = $in['PWW']; $FF99276 = $in['FF']; $TDRY99276 = $in['TDRY']; $HM99276 = $in['HM']; $in = findALLpara($gilan1data,$gilan1data2,"[99281=","[128*T="); $PWW99281 = $in['PWW']; $FF99281 = $in['FF']; $TDRY99281 = $in['TDRY']; $HM99281 = $in['HM']; $in = findALLpara($gilan1data,$gilan1data2,"[40720=","[122*T="); $PWW40720 = $in['PWW']; $FF40720 = $in['FF']; $TDRY40720 = $in['TDRY']; $HM40720 = $in['HM']; $in = findALLpara($gilan1data,$gilan1data2,"[18221=","[732*T="); $PWW18221 = $in['PWW']; $FF18221 = $in['FF']; $TDRY18221 = $in['TDRY']; $HM18221 = $in['HM']; $in = findALLpara($gilan1data,$gilan1data2,"[18253=","[006*T="); $PWW18253 = $in['PWW']; $FF18253 = $in['FF']; $TDRY18253 = $in['TDRY']; $HM18253 = $in['HM']; $in = findALLpara($gilan1data,$gilan1data2,"[18131=","[413*T="); $PWW18131 = $in['PWW']; $FF18131 = $in['FF']; $TDRY18131 = $in['TDRY']; $HM18131 = $in['HM']; $in = findALLpara($gilan1data,$gilan1data2,"[18261=","[753*T="); $PWW18261 = $in['PWW']; $FF18261 = $in['FF']; $TDRY18261 = $in['TDRY']; $HM18261 = $in['HM']; $in = findALLpara($gilan1data,$gilan1data2,"[18572=","[613*T="); $PWW18572 = $in['PWW']; $FF18572 = $in['FF']; $TDRY18572 = $in['TDRY']; $HM18572 = $in['HM']; $in = findALLpara($gilan1data,$gilan1data2,"[18235=","[746*T="); $PWW18235 = $in['PWW']; $FF18235 = $in['FF']; $TDRY18235 = $in['TDRY']; $HM18235 = $in['HM']; $in = findALLpara($gilan1data,$gilan1data2,"[18143=","[776*T="); $PWW18143 = $in['PWW']; $FF18143 = $in['FF']; $TDRY18143 = $in['TDRY']; $HM18143 = $in['HM']; $in = findALLpara($gilan1data,$gilan1data2,"[18219=","[767*T="); $PWW18219 = $in['PWW']; $FF18219 = $in['FF']; $TDRY18219 = $in['TDRY']; $HM18219 = $in['HM']; $in = findALLpara($gilan1data,$gilan1data2,"[18245=","[770*T="); $PWW18245 = "00"; //$in['PWW']; $FF18245 = $in['FF']; $TDRY18245 = $in['TDRY']; $HM18245 = $in['HM']; $in = findALLpara($gilan1data,$gilan1data2,"[18052=","[5054*T="); $PWW18052 = "00"; //$in['PWW']; $FF18052 = $in['FF']; $TDRY18052 = $in['TDRY']; $HM18052 = $in['HM']; } ///////////////////////////////////////////////////////////////////////////// پايان پارامترهای شهرها ///////////////////////////////////////////////////////////////////////////// آغاز بارندگی شش ساعته $rain6h = "aaaa/cities/rain6h.txt"; $rain6hdata = ""; $rain6h40709 = $rain6h40718 = $rain6h40719 = $rain6h40720 = $rain6h40805 = $rain6h99249 = $rain6h99268 = $rain6h99272 = $rain6h99276 = $rain6h99281 = $rain6h99282 = $rain6h99302 = $rain6h99317 = $rain6h18131 = $rain6h18221 = $rain6h18235 = $rain6h18253 = $rain6h18261 = $rain6h18572 = $rain6h05001 = $rain6h18219 = $rain6h18143 = $rain6h18245 = $rain6h18052 = ""; if (file_exists($rain6h) == 1){ if ($fh = fopen($rain6h, 'r')) { $rain6hdata = fread($fh, filesize($rain6h)); } fclose($fh); $rain6hinfo1 = ""; $rain6hinfo2 = ""; if (strpos($rain6hdata, "[[") !== false){ $rain6hinfo1 = substr($rain6hdata,strpos($rain6hdata,"[[")+2,strlen($rain6hdata)); $rain6hinfo2 = $rain6hinfo1; $rain6hinfo1 = substr($rain6hinfo1,0,strpos($rain6hinfo1,"=")); $rain6hinfo2 = substr($rain6hinfo2,strpos($rain6hinfo2,"=")+1,strlen($rain6hinfo2)); $rain6hinfo2 = substr($rain6hinfo2,0,strpos($rain6hinfo2,"]]")); if (($rain6h <> "/") and ($rain6h <> "")) { $rain6h = substr($rain6h,0,3); } } $rain6h40709 = FUNCrain6h($rain6hdata,"[40709="); $rain6h40718 = FUNCrain6h($rain6hdata,"[40718="); $rain6h40719 = FUNCrain6h($rain6hdata,"[40719="); $rain6h40720 = FUNCrain6h($rain6hdata,"[40720="); $rain6h40805 = FUNCrain6h($rain6hdata,"[40805="); $rain6h99249 = FUNCrain6h($rain6hdata,"[99249="); $rain6h99268 = FUNCrain6h($rain6hdata,"[99268="); $rain6h99272 = FUNCrain6h($rain6hdata,"[99272="); $rain6h99276 = FUNCrain6h($rain6hdata,"[99276="); $rain6h99281 = FUNCrain6h($rain6hdata,"[99281="); $rain6h99282 = FUNCrain6h($rain6hdata,"[99282="); $rain6h99302 = FUNCrain6h($rain6hdata,"[99302="); $rain6h99317 = FUNCrain6h($rain6hdata,"[99317="); $rain6h18131 = FUNCrain6h($rain6hdata,"[18131="); $rain6h18221 = FUNCrain6h($rain6hdata,"[18221="); $rain6h18235 = FUNCrain6h($rain6hdata,"[18235="); $rain6h18253 = FUNCrain6h($rain6hdata,"[18253="); $rain6h18261 = FUNCrain6h($rain6hdata,"[18261="); $rain6h18572 = FUNCrain6h($rain6hdata,"[18572="); $rain6h18143 = FUNCrain6h($rain6hdata,"[18143="); $rain6h18219 = FUNCrain6h($rain6hdata,"[18219="); $rain6h18245 = FUNCrain6h($rain6hdata,"[18245="); $rain6h18052 = FUNCrain6h($rain6hdata,"[18052="); } $rain6h40709 = rain6h_missing($rain6hXXXXX, $rain6h40709, "[40709="); $rain6h40718 = rain6h_missing($rain6hXXXXX, $rain6h40718, "[40718="); $rain6h40720 = rain6h_missing($rain6hXXXXX, $rain6h40720, "[40720="); $rain6h40805 = rain6h_missing($rain6hXXXXX, $rain6h40805, "[40805="); $rain6h99249 = rain6h_missing($rain6hXXXXX, $rain6h99249, "[99249="); $rain6h99268 = rain6h_missing($rain6hXXXXX, $rain6h99268, "[99268="); $rain6h99276 = rain6h_missing($rain6hXXXXX, $rain6h99276, "[99276="); $rain6h99281 = rain6h_missing($rain6hXXXXX, $rain6h99281, "[99281="); $rain6h99282 = rain6h_missing($rain6hXXXXX, $rain6h99282, "[99282="); $rain6h99302 = rain6h_missing($rain6hXXXXX, $rain6h99302, "[99302="); $rain6h99317 = rain6h_missing($rain6hXXXXX, $rain6h99317, "[99317="); $rain6h18131 = rain6h_missing($rain6hXXXXX, $rain6h18131, "[18131="); $rain6h18221 = rain6h_missing($rain6hXXXXX, $rain6h18221, "[18221="); $rain6h18235 = rain6h_missing($rain6hXXXXX, $rain6h18235, "[18235="); $rain6h18253 = rain6h_missing($rain6hXXXXX, $rain6h18253, "[18253="); $rain6h18261 = rain6h_missing($rain6hXXXXX, $rain6h18261, "[18261="); $rain6h18572 = rain6h_missing($rain6hXXXXX, $rain6h18572, "[18572="); $rain6h05001 = rain6h_missing($rain6hXXXXX, $rain6h05001, "[05001="); $rain6h00767 = rain6h_missing($rain6hXXXXX, $rain6h00767, "[18219="); $rain6h00776 = rain6h_missing($rain6hXXXXX, $rain6h00776, "[18143="); $rain6h00770 = rain6h_missing($rain6hXXXXX, $rain6h00770, "[18245="); $rain6h05054 = rain6h_missing($rain6hXXXXX, $rain6h05054, "[18052="); $rain6h40709 = str_replace(".","/",$rain6h40709); $rain6h40718 = str_replace(".","/",$rain6h40718); $rain6h40720 = str_replace(".","/",$rain6h40720); $rain6h40805 = str_replace(".","/",$rain6h40805); $rain6h99249 = str_replace(".","/",$rain6h99249); $rain6h99268 = str_replace(".","/",$rain6h99268); $rain6h99276 = str_replace(".","/",$rain6h99276); $rain6h99281 = str_replace(".","/",$rain6h99281); $rain6h99282 = str_replace(".","/",$rain6h99282); $rain6h99302 = str_replace(".","/",$rain6h99302); $rain6h99317 = str_replace(".","/",$rain6h99317); $rain6h18131 = str_replace(".","/",$rain6h18131); $rain6h18221 = str_replace(".","/",$rain6h18221); $rain6h18235 = str_replace(".","/",$rain6h18235); $rain6h18253 = str_replace(".","/",$rain6h18253); $rain6h18261 = str_replace(".","/",$rain6h18261); $rain6h18572 = str_replace(".","/",$rain6h18572); $rain6h05001 = str_replace(".","/",$rain6h05001); $rain6h00767 = str_replace(".","/",$rain6h00767); $rain6h00776 = str_replace(".","/",$rain6h00776); $rain6h00770 = str_replace(".","/",$rain6h00770); $rain6h05054 = str_replace(".","/",$rain6h05054); ///////////////////////////////////////////////////////////////////////////// پايان بارندگی شش ساعته function rain6h_missing($rain6hXXXXX, $stationrain, $STcode){ $rain6h = ""; if (strlen($stationrain) == 0){ if (strpos($rain6hXXXXX, $STcode) !== false){ $rain6h = substr($rain6hXXXXX,strpos($rain6hXXXXX,$STcode)+7,strlen($rain6hXXXXX)); $rain6h = substr($rain6h,0,strpos($rain6h,"]")); if ((int)$rain6h > 100) { $rain6h = ""; } }else { $rain6h = ""; } }else{ $rain6h = $stationrain; } return $rain6h; } function FUNCrain6h($rain6hdata,$STcode){ if (strpos($rain6hdata, $STcode) !== false){ $rain6h = substr($rain6hdata,strpos($rain6hdata,$STcode)+7,strlen($rain6hdata)); $rain6h = substr($rain6h,0,strpos($rain6h,"]")); if (($rain6h <> "/") and ($rain6h <> "")) { $rain6h = substr($rain6h,0,3); } }else { $rain6h = "/"; } if (($rain6h == "") or ($rain6h == "/") or ($rain6h == "///") or ((int)($rain6h) > 999)){ $rain6h = ""; }elseif ($rain6h == "990"){ $rain6h = "TR"; }elseif ($rain6h == "991"){ $rain6h = "0.1"; }elseif ($rain6h == "992"){ $rain6h = "0.2"; }elseif ($rain6h == "993"){ $rain6h = "0.3"; }elseif ($rain6h == "994"){ $rain6h = "0.4"; }elseif ($rain6h == "995"){ $rain6h = "0.5"; }elseif ($rain6h == "996"){ $rain6h = "0.6"; }elseif ($rain6h == "997"){ $rain6h = "0.7"; }elseif ($rain6h == "998"){ $rain6h = "0.8"; }elseif ($rain6h == "999"){ $rain6h = "0.9"; }else { $rain6h = (int)($rain6h) * 1; } return $rain6h; } function findALLpara($gilan1data,$gilan1data2,$STCODE,$STCODE2){ $PWW = $FF = $TDRY = $HM = ""; $t1 = "0"; $t2 = "1"; if (strpos($gilan1data, $STCODE) !== false){ $HM = substr($gilan1data,strpos($gilan1data,$STCODE)+7,strlen($gilan1data)); $HM = substr($HM,strpos($HM,"=")+1,strlen($HM)); $HM = substr($HM,strpos($HM,"=")+1,strlen($HM)); $PWW = substr($HM,0,strpos($HM,"=")); $HM = substr($HM,strpos($HM,"=")+1,strlen($HM)); $FF = substr($HM,0,strpos($HM,"=")); if (substr($FF,2,2) != "//"){ $FF = substr($FF,2,2); }else{ $FF = ""; } $HM = substr($HM,strpos($HM,"=")+1,strlen($HM)); $TDRY = substr($HM,0,strpos($HM,"=")); $TDRY = str_replace("-","",$TDRY); if (substr($TDRY,0,1) == "1"){ if (substr($TDRY,1,3) != "///"){ $TDRY = (int)(substr($TDRY,1,3)) / (-10); }else{ $TDRY = ""; } }elseif (substr($TDRY,0,1) == "0"){ if (substr($TDRY,1,3) != "///"){ $TDRY = (int)(substr($TDRY,1,3)) / (10); }else{ $TDRY = ""; } }else{ $TDRY = ""; } $HM = substr($HM,strpos($HM,"=")+1,strlen($HM)); $HM = substr($HM,0,strpos($HM,"]")); if ($HM == "///"){ $HM = ""; } }else if ($gilan1data2 <> ""){ $t1 = substr($gilan1data2,2,2); $t2 = substr($gilan1data2,strpos($gilan1data2,"*Time=")+6,strlen($gilan1data2)); $t2 = substr($t2,0,2); if ($t1 == $t2){ if (strpos($gilan1data2, $STCODE2) !== false){ $TDRY = substr($gilan1data2,strpos($gilan1data2,$STCODE2)+7,strlen($gilan1data2)); $TDRY = substr($TDRY,0,strpos($TDRY,"*")); $TDRY = round(((float)$TDRY),1); $HM = substr($gilan1data2,strpos($gilan1data2,$STCODE2)+7,strlen($gilan1data2)); $HM = substr($HM,strpos($HM,"*H=")+3,strlen($HM)); $HM = substr($HM,0,strpos($HM,"*")); $HM = round(((float)$HM)); $FF = substr($gilan1data2,strpos($gilan1data2,$STCODE2)+7,strlen($gilan1data2)); $FF = substr($FF,strpos($FF,"*WS1=")+5,strlen($FF)); $FF = substr($FF,0,strpos($FF,"*")); if ($FF == ""){ $FF = substr($gilan1data2,strpos($gilan1data2,$STCODE2)+7,strlen($gilan1data2)); $FF = substr($FF,strpos($FF,"*WS2=")+5,strlen($FF)); $FF = substr($FF,0,strpos($FF,"]")); } } } } if (($PWW == "") or ($PWW == "/")){ $PWW = "00"; } if (($FF == "") or ($FF == "/") or ((int)($FF) > 99)){ $FF = ""; }else { $FF = round(((float)$FF) * 3.6,1); } if (($TDRY < -50) or ($TDRY > 50)){ $TDRY = ""; } if (($HM == "") or ($HM == "/") or ((int)($HM) > 100)){ $HM = ""; } $FF = str_replace(".","/",$FF); $TDRY = str_replace(".","/",$TDRY); $HM = str_replace(".","/",$HM); $out['PWW'] = $PWW; $out['FF'] = $FF; $out['TDRY'] = $TDRY; $out['HM'] = $HM; return $out; } ///////////////////////////////////////////////////////////////////////////// END NEW CODE ///////////////////////////////////////////////////////////////////////////// // ----------- پیلمبرا و لوشان -------------------------------------------- $a01 = $a02 = $a03 = $a04 = $a05 = $a06 = $a07 = $a08 = $a09 = $a10 = $a11 = $a12 = $a13 = $a14 = $a15 = $a16 = $a17 = $a18 = $a19 = ''; $b01 = $b02 = $b03 = $b04 = $b05 = $b06 = $b07 = $b08 = $b09 = $b10 = $b11 = $b12 = $b13 = $b14 = $b15 = ''; $str18141 = ''; $str18367 = ''; if (file_exists("aaaa/autogilan/new18141.txt") and (filesize("aaaa/autogilan/new18141.txt")>0)){ $myfile = fopen("aaaa/autogilan/new18141.txt", "r"); $str18141 = fread($myfile,filesize("aaaa/autogilan/new18141.txt")); fclose($myfile); } if (substr_count($str18141," ") == 14){ $a01 = substr($str18141,0,strpos($str18141," ")); $str18141 = substr($str18141,strpos($str18141," ")+1,strlen($str18141)); $a02 = substr($str18141,0,strpos($str18141," ")); $str18141 = substr($str18141,strpos($str18141," ")+1,strlen($str18141)); $a03 = substr($str18141,0,strpos($str18141," ")); $a03 = round((float)($a03),1); $str18141 = substr($str18141,strpos($str18141," ")+1,strlen($str18141)); $a04 = substr($str18141,0,strpos($str18141," ")); $a04 = round((float)($a04),1); $str18141 = substr($str18141,strpos($str18141," ")+1,strlen($str18141)); $a05 = substr($str18141,0,strpos($str18141," ")); $a05 = round((float)($a05),1); $str18141 = substr($str18141,strpos($str18141," ")+1,strlen($str18141)); $a06 = substr($str18141,0,strpos($str18141," ")); $a06 = round((float)($a06),1); $str18141 = substr($str18141,strpos($str18141," ")+1,strlen($str18141)); $a07 = substr($str18141,0,strpos($str18141," ")); $a07 = round((float)($a07),1); $str18141 = substr($str18141,strpos($str18141," ")+1,strlen($str18141)); $a08 = substr($str18141,0,strpos($str18141," ")); $a08 = round((float)($a08),1); $str18141 = substr($str18141,strpos($str18141," ")+1,strlen($str18141)); $a09 = substr($str18141,0,strpos($str18141," ")); $a09 = round((float)($a09),1); $str18141 = substr($str18141,strpos($str18141," ")+1,strlen($str18141)); $a10 = substr($str18141,0,strpos($str18141," ")); $a10 = round((float)($a10),1); $str18141 = substr($str18141,strpos($str18141," ")+1,strlen($str18141)); $a11 = substr($str18141,0,strpos($str18141," ")); $a11 = round((float)($a11),0); $str18141 = substr($str18141,strpos($str18141," ")+1,strlen($str18141)); $a12 = substr($str18141,0,strpos($str18141," ")); $a12 = round((float)($a12),0); $str18141 = substr($str18141,strpos($str18141," ")+1,strlen($str18141)); $a13 = substr($str18141,0,strpos($str18141," ")); $a13 = round((float)($a13),1); $str18141 = substr($str18141,strpos($str18141," ")+1,strlen($str18141)); $a14 = substr($str18141,0,strpos($str18141," ")); $a14 = round((float)($a14),1); $str18141 = substr($str18141,strpos($str18141," ")+1,strlen($str18141)); $a15 = substr($str18141,0,strpos($str18141,"=")); $a15 = round((float)($a15),1); if (date("Y/m/d") == $a01){ $windpilembera = round(((float)($a15))*3.6,1); $Temppilembera = $a07; if ($Temppilembera == "/") { $Temppilembera = ''; }else { if ((int)$Temppilembera > 45) { $Temppilembera = ""; } $Temppilembera = str_replace(".","/",$Temppilembera); } $hpilembera = $a08; $windpilembera = str_replace(".","/",$windpilembera); $hpilembera = str_replace(".","/",$hpilembera); }else{ $windpilembera = ''; $Temppilembera = ''; $hpilembera = ''; } }else{ $windpilembera = ''; $Temppilembera = ''; $hpilembera = ''; } if (file_exists("aaaa/autogilan/new18367.txt") and (filesize("aaaa/autogilan/new18367.txt")>0)){ $myfile = fopen("aaaa/autogilan/new18367.txt", "r"); $str18367 = fread($myfile,filesize("aaaa/autogilan/new18367.txt")); fclose($myfile); } if (substr_count($str18367, ' ') == 10) { $b01 = substr($str18367,0,strpos($str18367," ")); $str18367 = substr($str18367,strpos($str18367," ")+1,strlen($str18367)); $b02 = substr($str18367,0,strpos($str18367," ")); $str18367 = substr($str18367,strpos($str18367," ")+1,strlen($str18367)); $b03 = substr($str18367,0,strpos($str18367," ")); $b03 = round((float)($b03),0); $str18367 = substr($str18367,strpos($str18367," ")+1,strlen($str18367)); $b04 = substr($str18367,0,strpos($str18367," ")); $b04 = round((float)($b04),0); $str18367 = substr($str18367,strpos($str18367," ")+1,strlen($str18367)); $b05 = substr($str18367,0,strpos($str18367," ")); $b05 = round((float)($b05),0); $str18367 = substr($str18367,strpos($str18367," ")+1,strlen($str18367)); $b06 = substr($str18367,0,strpos($str18367," ")); $b06 = round((float)($b06),0); $str18367 = substr($str18367,strpos($str18367," ")+1,strlen($str18367)); $b07 = substr($str18367,0,strpos($str18367," ")); $b07 = round((float)($b07),0); $str18367 = substr($str18367,strpos($str18367," ")+1,strlen($str18367)); $b08 = substr($str18367,0,strpos($str18367," ")); $b08 = round((float)($b08),0); $str18367 = substr($str18367,strpos($str18367," ")+1,strlen($str18367)); $b09 = substr($str18367,0,strpos($str18367," ")); $b09 = round((float)($b09),0); $str18367 = substr($str18367,strpos($str18367," ")+1,strlen($str18367)); $b10 = substr($str18367,0,strpos($str18367," ")); $b10 = round((float)($b10),0); $str18367 = substr($str18367,strpos($str18367," ")+1,strlen($str18367)); $b11 = substr($str18367,0,strpos($str18367,"=")); $b11 = round((float)($b11),0); if (date("Y/m/d") == $a01){ $windlowshan = round(((float)($b03))*3.6,1); $Templowshan = $b10; $hlowshan = $b11; $windlowshan = str_replace(".","/",$windlowshan); $Templowshan = str_replace(".","/",$Templowshan); $hlowshan = str_replace(".","/",$hlowshan); }else{ $windlowshan = ''; $Templowshan = ''; $hlowshan = ''; } }else{ $windlowshan = ''; $Templowshan = ''; $hlowshan = ''; } // ----------- پایان پیلمبرا و لوشان -------------------------------------- $gmdate1 = gmdate("Hi"); //----------------------------------- محاسبه داده ها برای ساعات شب $amlashtemp = $anzalitemp = $astanehtemp = $astaratemp = $azbaremtemp = $deylamantemp = $foumantemp = $jirandehtemp = $jirkoultemp = $kiashahrtemp = $lahijantemp = $manjiltemp = $masoulehtemp = $roudbartemp = $roudsartemp = $taleshtemp = $pilambaratemp = $lowshantemp = $rashttemp = $asbevounitemp = $froudgahtemp = $langarudtemp = $froudgahtemp = $froudgahtemp = $froudgahtemp = $heyrantemp = ""; $amlashspeed = $anzalispeed = $astanehspeed = $astaraspeed = $azbaremspeed = $deylamanspeed = $foumanspeed = $jirandehspeed = $jirkoulspeed = $kiashahrspeed = $lahijanspeed = $manjilspeed = $masoulehspeed = $roudbarspeed = $roudsarspeed = $taleshspeed = $pilambaraspeed = $lowshanspeed = $rashtspeed = $asbevounispeed = $froudgahspeed = $heyranspeed = ""; $amlashhumidity = $anzalihumidity = $astanehhumidity = $astarahumidity = $azbaremhumidity = $deylamanhumidity = $foumanhumidity = $jirandehhumidity = $jirkoulhumidity = $kiashahrhumidity = $lahijanhumidity = $manjilhumidity = $masoulehhumidity = $roudbarhumidity = $roudsarhumidity = $taleshhumidity = $pilambarahumidity = $lowshanhumidity = $rashthumidity = $asbevounihumidity = $froudgahhumidity = $heyranhumidity = ""; $amlasht = $anzalit = $astaneht = $astarat = $azbaremt = $deylamant = $foumant = $jirandeht = $jirkoult = $kiashahrt = $lahijant = $manjilt = $masouleht = $roudbart = $roudsart = $talesht = $pilambarat = $lowshant = $rashtt = $asbevounit = $frodgaht = $frodgaht = $rezvanshahrt = $somehsarat = $langarudt = $heyrant = ""; $mp = "aaaa/mobile/mobilepara.txt"; if (file_exists($mp) == 1){ if ($fh = fopen($mp, 'r')) { $windtemp_str = fread($fh, filesize($mp)); } fclose($fh); $windhumidity_str = $windspeed_str = $windtemp_str; $windtime_str = substr($windtemp_str,strpos($windtemp_str,"[TIME"),strlen($windtemp_str)); $windtime_str = substr($windtime_str,0,strpos($windtime_str,"TIME]")+5); $windtemp_str = substr($windtemp_str,strpos($windtemp_str,"[TEMP"),strlen($windtemp_str)); $windtemp_str = substr($windtemp_str,0,strpos($windtemp_str,"TEMP]")+11); $windhumidity_str = substr($windhumidity_str,strpos($windhumidity_str,"[HUMIDITY"),strlen($windhumidity_str)); $windhumidity_str = substr($windhumidity_str,0,strpos($windhumidity_str,"HUMIDITY]")+11); $windspeed_str = substr($windspeed_str,strpos($windspeed_str,"[WIND_SPEED"),strlen($windspeed_str)); $windspeed_str = substr($windspeed_str,0,strpos($windspeed_str,"WIND_SPEED]")+11); $amlashtemp = findtemp1($windtemp_str,"|18261="); $anzalitemp = findtemp1($windtemp_str,"|40718="); $astanehtemp = findtemp1($windtemp_str,"|18221="); $astaratemp = findtemp1($windtemp_str,"|40709="); $azbaremtemp = findtemp1($windtemp_str,"|18253="); $deylamantemp = findtemp1($windtemp_str,"|99302="); $foumantemp = findtemp1($windtemp_str,"|18235="); $jirandehtemp = findtemp1($windtemp_str,"|40805="); $jirkoultemp = findtemp1($windtemp_str,"|18572="); $kiashahrtemp = findtemp1($windtemp_str,"|99268="); $lahijantemp = findtemp1($windtemp_str,"|99276="); $manjiltemp = findtemp1($windtemp_str,"|40720="); $masoulehtemp = findtemp1($windtemp_str,"|99281="); $roudbartemp = findtemp1($windtemp_str,"|99317="); $roudsartemp = findtemp1($windtemp_str,"|99282="); $taleshtemp = findtemp1($windtemp_str,"|99249="); $pilambaratemp = findtemp1($windtemp_str,"|18141="); $lowshantemp = findtemp1($windtemp_str,"|18367="); $rashttemp = findtemp1($windtemp_str,"|99272="); $asbevounitemp = findtemp1($windtemp_str,"|18131="); $froudgahtemp = findtemp1($windtemp_str,"|40719="); $rezvanshahrtemp = findtemp1($windtemp_str,"|REZVA="); $somehsaratemp = findtemp1($windtemp_str,"|SOMEH="); $langarudtemp = findtemp1($windtemp_str,"NGARUD="); $heyrantemp = findtemp1($windtemp_str,"HEYRA="); $amlashtemp = str_replace(".","/",$amlashtemp); $anzalitemp = str_replace(".","/",$anzalitemp); $astanehtemp = str_replace(".","/",$astanehtemp); $astaratemp = str_replace(".","/",$astaratemp); $azbaremtemp = str_replace(".","/",$azbaremtemp); $deylamantemp = str_replace(".","/",$deylamantemp); $foumantemp = str_replace(".","/",$foumantemp); $jirandehtemp = str_replace(".","/",$jirandehtemp); $jirkoultemp = str_replace(".","/",$jirkoultemp); $kiashahrtemp = str_replace(".","/",$kiashahrtemp); $lahijantemp = str_replace(".","/",$lahijantemp); $manjiltemp = str_replace(".","/",$manjiltemp); $masoulehtemp = str_replace(".","/",$masoulehtemp); $roudbartemp = str_replace(".","/",$roudbartemp); $roudsartemp = str_replace(".","/",$roudsartemp); $taleshtemp = str_replace(".","/",$taleshtemp); $pilambaratemp = str_replace(".","/",$pilambaratemp); $lowshantemp = str_replace(".","/",$lowshantemp); $rashttemp = str_replace(".","/",$rashttemp); $asbevounitemp = str_replace(".","/",$asbevounitemp); $froudgahtemp = str_replace(".","/",$froudgahtemp); $rezvanshahrtemp = str_replace(".","/",$rezvanshahrtemp); $somehsaratemp = str_replace(".","/",$somehsaratemp); $langarudtemp = str_replace(".","/",$langarudtemp); $heyrantemp = str_replace(".","/",$heyrantemp); $PWW18261=find_cold_icon($PWW18261, $amlashtemp); $PWW40718=find_cold_icon($PWW40718,$anzalitemp); $PWW18131=find_cold_icon($PWW18131,$asbevounitemp); $PWW18221=find_cold_icon($PWW18221,$astanehtemp); $PWW40709=find_cold_icon($PWW40709,$astaratemp); $PWW18253=find_cold_icon($PWW18253,$azbaremtemp); $PWW99302=find_cold_icon($PWW99302,$deylamantemp); $PWW18235=find_cold_icon($PWW18235,$foumantemp); $PWW40719=find_cold_icon($PWW40719,$froudgahtemp); $PWW40805=find_cold_icon($PWW40805,$jirandehtemp); $PWW18572=find_cold_icon($PWW18572,$jirkoultemp); $PWW99268=find_cold_icon($PWW99268,$kiashahrtemp); $PWW99276=find_cold_icon($PWW99276,$lahijantemp); $PWW18245=find_cold_icon($PWW18245,$langarudtemp); $PWW40720=find_cold_icon($PWW40720,$manjiltemp); $PWW99281=find_cold_icon($PWW99281,$masoulehtemp); $PWW99272=find_cold_icon($PWW99272,$rashttemp); $PWW18143=find_cold_icon($PWW18143,$rezvanshahrtemp); $PWW99317=find_cold_icon($PWW99317,$roudbartemp); $PWW99282=find_cold_icon($PWW99282,$roudsartemp); $PWW18219=find_cold_icon($PWW18219,$somehsaratemp); $PWW99249=find_cold_icon($PWW99249,$taleshtemp); $amlashhumidity = findhumidity1($windhumidity_str,"|18261="); $anzalihumidity = findhumidity1($windhumidity_str,"|40718="); $astanehhumidity = findhumidity1($windhumidity_str,"|18221="); $astarahumidity = findhumidity1($windhumidity_str,"|40709="); $azbaremhumidity = findhumidity1($windhumidity_str,"|18253="); $deylamanhumidity = findhumidity1($windhumidity_str,"|99302="); $foumanhumidity = findhumidity1($windhumidity_str,"|18235="); $jirandehhumidity = findhumidity1($windhumidity_str,"|40805="); $jirkoulhumidity = findhumidity1($windhumidity_str,"|18572="); $kiashahrhumidity = findhumidity1($windhumidity_str,"|99268="); $lahijanhumidity = findhumidity1($windhumidity_str,"|99276="); $manjilhumidity = findhumidity1($windhumidity_str,"|40720="); $masoulehhumidity = findhumidity1($windhumidity_str,"|99281="); $roudbarhumidity = findhumidity1($windhumidity_str,"|99317="); $roudsarhumidity = findhumidity1($windhumidity_str,"|99282="); $taleshhumidity = findhumidity1($windhumidity_str,"|99249="); $pilambarahumidity = findhumidity1($windhumidity_str,"|18141="); $lowshanhumidity = findhumidity1($windhumidity_str,"|18367="); $rashthumidity = findhumidity1($windhumidity_str,"|99272="); $asbevounihumidity = findhumidity1($windhumidity_str,"|18131="); $froudgahhumidity = findhumidity1($windhumidity_str,"|40719="); $rezvanshahrhumidity = findhumidity1($windhumidity_str,"|REZVA="); $somehsarahumidity = findhumidity1($windhumidity_str,"|SOMEH="); $langarudhumidity = findhumidity1($windhumidity_str,"NGARUD="); $heyranhumidity = findhumidity1($windhumidity_str,"HEYRA="); $amlashhumidity = str_replace(".","/",$amlashhumidity); $anzalihumidity = str_replace(".","/",$anzalihumidity); $astanehhumidity = str_replace(".","/",$astanehhumidity); $astarahumidity = str_replace(".","/",$astarahumidity); $azbaremhumidity = str_replace(".","/",$azbaremhumidity); $deylamanhumidity = str_replace(".","/",$deylamanhumidity); $foumanhumidity = str_replace(".","/",$foumanhumidity); $jirandehhumidity = str_replace(".","/",$jirandehhumidity); $jirkoulhumidity = str_replace(".","/",$jirkoulhumidity); $kiashahrhumidity = str_replace(".","/",$kiashahrhumidity); $lahijanhumidity = str_replace(".","/",$lahijanhumidity); $manjilhumidity = str_replace(".","/",$manjilhumidity); $masoulehhumidity = str_replace(".","/",$masoulehhumidity); $roudbarhumidity = str_replace(".","/",$roudbarhumidity); $roudsarhumidity = str_replace(".","/",$roudsarhumidity); $taleshhumidity = str_replace(".","/",$taleshhumidity); $pilambarahumidity = str_replace(".","/",$pilambarahumidity); $lowshanhumidity = str_replace(".","/",$lowshanhumidity); $rashthumidity = str_replace(".","/",$rashthumidity); $asbevounihumidity = str_replace(".","/",$asbevounihumidity); $froudgahhumidity = str_replace(".","/",$froudgahhumidity); $rezvanshahrhumidity = str_replace(".","/",$rezvanshahrhumidity); $somehsarahumidity = str_replace(".","/",$somehsarahumidity); $langarudhumidity = str_replace(".","/",$langarudhumidity); $heyranhumidity = str_replace(".","/",$heyranhumidity); $amlashspeed = findspeed1($windspeed_str,"|18261="); $anzalispeed = findspeed1($windspeed_str,"|40718="); $astanehspeed = findspeed1($windspeed_str,"|18221="); $astaraspeed = findspeed1($windspeed_str,"|40709="); $azbaremspeed = findspeed1($windspeed_str,"|18253="); $deylamanspeed = findspeed1($windspeed_str,"|99302="); $foumanspeed = findspeed1($windspeed_str,"|18235="); $jirandehspeed = findspeed1($windspeed_str,"|40805="); $jirkoulspeed = findspeed1($windspeed_str,"|18572="); $kiashahrspeed = findspeed1($windspeed_str,"|99268="); $lahijanspeed = findspeed1($windspeed_str,"|99276="); $manjilspeed = findspeed1($windspeed_str,"|40720="); $masoulehspeed = findspeed1($windspeed_str,"|99281="); $roudbarspeed = findspeed1($windspeed_str,"|99317="); $roudsarspeed = findspeed1($windspeed_str,"|99282="); $taleshspeed = findspeed1($windspeed_str,"|99249="); $pilambaraspeed = findspeed1($windspeed_str,"|18141="); $lowshanspeed = findspeed1($windspeed_str,"|18367="); $rashtspeed = findspeed1($windspeed_str,"|99272="); $asbevounispeed = findspeed1($windspeed_str,"|18131="); $froudgahspeed = findspeed1($windspeed_str,"|40719="); $rezvanshahrspeed = findspeed1($windspeed_str,"|REZVA="); $somehsaraspeed = findspeed1($windspeed_str,"|SOMEH="); $langarudspeed = findspeed1($windspeed_str,"NGARUD="); $heyranspeed = findspeed1($windspeed_str,"HEYRA="); $amlashspeed = str_replace(".","/",$amlashspeed); $anzalispeed = str_replace(".","/",$anzalispeed); $astanehspeed = str_replace(".","/",$astanehspeed); $astaraspeed = str_replace(".","/",$astaraspeed); $azbaremspeed = str_replace(".","/",$azbaremspeed); $deylamanspeed = str_replace(".","/",$deylamanspeed); $foumanspeed = str_replace(".","/",$foumanspeed); $jirandehspeed = str_replace(".","/",$jirandehspeed); $jirkoulspeed = str_replace(".","/",$jirkoulspeed); $kiashahrspeed = str_replace(".","/",$kiashahrspeed); $lahijanspeed = str_replace(".","/",$lahijanspeed); $manjilspeed = str_replace(".","/",$manjilspeed); $masoulehspeed = str_replace(".","/",$masoulehspeed); $roudbarspeed = str_replace(".","/",$roudbarspeed); $roudsarspeed = str_replace(".","/",$roudsarspeed); $taleshspeed = str_replace(".","/",$taleshspeed); $pilambaraspeed = str_replace(".","/",$pilambaraspeed); $lowshanspeed = str_replace(".","/",$lowshanspeed); $rashtspeed = str_replace(".","/",$rashtspeed); $asbevounispeed = str_replace(".","/",$asbevounispeed); $froudgahspeed = str_replace(".","/",$froudgahspeed); $rezvanshahrspeed = str_replace(".","/",$rezvanshahrspeed); $somehsaraspeed = str_replace(".","/",$somehsaraspeed); $langarudspeed = str_replace(".","/",$langarudspeed); $heyranspeed = str_replace(".","/",$heyranspeed); $amlasht = findtime1($windtime_str,"|18261="); $anzalit = findtime1($windtime_str,"|40718="); $astaneht = findtime1($windtime_str,"|18221="); $astarat = findtime1($windtime_str,"|40709="); $azbaremt = findtime1($windtime_str,"|18253="); $deylamant = findtime1($windtime_str,"|99302="); $foumant = findtime1($windtime_str,"|18235="); $jirandeht = findtime1($windtime_str,"|40805="); $jirkoult = findtime1($windtime_str,"|18572="); $kiashahrt = findtime1($windtime_str,"|99268="); $lahijant = findtime1($windtime_str,"|99276="); $manjilt = findtime1($windtime_str,"|40720="); $masouleht = findtime1($windtime_str,"|99281="); $roudbart = findtime1($windtime_str,"|99317="); $roudsart = findtime1($windtime_str,"|99282="); $talesht = findtime1($windtime_str,"|99249="); $pilambarat = findtime1($windtime_str,"|18141="); $lowshant = findtime1($windtime_str,"|18367="); $rashtt = findtime1($windtime_str,"|99272="); $asbevounit = findtime1($windtime_str,"|18131="); $froudgaht = findtime1($windtime_str,"|40719="); $rezvanshahrt = findtime1($windtime_str,"|REZVA="); $somehsarat = findtime1($windtime_str,"|SOMEH="); $langarudt = findtime1($windtime_str,"NGARUD="); $heyrant = findtime1($windtime_str,"HEYRA="); $amlashtemp = test_data_is_up2date1($amlasht,$amlashtemp); $anzalitemp = test_data_is_up2date1($anzalit,$anzalitemp); $astanehtemp = test_data_is_up2date1($astaneht,$astanehtemp); $astaratemp = test_data_is_up2date1($astarat,$astaratemp); $azbaremtemp = test_data_is_up2date1($azbaremt,$azbaremtemp); $deylamantemp = test_data_is_up2date1($deylamant,$deylamantemp); $foumantemp = test_data_is_up2date1($foumant,$foumantemp); $jirandehtemp = test_data_is_up2date1($jirandeht,$jirandehtemp); $jirkoultemp = test_data_is_up2date1($jirkoult,$jirkoultemp); $kiashahrtemp = test_data_is_up2date1($kiashahrt,$kiashahrtemp); $lahijantemp = test_data_is_up2date1($lahijant,$lahijantemp); $manjiltemp = test_data_is_up2date1($manjilt,$manjiltemp); $masoulehtemp = test_data_is_up2date1($masouleht,$masoulehtemp); $roudbartemp = test_data_is_up2date1($roudbart,$roudbartemp); $roudsartemp = test_data_is_up2date1($roudsart,$roudsartemp); $taleshtemp = test_data_is_up2date1($talesht,$taleshtemp); $pilambaratemp = test_data_is_up2date1($pilambarat,$pilambaratemp); $lowshantemp = test_data_is_up2date1($lowshant,$lowshantemp); $rashttemp = test_data_is_up2date1($rashtt,$rashttemp); $asbevounitemp = test_data_is_up2date1($asbevounit,$asbevounitemp); $froudgahtemp = test_data_is_up2date1($froudgaht,$froudgahtemp); $rezvanshahrtemp = test_data_is_up2date1($rezvanshahrt,$rezvanshahrtemp); $somehsaratemp = test_data_is_up2date1($somehsarat,$somehsaratemp); $langarudtemp = test_data_is_up2date1($langarudt,$langarudtemp); $heyrantemp = test_data_is_up2date1($heyrant,$heyrantemp); $amlashhumidity = test_data_is_up2date2($amlasht,$amlashhumidity); $anzalihumidity = test_data_is_up2date2($anzalit,$anzalihumidity); $astanehhumidity = test_data_is_up2date2($astaneht,$astanehhumidity); $astarahumidity = test_data_is_up2date2($astarat,$astarahumidity); $azbaremhumidity = test_data_is_up2date2($azbaremt,$azbaremhumidity); $deylamanhumidity = test_data_is_up2date2($deylamant,$deylamanhumidity); $foumanhumidity = test_data_is_up2date2($foumant,$foumanhumidity); $jirandehhumidity = test_data_is_up2date2($jirandeht,$jirandehhumidity); $jirkoulhumidity = test_data_is_up2date2($jirkoult,$jirkoulhumidity); $kiashahrhumidity = test_data_is_up2date2($kiashahrt,$kiashahrhumidity); $lahijanhumidity = test_data_is_up2date2($lahijant,$lahijanhumidity); $manjilhumidity = test_data_is_up2date2($manjilt,$manjilhumidity); $masoulehhumidity = test_data_is_up2date2($masouleht,$masoulehhumidity); $roudbarhumidity = test_data_is_up2date2($roudbart,$roudbarhumidity); $roudsarhumidity = test_data_is_up2date2($roudsart,$roudsarhumidity); $taleshhumidity = test_data_is_up2date2($talesht,$taleshhumidity); $pilambarahumidity = test_data_is_up2date2($pilambarat,$pilambarahumidity); $lowshanhumidity = test_data_is_up2date2($lowshant,$lowshanhumidity); $rashthumidity = test_data_is_up2date2($rashtt,$rashthumidity); $asbevounihumidity = test_data_is_up2date2($asbevounit,$asbevounihumidity); $froudgahhumidity = test_data_is_up2date2($froudgaht,$froudgahhumidity); $rezvanshahrhumidity = test_data_is_up2date2($rezvanshahrt,$rezvanshahrhumidity); $somehsarahumidity = test_data_is_up2date2($somehsarat,$somehsarahumidity); $langarudhumidity = test_data_is_up2date2($langarudt,$langarudhumidity); $heyranhumidity = test_data_is_up2date2($heyrant,$heyranhumidity); $amlashspeed = test_data_is_up2date3($amlasht,$amlashspeed); $anzalispeed = test_data_is_up2date3($anzalit,$anzalispeed); $astanehspeed = test_data_is_up2date3($astaneht,$astanehspeed); $astaraspeed = test_data_is_up2date3($astarat,$astaraspeed); $azbaremspeed = test_data_is_up2date3($azbaremt,$azbaremspeed); $deylamanspeed = test_data_is_up2date3($deylamant,$deylamanspeed); $foumanspeed = test_data_is_up2date3($foumant,$foumanspeed); $jirandehspeed = test_data_is_up2date3($jirandeht,$jirandehspeed); $jirkoulspeed = test_data_is_up2date3($jirkoult,$jirkoulspeed); $kiashahrspeed = test_data_is_up2date3($kiashahrt,$kiashahrspeed); $lahijanspeed = test_data_is_up2date3($lahijant,$lahijanspeed); $manjilspeed = test_data_is_up2date3($manjilt,$manjilspeed); $masoulehspeed = test_data_is_up2date3($masouleht,$masoulehspeed); $roudbarspeed = test_data_is_up2date3($roudbart,$roudbarspeed); $roudsarspeed = test_data_is_up2date3($roudsart,$roudsarspeed); $taleshspeed = test_data_is_up2date3($talesht,$taleshspeed); $pilambaraspeed = test_data_is_up2date3($pilambarat,$pilambaraspeed); $lowshanspeed = test_data_is_up2date3($lowshant,$lowshanspeed); $rashtspeed = test_data_is_up2date3($rashtt,$rashtspeed); $asbevounispeed = test_data_is_up2date3($asbevounit,$asbevounispeed); $froudgahspeed = test_data_is_up2date3($froudgaht,$froudgahspeed); $rezvanshahrspeed = test_data_is_up2date3($rezvanshahrt,$rezvanshahrspeed); $somehsaraspeed = test_data_is_up2date3($somehsarat,$somehsaraspeed); $langarudspeed = test_data_is_up2date3($langarudt,$langarudspeed); $heyranspeed = test_data_is_up2date3($heyrant,$heyranspeed); } function find_cold_icon($pww, $stationtemp) { if (($pww == "00") or ($pww == "01") or ($pww == "02") or ($pww == "03") or ($pww == "clear") or ($pww == "nonww")) { if (($stationtemp != "") and ((int)$stationtemp < 1)){ return "cold"; }else { return $pww; } }else { return $pww; } } function findhumidity1($windhumidity_str,$station_code){ if (strpos($windhumidity_str, $station_code) !== false){ $station_code = substr($windhumidity_str,strpos($windhumidity_str,$station_code)+7,strlen($windhumidity_str)); $station_code = substr($station_code,0,strpos($station_code,"|")); }else { $station_code = ""; } return $station_code; } function findtemp1($windtemp_str,$station_code){ if (strpos($windtemp_str, $station_code) !== false){ $station_code = substr($windtemp_str,strpos($windtemp_str,$station_code)+7,strlen($windtemp_str)); $station_code = substr($station_code,0,strpos($station_code,"|")); if ((int)$station_code > 50) { $station_code = ""; } }else { $station_code = ""; } return $station_code; } function findspeed1($windspeed_str,$station_code){ if (strpos($windspeed_str, $station_code) !== false){ $station_code = substr($windspeed_str,strpos($windspeed_str,$station_code)+7,strlen($windspeed_str)); $station_code = substr($station_code,0,strpos($station_code,"|")); $station_code = round(((float)$station_code) * 3.6,1); }else { $station_code = ""; } return $station_code; } function test_data_is_up2date1($station_time,$station_temp){ $mydate = gmdate("YmdHi", strtotime('-1 hours')); if ($station_time != ""){ $station_time = str_replace("-","",$station_time); $station_time = str_replace("=","",$station_time); $station_time = str_replace(":","",$station_time); if (((float)$station_time <= (float)$mydate) or ((float)$station_temp < -30) or ((float)$station_temp > 60)) { $station_temp = ""; } } return $station_temp; } function test_data_is_up2date2($station_time,$station_temp){ $mydate = gmdate("YmdHi", strtotime('-1 hours')); if ($station_time != ""){ $station_time = str_replace("-","",$station_time); $station_time = str_replace("=","",$station_time); $station_time = str_replace(":","",$station_time); if (((float)$station_time <= (float)$mydate) or ((float)$station_temp < 3) or ((float)$station_temp > 100)) { $station_temp = ""; } } return $station_temp; } function test_data_is_up2date3($station_time,$station_temp){ $mydate = gmdate("YmdHi", strtotime('-1 hours')); if ($station_time != ""){ $station_time = str_replace("-","",$station_time); $station_time = str_replace("=","",$station_time); $station_time = str_replace(":","",$station_time); if (((float)$station_time <= (float)$mydate) or ((float)$station_temp < 0) or ((float)$station_temp > 120)) { $station_temp = ""; } } return $station_temp; } function findtime1($windtime_str,$station_code){ if (strpos($windtime_str, $station_code) !== false){ $station_code = substr($windtime_str,strpos($windtime_str,$station_code)+7,strlen($windtime_str)); $station_code = substr($station_code,0,strpos($station_code,"|")); }else { $station_code = ""; } return $station_code; } // ------------- پايان محاسبه داده ها برای ساعات شب ?>