Augmenter: hook Augmenters into DataStore and enable augmenting for some Importers
[nonametv.git] / web-admin / nowonchannel.php
blobd3a17457ec0e9aa384080fc459229b41119037d3
1 <?php
3 require "config.php";
4 require "common.php";
5 require "mysql.php";
6 #require "commonmysql.php";
7 require "channels.php";
8 require "programs.php";
10 $debug=false;
12 if( $debug ){
13 dbg( "NonameTV" , $dconf );
17 // connect to main database
19 switch( $dconf['dbtype'] ){
20 case 'mysql':
21 $myc = sql_doconnect();
22 if( ! $myc ) exit;
23 break;
27 <html>
28 <head>
29 <title>Now on channel</title>
30 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
31 <link href="css/nonametv.css" rel=stylesheet>
32 </head>
34 <body bgcolor="#FFFFFF" text="#000000">
36 <?php
39 // main
41 if( $_REQUEST['id'] ) $channel_id = $_REQUEST['id'];
42 else {
45 $chann = sql_findChannel( $myc , 'id' , $channel_id );
47 if( $chann['logo'] ){
48 print "<img src=\"" . $dconf['urllogos'] . "/" . $chann['xmltvid'] . ".png\">\n";
50 print "<h1>Trenutno na " . $chann['display_name'] . " (" . $chann['xmltvid'] . ")</h1>\n";
52 if( $_REQUEST['time'] ) $fromtime = $_REQUEST['time'];
53 if( ! $fromtime ){
54 //$fromtime = time();
55 $fromtime = 1155647837;
57 //dbg("fromtime",$fromtime);
58 // find last 'timewidth' point before requested time
59 // as this is the actual starting time
60 $da = getdate($fromtime);
61 $da['minutes'] = (int)($da['minutes'] / $dconf['grantimebar']) * $dconf['grantimebar'];
62 $da['seconds'] = 0;
63 $fromtime = mktime ( $da['hours'] , $da['minutes'] , $da['seconds'] , $da['mon'] , $da['mday'] , $da['year'] );
66 $totime = $fromtime + ( $dconf['timewidth'] * 60 );
67 //dbg("fromtime",$fromtime);
68 //dbg("totime",$totime);
70 $pdb = extract_programs( $channel_id , $fromtime , $totime );
71 if( $debug ) dbg( "programs" , $pdb );
73 $pdb = fix_programs( $pdb , $fromtime , $totime );
76 if( $pdb ){
77 print "\n<!-- now showing table -->\n";
78 print "<table width=\"75%\" border=\"0\" cellpadding=\"4\" cellspacing=\"2\" class=\"nowshowing\">\n";
79 print "<tr class=\"tableMenuTitle\">\n";
80 print " <td class=\"tableMenuBody\">Time</td>\n";
81 print " <td class=\"tableMenuBody\">Program</td>\n";
82 print "</tr>\n";
84 $pdb = array_sort( $pdb , "start_time" );
86 reset( $pdb );
87 while( list( $chk , $chv ) = each( $pdb ) ){
89 print "<tr class=\"tableBody\">\n";
91 print " <td align=\"center\">\n";
92 print hmins($chv['start_time']) . " - " . hmins($chv['end_time']);
93 print " </td>\n";
95 $cellclass = cellclass_category( $chv , $chann['def_cat'] );
97 print "<td class=\"" . $cellclass . "\">";
98 if( $cellclass != "cat_hole" ) print "<a href=\"viewprogram.php?channel=" . $chv['channel_id'] . "&time=" . str2time($chv['start_time'], 0 ) . "\">";
99 print "<b>" . $chv['title'] . "</b>";
100 if( $cellclass != "cat_hole" ) print "</a>";
101 print "</td>\n";
103 print "</tr>\n";
106 print "</table>\n";
110 // disconnect from main database
112 switch( $dconf['dbtype'] ){
113 case 'mysql':
114 sql_dodisconnect( $myc );
115 break;
120 </body>
121 </html>