<?php
/*Realism Clan Manager - Best for extra management of Realism Gaming Clans/Community.
    Copyright (C) 2013  Michael Woods aka Blood_Wolf89

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, version 3 of the License.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see http://www.gnu.org/licenses/ */
ini_set('error_reporting', 'E_ALL ^ E_NOTICE');
include_once '../include/processes.php';
$Login_Process = new Login_Process;
$Login_Process->check_status($_SERVER['SCRIPT_NAME']);

INCLUDE 'setup.php' ; 
INCLUDE ($langinclude) ; 
$xml = simplexml_load_file("$path_dir");
$myValue = $_GET["value"];
$indexOfChildOne = 0;
foreach($xml as $key0 => $value){
	if ( $indexOfChildOne == $myValue ) {
		$saveNodeIndexOfChildOne = $indexOfChildOne;
	}
	$indexOfChildOne++;
}
if ($saveNodeIndexOfChildOne > 4) {
	$saveNodeIndexOfChildOneFix = $saveNodeIndexOfChildOne - 5;
	unset($xml->member[$saveNodeIndexOfChildOneFix]);
}
$xml = $xml->asXML();
$fp = fopen($path_dir,'w');
$write = fwrite($fp,$xml);
require_once("squadxml.php");
?>