Mercurial > epgrec.yaz
diff viewer.php @ 1:f5a9f0eb4858
deleted: LICENSE.ja
author | Sushi-k <epgrec@park.mda.or.jp> |
---|---|
date | Wed, 08 Jul 2009 11:44:50 +0900 |
parents | |
children | 8965ef108821 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/viewer.php Wed Jul 08 11:44:50 2009 +0900 @@ -0,0 +1,49 @@ +<?php +header("Expires: Thu, 01 Dec 1994 16:00:00 GMT"); +header("Last-Modified: ". gmdate("D, d M Y H:i:s"). " GMT"); +header("Cache-Control: no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + + +include_once("config.php"); +include_once(INSTALL_PATH . "/DBRecord.class.php" ); +include_once(INSTALL_PATH . "/reclib.php" ); + +if( ! isset( $_GET['reserve_id'] )) jdialog("予約番号が指定されていません", "recordedTable.php"); +$reserve_id = $_GET['reserve_id']; + +try{ + $rrec = new DBRecord( TBL_PREFIX.RESERVE_TBL, "id", $reserve_id ); + + $start_time = toTimestamp($rrec->starttime); + $end_time = toTimestamp($rrec->endtime ); + $duration = $end_time - $start_time + FORMER_TIME; + + $dh = $duration / 3600; + $duration = $duration % 3600; + $dm = $duration / 60; + $duration = $duration % 60; + $ds = $duration; + + $title = htmlspecialchars(str_replace(array("\r\n","\r","\n"), '', $rrec->title),ENT_QUOTES); + $abstract = htmlspecialchars(str_replace(array("\r\n","\r","\n"), '', $rrec->description),ENT_QUOTES); + + header("Content-type: video/x-ms-asf; charset=\"UTF-8\""); + header('Content-Disposition: inline; filename="'.$rrec->path.'.asx"'); + echo "<ASX version = \"3.0\">"; + echo "<PARAM NAME = \"Encoding\" VALUE = \"UTF-8\" />"; + echo "<ENTRY>"; + echo "<REF HREF=\"".INSTALL_URL."/sendstream.php?reserve_id=".$rrec->id ."\" />"; + echo "<REF HREF=\"".INSTALL_URL.SPOOL."/".$rrec->path ."\" />"; + echo "<TITLE>".$title."</TITLE>"; + echo "<ABSTRACT>".$abstract."</ABSTRACT>"; + echo "<DURATION VALUE="; + echo '"'.sprintf( "%02d:%02d:%02d",$dh, $dm, $ds ).'" />'; + echo "</ENTRY>"; + echo "</ASX>"; +} +catch(exception $e ) { + exit( $e->getMessage() ); +} +?> \ No newline at end of file