<?php

$pagesize = 10;
$pagestart = 0;

$extension = $_REQUEST['id'];

$title = "ARDI Extension Removal";

include($installfolder.'/include/tmpl.php');

function cmp($a, $b)
{
    if ($a == $b) {
        return 0;
    }
    return version_compare($b, $a);
}

$platform = "windows";

$info = file_get_contents("https://ardi.optrix.com.au/extensions/".$extension.'/info.json');
$inf = json_decode($info);

// Initialize a file URL to the variable 
$log = "";
if (file_exists($installfolder.'/addons/'.$extension))
{
	mkdir($installfolder."/disabled");
	rename($installfolder.'/addons/'.$extension,$installfolder.'/disabled/'.$extension);
	$log = "Moved Addin to <strong>Disabled</strong> directory.";
}

global $db;

T('header-basic','title='.$title);

$localversions = "";

ST('section','class=content');
	ST('row');
	
		ST('half');
			ST('box','title=Removal Log');				
				echo '<h2>'.$inf->name.' ('.$inf->version.')</h2>';
				echo '<p>'.$log.'</p>';
				echo '<br/>';
				echo '<a href="'.$siteroot.'/extender"><button class="btn btn-success">Back To Extension List</button></a>';
			ET();
		ET();
		
	ET();
ET();

?>
