#!/usr/bin/perl

require "common.conf";
require "$basePath/cgi-lib.pl";
require "$basePath/alllib.cgi";

use DBI;
#my $dbh =DBI->connect("DBI:$sqltype:database=$dbname;host=$hostname",$dbuser,$dbpassword);
my $dbh =DBI->connect("DBI:$sqltype:database=$mysqldbname;host=$mysqlhost",$mysqlusername,$mysqlpasssword);
use CGI;
my $query = new CGI;
$id = $query->param("id");

$cnt=0;
my $qry="select * from news where newsid = $id";
my $tableData=$dbh->prepare($qry);
$tableData->execute;
my(@data)=$tableData->fetchrow_array;

$desc = $data[2];
$desc =~ s/\n/\<br\>/g;
$images = $data[4];
@imageArray = split(",",$images);


&ReadParse(*gotData);
print &PrintHeader;
showMain();


sub showMain
{
print<<_HTML;

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>www.yourgolfguru.com</title>
<link rel='stylesheet' href='stylesheet.css' type='text/css'>
<style type="text/css">
<!--
body {
	background-image: url(images/bg3.gif);
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {color: #9FB73B}
.style4 {	color: #E9680A;
	font-weight: bold;
}
.style5 {color: #9FB73B; font-weight: bold; }
-->
</style>
<script>
function OpenBrWindow(popurl,winname,winvar){
winpops=window.open(popurl,"",winvar)
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<body>

  <table width="734" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
    <tr>
      <td colspan="2"><div align="center">
          <table width="100" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td><img src="images/banner1.gif" width="254" height="164" border="0" usemap="#Map" /></td>
              <td><img src="images/banner.gif" width="245" height="164" /></td>
              <td><img src="images/free.gif" width="235" height="164" border="0" usemap="#Map2" /></td>
            </tr>
          </table>
      </div></td>
    </tr>
    <tr>
      <td colspan="2">
	  <table width="734" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="196"><img src="images/gap.gif" width="196" height="22" /></td>
            <td width="101"><img src="images/ball.gif" width="104" height="22" /></td>
            <td width="437" bgcolor="#000000"><div align="center"><a href="index.htm" class="showcase">Home</a> <span class="style1">|</span> <a href="about.htm" class="showcase">About me</a> <span class="style1">|</span><a href="updates.htm" class="showcase"> Tiger Watch</a> <span class="style1">|</span> <a href="feedback.htm" class="showcase">Feedback</a> <span class="style1">|</span> <a href="research.htm" class="showcase">Research Papers</a></div></td>
          </tr>
      </table>
	  </td>
    </tr>
	<tr>
	  <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/tiger_watch.gif"></td>
	 </tr>
    <tr>
      <td><br/>
		<table width="500" border="0" cellspacing="0" cellpadding="4" align="center">
			<tr>
				<td>&nbsp;&nbsp;</td>
				<td>
					<p align="center"><font face="Arial, Helvetica, sans-serif" size="2" color="#355871"><b>$data[0]</b>
					</p>
	  
						<font face="Arial, Helvetica, sans-serif" size="2" color="#355871">
						<p align="justify">$desc</p></font>	
				</td>
			</tr>
			<tr>
				<td>&nbsp;&nbsp;</td>
				<td>
_HTML
				if ($images ne "") {
					foreach (@imageArray){
						print "<image src='/news/images/".$_."' hspace=10>&nbsp;";
					}
				}
print<<_HTML;

				</td>
			</tr>
		</table>
	</td>
</tr>

<tr>
      <td width="225" height="20">&nbsp;</td>
      <td width="509">&nbsp;</td>
    </tr>
    <tr bgcolor="#A0B83B">
      <td colspan="2">
	<div align="center"><a href="index.htm" class="showcase8">Home</a> | <a href="about.htm" class="showcase8">About me</a> | <a href="updates.htm" class="showcase8">Tiger Watch </a>|<a href="feedback.htm" class="showcase8"> Feedback</a> | <a href="research.htm" class="showcase8">Research Papers</a>
	</div>
	</td>
   </tr>

</table>
</div >


<map name="Map">
  <area shape="rect" coords="7,44,146,158" href="logo.htm">
</map>
<map name="Map2">
  <area shape="rect" coords="15,25,116,50" href="fswing.htm">
  <area shape="rect" coords="118,26,220,51" href="sgame.htm">
</map>
</body>
</html>
_HTML
}