summaryrefslogtreecommitdiffstats
path: root/Website/testCase.php
diff options
context:
space:
mode:
authorgsmselftest2011-11-09 16:41:00 +0100
committergsmselftest2011-11-09 16:41:00 +0100
commit1c009430af80260d67c47652783931414989c75d (patch)
tree204540af3ff3d8e23892986ad7585080900b7463 /Website/testCase.php
parentReport relocating! (diff)
downloadgsm-selftest-1c009430af80260d67c47652783931414989c75d.tar.gz
gsm-selftest-1c009430af80260d67c47652783931414989c75d.tar.xz
gsm-selftest-1c009430af80260d67c47652783931414989c75d.zip
Final folder team project
Diffstat (limited to 'Website/testCase.php')
-rw-r--r--Website/testCase.php260
1 files changed, 260 insertions, 0 deletions
diff --git a/Website/testCase.php b/Website/testCase.php
new file mode 100644
index 0000000..b00189d
--- /dev/null
+++ b/Website/testCase.php
@@ -0,0 +1,260 @@
+<?
+ //color definitions
+ $colorDunno = array("R"=>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 :)
+?>