<?php
include("config_mysite.php");
connect();
$id=strip_tags(mysql_real_escape_string($_GET['id']));
$select=mysql_query("select * from `programs` where `id`='$id'");
$row=mysql_fetch_array($select);
$page_title=$row['title'];
$current='view_program';
?>
<?php include('html/header.php');?>
<?php
echo '
<table width="100%">
<tr><td valign="top" style="color: #000; border-right: 1px solid #f0f0f0;border-left: 1px solid #f0f0f0; background: #f9f9f9;padding: 5px; width: 150px;">
'.nl2br($row['data']).'
</td><td valign="top">
<div id="view_program"><h1>'.$row['title'].'</h1>
<p>
<img src="'.$row['image'].'"/>
';
echo nl2br($row['description']);
?>
<br/><br/>
<br/>
<br/>
<?php
if($row['file'])
echo '<table width="150"><tr><td><div id="download"><a href="'.$row['file'].'">Download</a></div></td></tr></table>';
else
echo '<table width="150"><tr><td><div id="download"><a href="'.$row['url'].'" rel="nofollow">Download</a></div></td></tr></table>';
echo '
</td></tr></table>
';
?>
<div style="width: 95px; float: left;"><g:plusone href="<?php echo 'http://'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];?>" size="medium"></g:plusone></div>
<div style="width: 65px; float: left;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<fb:like href="<?php echo 'http://'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];?>" send="true" layout="button_count" width="30" show_faces="false" font="" style="float: left;"></fb:like>
<script src="https://apis.google.com/js/plusone.js" type="text/javascript"></script>
<br/>
<h3>See more</h3>
<ul>
<?php
$select=mysql_query("select `title`,`id` from `programs` order by rand() limit 10");
while($row=mysql_fetch_array($select))
{
echo '<li><a href="view_program.php?id='.$row['id'].'">'.$row['title'].'</a></li>';
}
?>
</ul>
<?php include('html/footer.php');?>