home *** CD-ROM | disk | FTP | other *** search
- PHP_IsdnCtrl
-
- Frontend for the ISDN4K Util isdnrep with HTML output ( additional script to the PHP_Imon http://www.daxtar.de/isdn/ )
-
-
- <?
- /*
- Still in process, not yet found the time to comment :-)
- Contact : mb@daxtar.de, http://www.daxtar.de/isdn/
- */
-
- // set to the correct filename !!!
- $isdnrep_command = "/usr/bin/isdnrep";
-
- $bg_image="/images/bg.gif";
-
- // don't change this !!!!!!!!!!, }:-)
- $month_list = array("", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
-
-
- function print_month_select($no)
- {
- $date_array = getdate(time());
- printf ("<SELECT NAME=\"%s\">\n", "month".$no);
- for ($i=1; $i<13; $i++)
- {
- if ($date_array[month] == $GLOBALS["month_list"][$i])
- printf ("<OPTION selected VALUE=\"%s\">%s</OPTION>\n", $i, $GLOBALS["month_list"][$i]);
- else
- printf ("<OPTION VALUE=\"%s\">%s</OPTION>\n", $i, $GLOBALS["month_list"][$i]);
- }
- printf ("</SELECT>\n\n");
- }
-
- function print_day_select($no)
- {
- $date_array = getdate(time());
- printf ("<SELECT NAME=\"%s\">\n", "day".$no);
- for ($i=1; $i<32; $i++)
- {
- if ($date_array[mday] == $i)
- printf ("<OPTION selected VALUE=\"%s\">%s</OPTION>\n", $i, $i);
- else
- printf ("<OPTION VALUE=\"%s\">%s</OPTION>\n", $i, $i);
- }
- printf ("</SELECT>\n\n");
- }
-
- function print_year_select($no)
- {
- $date_array = getdate(time());
- printf ("<SELECT NAME=\"%s\">\n", "year".$no);
- for ($i=($date_array[year]-2); $i<($date_array[year]+5); $i++)
- {
- if ($date_array[year] == $i)
- printf ("<OPTION selected>%s</OPTION>\n", $i);
- else
- printf ("<OPTION>%s</OPTION>\n", $i);
- }
- printf ("</SELECT>\n\n");
- }
-
- ?>
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
- <HTML>
- <HEAD>
- <TITLE>Php Isdnrep</TITLE>
- </HEAD>
-
- <BODY BACKGROUND="<? echo $bg_image; ?>">
-
-
- <TABLE ALIGN="CENTER" BORDER="0" CELLSPACING="2" CELLPADDING=3><TR><TD BGCOLOR="white">
- <?
- $isdnrep_options = " -wX WWW ";
-
- switch ($repmode)
- {
- case "single_day" : $isdnrep_options = $isdnrep_options."-t ".$day."/".$month."/".$year[2].$year[3]; break;
- case "single_month" : $isdnrep_options = $isdnrep_options."-t ".$month."/".$year[2].$year[3]; break;
- case "timespan" : $isdnrep_options = $isdnrep_options."-t ".$month_from."/".$year_from[2].$year_from[3]."-".$month_til."/".$year_til[2].$year_til[3]; break;
- default : break;
- }
-
- printf ("%s", system($isdnrep_command.$isdnrep_options));
- //printf ("%s", $isdnrep_command.$isdnrep_options);
- ?>
-
- </TD></TR></TABLE>
-
- <HR SIZE=1> <BR>
-
- <TABLE BORDER="4" CELLPADDING="0" CELLSPACING="0" ALIGN="CENTER"><TR><TD bgcolor="#C0C0C0">
- <TABLE BORDER="0" CELLPADDING="3" CELLSPACING="0">
-
- <?
- printf ("<FORM NAME=\"single_day\" ACTION=\"%s\">\n", getenv("SCRIPT_NAME"));
- printf ("<TR><TD><input type=\"submit\" value=\"Report\"></TD>\n");
- printf ("<TD>day</TD><TD>:</TD><TD>\n");
- print_day_select("");
- print_month_select("");
- print_year_select("");
- ?>
- <input type="hidden" name="repmode" value="single_day"></TD>
- </FORM>
- </TR>
-
- <?
- printf ("<FORM NAME=\"single_month\" ACTION=\"%s\">\n", getenv("SCRIPT_NAME"));
- printf ("<TR><TD><input type=\"submit\" value=\"Report\"></TD>\n");
- printf ("<TD>month</TD><TD>:</TD><TD>\n");
- print_month_select("");
- print_year_select("");
- ?>
- <input type="hidden" name="repmode" value="single_month"></TD>
- </FORM>
- </TR>
-
- <?
- printf ("<FORM NAME=\"timespan\" ACTION=\"%s\">\n", getenv("SCRIPT_NAME"));
- printf ("<TR><TD><input type=\"submit\" value=\"Report\"></TD>\n");
- printf ("<TD>timespan</TD><TD>:</TD><TD>\n");
- print_month_select("_from");
- print_year_select("_from");
- printf (" til ");
- print_month_select("_til");
- print_year_select("_til");
- ?>
- <input type="hidden" name="repmode" value="timespan"></TD>
- </FORM>
- </TR>
-
- </TABLE></TD></TR></TABLE></TD></TR>
-
-
- </TABLE>
-
-
- </BODY>
- </HTML>
-
-