Location: PHPKode > projects > QT-registrations > qtregistrations/qtr_adm_module.php
<?php

/**
* PHP versions 4 and 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    QT-registerations
* @author     Philippe Vandenberghe <hide@address.com>
* @copyright  2008-2012 The PHP Group
* @version    2.4 build:20100313
*/

session_start();
require_once('bin/qtr_init.php');
include(Translate('qtr_adm.php'));
if ( $oVIP->role!='A' ) die(Error(13));

$a = 'add';
$id = '';
$ok = '';
QThttpvar('a id ok','str str str');

$oVIP->selfurl = 'qtr_adm_module.php';
$oVIP->selfname = '<span class="upper">'.$L['Adm_modules'].'</span><br/>'.($a=='add' ? $L['Add'] : $L['Remove']);

// --------
// SUBMITTED
// --------

if ( !empty($ok) )
{
  // check form
  if ( get_magic_quotes_gpc() ) $id = stripslashes($id);
  $id = str_replace(' ','_',$id);
  $strFile = 'qtrm_'.$id.'_'.($a=='rem' ? 'un' : '').'install.php';

  if ( file_exists($strFile) )
  {
  // exit
  $oVIP->selfname = $L['Adm_modules'];
  $oVIP->exiturl = 'qtr_adm_module.php?a='.$a;
  $oVIP->exitname = '&laquo; '.$L['Exit'];
  $oVIP->EndMessage(NULL,$L['Module_name'].': '.$id.'<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('qtr_adm_p_header.php');

echo '<form method="post" action="',$oVIP->selfurl,'">
<table class="data_o" cellspacing="0">
';
echo '<tr class="data_o">
<td class="th_o th_o_first" style="width:200px;"><label for="name">',$L['Module_'.$a],'</label></td>
<td class="td_o"><input id="id" name="id" size="12" maxlength="24" value=""/>&nbsp;<span class="help">',$L['Module_name'],'</span></td>
</tr>
';
echo '<tr class="data_o">
<td class="th_o th_o_first">&nbsp;</td>
<td class="td_o"><input type="hidden" name="a" value="',$a,'"/><input type="submit" id="ok" name="ok" value="',$L['Search'],'"/></td>
</tr>
';
echo '</table>
</form>
';

// HTML END

echo '
<script type="text/javascript">
<!--
document.getElementById("name").focus();
-->
</script>
';

include('qtr_adm_p_footer.php');

?>
Return current item: QT-registrations