function choose()
 {
     while (list($k, $v) = each($GLOBALS)) {
         global ${$k};
     }
     $collectorid = getcollectorid("advalvas");
     $query = "DELETE FROM station " . "WHERE collectorid='" . addslashes($collectorid) . "'";
     $sql->query($query);
     $query = "DELETE FROM program";
     $sql->query($query);
     print_header_open();
     print_title("Choose Stations for " . $this->MODULE_NAME);
     print_header_close();
     print "\n                        <FORM ACTION=\"" . page_name() . "\" METHOD=POST>\n                        <INPUT TYPE=HIDDEN NAME=\"module\" VALUE=\"" . prepare($module) . "\">\n                        <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2>\n                        <TR BGCOLOR=\"#ccccff\">\n                                <TD><B>Original Name</B></TD>\n                                <TD><B>xawtv Name</B></TD>\n                                <TD><B>Channel</B></TD>\n                        </TR>\n                ";
     while (list($name, $value) = each($HTTP_POST_VARS)) {
         if ($value == 1) {
             $suburl = "?NL&" . $name;
             $channel_name = preg_replace("/_/", " ", $name);
             $channel_name = preg_replace("/\\|/", "+", $channel_name);
             $query = $sql->insert_query("station", array("sname" => $this->transformName($channel_name), "collectorid" => $collectorid, "suburl" => $suburl, "rname" => $this->transformName($channel_name), "channel" => "0"));
             $result = $sql->query($query);
             $sid = $sql->last_record($result);
             print "\n\t\t\t\t<TR>\n\t\t\t\t\t\t<TD>" . prepare($channel_name) . "</TD>\n\t\t\t\t\t\t<TD>\n\t\t\t\t\t\t\t\t<INPUT TYPE=TEXT NAME=\"T" . htmlentities($sid) . "\"\n\t\t\t\t\t\t\t\tVALUE=\"" . prepare($channel_name) . "\">\n\t\t\t\t\t\t</TD>\n\t\t\t\t\t\t<TD>" . html_form::text_widget("C" . htmlentities($sid)) . "</TD>\n\t\t\t\t</TR>\n\t\t\t\t";
         }
     }
     print "</TABLE>\n";
     print "<P><INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=\"Update\"></P>\n";
     print "</FORM>\n";
     print_page_close();
     exit;
 }
 function view()
 {
     foreach ($GLOBALS as $k => $v) {
         global ${$k};
     }
     $fd = fopen("http://www.sp.uconn.edu/~wwwnews/huskyvision", "r");
     if ($fd) {
         print_header_open();
         print_title("HuskyVision");
         print_header_close();
         print "Deleting station and program settings.<br>\n";
         $collectorid = getcollectorid("huskyvision");
         $query = "DELETE FROM station WHERE collectorid='" . addslashes($collectorid) . "'";
         $sql->query($query);
         $query = "DELETE FROM program";
         $sql->query($query);
         echo "<p>Scanning HuskyVision...<br>\n";
         echo "Stations found: <br>\n";
         print "\n\t\t\t\t<FORM ACTION=\"" . $this->page_name . "\" METHOD=POST>\n\t\t\t\t<INPUT TYPE=HIDDEN NAME=\"module\" VALUE=\"" . prepare($module) . "\">\n\t\t\t\t<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2>\n\t\t\t\t\t<TR BGCOLOR=\"#ccccff\">\n\t\t\t\t\t\t<TD><B>Name</B></TD>\n\t\t\t\t\t\t<TD><B>Add</B></TD>\n\t\t\t\t\t</TR>\n\t\t\t";
         $i = 0;
         while (!feof($fd)) {
             $lijn = fgets($fd, 1024);
             list($channel_id, $channel_name) = explode(",", $lijn);
             if (!empty($channel_name)) {
                 $query = $sql->insert_query("station", array("sid" => NULL, "sname" => $channel_name, "collectorid" => "2", "rname" => $channel_name, "channel" => $channel_id));
                 $result = $sql->query($query);
                 $sid = $sql->last_record($result);
                 print "\n\t\t\t\t\t\t<TR>\n\t\t\t\t\t\t\t<TD>" . prepare($channel_name) . "</TD>\n\t\t\t\t\t\t\t<TD>\n\t\t\t\t\t\t\t\t<INPUT TYPE=CHECKBOX NAME=\"T" . htmlentities($sid) . "\" VALUE=\"1\" CHECKED>\n\t\t\t\t\t\t\t\t<INPUT TYPE=HIDDEN NAME=\"N" . htmlentities($sid) . "\" VALUE=\"" . prepare($channel_name) . "\">\n\t\t\t\t\t\t\t\t<INPUT TYPE=HIDDEN NAME=\"C" . htmlentities($sid) . "\" VALUE=\"" . prepare($channel_id) . "\">\n\t\t\t\t\t\t\t</TD>\n\t\t\t\t\t\t</TR>\n\t\t\t\t\t";
                 $i++;
             }
             // end checking for valid name
         }
         // end while
         fclose($fd);
         print "</table>\n";
         print "<p><INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=\"Choose\"></p>\n";
         print "</form>\n";
         print_page_close();
     }
     // end if fd
 }
Пример #3
0
    $sql->query($query);
    echo "<p>Scanning eurotv...<br>\n";
    echo "Stations found: <br>\n";
    print "\n\t\t<FORM ACTION=\"" . $PHP_SELF . "\" METHOD=POST>\n\t\t<TABLE BORDER=0 CELLSPACING=0>\n\t\t\t<tr BGCOLOR=\"#ccccff\">\n\t\t\t\t<td><B>Name</B></td>\n\t\t\t\t<td><B>Add</B></td>\n\t\t\t</tr>\n\t";
    $i = 0;
    while (!feof($fd)) {
        $lijn = fgets($fd, 1024);
        if (preg_match("/A HREF=\"\\/sl.*\\/a/", $lijn)) {
            $lijn = preg_replace("/\r/", " ", $lijn);
            $lijn = preg_replace("/\n/", " ", $lijn);
            //(/HREF=\"(.*)?\"\>(.*)\<\/a\>/)
            $lijn = preg_replace("/.*HREF=\"\\/(.*)\\.htm\"\\>(.*)?\\<\\/a\\>.*/", "\\1##\\2", $lijn);
            list($url, $name) = split("##", $lijn);
            $url = preg_replace("/^sl/", "", $url);
            $query = "INSERT into station values ('NULL','{$name}','2','{$url}','{$name}')";
            $result = $sql->query($query);
            $sid = $sql->last_record($result);
            print "<tr><td>{$name}</td><td><input type=CHECKBOX name=\"T{$sid}\" value=\"1\" checked></td></tr>\n";
            //print $lijn;
            $i++;
        }
        // end if matches link
    }
    // end while
    fclose($fd);
    print "</table>\n";
    print "<p><INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=\"Choose\"></p>\n";
    print "</form>\n";
    print_page_close();
}
// end if fd
Пример #4
0
 function choose()
 {
     while (list($k, $v) = each($GLOBALS)) {
         global ${$k};
     }
     $collectorid = getcollectorid("advalvas");
     $query = "DELETE FROM station " . "WHERE collectorid='" . addslashes($collectorid) . "'";
     $sql->query($query);
     $query = "DELETE FROM program";
     $sql->query($query);
     print_header_open();
     print_title("Choose Stations for " . $this->MODULE_NAME);
     print_header_close();
     print "\n\t\t\t<FORM ACTION=\"" . page_name() . "\" METHOD=POST>\n\t\t\t<INPUT TYPE=HIDDEN NAME=\"module\" VALUE=\"" . prepare($module) . "\">\n\t\t\t<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2>\n\t\t\t<TR BGCOLOR=\"#ccccff\">\n\t\t\t\t<TD><B>Original Name</B></TD>\n\t\t\t\t<TD><B>xawtv Name</B></TD>\n\t\t\t\t<TD><B>Channel</B></TD>\n\t\t\t</TR>\n\t\t";
     while (list($name, $value) = each($HTTP_POST_VARS)) {
         if (preg_match("/^T/", $name)) {
             // derive sid from this...
             $sid = preg_replace("/^T/", "", $name);
             // grab all sid-related variables
             $channel_name = ${"N" . $sid};
             $channel_number = ${"C" . $sid};
             // create actual insert query
             $query = $sql->insert_query("station", array("sname" => $this->transformName($channel_name), "collectorid" => "1", "suburl" => $this->transformURL($channel_name), "rname" => $this->transformName($channel_name), "channel" => $channel_number));
             $result = $sql->query($query);
             $old_sid = $sid;
             $sid = $sql->last_record($result);
             ${"C" . $sid} = ${"C" . $old_sid};
             global ${"C" . $sid};
             print "\n\t\t\t\t<TR>\n\t\t\t\t\t<TD>" . prepare($channel_name) . "</TD>\n\t\t\t\t\t<TD>\n\t\t\t\t\t\t<INPUT TYPE=TEXT NAME=\"T" . htmlentities($sid) . "\"\n\t\t\t\t\t\t VALUE=\"" . prepare($channel_name) . "\">\n\t\t\t\t\t</TD>\n\t\t\t\t\t<TD>" . html_form::text_widget("C" . htmlentities($sid)) . "</TD>\n\t\t\t\t</TR>\n\t\t\t\t";
         }
         // end if value = 1
     }
     print "</TABLE>\n";
     print "<P><INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=\"Update\"></P>\n";
     print "</FORM>\n";
     print_page_close();
     exit;
 }