<?php
/**
* PHP versions 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to hide@address.com so we can mail you a copy immediately.
*
* @package QuickTicket
* @author Philippe Vandenberghe <hide@address.com>
* @copyright 2008-2012 The PHP Group
* @version 2.5 build:20101222
*/
session_start();
require_once('bin/qti_init.php');
include(Translate('qti_adm.php'));
if ( $oVIP->role!='A' ) die(Error(13));
// INITIALISE
$a = 'add';
if ( isset($_GET['a']) ) $a = strip_tags($_GET['a']);
$oVIP->selfurl = 'qti_adm_module.php';
$oVIP->selfname = '<span class="upper">'.$L['Adm_modules'].'</span><br />'.($a=='add' ? $L['Add'] : $L['Remove']);
// --------
// SUBMITTED
// --------
if ( isset($_POST['ok']) )
{
$a = 'add';
if ( isset($_POST['action']) ) $a = $_POST['action'];
// check form
$strName = strtolower(strip_tags(trim($_POST['name']))); if ( get_magic_quotes_gpc() ) $strName = stripslashes($strName);
$strName = str_replace(' ','_',$strName);
$strFile = 'qtim_'.$strName.'_'.($a=='rem' ? 'un' : '').'install.php';
if ( file_exists($strFile) )
{
// exit
$oVIP->selfname = $L['Adm_modules'];
$oVIP->exiturl = 'qti_adm_module.php?a='.$a;
$oVIP->exitname = '« '.$L['Exit'];
$oVIP->EndMessage(NULL,$L['Module_name'].': '.$strName.'<br /><br /><a href="'.$strFile.'">'.$L['Module_'.$a].' !</a><br /><br />','admin',0);
}
else
{
$error = 'Module not found... ('.$strFile.')<br /><br />Possible cause: components of this module are not uploaded.';
}
}
// --------
// HTML START
// --------
include('qti_adm_p_header.php');
echo '<form method="post" action="',$oVIP->selfurl,'">
<table class="data_o" cellspacing="0">
';
echo '<tr class="data_o">
<td class="colhd colhdfirst" style="width:200px;"><label for="name">',$L['Module_'.$a],'</label></td>
<td class="colct"><input id="name" name="name" size="12" maxlength="24" value="" /> <span class="help">',$L['Module_name'],'</span></td>
</tr>
';
echo '<tr class="data_o">
<td class="colhd colhdfirst"> </td>
<td class="colct"><input type="hidden" name="action" value="',$a,'" /><input type="submit" id="ok" name="ok" value="',$L['Search'],'" /></td>
</tr>
';
echo '</table>
</form><br />
';
// HTML END
echo '
<script type="text/javascript">
<!--
document.getElementById("name").focus();
-->
</script>
';
include('qti_adm_p_footer.php');
?>