﻿<%@LANGUAGE=VBScript %>
<%option explicit
On error resume next 
Dim fso,spath,sDir,Desc,Title,Speaker,ThisDir,File,arry(100)
Dim sFullName, sLocation_Date, sSource, sNote, sLine, sSummary
Dim objFile, FileSize
Dim Tmp,n,m,p, linenum, st
Const ForWriting = 2
Const ForReading = 1
Set fso = CreateObject("Scripting.FileSystemObject")
'sDir = Request.QueryString("dir))
sDir = "\audio\ThanhTu\GiacNgoVaGiaiThoat"
spath=Server.MapPath("\") & "\" & sDir & "\"
'response.write (spath)

'''''''''''''''''''''''''''''''''''''''''''''
'  read description files
'''''''''''''''''''''''''''''''''''''''''''''
Set Desc = fso.OpenTextFile(sPath & "desc.txt",ForReading)
linenum=1
Title = ""
Speaker = ""
sLocation_Date = ""
sSource = ""
sNote = ""
sSummary = ""
st = 0 ' set st to @name
Do While Not Desc.AtEndOfStream
    sLine = Trim(Desc.ReadLine)
	
'
	
	if Mid(sLine,1,1) <> "!" then
		if (Instr(sLine,"@name")) > 0 then
			st = 1
		elseif 	(Instr(sLine,"@author")) > 0 then
			st = 2	
		elseif 	(Instr(sLine,"@location")) > 0 then
			st = 3
		elseif 	(Instr(sLine,"@note")) > 0 then
			st = 4
		elseif 	(Instr(sLine,"@source")) > 0 then	
			st = 5
		elseif 	(Instr(sLine,"@summary")) > 0 then	
			st = 6		
		end if
		'
		
		if Mid(sLine,1,1) <> "@" then
			
			
			Select case st 
				Case 1
					Title = Title & sLine		
				Case 2
					Speaker = Speaker & sLine	
				Case 3
					sLocation_Date = sLocation_Date & sLine	
				Case 4
					sNote = sNote & sLine
				Case 5
					sSource = sSource & sLine 			
				Case 6
					sSummary = sSummary & sLine	
			 end select		
		 end if
	end if 'not a comment line	
Loop

Desc.Close

'Response.write("Speaker=" & Speaker & "<br>")
'Response.write("Title=" & Title & "<br>")
'Response.write("Location=" & sLocation_Date & "<br>")
'Response.write("Note=" & sNote & "<br>")
'Response.write("Source=" & sSource & "<br>") 
'''''''''''''''''''''''''''''''''''''''''''''
' end read description files
'''''''''''''''''''''''''''''''''''''''''''''

%>
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8">
<META HTTP-EQUIV="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT">
<title><%=Title%></title>
</head>
<style>
A:link {
	COLOR: WHITE; TEXT-DECORATION: none
}
A:visited {
	COLOR: BLACK; TEXT-DECORATION: none
}
</style>
<BODY bgColor=#ffffff>
<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="743" id="AutoNumber1" height="130">
    <tr>
      <td bgcolor="#FFFFFF" align="center" width="95" height="60">

      <a href="/index.html">
      <img border="0" src="thuyetphap/images/home.gif" width="85" height="26" align="left"></a></td>
      <td bgcolor="#FFFFFF" align="center" width="545" height="60"><b>
      <font color="#008000" style="font-size: 20pt">DANH MỤC THUYẾT PHÁP<br>
      </font>
      <font color="#008000" style="font-size: 11pt">THIỀN TÔNG VIỆT NAM</font></b></td>

      <td bgcolor="#FFFFFF" align="center" width="103" height="60">
      <a href="/thuyetphap.htm">
      <img border="0" src="thuyetphap/images/thuyetphap.gif" width="98" height="26"></a></td>
    </tr>
    <tr>
      <td bgcolor="#800080" align="center" width="95" height="1" dir="ltr">
      <img border="0" src="file:///C|/images/1x1.gif" width="1" height="1"></td>
      <td bgcolor="#800080" align="center" width="545" height="1" dir="ltr">
      <img border="0" src="file:///C|/images/1x1.gif" width="1" height="1"></td>

      <td bgcolor="#800080" align="center" width="103" height="1" dir="ltr">
      <img border="0" src="file:///C|/images/1x1.gif" width="1" height="2"></td>
    </tr>
    <tr>
      <td bgcolor="#FFFFFF" align="center" width="743" height="71" colspan="3" dir="ltr">
        <p align="center" style="margin-top: 10; margin-bottom: 3" dir="ltr"><b>
        <font face="Times New Roman" style="font-size: 20pt" color="#800080"><%=Title%></font></b></p>
        <p align="center" style="margin-top: 3; margin-bottom: 3" dir="ltr"><b>
        <font face="Times New Roman" size="4" color="#000080"><%=sLocation_Date%> </font></b></p>
        <p style="margin-top: 2; margin-bottom: 10" align="center" dir="ltr"><b>
        <font face="Times New Roman" color="#800000" style="font-size: 11pt"><%=Speaker%></font></b></td>
    </tr>
    </table>
  </center>
</div>
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="743" id="AutoNumber1" height="34">
  <tr>
    <td width="51%" height="146" valign="top">

    <div align="center">
      <center>
    <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#808080" width="743" id="AutoNumber2" height="134">
      <tr>
        <td width="33%" align="center" valign="top" height="21">
        <p style="margin-top: 3; margin-bottom: 3"><b>
        <font size="2">TRACK</font></b></td>
<!--
        <td width="19%" align="center" valign="top" height="21">
        <p style="margin-top: 3; margin-bottom: 3"><b>
        <font size="2">THỜI GIAN</font></b></td>
-->        
        <td width="18%" align="center" valign="top" height="21">
        <p style="margin-top: 3; margin-bottom: 3"><b>
        <font size="2">DUNG LƯỢNG</font></b></td>
        <td width="15%" align="center" valign="top" height="21">

        <p style="margin-top: 3; margin-bottom: 3"><b>
        <font size="2">NGHE PHÁP</font></b></td>
      </tr>
<%
Set ThisDir = fso.GetFolder(spath)
n=1
For each objFile in ThisDir.Files
  Tmp=ucase(right(objFile.name,4))
  If Tmp=".MP3" Then
%>
<tr>
        <td width="33%" align="center" valign="top" height="25">
        <p style="margin-top: 6; margin-bottom: 3">Track 01</td>
<!--        
        <td width="19%" align="center" valign="top" height="25">
        <p style="margin-top: 3; margin-bottom: 3">15:04</td>
-->        
        <td width="18%" align="center" valign="top" height="25">
        <p style="margin-top: 3; margin-bottom: 3"><%=FormatNumber(objFile.Size/(1024*1024),2)%>&nbsp;MB</td>
        <td width="15%" align="center" valign="top" height="25">
        <p style="margin-top: 5; margin-bottom: 3">
        <a href=" <%=sDir & "\" & objFile.name %>">&lt;&lt;<img border="0" src="thuyetphap/images/play.gif" width="15" 			height="15">&gt;&gt;</a></td>
      </tr>
	<%end if%>
<%Next%>

      </table>
      </center>
    </div>
    </td>
  </tr>
  </table>
</center>
<P align=justify></P>
<P align=justify></P>

<P align=justify></P>

<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="743" id="AutoNumber2" height="56" bgcolor="#FFFFFF" dir="ltr">
    <tr>
      <td height="31" width="743" bgcolor="#FFFFFF" align="center" colspan="3" dir="ltr">

<P align=left dir="ltr"><%=sNote%></P>

      </td>
    </tr>
    <tr>
      <td height="31" width="743" bgcolor="#FFFFFF" align="center" colspan="3" dir="ltr">

<P align=right dir="ltr"><i><font color="#000080"><b>
<%=sSource%></b></font>.</i></P>

      </td>
    </tr>
    <tr>
      <td height="2" width="28" bgcolor="#800080" align="center" dir="ltr">
      <img border="0" src="file:///C|/images/1x1.gif" width="1" height="1"></td>
      <td height="2" width="692" bgcolor="#800080" align="center" dir="ltr">
      <img border="0" src="file:///C|/images/1x1.gif" width="1" height="1"></td>
      <td height="2" width="23" bgcolor="#800080" align="center" dir="ltr">
      <img border="0" src="file:///C|/images/1x1.gif" width="1" height="1"></td>

    </tr>
    <tr>
      <td width="28" bgcolor="#FFFFFF" align="center" height="20" dir="ltr">&nbsp;</td>
      <td width="692" bgcolor="#FFFFFF" align="center" height="20" dir="ltr">
      <font color="#008000" style="font-size: 11pt">
      <span style="font-weight: 700">THI&#7872;N TÔNG VI&#7878;T NAM</span></font></td>
      <td width="23" bgcolor="#FFFFFF" align="center" height="20" dir="ltr">

      <a href="file:///C|/Dev/index.html">
      <img border="0" src="file:///C|/images/top2.gif" width="22" height="24"></a></td>
    </tr>
    <tr>
      <td height="2" width="28" bgcolor="#800080" align="center" dir="ltr">
      <img border="0" src="file:///C|/images/1x1.gif" width="1" height="1"></td>
      <td height="2" width="692" bgcolor="#800080" align="center" dir="ltr">
      <img border="0" src="file:///C|/images/1x1.gif" width="1" height="1"></td>
      <td height="2" width="23" bgcolor="#800080" align="center" dir="ltr">

      <img border="0" src="file:///C|/images/1x1.gif" width="1" height="1"></td>
    </tr>
  </table>
  </center>
</div>

</BODY></HTML>
