xref: /trunk/main/sd/res/webview/show.pl (revision cdf0e10c)
1*cdf0e10cSrcweir#!/usr/bin/perl
2*cdf0e10cSrcweir
3*cdf0e10cSrcweirrequire "common.pl";
4*cdf0e10cSrcweir
5*cdf0e10cSrcweirprint "Content-type: text/html\n\n";
6*cdf0e10cSrcweir
7*cdf0e10cSrcweir# get current and next picture
8*cdf0e10cSrcweir$sCurrPic = join( "", common::File_read( "currpic.txt" ) );
9*cdf0e10cSrcweir@aPictureArray = common::File_read( "picture.txt" );
10*cdf0e10cSrcweir
11*cdf0e10cSrcweir# not last picture or wrong input ?
12*cdf0e10cSrcweirif( abs( $sCurrPic ) > 0 )
13*cdf0e10cSrcweir{
14*cdf0e10cSrcweir    $nCurrPic = abs( $sCurrPic );
15*cdf0e10cSrcweir    $nPictureArrayLen = @aPictureArray;
16*cdf0e10cSrcweir    if( $nCurrPic < $nPictureArrayLen )
17*cdf0e10cSrcweir    {
18*cdf0e10cSrcweir        $sPictureName1 = ( split( ";", @aPictureArray[ $nCurrPic ] ) )[ 1 ];
19*cdf0e10cSrcweir        $sPictureName2 = ( split( ";", @aPictureArray[ $nCurrPic + 1 ] ) )[ 1 ];
20*cdf0e10cSrcweir    }
21*cdf0e10cSrcweir    else
22*cdf0e10cSrcweir    {
23*cdf0e10cSrcweir        $sPictureName1 = ( split( ";", @aPictureArray[ $nCurrPic ] ) )[ 1 ];
24*cdf0e10cSrcweir        $sPictureName2 = $sPictureName1;
25*cdf0e10cSrcweir    }
26*cdf0e10cSrcweir}
27*cdf0e10cSrcweir
28*cdf0e10cSrcweirprint "<HTML>";
29*cdf0e10cSrcweir
30*cdf0e10cSrcweirprint "<HEAD>";
31*cdf0e10cSrcweir    print "<TITLE>$$1</TITLE>";
32*cdf0e10cSrcweirprint "</HEAD>";
33*cdf0e10cSrcweir
34*cdf0e10cSrcweirprint "<BODY bgcolor=\"white\">";
35*cdf0e10cSrcweir    print "<P ALIGN=CENTER><IMG src=\"" . $sPictureName1 . "\" width=$$4 height=$$5 border=0>";
36*cdf0e10cSrcweir    print "<P><IMG src=\"" . $sPictureName2 . "\" width=1 height=1 border=0>";
37*cdf0e10cSrcweirprint "</BODY>";
38*cdf0e10cSrcweir
39*cdf0e10cSrcweirprint "</HTML>";