Direct.pl
上传用户:qdrechuli
上传日期:2022-08-01
资源大小:917k
文件大小:3k
- #!/usr/bin/perl -w
- use strict;
- use DBI;
- use CGI;
- use Jpc::Html;
- sub Titre
- {
- print '<H1 ALIGN="CENTER">',$_[0],"</H1><P>n";
- }
- sub Chapitre
- {
- print '<H3>',$_[0],"</H3>n";
- }
-
-
- sub Fin_Document
- {
- print '</BODY>',"n";
- print '</HTML>',"n";
- }
-
- sub main
- {
- my $sql;
- my $sqlreq;
-
-
- Document("Net-Cam : Visualisation en Direct");
- Titre("Net-Cam : Visualisation en Direct");
- print '<FONT FACE=verdana>';
- print '<FONT SIZE="-1">';
- my $h = new CGI;
- # my @CamIDs = substr($h->param('VL_Cam'),0,index($h->param('VL_Cam'),"-"));
- my @CamIDs = $h->param('VL_Cam');
- my $db = DBI->connect("DBI:mysql:netcam","root","");
- my $CamNum = 0;
- print '<TABLE COLS=2 SIZE=100%>';
- foreach my $CamID (@CamIDs)
- {
- $CamNum++;
- if ($CamNum==1 or $CamNum==3) { print '<TR>'; }
- print '<TD>';
- $sqlreq = "SELECT C_Url,C_Name,C_Active,C_Freq FROM cam WHERE C_ID=".$CamID." ";
- $sql = $db->prepare($sqlreq);
- $sql->execute();
- (my $CUrl,my $CName,my $CActive,my $CFreq) = $sql->fetchrow();
- $sql->finish();
- print '<FONT FACE=verdana>';
- print '<FONT SIZE="-1">';
- print "Camera = ",$CName," ";
- print "Url = HTTP://",$CUrl,"<BR>";
- print "<B>";
- if ($CActive)
- {
- print "<FONT COLOR=GREEN>Enregistrement ACTIF</FONT> ";
- print " 1 image/",$CFreq," secondes<BR>n";
- }
- else
- {
- print "<FONT COLOR=RED>Enregistrement INACTIF</FONT><BR>n";
- }
- print "</B><P>n";
- print '<SCRIPT LANGUAGE="JavaScript">',"n";
- print '<!--//hide script',"n";
- print ' if ((navigator.appName == "Microsoft Internet Explorer")&&(navigator.platform != "MacPPC")&&(navigator.platform != "Mac68k")) {',"n";
- print ' document.write("<OBJECT ID="AxisCamControl" CLASSID="CLSID:917623D1-D8E5-11D2-BE8B-00104B06BDE3" WIDTH="320" HEIGHT="240" CODEBASE="','http://',$CUrl,'/activex/AxisCamControl.cab#Version=1,0,2,15">");',"n";
- print ' document.write("<PARAM NAME=DisplaySoundPanel VALUE=0>");',"n";
- print ' document.write("<PARAM NAME=URL VALUE="','http://',$CUrl,'/axis-cgi/mjpg/video.cgi?resolution=320x240&clock=1&date=1">");',"n";
- print '',"n";
- print ' document.write("</OBJECT>");',"n";
- print '',"n";
- print ' } else {',"n";
- print ' theDate = new Date();',"n";
- print ' var output = "<img SRC="http://',$CUrl,'/axis-cgi/mjpg/video.cgi?resolution=320x240&clock=1&date=1";',"n";
- #print ' output += theDate.getTime()',"n";
- print ' output += "" ALT="Press Reload if no image is displayed">";',"n";
- print ' document.write(output);',"n";
- print ' }',"n";
- print '//end hide -->',"n";
- print '',"n";
- print '</SCRIPT>',"n";
- print '</TD>';
- if ($CamNum==2 or $CamNum==4) { print '</TR>'; }
- }
- if ($CamNum==1 or $CamNum==3) { print '</TR>'; }
- print '</TABLE>';
- $db->disconnect();
- Fin_Document();
- }
- main();
- exit(0);