Example #1
0
function DB_Count($TablesIDs, $Query = array())
{
    /****************************************************************************/
    $__args_types = array('string,array', 'array');
    #-----------------------------------------------------------------------------
    $__args__ = Func_Get_Args();
    eval(FUNCTION_INIT);
    /****************************************************************************/
    if (!Is_Array($TablesIDs)) {
        $TablesIDs = array($TablesIDs);
    }
    #-----------------------------------------------------------------------------
    $Sql = SPrintF('SELECT COUNT(*) FROM %s', Implode(',', $TablesIDs));
    #-----------------------------------------------------------------------------
    if ($Where = DB_Where($Query)) {
        $Sql = SPrintF('%s WHERE %s', $Sql, $Where);
    }
    if (isset($Query['GroupBy'])) {
        $Sql = SPrintF('%s GROUP BY %s', $Sql, $Query['GroupBy']);
    }
    $Result = DB_Query($Sql);
    #-----------------------------------------------------------------------------
    switch (ValueOf($Result)) {
        case 'error':
            return ERROR | @Trigger_Error('[DB_Count]: невозможно осуществить запрос');
        case 'resource':
            #-------------------------------------------------------------------------
            if (isset($Query['GroupBy'])) {
                return mysql_num_rows($Result);
            } else {
                $Result = MySQL_Fetch_Row($Result);
                return (int) Current($Result);
            }
        default:
            return ERROR | @Trigger_Error(101);
    }
}
function foot_printing($sess)
{
    global $conn;
    ?>
	<tr>
		<td colspan="6">
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr><td colspan="2"><hr size="3" noshade></td></tr>
				</tr>	
				<td>
				<b><?php 
    $message = MySQL_Query("SELECT * FROM uniletim_groups WHERE grp_id = '{$sess['4']}'") or die($query_error);
    //vybíráme zprávy - seøazeno podle id
    $entry = MySQL_Fetch_Row($message);
    echo $entry[1];
    ?>
</b>
				</td>
				<td align="right">			
				<b>uniLETIM&nbsp; </b>
				<?php 
    $date = date("Y-m-d");
    $date = Explode("-", $date);
    echo " " . $date[2] . "." . $date[1] . "." . $date[0] . "";
    ?>
				</td>
				</tr>
			</table>
			<br><br>
			<p class=help>
			 <a href="#" OnClick="history.back()"><?php 
    echo _BACK;
    ?>
</a>
			 &nbsp;&nbsp;>&nbsp;&nbsp;
			 <a href="javascript:window.print();"><?php 
    echo _PRINT;
    ?>
</a></p>
		</td>
	<tr>
</table>
</BODY>
</HTML>
	<?php 
    mysql_close($conn);
}
Example #3
0
	FUNCTION Fetch_Row() {
		RETURN MySQL_Fetch_Row($this->result);
		}
} else {
    // user listing of announces
    announces_print_user($uoz, $sess);
}
?>
		<tr>
			<td colspan="6">
			
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr><td colspan="2"><hr size="3" noshade></td></tr>
				</tr>	
				<td>
				<b><?php 
$message = MySQL_Query("SELECT * FROM lets_skupiny WHERE s_id = '{$sess['4']}'") or die($query_error);
//vybíráme zprávy - seøazeno podle id
$entry = MySQL_Fetch_Row($message);
echo $entry[1];
?>
</b>
				</td>
				<td align="right">			
				<b>uniLETIM</b>
				<?php 
$date = date("Y-m-d");
$date = Explode("-", $date);
echo " " . $date[2] . ". " . $date[1] . ". " . $date[0] . "";
?>
				</td>
				</tr>
			</table>
		</td>
    chmod("config.php", 0666);
    echo "The file <b>config.php</b> successfully created. Please reload the page.";
    exit;
}
// configuration file
include "./config.php";
// authorization of users
$SN = "hvxator";
Session_name("{$SN}");
Session_start();
$sid = Session_id();
$date = Date("U");
$ad = Date("U") - 1800;
$MSQ = @MySQL_Query("SELECT * FROM uniletim_auth WHERE (aut_id = '{$sid}')");
// AND (aut_date >= '$ad')
$sess = @MySQL_Fetch_Row($MSQ);
if (@MySQL_Num_Rows($MSQ) < 1) {
    $auth = "0";
    // test if the db.tables are created; if not, jump to install.php
    $dbInstalled = MySQL_Num_Rows(MySQL_Query("SHOW TABLES")) ? 1 : 0;
    if (!$dbInstalled) {
        include "./includes/tables.inc.php";
    }
    $memberExists = MySQL_Num_Rows(MySQL_Query("SELECT mbr_id FROM uniletim_members")) ? 1 : 0;
    if (!$memberExists) {
        include "./install.php";
        exit;
    }
    if ($lang == "") {
        $lang = $app_lang;
    }
function members_list_printing($sess)
{
    // page header
    head_printing();
    @($sqp = mysql_query("SELECT M.*, P.perm_group FROM uniletim_members M\r\n\t\t\t\t\t\t\t\tLEFT JOIN uniletim_perms P ON M.mbr_id = P.perm_member\r\n\t\t\t\t\t\t\t\tWHERE P.perm_group = '{$sess['4']}' AND M.mbr_state != 'd' ORDER BY M.mbr_login"));
    if (mysql_num_rows($sqp) == 0) {
        echo "<tr><td COLSPAN=5>" . _NO_USER . "</td></tr></table>\n";
    } else {
        ?>

	<table width="720" border="0" align="center" cellspacing="0" cellpadding="3">
		<tr class="dark">
			<td colspan="6"><h2><?php 
        echo _GROUP;
        ?>
: 
				<?php 
        $message = MySQL_Query("SELECT * FROM uniletim_groups WHERE grp_id = '{$sess['4']}'") or die($query_error);
        //vybíráme zprávy - seøazeno podle id
        $entry = MySQL_Fetch_Row($message);
        echo $entry[1];
        ?>
</h25>
						</td></tr>
						<TR class="middle">
							<td width="130">
							<?php 
        echo _USER_NAME;
        ?>
</td>
							<td><?php 
        echo _NAME;
        ?>
</td>
							<td><?php 
        echo _SURNAME;
        ?>
</td>
							<TD width="80"><?php 
        echo _PHONE;
        ?>
</td>
							<TD width="120"><?php 
        echo _EMAIL;
        ?>
</td>
							<td width="70" align="right"><?php 
        echo _ACCOUNT_STATUS;
        ?>
</td>

						</tr>
<?php 
        $i = 0;
        while ($row = mysql_fetch_row($sqp)) {
            if ($i % 2 == 0) {
                $bgcolor = '';
            } else {
                $bgcolor = " class=row";
            }
            ?>
						<TR <?php 
            echo $bgcolor;
            ?>
>
							<TD <?php 
            echo $bgcolor;
            ?>
><?php 
            echo $row[1];
            ?>
</td>
							<TD <?php 
            echo $bgcolor;
            ?>
><?php 
            echo $row[5];
            ?>
</td>
							<TD <?php 
            echo $bgcolor;
            ?>
><?php 
            echo $row[4];
            ?>
</td>
							<TD <?php 
            echo $bgcolor;
            ?>
><?php 
            echo $row[10];
            ?>
</td>
							<TD <?php 
            echo $bgcolor;
            ?>
><?php 
            echo $row[6];
            ?>
</td>
							<TD <?php 
            echo $bgcolor;
            ?>
 align="right"><?php 
            $message = MySQL_Query("SELECT SUM(ser_amount) FROM uniletim_services WHERE ser_provider like '{$row['0']}' AND ul_group = '{$sess['4']}'") or die($query_error);
            //vybíráme zprávy - seøazeno podle id
            $entry = MySQL_Fetch_Row($message);
            $count = $entry[0];
            $message = MySQL_Query("SELECT SUM(ser_amount) FROM uniletim_services WHERE ser_recipient like '{$row['0']}' AND ul_group = '{$sess['4']}'") or die($query_error);
            //vybíráme zprávy - seøazeno podle id
            $entry = MySQL_Fetch_Row($message);
            $count = $count - $entry[0];
            echo $count;
            ?>
</td>
						</tr>
   <?php 
            $i++;
        }
    }
    // page footer
    foot_printing($sess);
}
function group_list($sess, $group, $result, $result1, $result2, $error, $error1, $error2)
{
    $cs1 = " colspan=2";
    $cs2 = " colspan=6";
    $loc_page = _GROUPS;
    page_location_announces($sess, $menu, $rub, $pri, $uoz, $eid, $loc_page);
    page_result_error($result, $error);
    ?>
	<?php 
    $sql = mysql_query("SELECT * FROM uniletim_groups ORDER BY 'grp_name'");
    ?>
<div  class="content-border">
	<table class="content">
						<tr class="td_tmave">
						<td colspan="5"><?php 
    echo _GROUPS;
    ?>
: 
						</td></tr>
<?php 
    $i = 0;
    while ($row = mysql_fetch_row($sql)) {
        if ($i % 2 == 0) {
            $bgcolor = '';
        } else {
            $bgcolor = " class=td_rd";
        }
        ?>
						<TR <?php 
        echo $bgcolor;
        ?>
>
							<TD><A HREF="group.php?action=info&group=<?php 
        echo $row[0];
        ?>
"><?php 
        echo $row[1];
        ?>
</A></TD>
							<TD><?php 
        group_type($row);
        ?>
</TD>
							<TD align="right"><?php 
        $message = MySQL_Query("SELECT M.mbr_id FROM uniletim_members M LEFT JOIN uniletim_perms P ON M.mbr_id = P.perm_member WHERE P.perm_group = '{$row['0']}'") or die($query_error);
        $i = 0;
        while ($entry = MySQL_Fetch_Row($message)) {
            $i++;
        }
        echo "{$i} l ";
        $message = MySQL_Query("SELECT count(ann_id) FROM uniletim_announces WHERE ul_group = '{$row['0']}'") or die($query_error);
        $entry = MySQL_Fetch_Row($message);
        echo "{$entry['0']} l ";
        $message = MySQL_Query("SELECT count(ser_id) FROM uniletim_services WHERE ul_group = '{$row['0']}'") or die($query_error);
        $entry = MySQL_Fetch_Row($message);
        echo "{$entry['0']}";
        ?>
</TD>
						<TD align="right">
						<A HREF="index.php?group_ch=<?php 
        echo $row[0];
        ?>
&grp_name=<?php 
        echo $row[1];
        ?>
"><?php 
        echo _LOGIN;
        ?>
</A></TD>
						<TD align="right">
							<A HREF="group.php?action=list&group_del=<?php 
        echo "{$row['0']}";
        ?>
" onclick="return confirm('<?php 
        echo _RLY_DLT_GRP;
        ?>
')"><?php 
        echo _DELETE;
        ?>
</A>
						</td>
   <?php 
        $i++;
    }
    ?>
						<tr class="td_tmave">
						<td colspan="5"><a class="tm" href="group.php?action=new"><?php 
    echo _NEW_GROUP;
    ?>
</a>
						</td></tr>
						</TR>
		</TABLE>
		</div>
<?php 
}