<!-- #INCLUDE VIRTUAL="/_includes/functions.asp"-->
<!-- #INCLUDE VIRTUAL="/_includes/isadmin.asp"-->
<%
'-----------------------------------------------------------------
'--Page info
'-----------------------------------------------------------------
PAGE_NAME = "Broadcaster"
PAGE_NAME_S = "Broadcasters"

Set DB = New clsDatabase
	DB.OpenDatabase DATABASE_NAME , DATABASE_USERNAME , DATABASE_PASSWORD

	strQuery = "SELECT id, name, logo FROM library_broadcasters ORDER BY id, name"

	'------------------------------------
	'--select records
	'------------------------------------
	numOfRecords = DB.RunQuery(strQuery) - 1


	If numOfRecords > -1 Then retRecords = DB.GetLastResults()

Set DB = Nothing
%>
<HTML>
<HEAD>
		<script language="javascript">
			function delete_item(id){
				if(confirm('Are you sure you want to delete this item?\nALL ASSOCIATED RECORDS WILL BE DELETED!')){
					document.location='delete.asp?ID='+id;
				}
			}
		</script>
		<link href="/_cms/style.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY bgcolor="#FFFFFF" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
<FORM ACTION="index.asp" method="POST">
<CENTER><TABLE WIDTH="100%" border="0">
	<TR>
		<TD colspan="4" align="center"><BR><font class="txtPageHdr">Managing <%=PAGE_NAME_S%></font><font class="txtReg"><BR><BR></font></td>
	</TR>
</TABLE>
<%
If numOfRecords < 0 Then
	Response.Write "<table width=""90%"" border=""0"" cellspacing=""0"" cellpadding=""0"">" & _
	"<tr>" & _
	"	<td width=""100%"" valign=""middle"" align=""center""><FONT class=""txtReg""><BR>None at the moment!</font></td>" & _
	"</table>"

	orderButtonState = " disabled"
Else
	If numOfRecords < 1 Then orderButtonState = " disabled"

	For x=0 To numOfRecords

		Response.Write "<table width=""90%"" border=""0"" cellspacing=""0"" cellpadding=""0"">"

		If x MOD 2 = 0 Then
			trClass = "NormalRow"
		Else
			trClass = "AlternatRow"
		End If

		If retRecords(2,x) <> "" Then
			img = BROADCASTER_IMAGE_PATH & retRecords(2,x)
		Else
			img = "/_cms/images/spacer.gif"
		End If		

		Response.Write "<tr class=""" & trClass & """ onMouseOver=""this.className='MouseOverRow';"" onMouseOut=""this.className='" & trClass & "';"">" & _
		"<td width=""1%""><img src=""" & img & """ border=""0"" width=""15"" height=""15"" vspace=""2"" /></td>" & _
		"<td width=""25%""><FONT class=""txtReg""><B>&nbsp;" & retRecords(1,x) & "</b></font></td>" & _
		"<td width=""74%"" align=""right"" ><FONT class=""txtReg"">" & _
		"<a class=lnkNormal href=""edit.asp?ID=" & retRecords(0,x) & """><img src=""/_cms/images/icons/edit.gif"" width=""12"" height=""12"" border=""0"" hspace=""1"" vspace=""0"" align=""absmiddle"">Edit Info</a>&nbsp;|&nbsp;" & _
		"<a class=lnkNormal href="""" onClick=""delete_item(" & retRecords(0,x) & ");return false;""><img src=""/_cms/images/icons/delete.gif"" width=""12"" height=""12"" border=""0"" hspace=""1"" vspace=""0"" align=""absmiddle"">Delete</a>&nbsp;" & _
		"</font></td></tr>"

	Next
	Response.write "</table>"
End If
%>
<TABLE WIDTH="100%" align="center" border="0">
	<TR>
		<TD colspan="2" align="center"><BR><!-- <INPUT TYPE="button" NAME="action" VALUE="<%=PAGE_NAME_S%> Ordering" <%=orderButtonState%> onClick="document.location='order.asp';">&nbsp;&nbsp;&nbsp; --><INPUT TYPE="button" NAME="action" VALUE="Add <%=PAGE_NAME_S%>" onClick="document.location='add.asp';"><br><br></TD>
	</TR>
</TABLE>
</FORM>
</CENTER>
</body>
</HTML>