| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Old Sites/ees_request/externalpages/dba/application/ |
Upload File : |
<?php
include('externalpages'.DS.'ams'.DS.'config.php');
define( '_JEXEC', 1 );
define('JPATH_BASE', dirname(__FILE__) );
define( 'DS', DIRECTORY_SEPARATOR );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
require_once ( JPATH_BASE .DS.'libraries'.DS.'joomla'.DS.'factory.php' );
$mainframe =& JFactory::getApplication('site');
$user =& JFactory::getUser();
$regyear = date('Y');
$db_connection=mysql_connect($host, $username, $password, $db_name);
if (!$db_connection) {
die("<br><b>Database Error:</b> Could not connected. Try again later.<br>");
exit;
}
@mysql_select_db($db_name, $db_connection) or die("Unable to select database.");
mysql_query("SET NAMES 'utf8'", $db_connection);
$checkUserQuery = "SELECT * FROM db_manager WHERE userId='".$user->id."'";
$checkUserResult = mysql_query($checkUserQuery);
if ( mysql_num_rows($checkUserResult) > 0 ) {
$checkUserRow = mysql_fetch_array($checkUserResult);
$departmentQuery = "SELECT * FROM department WHERE id='".$checkUserRow['departmentId']."'";
$departmentResult = mysql_query($departmentQuery);
$departmentRow = mysql_fetch_array($departmentResult);
$_SESSION['departmentId'] = $departmentRow['id'];
$appQuery = "SELECT COUNT(DISTINCT `userId`) AS counter,application_form.`departmentId`,`departmentName`,`sectionTitle`
FROM `application_form`,`department`,`section`
WHERE application_form.departmentId=department.id AND application_form.sectionId=section.id
AND application_form.`submited`='1' AND application_form.departmentId='".$departmentRow['id']."' AND application_form.academicYear='".$regyear."' GROUP BY application_form.`departmentId`,`sectionId`";
$appResult = mysql_query($appQuery);
if( mysql_numrows($appResult) > 0 ) {
?>
<br>
<a href="?option=com_content&view=article&id=72"><b>[ << Πίσω]</b></a>
<br>
<table align="center" cellspacing="10">
<tr>
<th colspan="2" align="left"><font size="2"><b>Σύνολο Καταχωρημένων Αιτήσεων του Τμήματος <?php echo $departmentRow['departmentName'];?></b></font></th>
</tr>
<tr bgcolor="#B9EEAC">
<th align="left">Τομέας</th>
<th>Πλήθος Αιτήσεων</th>
</tr>
<?php
$sum = 0;
while( $appRow = mysql_fetch_array($appResult) ) {
echo "<tr>
<td>".$appRow['sectionTitle']."</td>
<td align='center'>".$appRow['counter']."</td>
</tr>";
$sum += $appRow['counter'];
}
echo " <tr bgcolor='#B9EEAC'>
<td><b>Σύνολο Αιτήσεων:</td><td align='center'>".$sum."</b></td>
</tr>
</table>";
}
else {
echo "<br><br>Δεν βρέθηκαν καταχωρημένες αιτήσεις στο Τμήμα ".$departmentRow['departmentName'].".";
echo "<br><br><font color='red'>Ελέγξτε τα κριτήρια αναζήτησης.</font> ";
echo " <a href='javascript:history.go(-1)'>[ Πίσω ]</a>";
}
}
else {
echo "<br><font color='red'>Απογορεύεται η πρόσβαση σε μη εξουσιοδοτημένους χρήστες!</font>";
}
?>