From 51047179c4ebfc74aefa0ead83617ff325d1104f Mon Sep 17 00:00:00 2001 From: Refik Hadzialic Date: Sat, 29 Oct 2011 18:27:40 +0200 Subject: Displays picture as it should on the web site! --- .../web/newModiefiedFilesOnServer/mutexTry.php | 349 +++++++++++++++++++++ .../newModiefiedFilesOnServer/networkResult.php | 309 ++++++++++++++++++ .../web/newModiefiedFilesOnServer/testCase.php | 260 +++++++++++++++ 3 files changed, 918 insertions(+) create mode 100644 notFinishedCode/web/newModiefiedFilesOnServer/mutexTry.php create mode 100644 notFinishedCode/web/newModiefiedFilesOnServer/networkResult.php create mode 100644 notFinishedCode/web/newModiefiedFilesOnServer/testCase.php (limited to 'notFinishedCode/web/newModiefiedFilesOnServer') diff --git a/notFinishedCode/web/newModiefiedFilesOnServer/mutexTry.php b/notFinishedCode/web/newModiefiedFilesOnServer/mutexTry.php new file mode 100644 index 0000000..0b5be2b --- /dev/null +++ b/notFinishedCode/web/newModiefiedFilesOnServer/mutexTry.php @@ -0,0 +1,349 @@ + + + + +Network test live results! + + + +
+ /dev/null 2>&1 &"); //start the software in background and don't wait for any output + sleep(6); //sleep half second till the software starts + //the software should be running already and set the lock, now we test it and then connect to it! + + $softwareRunning1 = isLocked($softwareLock); + if($softwareRunning1 == '0') //Software running and waiting for connection! + { + //try to open the socket and connect to the software + $fp = fsockopen($ip, $port, $errno, $error, 5); + + if (!$fp) + { + echo 'Could not open the socket or connect to the testing software! Check ports on both sides!'; + + } + else + { + socket_set_timeout($fp,50); //one should set the number of the longest test, so we can define the timeout function (it is the number after "$fp,") + + fwrite($fp, "START TEST"); + + //fwrite($fp, "SMART TEST"); //send command to start the tests + if(!feof($fp)) + { + while(!feof($fp)) + { + $received = fgets($fp, 128); //receive data! + + if ($received == "CONFIRM\n") //we got the confirmation from the testing software + { + //test finished successfully + + $GSMRZ1 = 0; + $GSMRZ2 = 0; + $GSMRZ3 = 0; + + $SIP = 0; + $UNISIP = 0; + $LANDLINE = 0; + $LSFKS = 0; + + $GSMEE = 0; + $GSMEV = 0; + $GSMET = 0; + $GSMEO = 0; + + $SIPP = 2; + $LANDLINEP = 2; + $UNISIPP = 2; + $NANOBTS1P = 2; + $NANOBTS2P = 2; + /////////// end of test! + echo '
+ + + + + + + + + + + '; + echo str_repeat("\n",7024); + flush(); + } + elseif ($received == "TEST DONE\n") + { + + + echo '
From: To: Message: Status:
'; + echo '
'; + echo '"; + echo ''; + echo str_repeat("\n",7024); + flush(); + usleep(100); + fwrite($fp, 'DISCONNECT'); //tell the testing software it may close + break; + } + else + { + //parse the received data! + $received = str_replace("\n",'',$received); + $dataForTable = explode("|", $received); + $callFrom = strtoupper($dataForTable[1]); + $callTo = strtoupper($dataForTable[2]); + $testStatus = strtoupper($dataForTable[3]); + //ADD HERE THE TEST CASES BUT MAKE IT INSIDE OF A FILE (e.q. include 'testing.php'); HERE I PUT IT ONLY FOR EXAMPLE PURPOSES! + + if($callFrom == 'SIP' || $callTo == 'SIP') + { + if($testStatus == '200') + { + $SIP = 1; + $SIPP = 1; + $LSFKS = 1; + + } + } + if($callFrom == 'GSMRZ1' || $callTo == 'GSMRZ1') + { + if($testStatus == '200') + { + $GSMRZ1 = 1; + } + if($testStatus != '200' && $GSMRZ1<1) + { + $GSMRZ1 = -1; + } + } + if($callFrom == 'GSMRZ2' || $callTo == 'GSMRZ2') + { + if($testStatus == '200') + { + $GSMRZ2 = 1; + $NANOBTS1P = 1; + } + if($testStatus != '200' && $GSMRZ2<1) + { + $GSMRZ2 = -1; + $NANOBTS1P = 0; + } + + } + if($callFrom == 'GSMRZ3' || $callTo == 'GSMRZ3') + { + if($testStatus == '200') + { + $GSMRZ3 = 1; + $NANOBTS2P = 1; + } + if($testStatus != '200' && $GSMRZ3 < 1) + { + $GSMRZ3 = -1; + $NANOBTS2P = 0; + } + } + if($callFrom == 'GSMEXT.O2' || $callTo == 'GSMEXT.O2') + { + if($testStatus == '200') + { + $GSMEO = 1; + $LSFKS = 1; + } + if($testStatus != '200' && $GSMEO < 1) + { + $GSMEO = -1; + } + } + if($callFrom == 'GSMEXT.VODA' || $callTo == 'GSMEXT.VODA') + { + if($testStatus == '200') + { + $GSMEV = 1; + $LSFKS = 1; + } + if($testStatus != '200' && $GSMEV < 1) + { + $GSMEV = -1; + } + } + if($callFrom == 'GSMEXT.EPLUS' || $callTo == 'GSMEXT.EPLUS') + { + if($testStatus == '200') + { + $GSMEE = 1; + $LSFKS = 1; + } + if($testStatus != '200' && $GSMEE < 1) + { + $GSMEE = -1; + } + } + if($callFrom == 'GSMEXT.TM' || $callTo == 'GSMEXT.TM') + { + if($testStatus == '200') + { + $GSMET = 1; + $LSFKS = 1; + } + if($testStatus != '200' && $GSMET < 1) + { + $GSMET = -1; + } + } + if($callFrom == 'LANDLINE' || $callTo == 'LANDLINE') + { + if($testStatus == '200') + { + $LANDLINEP = 1; + $LANDLINE = 1; + $LSFKS = 1; + } + if($testStatus != '200' && $LANDLINE<1) + { + $LANDLINE = -1; + } + } + if($callFrom == 'UNISIP' || $callTo == 'UNISIP') + { + if($testStatus == '200') + { + $UNISIPP = 1; + $UNISIP = 1; + + } + if($testStatus != '200' && $UNISIP<1) + { + $UNISIP = -1; + } + } + //END OF TEST CASE EXAMPLE + echo ' + '. $dataForTable[1] . ' + '. $dataForTable[2] . ' + ' . $dataForTable[4] . ' + ' . $dataForTable[3] . ' + '; + //echo $received . '
'; + echo str_repeat("\n",7024); + flush(); + usleep(100); + fwrite($fp, "CONTINUE"); //tell the software to proceed with the test and confirm receiving data + } + } + } + + fclose($fp);//close the soccket and the connection + + } + + } + elseif($softwareRunning1 == '1') + { + echo 'Testing software was not started(didn\'t obtain the lock)! Check it!'; + } + else + { + echo 'Testing software didn\'t obtain the lock'; + } + } + elseif($softwareRunning == '0') //0 means the software is still running in the background + { + echo 'Testing software is still running! Maybe you should kill it (if not started manually!)'; + } + else + { + echo 'We have an unknown error! Refresh te web page!'; + } + + //$release = ReleaseLock($nameOfLock); + //echo $release . "
"; + } + else + { + echo 'No single test was selected! Please go back and select at least one test'; + } + } + elseif($lockMe == '0') //0 means if the attempt timed out (for example, because another client has previously locked the name) + { + echo 'Someone was faster than you'; + } + else + { + // # if an error occurred (such as running out of memory or the thread was killed with + echo 'We have an error here'; + } +} +elseif ($locking == '0') //0 means somebody is already on the web site +{ + echo 'Somebody is using the web site already!' . "
"; +} +else +{ + echo 'We have some serious error here'; +} +?> +
+ + + diff --git a/notFinishedCode/web/newModiefiedFilesOnServer/networkResult.php b/notFinishedCode/web/newModiefiedFilesOnServer/networkResult.php new file mode 100644 index 0000000..962d607 --- /dev/null +++ b/notFinishedCode/web/newModiefiedFilesOnServer/networkResult.php @@ -0,0 +1,309 @@ +addPoints(array($GSMINTPercent,$GSMEXTPercent,$SIPPercent,$UNISIPPercent,$LANDLINEPercent),"Hits"); + $MyData->setAxisName(0,"Network operability"); + $MyData->addPoints(array("GSM University","GSM External","SIP","Uni.Tel.network","Landline"),"Networks"); + $MyData->setSerieDescription("Networks","Networks"); + $MyData->setAbscissa("Networks"); + + + /* Create the pChart object */ + $myPicture = new pImage(700,430,$MyData); + + /* Draw the background */ + $Settings = array("R"=>170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); +// $myPicture->drawFilledRectangle(0,0,700,230,$Settings); + + /* Overlay with a gradient */ + $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); + $myPicture->drawGradientArea(0,0,700,430,DIRECTION_VERTICAL,$Settings); + $myPicture->drawGradientArea(0,0,700,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>80)); + + /* Add a border to the picture */ + $myPicture->drawRectangle(0,0,699,429,array("R"=>0,"G"=>0,"B"=>0)); + + /* Write the picture title */ + $myPicture->setFontProperties(array("FontName"=>"fonts/Silkscreen.ttf","FontSize"=>6)); + $myPicture->drawText(10,13,"Network Test Results - UNI FREIBURG",array("R"=>255,"G"=>255,"B"=>255)); + + + + //CONNECTIONS + /* BTS PICTURE INTERNAL CONNECTIONS */ + $myPicture->drawLine(80,170,185,230,$BTS1PING); //BTS1 PING + $myPicture->drawLine(75,225,185,225,$BTS2PING); //BTS2 PING + $myPicture->drawLine(75,288,185,220,$BTS2PING); //BTS3 PING + /*GSMBOX LINES */ + $myPicture->drawLine(181,65,299,150); //BTS3 PING + $myPicture->drawLine(250,65,308,150); //BTS3 PING + $myPicture->drawLine(347,65,309,150); //BTS3 PING + $myPicture->drawLine(410,70,316,150); //BTS3 PING + + //Arrow for GSM-Box + $arrowSettings = array("FillR"=>2.5,"FillG"=>2.5,"FillB"=>2.5,"Ticks"=>1); + $myPicture->drawArrow(303,209,303,161,$arrowSettings); + + //Arrow for Landline + $arrowSettings = array("FillR"=>2.5,"FillG"=>2.5,"FillB"=>2.5,"Ticks"=>1); + $myPicture->drawArrow(313,210,393,171,$arrowSettings); + + //Arrow for University telephone network + $arrowSettings = array("FillR"=>2.5,"FillG"=>2.5,"FillB"=>2.5,"Ticks"=>1, "TwoHeads"=>TRUE); + $myPicture->drawArrow(303,298,303,239,$arrowSettings); + + //SIP + $arrowSettings = array("FillR"=>2.5,"FillG"=>2.5,"FillB"=>2.5,"Ticks"=>1, "TwoHeads"=>TRUE); + $myPicture->drawArrow(316,220,393,220,$arrowSettings); + /* Write some text */ + $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); + $TextSettings = array("BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); + $myPicture->drawText(346,218,"SIP",$TextSettings); + + //IAX + $arrowSettings = array("FillR"=>2.5,"FillG"=>2.5,"FillB"=>2.5,"Ticks"=>1, "TwoHeads"=>TRUE); + $myPicture->drawArrow(192,220,297,220,$arrowSettings); + /* Write some text */ + $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); + $TextSettings = array("BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); + $myPicture->drawText(235,218,"IAX",$TextSettings); + //###################################### + + //BTS1 + $Points = Triangle(74,155); + $myPicture->drawPolygon($Points, $BTS1COL); + /* Write some text */ + $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); + $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); + $myPicture->drawText(10,169,"nanoBTS0",$TextSettings); + //################################## + + //BTS2 + $Points = Triangle(74,215); + $myPicture->drawPolygon($Points, $BTS2COL); + /* Write some text */ + $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); + $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); + $myPicture->drawText(10,229,"nanoBTS1",$TextSettings); + //################################### + + //BTS3 + $Points = Triangle(74,275); + $myPicture->drawPolygon($Points, $BTS3COL); + /* Write some text */ + $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); + $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); + $myPicture->drawText(10,289,"nanoBTS3",$TextSettings); + //################################### + + + + //LsfKs-Asterisk + /* Turn on shadow computing */ + $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); + /* Draw a PNG object */ + $myPicture->drawFromPNG(295,210,$LSFKSCOL); + /* Write some text */ + $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); + $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); + $myPicture->drawText(270,257," LsfKs-Asterisk",$TextSettings); + //############################### + + + //Open BSC + /* Turn on shadow computing */ + $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); + /* Draw a PNG object */ + $myPicture->drawFromPNG(171,210,$GSMINTCOL); + /* Write some text */ + $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); + $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); + $myPicture->drawText(155,275," OpenBSC \r\n LCR \r\n Asterisk",$TextSettings); + //############################### + + + //E-plus + /* Turn on shadow computing */ + $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); + /* Draw a PNG object */ + $myPicture->drawFromPNG(171,50,$GSMEECOL); + /* Write some text */ + $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); + $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); + $myPicture->drawText(171,40,"E-Plus",$TextSettings); + //############################### + + + //Vodaphone + /* Turn on shadow computing */ + $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); + /* Draw a PNG object */ + $myPicture->drawFromPNG(231,50,$GSMEVCOL); + /* Write some text */ + $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); + $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); + $myPicture->drawText(218,40,"Vodafone",$TextSettings); + //############################### + + + //T-mobile + /* Turn on shadow computing */ + $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); + /* Draw a PNG object */ + $myPicture->drawFromPNG(336,50,$GSMETCOL); + /* Write some text */ + $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); + $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); + $myPicture->drawText(330,40,"T-Mobile",$TextSettings); + //############################### + + + //O2 + /* Turn on shadow computing */ + $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); + /* Draw a PNG object */ + $myPicture->drawFromPNG(396,50,$GSMEOCOL); + /* Write some text */ + $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); + $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); + $myPicture->drawText(404,40,"02",$TextSettings); + //############################### + + + //GSMBOX + /* Turn on shadow computing */ + $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); + /* Draw a PNG object */ + $myPicture->drawFromPNG(293,140,$GSMEXTCOL); + /* Write some text */ + $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); + $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); + $myPicture->drawText(238,157,"GSM-Box",$TextSettings); + //############################### + + + //LANDLINE + /* Turn on shadow computing */ + $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); + /* Draw a PNG object */ + $myPicture->drawFromPNG(393,147,$LANDLINECOL); + /* Write some text */ + $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); + $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); + $myPicture->drawText(388,137,"Landline",$TextSettings); + //############################### + + + //University SIP + /* Turn on shadow computing */ + $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); + /* Draw a PNG object */ + $myPicture->drawFromPNG(283,297,$UNISIPCOL); + /* Write some text */ + $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); + $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); + $myPicture->drawText(238,365,"University telephone network",$TextSettings); + //############################### + + + //SIP + /* Turn on shadow computing */ + $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); + /* Draw a PNG object */ + $myPicture->drawFromPNG(393,208,$SIPCOL); + /* Write some text */ + $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); + $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7); + $myPicture->drawText(399,256,"SIP",$TextSettings); + //############################### + + //PING RESULTS + //START ############################################ + $myPicture->setGraphArea(530,280,660,290); + + // Create the surface object + $mySurface = new pSurface($myPicture); + + // Set the grid size + $mySurface->setGrid(4,0); + + $mySurface->writeXLabels(array("Angle"=>45,"Labels"=>array("SIP","Landline","Uni. Telephone","BTS Cont.1","BTS Cont.2"))); + $mySurface->writeYLabels(array("Labels"=>array("Ping"))); + + $Palette = array(1=>array("R"=>0,"G"=>255,"B"=>0, "Alpha"=>40), + 0=>array("R"=>255,"G"=>0,"B"=>1, "Alpha"=>40), + 2=>array("R"=>255,"G"=>227,"B"=>85)); + + $mySurface->addPoint(0,0,$SIPP); + $mySurface->addPoint(1,0,$LANDLINEP); + $mySurface->addPoint(2,0,$UNISIPP); + $mySurface->addPoint(3,0,$NANOBTS1P); + $mySurface->addPoint(4,0,$NANOBTS2P); + + // Draw the surface chart + $mySurface->drawSurface(array("Border"=>TRUE,"Surrounding"=>40,"Palette"=>$Palette)); + + + //A BIT OF STATISTICS + /* Draw the chart scale */ + $myPicture->setGraphArea(520,50,685,220); + $AxisBoundaries = array(0=>array("Min"=>0,"Max"=>100)); + + $myPicture->drawScale(array("CycleBackground"=>TRUE,"DrawSubTicks"=>TRUE,"GridR"=>0,"GridG"=>0,"GridB"=>0,"GridAlpha"=>10,"Pos"=>SCALE_POS_TOPBOTTOM,"Mode"=>SCALE_MODE_MANUAL,"ManualScale"=>$AxisBoundaries)); + + /* Turn on shadow computing */ + $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); + + /* Create the per bar palette */ + $Palette = array("0"=>array("R"=>188,"G"=>224,"B"=>46,"Alpha"=>100), + "1"=>array("R"=>224,"G"=>100,"B"=>46,"Alpha"=>100), + "2"=>array("R"=>224,"G"=>214,"B"=>46,"Alpha"=>100), + "3"=>array("R"=>46,"G"=>151,"B"=>224,"Alpha"=>100), + "4"=>array("R"=>224,"G"=>176,"B"=>46,"Alpha"=>100)); + + +/* $Palette = array("1"=>array("R"=>91,"G"=>184,"B"=>202,"Alpha"=>100), + "2"=>array("R"=>166,"G"=>218,"B"=>215,"Alpha"=>100), + "3"=>array("R"=>223,"G"=>227,"B"=>203,"Alpha"=>100), + "0"=>array("R"=>114,"G"=>176,"B"=>180,"Alpha"=>100), + "4"=>array("R"=>241,"G"=>233,"B"=>214,"Alpha"=>100)); +*/ + /* Draw the chart */ + $myPicture->drawBarChart(array("DisplayPos"=>LABEL_POS_INSIDE,"DisplayValues"=>TRUE,"Rounded"=>TRUE,"Surrounding"=>30,"OverrideColors"=>$Palette)); + //############################################STATISTICS + + //DATE AND TEST NUMBER + /* Write some text */ + $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7)); + $TextSettings = array("BoxRounded"=>TRUE,"R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>9); + $taskInfo ='Task #: ' . $TASKID . ' ' . date("d.m.Y H:m:s"); + $myPicture->drawText(460,425,$taskInfo,$TextSettings); + //########################################################### + + + + /* Render the picture (choose the best way) */ + $myPicture->autoOutput("example.drawFilledCircle.png"); +?> diff --git a/notFinishedCode/web/newModiefiedFilesOnServer/testCase.php b/notFinishedCode/web/newModiefiedFilesOnServer/testCase.php new file mode 100644 index 0000000..b00189d --- /dev/null +++ b/notFinishedCode/web/newModiefiedFilesOnServer/testCase.php @@ -0,0 +1,260 @@ +216,"G"=>166,"B"=>14,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0); + $colorFail = array("R"=>255, "G"=>25, "B"=>25,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0); + $colorWork = array("R"=>150,"G"=>215,"B"=>121,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0); + + +$TASKID = $_GET['TASKID']; + +$GSMRZ1 = $_GET['RZ1']; +$GSMRZ2 = $_GET['RZ2']; +$GSMRZ3 = $_GET['RZ3']; + + +$SIP = $_GET['S']; +$UNISIP = $_GET['US']; +$LANDLINE = $_GET['LL']; +$LSFKS = $_GET['LS']; + +$GSMEE = $_GET['EE']; +$GSMEV = $_GET['EV']; +$GSMET = $_GET['ET']; +$GSMEO = $_GET['EO']; + + +$SIPP = $_GET['SP']; +$LANDLINEP = $_GET['SGP']; +$UNISIPP = $_GET['USP']; +$NANOBTS1P = $_GET['NBP1']; +$NANOBTS2P = $_GET['NBP2']; +/* +$GSMRZ1 = 0; +$GSMRZ2 = -10; +$GSMRZ3 = 10; + +$SIP = 4; +$UNISIP = 0; +$LANDLINE = 1; +$LSFKS = 1; + +$GSMEE = 10; +$GSMEV = 10; +$GSMET = -10; +$GSMEO = 10; +*/ +$GSMEXTCOL = 'icons/box_dunno.png'; +$GSMINTCOL = "icons/server_dunno.png"; +$LSFKSCOL = "icons/server_dunno.png"; + +$SIPCOL = 'icons/sip_dunno.png'; +$UNISIPCOL = 'icons/uni-network_dunno.png'; +$LANDLINECOL = 'icons/telephone_dunno.png'; + +$BTS1COL = $colorDunno; +$BTS2COL = $colorDunno; +$BTS3COL = $colorDunno; + +$GSMEECOL = 'icons/blackberry_dunno.png'; +$GSMEVCOL = 'icons/blackberry_dunno.png'; +$GSMETCOL = 'icons/blackberry_dunno.png'; +$GSMEOCOL = 'icons/blackberry_dunno.png'; + + +$BTS1PING = array("R"=>255,"G"=>0,"B"=>0); //put here the color :) +$BTS1PING["Ticks"]=2; +$BTS1PING["Weight"]=0; + +$BTS2PING = array("R"=>255,"G"=>0,"B"=>0); +$BTS2PING["Ticks"]=2; +$BTS2PING["Weight"]=0; + +$BTS3PING = array("R"=>255,"G"=>0,"B"=>0); +$BTS3PING["Ticks"]=2; +$BTS3PING["Weight"]=0; + +if ($GSMRZ1 > 0 || $GSMRZ2 > 0 || $GSMRZ3 > 0) +{ + $GSMINT = 1; + $GSMINTCOL = 'icons/server_work.png'; +} +elseif($GSMRZ1 < 0 || $GSMRZ2 < 0 || $GSMRZ3 < 0) +{ + $GSMINT = -1; + $GSMINTCOL = 'icons/server_fail.png'; +} + +if($LANDLINE>0) +{ + $LANDLINECOL = 'icons/telephone_work.png'; +} +elseif($LANDLINE<0) +{ + $LANDLINECOL = 'icons/telephone_fail.png'; +} + +if($SIP > 0 && $GSMINT > 0) +{ + $LSFKS = 1; +} + +if($LSFKS>0) +{ + $LSFKSCOL = 'icons/server_work.png'; +} +elseif($LSFKS<0) +{ + $LSFKSCOL = 'icons/server_fail.png'; +} + +if($SIP>0) +{ + $SIPCOL = 'icons/sip_work.png'; +} +elseif($SIP<0) +{ + $SIPCOL = 'icons/sip_fail.png'; +} + +if($UNISIP > 0) +{ + $UNISIPCOL = 'icons/uni-network_work.png'; +} +elseif($UNISIP < 0) +{ + $UNISIPCOL = 'icons/uni-network_fail.png'; +} + +if($GSMEE > 0 || $GSMEV > 0 || $GSMET > 0 || $GSMEO > 0) +{ + $GSMEXTCOL = 'icons/box_work.png'; +} +elseif($GSMEE < 0 || $GSMEV < 0 || $GSMET < 0 || $GSMEO < 0) +{ + $GSMEXTCOL = 'icons/box_fail.png'; +} + +if($GSMRZ1 > 0) +{ + $BTS1COL = $colorWork; +} +elseif($GSMRZ1 < 0) +{ + $BTS1COL = $colorFail; +} + +if($GSMRZ2 > 0) +{ + $BTS2COL = $colorWork; +} +elseif($GSMRZ2 < 0) +{ + $BTS2COL = $colorFail; +} + +if($GSMRZ3 > 0) +{ + $BTS3COL = $colorWork; +} +elseif($GSMRZ3 < 0) +{ + $BTS3COL = $colorFail; +} + +if($GSMEE > 0) +{ + $GSMEECOL = 'icons/blackberry_work.png'; +} +elseif($GSMEE < 0) +{ + $GSMEECOL = 'icons/blackberry_fail.png'; +} + +if($GSMEV > 0) +{ + $GSMEVCOL = 'icons/blackberry_work.png'; +} +elseif($GSMEV < 0) +{ + $GSMEVCOL = 'icons/blackberry_fail.png'; +} + +if($GSMET > 0) +{ + $GSMETCOL = 'icons/blackberry_work.png'; +} +elseif($GSMET < 0) +{ + $GSMETCOL = 'icons/blackberry_fail.png'; +} + +if($GSMEO > 0) +{ + $GSMEOCOL = 'icons/blackberry_work.png'; +} +elseif($GSMEO < 0) +{ + $GSMEOCOL = 'icons/blackberry_fail.png'; +} + + + +//NETWORK OPERABILITY CALCULATION +$GSMINTOCalc = 0; +$GSMEXTOCalc = 0; + +//internal GSM calcuation +if($GSMRZ1>0) +{ + $GSMINTOCalc += 1; +} +if($GSMRZ2>0) +{ + $GSMINTOCalc += 1; +} +if($GSMRZ3>0) +{ + $GSMINTOCalc += 1; +} + +//external GSM calculation +if($GSMET>0) +{ + $GSMEXTOCalc += 1; +} +if($GSMEO>0) +{ + $GSMEXTOCalc += 1; +} +if($GSMEE>0) +{ + $GSMEXTOCalc += 1; +} +if($GSMEV>0) +{ + $GSMEXTOCalc += 1; +} + +if($SIP<0) +{ + $SIP=0; +} + +if($LANDLINE<0) +{ + $LANDLINE=0; +} +if($UNISIP<0) +{ + $UNISIP=0; +} +$GSMINTPercent = round(($GSMINTOCalc/3),2)*100; +$GSMEXTPercent = round(($GSMEXTOCalc/4),2)*100; +$SIPPercent = $SIP*100; +$UNISIPPercent = $UNISIP*100; +$LANDLINEPercent = $LANDLINE*100; + +//print_r($GSMINTCOL); +// add here to set the color for each node after the test ;) +// setNode(0,$SIPCOL) or something as that :) +?> -- cgit v1.2.3-55-g7522