Edit Region'; $posts = Mirror::get_one_region($_POST['region_id']); form_start(); include_once(INC.'/forms/region.php'); form_hidden('doit','1'); form_hidden('action','edit'); form_hidden('region_id',$_POST['region_id']); form_submit('submit','','button1','Update'); form_end(); require_once(FOOTER); exit; } break; case 'delete': if (!record_exists('mirror_mirror_region_map','region_id',$_POST['region_id'])&&Mirror::delete_region($_POST['region_id'])) { set_msg('Region deleted successfully.'); } else { set_error('Region cannot be deleted because it is linked to a mirror.'); } break; } } else { set_error('You must select a region to continue.'); } } $title = 'Regions'; $nav = INC.'/admin_nav.php'; require_once(HEADER); echo '

Regions

'; show_error(); show_msg(); $regions = Mirror::get_regions(); $_GET['sort']=(!empty($_GET['sort']))?$_GET['sort']:'region_name'; $_GET['order']=(!empty($_GET['order']))?$_GET['order']:'ASC'; $regions=array_order_by($regions,$_GET['sort'],$_GET['order']); $headers = array( 'region_id'=>'', 'region_name'=>'Region Name', 'mirrors'=>'Mirrors', 'region_priority'=>'Priority' ); $actions = array( 'edit'=>'Edit', 'delete'=>'Delete' ); form_start(); ListOut::show($regions,$headers,'radio',$actions); form_end(); echo '

Add a Region

'; form_start(); $posts = ['region_name'=>'', 'region_priority'=>'']; include_once(INC.'/forms/region.php'); form_submit('add-submit','','button1','Add Region'); form_end(); require_once(FOOTER);