Location: PHPKode > projects > ACollab > admin/delete_lang.php
<?php
/****************************************************************/
/* ATutor														*/
/****************************************************************/
/* Copyright (c) 2002-2003 by Greg Gay & Joel Kronenberg        */
/* Adaptive Technology Resource Centre / University of Toronto  */
/* http://atutor.ca												*/
/*                                                              */
/* 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.				*/
/****************************************************************/
// $Id: delete_lang.php 399 2005-02-14 17:27:58Z shozubq $

$_user_location = 'admin';

define('AC_INCLUDE_PATH', '../include/');
require(AC_INCLUDE_PATH.'vitals.inc.php');
//if ($_SESSION['course_id'] > -1) { exit; }

if ($_POST['cancel']) {
	Header('Location: lang.php?f='.urlencode_feedback(AC_FEEDBACK_CANCELLED));
	exit;
}

if (isset($_POST['submit'])) {
	$sql = "DELETE FROM ".TABLE_PREFIX."lang2 WHERE lang='$_POST[delete_lang]'";
	$result = mysql_query($sql, $db);

	$sql	= "UPDATE ".TABLE_PREFIX."members SET language='".DEFAULT_LANGUAGE."' WHERE language='$_POST[delete_lang]'";
	mysql_query($sql, $db);

	
	if (DEFAULT_LANGUAGE == $_POST['delete_lang']) {
		$_SESSION['lang'] = 'en';
	} else {
		$_SESSION['lang'] = DEFAULT_LANGUAGE;
	}

	Header('Location: lang.php?f='.urlencode_feedback(AC_FEEDBACK_LANG_DELETED));
	exit;
}

if($_GET['delete_lang']){
	require(AC_INCLUDE_PATH.'admin/header.inc.php'); 
?>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
	<input type="hidden" name="delete_lang" value="<?php echo $_GET['delete_lang'] ?>" />
	<table border="0" cellspacing="0" cellpadding="2" align="center" class="box2">
	<tr>
		<th colspan="3" class="box"><h3><?php echo _AC('delete').' '._AC('language'); ?></h3></th>
	</tr>
	<tr bgcolor="white">
		<td>&nbsp;</td>
		<td><b><?php echo _AC('language'); ?>:</b> <?php echo $row['title']; ?></td>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td class="row1">&nbsp;</td>
		<td class="row1"><img src="images/clr.gif" height="1" width="1" alt="" /><br /><?php echo _AC('confirm_delete_lang', $_GET['delete_lang']); ?><br /></td>
		<td class="row1">&nbsp;</td>
	</tr>
	<tr bgcolor="white">
		<td class="row1">&nbsp;</td>
		<td class="row1" align="right"><br /><input type="submit" name="submit" value="<?php echo _AC('delete'); ?>" class="submitY" onfocus="this.className='submitY highlight'" onblur="this.className='submitY'" /> &nbsp; <input type="submit" name="cancel" value="<?php echo _AC('cancel'); ?>" class="submitN" onfocus="this.className='submitN highlight'" onblur="this.className='submitN'" /><br /><br /></td>
		<td class="row1">&nbsp;</td>
	</tr>
	</table>
</form>

<?php
	require(AC_INCLUDE_PATH.'admin/footer.inc.php'); 
}
?>
Return current item: ACollab