Location: PHPKode > scripts > QT-registrations > qt-registrations/qtregistrations/qtr_adm_index.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.
 *
 * @category   Safety
 * @package    QT-registerations
 * @author     Philippe Vandenberghe <hide@address.com>
 * @copyright  2008-2012 The PHP Group
 * @license    http://www.php.net/license  PHP License 3.0
 * @version    1.3 build:20080923
 * @link       http://www.qt-cute.org/doc/package/qtr
 * @since      File available since Release 1.0.0
 * @deprecated File deprecated in Release 2.0.0
 *
 */

session_start();
require_once('bin/qtr_init.php');
if ( $oVIP->role!='A' ) die($L['R_admin']);

// INITIALISE

include(Translate('qtr_lang_adm.inc'));

$oVIP->selfurl = 'qtr_adm_index.php';
$oVIP->selfname = $L['Adm_status'];

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

if ( isset($_POST['ok']) )
{
  // check admin email and website url
  if ( !QTismail($_SESSION[QT]['admin_email'],false) ) $qtr_error='Error';
  if ( strlen($_SESSION[QT]['site_url'])<8 ) $qtr_error='Error';
  if ( !empty($qtr_error) )
  {
    $strFile=$_SESSION[QT]['language'].'/sys_online_error.php';
    if ( file_exists($strFile) ) { $strMsg = include($strFile); } else { $strMsg = '<p>Missing admin e-mail or website url...</p>'.N; }
    $oVIP->exiturl = 'qtr_adm_site.php';
    $oVIP->exitname = $L['Adm_general'];
    $oVIP->EndMessage(NULL,$strMsg,'admin',0);
  }

  $str = '-1';
  if ( isset($_POST['offline']) ) $str = strip_tags($_POST['offline']);
  if ( $str=='1' || $str=='0' )
  {
  $oDB->Query('UPDATE '.TABSETTING.' SET setting="'.$_POST['offline'].'" WHERE param="board_offline"');
  $_SESSION[QT]['board_offline'] = $_POST['offline'];
  }

  $strInfo = $L['S_save'];
}

// --------
// HTML START
// --------

$arrJava = array('com'=>false);

include('qtr_adm_p_header.php');
include('qtr_adm_p_title.php');

// BOARD OFFLINE

echo '<h2>',$oVIP->selfname,'</h2>
<table class="ta" cellspacing="0">
<tr class="tr tr_o">
<th class="th_o th_o_first" style="width:200px;"><span class="txt_head">',$L['Adm_status'],'</span></th>
';
if ( $_SESSION[QT]['board_offline']=='0' )
{
  echo '<td class="td_o">&nbsp;</td>';
  echo '<td class="td_o" style="text-align:center; background-color:#AAFFAA"><b>',$L['On_line'],'</b></td>';
}
else
{
  echo '<td class="td_o">&nbsp;</td>';
  echo '<td class="td_o" style="text-align:center; background-color:#FFAAAA"><b>',$L['Off_line'],'</b></td>';
}
echo '<td class="td_o" style="text-align:right">
<form method="post" action="',$oVIP->selfurl,'">',$L['Change'],S,'<select id="offline" name="offline">
<option value="0"',($_SESSION[QT]['board_offline']=='0' ? QSEL : ''),'>',$L['On_line'],'</option>
<option value="1"',($_SESSION[QT]['board_offline']=='1' ? QSEL : ''),'>',$L['Off_line'],'</option>
</select>&nbsp;<input type="submit" name="ok" value="',$L['Save'],'"/></form>
</td>
</tr>
</table>',N,N;

// STATS

echo '<h2>',$L['Info'],'</h2>',N;

$oDB->Query('SELECT count(id) as countid FROM '.TABDOMAIN);
$row = $oDB->Getrow();
$intDomain = $row['countid'];

$oDB->Query('SELECT count(id) as countid FROM '.TABSECTION);
$row = $oDB->Getrow();
$intSection = $row['countid'];

$oDB->Query('SELECT count(id) as countid FROM '.TABSECTION.' WHERE type="1"');
$row = $oDB->Getrow();
$intHidden = $row['countid'];

$oDB->Query('SELECT count(id) as countid FROM '.TABPOST);
$row = $oDB->Getrow();
$intPost = $row['countid'];

if ( $intPost>0 )
{
$oDB->Query('SELECT min(firstpostdate) as firsttopic FROM '.TABTOPIC);
$row = $oDB->Getrow();
$strStartdate = QTdate($row['firsttopic'],$arrQTdate);
}
else
{
$strStartdate = S;
}

echo '<table class="ta" cellspacing="0">
';
echo '<tr class="tr tr_o">
<th class="th_o th_o_first" style="width:200px;"><span class="txt_head">',$L['Domains'],'/',$L['Sections'],'</span></th>
<td class="td_o">',LangS('Domain',$intDomain,$L),', ',LangS('Section',$intSection,$L),' <span class="small">(',$intHidden,S,$L['Hidden'],')</span>, <a href="qtr_stats.php">',$L['Adm_stats'],'</a></td>
</tr>
';
echo '<tr class="tr tr_o">
<th class="th_o th_o_first" style="width:200px;"><span class="txt_head">',$L['Board_start_date'],'</span></th>
<td class="td_o">',$strStartdate,'</td>
</tr>
';

$oDB->Query('SELECT count(id) as countid FROM '.TABUSER);
$row = $oDB->Getrow();
$intUser = $row['countid'];
$oDB->Query('SELECT count(id) as countid FROM '.TABUSER.' WHERE role="A"');
$row = $oDB->Getrow();
$intAdmin = $row['countid'];
$oDB->Query('SELECT count(id) as countid FROM '.TABUSER.' WHERE role="M"');
$row = $oDB->Getrow();
$intMod = $row['countid'];

echo '<tr class="tr tr_o">
<th class="th_o th_o_first"><span class="txt_head">',$L['Users'],'</span></th>
<td class="td_o">',LangS('User',$intUser,$L),' <span class="small">(',LangS('Userrole,A',$intAdmin,$L),', ',LangS('Userrole,M',$intMod,$L),')</span></td>
</tr>
';

// messages

$oDB->Query('SELECT count(id) as countid FROM '.TABTOPIC);
$row = $oDB->Getrow();
$intTopic = $row['countid'];
$oDB->Query('SELECT count(id) as countid FROM '.TABPOST.' WHERE type<>"P"');
$row = $oDB->Getrow();
$intReply = $row['countid'];

echo '<tr class="tr tr_o">
<th class="th_o th_o_first"><span class="txt_head">',$L['Topics'],'</span></th>
<td class="td_o">',LangS('Topic',$intTopic,$L),' <span class="small">(',LangS('Reply',$intReply,$L),')</span></td>
</tr>
';

// db version

echo '<tr class="tr tr_o">
<th class="th_o th_o_first"><span class="txt_head">',$L['Version'],'</span></th>
<td class="td_o">',QTRVERSION,', <span class="small">database ',$_SESSION[QT]['version'],', sid ',QT,'</span></td>
</tr>
';

echo '</table>
';

// PUBLIC ACCESS LEVEL

echo '
<h2>',$L['Public_access_level'],'</h2>
<table class="ta" cellspacing="0">
<tr class="tr tr_o">
<th class="th_o th_o_first" style="width:200px; text-align:right; height:25px"><span class="texthead">',$L['Visitors_can'],'</span></th>
<td class="td_o">',$L['Pal'][$_SESSION[QT]['visitor_right']],'</td>
<td class="td_o" style="text-align:right"><a href="qtr_adm_secu.php">',$L['Change'],'</a></span></td>
</tr>
</table>
';

// HTML END

include('qtr_adm_p_footer.php');

?>
Return current item: QT-registrations