Edit Mirror';
$posts = Mirror::get_one_mirror($_POST['mirror_id']);
form_start();
include_once(INC.'/forms/mirror.php');
form_hidden('doit','1');
form_hidden('action','edit');
form_hidden('mirror_id',$_POST['mirror_id']);
form_submit('submit','','button1','Update');
form_end();
require_once(FOOTER);
exit;
}
break;
case 'delete':
if (Mirror::delete_mirror($_POST['mirror_id'])) {
set_msg('Mirror deleted successfully.');
} else {
set_error('Mirror could not be deleted.');
}
break;
case 'toggle':
if (Mirror::toggle($_POST['mirror_id'])) {
set_msg('Mirror enabled/disabled.');
} else {
set_error('Mirror could not be enabled/disabled.');
}
}
} else {
set_error('You must select a mirror to continue.');
}
}
$title = 'Mirrors';
$nav = INC.'/admin_nav.php';
require_once(HEADER);
echo '
Mirrors
';
show_error();
show_msg();
$mirrors = Mirror::get_mirrors();
$_GET['sort']=(!empty($_GET['sort']))?$_GET['sort']:'mirror_active';
$_GET['order']=(!empty($_GET['order']))?$_GET['order']:'ASC';
$mirrors=array_order_by($mirrors,$_GET['sort'],$_GET['order']);
$headers = array(
'mirror_id'=>'',
'mirror_active'=>'Status',
'mirror_rating'=>'Rating',
'mirror_name'=>'Host Name',
'mirror_baseurl'=>'Address',
'region_name'=>'Region',
'mirror_count'=>'Hits'
);
$actions = array(
'toggle'=>'Enable/Disable',
'edit'=>'Edit',
'delete'=>'Delete'
);
form_start();
ListOut::show($mirrors,$headers,'radio',$actions);
form_end();
echo 'Add a Mirror
';
form_start();
$posts = ['mirror_name' => '', 'region_id' => '', 'mirror_baseurl' => '', 'mirror_rating' => ''];
include_once(INC.'/forms/mirror.php');
form_submit('add-submit','','button1','Add Mirror');
form_end();
require_once(FOOTER);