Augmenter: hook Augmenters into DataStore and enable augmenting for some Importers
[nonametv.git] / web-admin / listtses.php
blob04f06be71ea263704648102aae21023a13bc5865
1 <?php
3 require "config.php";
4 require "common.php";
5 require "mysql.php";
6 require "language.php";
7 require "epgservers.php";
8 require "networks.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;
26 $lngstr = loadlanguage( 'listtses' );
27 if( $debug ) dbg("language strings" , $lngstr );
30 <html>
31 <head>
32 <title>List EPG servers</title>
33 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
34 <link href="css/nonametv.css" rel=stylesheet>
35 </head>
37 <body bgcolor="#FFFFFF" text="#000000">
39 <?php
41 function picksrvidform()
43 global $myc;
45 print "<h1>Pick EPG server</h1>\n";
46 print "<form name=epgserver action=\"listtses.php\" method=post>\n";
48 $srvdb = sql_loadEPGservers( $myc , '' , '' );
50 print " <table>\n";
52 print " <tr>\n";
53 print " <td class=\"tableBody\">\n";
54 print " <div align=\"right\">Name</div>\n";
55 print " </td>\n";
56 print " <td class=\"tableBody\">\n";
57 print " <select name=\"srvid\">\n";
58 reset($srvdb);
59 while( list( $sk , $sv ) = each($srvdb) ){
60 print " <option value=\"" . $sv['id'] . "\">" . $sv['name'] . "</option>\n";
62 print " </select>\n";
63 print " </td>\n";
64 print " </tr>\n";
66 print " </table>\n";
68 print " <input name=\"Action\" value=\"Continue\" type=\"submit\" class=\"gumb\">\n";
70 print "</form>\n";
73 function picknetidform( $srvid )
75 global $myc;
77 print "<h1>Pick network on EPG server " . $srvid . "</h1>\n";
78 print "<form name=network action=\"listtses.php\" method=post>\n";
79 print " <input type=\"hidden\" name=\"srvid\" value=\"" . $srvid . "\">\n";
81 $netdb = sql_loadNetworks( $myc , 'epgserver' , $srvid );
83 print " <table>\n";
85 print " <tr>\n";
86 print " <td class=\"tableBody\">\n";
87 print " <div align=\"right\">Name</div>\n";
88 print " </td>\n";
89 print " <td class=\"tableBody\">\n";
90 print " <select name=\"netid\">\n";
91 reset($netdb);
92 while( list( $nk , $nv ) = each($netdb) ){
93 print " <option value=\"" . $nv['id'] . "\">" . $nv['name'] . "</option>\n";
95 print " </select>\n";
96 print " </td>\n";
97 print " </tr>\n";
99 print " </table>\n";
101 print " <input name=\"Action\" value=\"Continue\" type=\"submit\" class=\"gumb\">\n";
103 print "</form>\n";
107 // main
110 $srvid = false;
111 $netid = false;
113 if( $debug ) dbg( "REQUEST" , $_REQUEST );
114 if( isset($_REQUEST['srvid']) ) $srvid = $_REQUEST['srvid'];
115 if( isset($_REQUEST['netid']) ) $netid = $_REQUEST['netid'];
117 if( $debug ) dbg( "POST" , $_POST );
118 if( isset($_POST['srvid']) ) $srvid = $_POST['srvid'];
119 if( isset($_POST['netid']) ) $netid = $_POST['netid'];
121 if( ! $srvid ){
122 picksrvidform();
123 sql_dodisconnect( $myc );
124 exit;
127 if( $srvid and ! $netid ){
128 picknetidform( $srvid );
129 sql_dodisconnect( $myc );
130 exit;
133 print "<h1>" . $lngstr['title'] . " " . $srvid . "</h1>\n";
135 print "<form name=\"new\">\n";
136 print " <input type=\"button\" value=\"Add new network\" class=\"gumb\" onClick=\"javascript:window.location.href='editnetwork.php?action=new&srvid=" . $srvid . "'\">\n";
137 print "</form>\n";
139 $ndb = sql_loadNetworks( $myc , 'epgserver' , $srvid );
140 if( $debug ) dbg( "networks" , $ndb );
142 if( $ndb ){
143 print "<table width=\"80%\" border=\"0\" cellpadding=\"4\" cellspacing=\"0\">\n";
144 print "<tr class=\"tableTitle\">\n";
145 print " <td>" . $lngstr['name'] . "</td>\n";
146 print " <td>" . $lngstr['active'] . "</td>\n";
147 print " <td>" . $lngstr['description'] . "</td>\n";
148 print "</tr>\n";
150 $rowstyle = 0;
152 reset( $ndb );
153 while( list( $sk , $sv ) = each( $ndb ) ){
155 print "<tr class=\"tableBody\">\n";
156 print " <td><a href=\"editnetwork.php?id=" . $sv['id'] . "\">" . $sv['name'] . "</a></td>\n";
157 print " <td>" . $sv['active'] . "</td>\n";
158 print " <td>" . $sv['description'] . "</td>\n";
159 print "</tr>\n";
161 $rowstyle = 1 - $rowstyle;
164 print "</table>\n";
168 // disconnect from main database
170 switch( $dconf['dbtype'] ){
171 case 'mysql':
172 sql_dodisconnect( $myc );
173 break;
178 </body>
179 </html>