<?php
// BOTH ZZ AND XX are the SAME
  if(!(isset($apppath))){$apppath = "/home/relayup/";}
  $settingfile = $apppath . "dev/Shield";

  $seperator ="//\n";
  $SheildSettings = "";

  $ShieldSetting_00 = "";  $ShieldSetting_01 = "";
  $ShieldSetting_02 = "";  $ShieldSetting_03 = "";
  $ShieldSetting_04 = "";  $ShieldSetting_05 = "";
  $ShieldSetting_06 = "";  $ShieldSetting_07 = "";
  $ShieldSetting_08 = "";  $ShieldSetting_09 = "";
  $ShieldSetting_10 = "";  $ShieldSetting_11 = "";
  $ShieldSetting_12 = "";  $ShieldSetting_13 = "";
  $ShieldSetting_14 = "";  $ShieldSetting_15 = "";
  $ShieldSetting_16 = "";  $ShieldSetting_17 = "";
  $ShieldSetting_18 = "";  $ShieldSetting_19 = "";
  $ShieldSetting_20 = "";  $ShieldSetting_21 = "";
  $ShieldSetting_22 = "";  $ShieldSetting_23 = "";
  $ShieldSetting_24 = "";  $ShieldSetting_25 = "";
  $ShieldSetting_26 = "";  $ShieldSetting_27 = "";
  $ShieldSetting_28 = "";  $ShieldSetting_29 = "";
  $ShieldSetting_94 = "";  $ShieldSetting_95 = "";

  $readname = $apppath . 'dev/html-normal/temp_default.cfg';
  if (file_exists($readname)) { } else {$readname = $apppath . 'dev/00_saved.cfg';}
  $savedcontent = file_get_contents($readname);
  if($savedcontent != ""){
    $savedlist = preg_split("/\r\n|\n|\r/", $savedcontent);
    foreach ($savedlist as $saveditem){
      $TheIndex = substr($saveditem, 0, 2); // 00_SET=
      $TheValue = substr($saveditem, 7);    // 00_SET=

      $pos = strpos($saveditem, "=");
      if ($pos !== false) {
        $TheValue = substr($saveditem, $pos+1);
      }      
      if($TheIndex == "00"){$ShieldSetting_00 = $TheValue;}
      if($TheIndex == "01"){$ShieldSetting_01 = $TheValue;}
      if($TheIndex == "02"){$ShieldSetting_02 = $TheValue;}
      if($TheIndex == "03"){$ShieldSetting_03 = $TheValue;}
      if($TheIndex == "04"){$ShieldSetting_04 = $TheValue;}
      if($TheIndex == "05"){$ShieldSetting_05 = $TheValue;}
      if($TheIndex == "06"){$ShieldSetting_06 = $TheValue;}
      if($TheIndex == "07"){$ShieldSetting_07 = $TheValue;}
      if($TheIndex == "08"){$ShieldSetting_08 = $TheValue;}
      if($TheIndex == "09"){$ShieldSetting_09 = $TheValue;}
      if($TheIndex == "10"){$ShieldSetting_10 = $TheValue;}
      if($TheIndex == "11"){$ShieldSetting_11 = $TheValue;}
      if($TheIndex == "12"){$ShieldSetting_12 = $TheValue;}
      if($TheIndex == "13"){$ShieldSetting_13 = $TheValue;}
      if($TheIndex == "14"){$ShieldSetting_14 = $TheValue;}
      if($TheIndex == "15"){$ShieldSetting_15 = $TheValue;}
      if($TheIndex == "16"){$ShieldSetting_16 = $TheValue;}
      if($TheIndex == "17"){$ShieldSetting_17 = $TheValue;}
      if($TheIndex == "18"){$ShieldSetting_18 = $TheValue;}
      if($TheIndex == "19"){$ShieldSetting_19 = $TheValue;}
      if($TheIndex == "20"){$ShieldSetting_20 = $TheValue;}
      if($TheIndex == "21"){$ShieldSetting_21 = $TheValue;}
      if($TheIndex == "22"){$ShieldSetting_22 = $TheValue;}
      if($TheIndex == "23"){$ShieldSetting_23 = $TheValue;}
      if($TheIndex == "24"){$ShieldSetting_24 = $TheValue;}
      if($TheIndex == "25"){$ShieldSetting_25 = $TheValue;}
      if($TheIndex == "26"){$ShieldSetting_26 = $TheValue;}
      if($TheIndex == "27"){$ShieldSetting_27 = $TheValue;}
      if($TheIndex == "28"){$ShieldSetting_28 = $TheValue;}
      if($TheIndex == "29"){$ShieldSetting_29 = $TheValue;}
      if($TheIndex == "30"){$ShieldSetting_30 = $TheValue;}	  
      if($TheIndex == "94"){$ShieldSetting_94 = $TheValue;}
      if($TheIndex == "95"){$ShieldSetting_95 = $TheValue;}
    }

    $SheildSettings = $seperator;

    $SheildSettings .= "ShieldSetting_00=$ShieldSetting_00$seperator";
  //  $SheildSettings .= "ShieldSetting_01=$ShieldSetting_01$seperator";
    $SheildSettings .= "ShieldSetting_02=$ShieldSetting_02$seperator";

    $SheildSettings .= "ShieldSetting_04=$ShieldSetting_04$seperator";
    $SheildSettings .= "ShieldSetting_03=$ShieldSetting_03$seperator";//Keep this after number 4. I forget why.

    $SheildSettings .= "ShieldSetting_05=$ShieldSetting_05$seperator";
    $SheildSettings .= "ShieldSetting_06=$ShieldSetting_06$seperator";
    $SheildSettings .= "ShieldSetting_07=$ShieldSetting_07$seperator";
    $SheildSettings .= "ShieldSetting_08=$ShieldSetting_08$seperator";
    $SheildSettings .= "ShieldSetting_09=$ShieldSetting_09$seperator";
    $SheildSettings .= "ShieldSetting_10=$ShieldSetting_10$seperator";
    $SheildSettings .= "ShieldSetting_11=$ShieldSetting_11$seperator";
    $SheildSettings .= "ShieldSetting_12=$ShieldSetting_12$seperator";
    $SheildSettings .= "ShieldSetting_13=$ShieldSetting_13$seperator";
    $SheildSettings .= "ShieldSetting_14=$ShieldSetting_14$seperator";
    $SheildSettings .= "ShieldSetting_15=$ShieldSetting_15$seperator";
    $SheildSettings .= "ShieldSetting_16=$ShieldSetting_16$seperator";
    $SheildSettings .= "ShieldSetting_17=$ShieldSetting_17$seperator";
    $SheildSettings .= "ShieldSetting_18=$ShieldSetting_18$seperator";
    $SheildSettings .= "ShieldSetting_19=$ShieldSetting_19$seperator";
    $SheildSettings .= "ShieldSetting_20=$ShieldSetting_20$seperator";
    $SheildSettings .= "ShieldSetting_21=$ShieldSetting_21$seperator";
    $SheildSettings .= "ShieldSetting_22=$ShieldSetting_22$seperator";
    $SheildSettings .= "ShieldSetting_30=$ShieldSetting_30$seperator";
//    $SheildSettings .= "ShieldSetting_94=$ShieldSetting_94$seperator";
//    $SheildSettings .= "ShieldSetting_95=$ShieldSetting_95$seperator";
  }
?>