<?php
session_start
();
include(
"database_odbc.php");
include(
"func.php");
?>
<html><!-- #BeginTemplate "/Templates/template.dwt" -->
<head>
<!-- #BeginEditable "doctitle" --> 
<title>MusicWeb: Your Music. Your Way</title>
<!-- #EndEditable --> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="641" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td width="640"> 
      <table width="640" border="0" cellspacing="0" cellpadding="2" bgcolor="#8080C0">
        <tr> 
          <td width="338"><img src="studio2/images/musicweblogo2.gif" width="316" height="83"></td>
          <td width="294" valign="top"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="3" height="80">
              <tr align="right" valign="top"> 
                <td> 
                  <p><font face="Tahoma,Arial,Helvetica" size="2"><b><?php print date("F d, Y"); ?><br>
                    </b></font></p>
                  <p>&nbsp;</p>
                  </td>
              </tr>
              <tr align="right" valign="bottom"> 
                <td height="30"> 
                  <table border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td align="right"><a href="viewcart.php"><img src="studio2/images/view.gif" width="55" height="16" border="0"></a></td>
                      <td><img src="studio2/images/numitems.gif" width="111" height="13"></td>
                      <td><?php include("counter.php"); ?></td>
                    </tr>
                  </table>
                  
                </td>
              </tr>
            </table>
            
          </td>
        </tr>
      </table>
      <table width="640" border="0" cellspacing="0" cellpadding="0">
        <tr bgcolor="#000000"> 
          <td width="11%"><img src="studio2/images/spcr_1x1.gif" width="1" height="1"></td>
          <td width="89%"><img src="studio2/images/spcr_1x1.gif" width="1" height="1"></td>
        </tr>
        <tr> 
          <td width="11%" bgcolor="#008000"> 
            <p bgcolor="#0000CC"><font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif"><img src="studio2/images/cdcdover1.jpg" width="71" height="71"></font></p>
          </td>
          <td width="89%" bgcolor="#008000">
            <table width="100%" border="0" cellspacing="0" cellpadding="5">
              <tr>
                <td><font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif" bgcolor="#0000CC"><i><font size="2">Enjoy 
                  deep discounts on hundreds of songs from up-and-coming stars. 
                  Build $7.99 or $9.99 CDs, click on SPECIAL when you see it. 
                  The <b>MusicWeb</b> Clearance Sale ends May 1, 2002 at 11:59 
                  p.m. so buy your bargains today!</font></i></font></td>
              </tr>
            </table>
            <font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif" bgcolor="#0000CC"><i></i></font></td>
        </tr>
      </table>
      <table width="640" border="0" cellspacing="0" cellpadding="0">
        <tr bgcolor="#000000"> 
          <td width="125"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="5">
              <tr> 
                <td><img src="studio2/images/explore.gif" width="70" height="23"></td>
              </tr>
            </table>
          </td>
          <td width="4">&nbsp;</td>
          <td background="studio2/images/dashes.gif" width="1"><img src="studio2/images/spcr_1x1.gif"></td>
          <td width="5">&nbsp;</td>
          <td width="505"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="5">
              <tr> 
                <td> 
                  <div align="right"><img src="studio2/images/musicnews.gif" width="108" height="23"></div>
                </td>
              </tr>
            </table>
          </td>
        </tr>
        <tr> 
          <td width="125" valign="top" bgcolor="#CCCCCC"><?php toc(); ?></td>
          <td width="4" bgcolor="#CCCCCC">&nbsp;</td>
          <td background="studio2/images/dashes.gif" width="1"><img src="studio2/images/spcr_1x1.gif"></td>
          <td width="5" >&nbsp;</td>
          <td width="505" valign="top"> <!-- #BeginEditable "content" -->
<?php
# See prodlist.php for description of what happens in this function.

function productDescription($pd
{
     global 
$REQUEST_URI$notify;

    
$sql "SELECT * FROM Song, Artist, Collection WHERE Song.SongTitle= '".str_replace("_"," ",$pd). 
           
"' AND Song.SongTitle = Collection.SongTitle AND Artist.ArtistName = Collection.ArtistName"
           
       
$result db_query($sql);
    if(!
$result
    { 
        return 
FALSE
    }else {
        while(
odbc_fetch_row($result)) 
        {
            
$title odbc_result($result,"SongTitle");            
            
$id str_replace(" ","_",$title);
            
$price odbc_result($result,"SongPrice"); 
            
$aname odbc_result($result,"ArtistName");             
            
$oartist odbc_result($result,"OriginalArtist");            
            
$slength odbc_result($result,"SongLength");
            
$rating odbc_result($result,"SongRating");                        

            print 
'<br><h1>'.$notify.'</h1><h1>'.$title.'</h1>'.
                  
'<p><b>Artist Name:</b> '.$aname.'<br>'.
                  
'<b>Product #</b> '.$id.'</p>';
            print 
'<p><b>Original Artist:</b> '.$oartist.'<br>'.
                  
'<b>Song Length (mins):</b> '.$slength.'<br>'.
                  
'<b>Song Rating:</b> '.$rating.' (<a href="/">What this means?</a>)</p>'
                           
            print 
'<p><b>Song Description:</b> </p>';
            
            print 
'<b>Price:</b> $'.number_format($price,2,".",",");
            print 
'<form method="POST" action="'.$REQUEST_URI.'">'.
                  
'<input type="hidden" name="ProductID" value="'.$id.'">'.
                  
'<input type="submit" name="addtocart" value="Add to Cart"></form>';
        }       
        return 
TRUE;        
    }        
}
productDescription($song);

?>
<!-- #EndEditable --> 
            <p>&nbsp;</p>
          </td>
        </tr>
      </table>
      <table width="640" border="0" cellspacing="0" cellpadding="5">
        <tr bgcolor="#008000"> 
          <td>&nbsp; </td>
        </tr>
        <tr> 
          <td> 
            <p><font size="2">&copy; MusicWeb, a Rensselaer Polytechnic Institute 
              Company.<br>
              MusicWeb and related marks are trademarks of Rensselaer Polytechnic 
              Institute. ALL RIGHTS RESERVED</font> </p>
          </td>
        </tr>
      </table>
    </td>
    <td background="studio2/images/dashes.gif" width="1"><img src="studio2/images/spcr_1x1.gif" width="1" height="1"></td>
  </tr>
  <tr>
    <td width="640" background="studio2/images/hdashes.gif"><img src="studio2/images/spcr_1x1.gif" width="1" height="1"></td>
    <td background="studio2/images/dashes.gif" width="1"><img src="studio2/images/spcr_1x1.gif" width="1" height="1"></td>
  </tr>
</table>
</body>
<!-- #EndTemplate --></html>