Thứ Tư, 29 tháng 8, 2012

Block Thời tiết + tỷ giá



Link Images

 http://www.mediafire.com/?1pjcn0qi4dej68i
 Chi tiết function


function getboxWeather()
{
/*box 1*/
$content= "<br /><div class=\"box-item\">
    <div class=\"list-item-header fl\">


        <div class=\"fl\"><img src=\"".INCLUDE_PATH."themes/kttnews/images/folder-activeleft2.gif\" alt=\"\" /></div>
        <div class=\"folder-active2 fl\">
        <b>Thời tiết</b>
        </div>
        <div class=\"fl\"><img src=\"".INCLUDE_PATH."themes/kttnews/images/folder-activeright2.gif\" alt=\"\" /></div>
        <div class=\"fr\"><img src=\"".INCLUDE_PATH."themes/kttnews/images/folder-topright.gif\" alt=\"\" /></div>
    </div>
    <div class=\"box-middle1 list-item1 fl\" id=\"ListItem60\">";
    $content.="<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
  <tr>
    <td valign=\"top\" style=\"border-right:1px solid #F2F2F2\">";
    $hn = weather('VMXX0006', 'c');
    $content.="<table cellpadding=\"2\" cellspacing=\"4\">\n";
    $content.="<tr><td colspan=\"2\"><b>Hà nội</b></td></tr>\n";
    if(isset($hn[0]['temp']))
    {
        $content.="<tr><td><img src=\"i/".$hn[0]['image']."\" border=\"0\"/></td><td><b>".$hn[0]['temp']."</b></td></tr>\n";
    }
   
    $hue = weather('VMXX0009', 'c');
   
    $content.="<tr><td colspan=\"2\"><b>Huế</b></td></tr>\n";
    if(isset($hue[0]['temp']))
    {
        $content.="<tr><td><img src=\"i/".$hue[0]['image']."\" border=\"0\"/></td><td><b>".$hue[0]['temp']."</b></td></tr>\n";
    }
   
    $day=array();
    $day = weather('VMXX0007', 'c');
   
    $content.="<tr><td colspan=\"2\"><b>TP.HCM</b></td></tr>\n";
    if(isset($day[0]['temp']))
    {
        $content.="<tr><td><img src=\"i/".$day[0]['image']."\" border=\"0\"/></td><td><b>".$day[0]['temp']."</b></td></tr>\n";
    }
       
   
    $content.="</table>\n";
   
    $content.="<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
  <tr><tr><td colspan=\"2\"><span class=\"uilsource\">(Nguồn: weather.yahoo.com)</spam></td></tr></table>\n";
    $content.="</td>
    <td valign=\"top\" style=\"padding-left:10px;\">";
    $content.="<script type=\"text/javascript\">";
$content.= @file_get_contents('http://www.vnexpress.net/Service/Gold_Content.js');

$content.= "
if (typeof(vGoldBuy) !='undefined' && typeof(vGoldSell) !='undefined')
{

document.writeln('<table width=\"100%\" border=\"0\" cellspacing=\"5\" cellpadding=\"5\">');
document.writeln('<tr><td colspan=\"2\"><b>Giá vàng 9999</b></td></tr>');
document.writeln('<tr><td>Bán:</td><td>'+vGoldBuy+'</td></tr>');
document.writeln('<tr><td>Mua:</td><td>'+vGoldSell+'</td></tr>');

document.writeln('<tr><td colspan=\"2\"><span class=\"uilsource\">(Nguồn: Cty SJC Hà Nội)</spam></td></tr>');

  document.writeln('</table>');
}

</script>";
        $content.="<script type=\"text/javascript\">";
$content.= @file_get_contents('http://vnexpress.net/Service/Forex_Content.js');


$content.= "
if (typeof(vForexs) !='undefined' && typeof(vCosts) !='undefined')
{


document.writeln('<table width=\"100%\" border=\"0\" cellspacing=\"5\" cellpadding=\"5\">');
document.writeln('<tr><td colspan=\"2\" height=\"1\" bgcolor=\"#F2F2F2\"></td></tr>');
document.writeln('<tr><td colspan=\"2\"><b>Tỉ giá</b></td></tr>');
document.writeln('<tr><td>'+ vForexs[0]+'</td><td>'+vCosts[0]+'</td></tr>');
document.writeln('<tr><td>'+ vForexs[10]+'</td><td>'+vCosts[10]+'</td></tr>');
document.writeln('<tr><td>'+ vForexs[6]+'</td><td>'+vCosts[6]+'</td></tr>');
document.writeln('<tr><td>'+ vForexs[7]+'</td><td>'+vCosts[7]+'</td></tr>');

document.writeln('<tr><td colspan=\"2\"><span class=\"uilsource\">(Nguồn Eximbank)</spam></td></tr>');

 
 
  document.writeln('</table>');
}

</script>";
       
$content.="</td>
  </tr>
</table></div>
    <div class=\"fl\">
        <div class=\"fl\"><img src=\"".INCLUDE_PATH."themes/kttnews/images/box-bottomleft1.gif\" alt=\"\" /></div>
        <div class=\"box-bottomcenter1 fl\">&nbsp;</div>
        <div class=\"fl\"><img src=\"".INCLUDE_PATH."themes/kttnews/images/box-bottomright1.gif\" alt=\"\" /></div>
    </div>
</div>";

return $content;

}

Không có nhận xét nào: