Mercurial > epgrec.yaz
annotate viewer.php @ 175:f68f63465a41 default tip
handles RecException instead of Exception
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Tue, 16 Apr 2013 15:24:02 +0900 |
parents | f40b6cc4c587 |
children |
rev | line source |
---|---|
1 | 1 <?php |
2 header("Expires: Thu, 01 Dec 1994 16:00:00 GMT"); | |
3 header("Last-Modified: ". gmdate("D, d M Y H:i:s"). " GMT"); | |
4 header("Cache-Control: no-cache, must-revalidate"); | |
5 header("Cache-Control: post-check=0, pre-check=0", false); | |
6 header("Pragma: no-cache"); | |
7 | |
8 | |
9 include_once("config.php"); | |
10 include_once(INSTALL_PATH . "/DBRecord.class.php" ); | |
11 include_once(INSTALL_PATH . "/reclib.php" ); | |
39
8965ef108821
change: modify all scripts for web base setting.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
12 include_once(INSTALL_PATH . "/Settings.class.php" ); |
8965ef108821
change: modify all scripts for web base setting.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
13 |
8965ef108821
change: modify all scripts for web base setting.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
14 $settings = Settings::factory(); |
1 | 15 |
16 if( ! isset( $_GET['reserve_id'] )) jdialog("予約番号が指定されていません", "recordedTable.php"); | |
17 $reserve_id = $_GET['reserve_id']; | |
18 | |
19 try{ | |
39
8965ef108821
change: modify all scripts for web base setting.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
20 $rrec = new DBRecord( RESERVE_TBL, "id", $reserve_id ); |
1 | 21 |
22 $start_time = toTimestamp($rrec->starttime); | |
23 $end_time = toTimestamp($rrec->endtime ); | |
39
8965ef108821
change: modify all scripts for web base setting.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
24 $duration = $end_time - $start_time + $settings->former_time; |
1 | 25 |
26 $dh = $duration / 3600; | |
27 $duration = $duration % 3600; | |
28 $dm = $duration / 60; | |
29 $duration = $duration % 60; | |
30 $ds = $duration; | |
31 | |
32 $title = htmlspecialchars(str_replace(array("\r\n","\r","\n"), '', $rrec->title),ENT_QUOTES); | |
33 $abstract = htmlspecialchars(str_replace(array("\r\n","\r","\n"), '', $rrec->description),ENT_QUOTES); | |
34 | |
35 header("Content-type: video/x-ms-asf; charset=\"UTF-8\""); | |
36 header('Content-Disposition: inline; filename="'.$rrec->path.'.asx"'); | |
37 echo "<ASX version = \"3.0\">"; | |
38 echo "<PARAM NAME = \"Encoding\" VALUE = \"UTF-8\" />"; | |
39 echo "<ENTRY>"; | |
59
f40b6cc4c587
change: viewer & stream
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
44
diff
changeset
|
40 if( ! $rrec->complete ) echo "<REF HREF=\"".$settings->install_url."/sendstream.php?reserve_id=".$rrec->id ."\" />"; |
44 | 41 echo "<REF HREF=\"".$settings->install_url.$settings->spool."/".$rrec->path ."\" />"; |
1 | 42 echo "<TITLE>".$title."</TITLE>"; |
43 echo "<ABSTRACT>".$abstract."</ABSTRACT>"; | |
44 echo "<DURATION VALUE="; | |
45 echo '"'.sprintf( "%02d:%02d:%02d",$dh, $dm, $ds ).'" />'; | |
46 echo "</ENTRY>"; | |
47 echo "</ASX>"; | |
48 } | |
49 catch(exception $e ) { | |
50 exit( $e->getMessage() ); | |
51 } | |
59
f40b6cc4c587
change: viewer & stream
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
44
diff
changeset
|
52 ?> |