• 07-02-2015, 20:05:23
    #1
    merhaba arkadaşlar mgm.gov.tr sitesinden çektiğim hava durumu verilerini bir tabloya buradan bir arkadaş yardımıyla döktük ama css bir tabloya dökerken problem yaşıyoruz

    http://kardelentv.com.tr/havadurumu/ linkinde bulunan verileri



    şekilde ki gibi düzenlemem gerekiyor ama kafayı yemek üzereyim kodlar css ve php olarak aşağıdadır ücretli/ücretsiz yardım edebilecek olan varmı toplam 40 il var ama 5-6 tane il koyabilirseniz gerisini bende kopya çekerek yapabilirm :/

    PHP :

    <html>
    
    	<head>
    		<!-- Bring to you by http://www.CSSTableGenerator.com -->
    		<link rel="stylesheet" href="table.css" type="text/css"/>	
    	</head>
    <meta http-equiv="Content-Type" content="text/HTML; charset=utf-8" />
    	<body>
    	<div class="CSS_Table_Example" style="width:600px;height:150px;">
    	<table>
    <?php
    function baglan($veri) {
    	$ref="http://google.com.tr";
    	$uag="Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36";
    	$a=curl_init();
    	curl_setopt($a,CURLOPT_URL,$veri);
    	curl_setopt($a,CURLOPT_REFERER,$ref);
    	curl_setopt($a,CURLOPT_USERAGENT,$uag);
    	curl_setopt($a,CURLOPT_RETURNTRANSFER,true);
    	$b=curl_exec($a);
    	curl_close($a);
    	return $b;
    }
    $il=array('ERZURUM','ADANA','AMASYA','ANTALYA','ISTANBUL','SIVAS','CORUM');
    for($l=0;$l<=count($il)-1;$l++) {
    $a="http://mgm.gov.tr/tahmin/il-ve-ilceler.aspx?m=".$il[$l]."#sfB";
    $b=baglan($a); $c=explode('<div id="govde_ust_genis_icerik_sayfa">',$b); $c=explode('<div id="divSecim520Blok">',$c[1]); $c=$c[0];
    preg_match('#<h1 id="sfB" style="clear:both;">(.*?)<strong>(.*?)</strong></h1>#',$c,$a1); $a1=$a1[2]; // $a1 IL ISMI.
    $c1=explode('<tbody>',$c); $c1=explode('</tbody>',$c1[1]); $c1=$c1[0];
    preg_match_all('#<tr>(.*?)</tr>#si',$c1,$d);
    echo "
    	<tr> 
    					<td>
    			".$a1."
    					</td>
    					<td >
    						Derece
    					</td>
    					<td>
    						Hadise
    					</td>
    				</tr>
    ";
    for($i=0;$i<=count($d[1])-1;$i++) {
    	if($i==0) {$num="1";} if($i==1) {$num="2";} if($i==2) {$num="3";}
    	preg_match('#<th id="cp_sayfa_thmGun'.$num.'" class="(.*?)">(.*?)</th>#si',$d[1][$i],$gun); $gun=$gun[2]; // GÜN.
    	$gun1=explode(' ',$gun); $gun=$gun1[count($gun1)-1]; // BURADA EXPLODE BOÞLUK ÝLE AYIRDIK VE GELEN SON DEÐER OLAN GÜN ÝSMÝNÝ COUNT ÝLE ALDIK.
    	preg_match('#<td id="cp_sayfa_thmMax'.$num.'" class="(.*?)">(.*?)</td>#',$d[1][$i],$derece); $derece=$derece[2]; // MAX SICAKLIK DERECESI.
    	preg_match('#<img id="cp_sayfa_imgHadise'.$num.'" src="(.*?)" alt="(.*?)" /></td>#',$d[1][$i],$durum); $durum=$durum[2]; // HAVA DURUMU.
    	echo "
    <tr>
    <td>
    ".$gun."
    </td>
    <td>
    ".$derece."			
    </td>
    <td>
    ".$durum."	
    </td>
    </tr>
    	";
    	if($i==2) {break;}
    }
    }
    ?>			</table>
    		</div>
    	</body>
    	
    </html>
    Table.css:

    .CSS_Table_Example {
    	margin:0px;padding:0px;
    	width:100%;
    	box-shadow: 10px 10px 5px #888888;
    	border:1px solid #000000;
    	-moz-border-radius-bottomleft:9px;
    	-webkit-border-bottom-left-radius:9px;
    	border-bottom-left-radius:9px;
    	-moz-border-radius-bottomright:9px;
    	-webkit-border-bottom-right-radius:9px;
    	border-bottom-right-radius:9px;
    	-moz-border-radius-topright:9px;
    	-webkit-border-top-right-radius:9px;
    	border-top-right-radius:9px;
    	-moz-border-radius-topleft:9px;
    	-webkit-border-top-left-radius:9px;
    	border-top-left-radius:9px;
    }.CSS_Table_Example table{
    	width:100%;
    	height:100%;
    	margin:0px;padding:0px;
    }.CSS_Table_Example tr:last-child td:last-child {
    	-moz-border-radius-bottomright:9px;
    	-webkit-border-bottom-right-radius:9px;
    	border-bottom-right-radius:9px;
    }.CSS_Table_Example table tr:first-child td:first-child {
    	-moz-border-radius-topleft:9px;
    	-webkit-border-top-left-radius:9px;
    	border-top-left-radius:9px;
    }.CSS_Table_Example table tr:first-child td:last-child {
    	-moz-border-radius-topright:9px;
    	-webkit-border-top-right-radius:9px;
    	border-top-right-radius:9px;
    }.CSS_Table_Example tr:last-child td:first-child{
    	-moz-border-radius-bottomleft:9px;
    	-webkit-border-bottom-left-radius:9px;
    	border-bottom-left-radius:9px;
    }.CSS_Table_Example tr:hover td{
    	background-color:#82c0ff;
    	background:-o-linear-gradient(bottom, #82c0ff 5%, #56aaff 100%);	background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #82c0ff), color-stop(1, #56aaff) );
    	background:-moz-linear-gradient( center top, #82c0ff 5%, #56aaff 100% );
    	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#82c0ff", endColorstr="#56aaff");	background: -o-linear-gradient(top,#82c0ff,56aaff);
    }.CSS_Table_Example tr:first-child td{
    	background:-o-linear-gradient(bottom, #0069d3 5%, #007fff 100%);	background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #0069d3), color-stop(1, #007fff) );
    	background:-moz-linear-gradient( center top, #0069d3 5%, #007fff 100% );
    	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#0069d3", endColorstr="#007fff");	background: -o-linear-gradient(top,#0069d3,007fff);
    	background-color:#0069d3;
    	border:0px solid #000000;
    	text-align:center;
    	border-width:0px 0px 1px 1px;
    	font-size:18px;
    	font-family:Comic Sans MS;
    	font-weight:bold;
    	color:#ffffff;
    }.CSSTableGenerator tr:first-child:hover td{
    	background:-o-linear-gradient(bottom, #0069d3 5%, #007fff 100%);	background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #0069d3), color-stop(1, #007fff) );
    	background:-moz-linear-gradient( center top, #0069d3 5%, #007fff 100% );
    	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#0069d3", endColorstr="#007fff");	background: -o-linear-gradient(top,#0069d3,007fff);
    	background-color:#0069d3;
    }.CSS_Table_Example tr:first-child td:first-child{
    	border-width:0px 0px 1px 0px;
    }.CSS_Table_Example tr:first-child td:last-child{
    	border-width:0px 0px 1px 1px;
    }.CSS_Table_Example td{
    	background:-o-linear-gradient(bottom, #56aaff 5%, #82c0ff 100%);	background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #56aaff), color-stop(1, #82c0ff) ); 
    	background:-moz-linear-gradient( center top, #56aaff 5%, #82c0ff 100% );
    	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#56aaff", endColorstr="#82c0ff");	background: -o-linear-gradient(top,#56aaff,82c0ff);
    	background-color:#56aaff;
    	border:1px solid #000000;
    	border-width:0px 1px 1px 0px;
    	text-align:left;
    	padding:7px;
    	font-size:12px;
    	font-family:Comic Sans MS;
    	font-weight:bold;
    	color:#000000;
    }.CSS_Table_Example tr:last-child td{
    	border-width:0px 1px 0px 0px;
    }.CSS_Table_Example tr td:last-child{
    	border-width:0px 0px 1px 0px;
    }.CSS_Table_Example tr:last-child td:last-child{
    	border-width:0px 0px 0px 0px;
    }
  • 08-02-2015, 01:23:50
    #2
    yokmu yardım edecek olan birisi ücretli/ücretsiz