6 #require "commonmysql.php";
7 require "channels.php";
8 require "programs.php";
13 dbg( "NonameTV" , $dconf );
17 // connect to main database
19 switch( $dconf['dbtype'] ){
21 $myc = sql_doconnect();
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
>
34 <body bgcolor
="#FFFFFF" text
="#000000">
41 if( $_REQUEST['id'] ) $channel_id = $_REQUEST['id'];
45 $chann = sql_findChannel( $myc , 'id' , $channel_id );
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'];
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'];
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 );
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";
84 $pdb = array_sort( $pdb , "start_time" );
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']);
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>";
110 // disconnect from main database
112 switch( $dconf['dbtype'] ){
114 sql_dodisconnect( $myc );