<!doctype html public "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<title>GiantDisc Web Interface: Update Track Details</title>
<link href="gdweb.css" rel="stylesheet" type="text/css">
</head>
<body>

<h5>GiantDisc Web Interface</h5>
<h2>Update Track Details</h2>

<table border="0">
<tr>
<td class="plformtit">Artist</td>
<td class="plform"> <?echo $artist ?>
</td></tr>

<tr>
<td class="plformtit">Title</td>
<td class="plform"> <?echo $title  ?>
</td></tr>

<tr>
<td class="plformtit">Genre</td>
<td class="plform"> <? echo $genre1 ?>, <? echo $genre2 ?>
</td></tr>

<tr>
<td class="plformtit">Year</td>
<td class="plform"><?echo $year ?>
</tr>

<tr>
<td class="plformtit">Beats</td>
<td class="plform"><?echo $bpm  ?>
</td>
</tr>

<tr>
<td class="plformtit">Language</td>
<td class="plform"> <? echo $lang ?>
</td>
</tr>

<tr>
<td class="plformtit">Type</td>
<td class="plform"> <? echo ($type-1) ?>
</td>
</tr>

<tr>
<td class="plformtit">Rating</td>
<td class="plform"><? echo $rating ?>
</td>
</tr>

<tr>
<td class="plformtit">Source</td>
<td class="plform"><? echo ($source-1) ?>
</td>
</tr>

<tr>
<td class="plformtit">Sourceid</td>
<td class="plform"><? echo $sourceid ?>
</td>
</tr>

<tr>
<td class="plformtit">Condition</td>
<td class="plform"> <? echo ($condition) ?>
</td>
</tr>

<tr>
<td class="plformtit">Tracknum</td>
<td class="plform"><?echo $tracknb?>
</td>
</tr>

<tr>
<td class="plformtit">Length</td>
<td class="plform"><?echo $length?>
</td>
</tr>

<tr>
<td class="plformtit">mp3file</td>
<td class="plform"><?echo $mp3file?>
</td>
</tr>

<tr>
<td class="plformtit">voladjust</td>
<td class="plform"><?echo $voladjust?>
</td>
</tr>

<tr>
<td class="plformtit">lengthfrm</td>
<td class="plform"><?echo $lengthfrm?>
</td>
</tr>

<tr>
<td class="plformtit">startfrm</td>
<td class="plform"><?echo $startfrm?>
</td>
</tr>

<tr>
<td class="plformtit">created</td>
<td class="plform"><?echo $created?>
</td>
</tr>

<tr>
<td class="plformtit">ID</td>
<td class="plform"><?echo $id?>
</td>
</tr>

<tr>
<td class="plformtit" style="vertical-align: top;">Lyrics</td>
<td colspan="3" class="plform"><pre><?echo $lyrics?></pre>
</td></tr>

</table>


<? 


if(isset($id)){
  # open data source
  $ds = mysql_connect();	

  $sqlcmd= "UPDATE tracks SET "
          ."artist='$artist', title='$title', genre1='$genre1', genre2='$genre2', "
		  ."year=$year, lang='$lang', type=".($type-1).", rating=$rating, "
          ."length=$length, source=".($source-1).", sourceid='$sourceid', tracknb=$tracknb, "
		  ."mp3file='$mp3file', condition=$condition, voladjust=$voladjust, "
		  ."lengthfrm=$lengthfrm, startfrm=$startfrm, bpm=$bpm, lyrics='$lyrics', "
		  ."created='$created', modified=CURDATE() "
		  ."WHERE id=$id";

  print ("SQL-COMMAND: ". $sqlcmd);

  if(! mysql_db_query ("GiantDisc", $sqlcmd)){
    echo "<p><b>Error: </b>".mysql_errno()." - ".mysql_error()."<br>";
  }
  else{
    echo "<p><b>Record sucessfully updated</b><br>\n";
  }

}
?>



<? 
?>
</body>
</html>