Ejemplo n.º 1
0
<?php

session_start();
$year = $_POST['year'];
$con = mysql_connect('localhost', 'LaPitto', 'X2KxFXdTBmHeMwzm');
mysql_query('SET NAMES UTF8');
if (!$con) {
    die('Could not connect: ' . mysql_error());
}
if (!mysql_select_db('LaPitto', $con)) {
    die('Could not connect: ' . mysql_error());
}
getMeeting(1, $year, 3);
function getMeeting($u_ID, $year, $level)
{
    $query = mysql_query("select distinct meeting.meeting from content, event, content_user, meeting where content_user.u_ID = '{$u_ID}' and content_user.c_ID = content.c_ID and content.e_ID = event.e_ID and event.m_ID = meeting.m_ID and meeting.year = '{$year}' order by meeting.meeting asc");
    while ($ans = mysql_fetch_array($query)) {
        if ($level > 1) {
            getEvent($ans['meeting'], $u_ID, $level);
        }
    }
}
function getEvent($meeting, $u_ID, $level)
{
    $query = mysql_query("select distinct content.e_ID, event.content from content, event, content_user, meeting where content_user.u_ID = '{$u_ID}' and content_user.c_ID = content.c_ID and content.e_ID = event.e_ID and event.m_ID = meeting.m_ID and meeting.meeting = '{$meeting}' order by content.e_ID asc");
    while ($ans = mysql_fetch_array($query)) {
        if ($level > 2) {
            getContent($ans['e_ID'], $u_ID);
        }
    }
}
Ejemplo n.º 2
0
<?php

session_start();
$u_ID = $_SESSION['u_ID'];
$year = $_POST['year'];
$level = 3;
$con = mysql_connect('localhost', 'LaPitto', 'X2KxFXdTBmHeMwzm');
mysql_query('SET NAMES UTF8');
if (!$con) {
    die('Could not connect: ' . mysql_error());
}
if (!mysql_select_db('LaPitto', $con)) {
    die('Could not connect: ' . mysql_error());
}
getMeeting($u_ID, $year, $level);
function getMeeting($u_ID, $year, $level)
{
    $query = mysql_query("select distinct meeting.meeting from content, event, content_user, meeting where content_user.u_ID = '{$u_ID}' and content_user.c_ID = content.c_ID and content.e_ID = event.e_ID and event.m_ID = meeting.m_ID and meeting.year = '{$year}'");
    while ($ans = mysql_fetch_array($query)) {
        echo "<tr>";
        echo "<td colspan='11'>";
        echo "<h3 style='margin:10px'>" . $year . "-第" . $ans['meeting'] . "次校长办公会" . "</h3>";
        if ($level > 1) {
            getEvent($ans['meeting'], $u_ID, $level);
        }
        echo "</td>";
        echo "</tr>";
    }
}
function getEvent($meeting, $u_ID, $level)
{
Ejemplo n.º 3
0
}
if (!mysql_select_db('LaPitto', $con)) {
    die('Could not connect: ' . mysql_error());
}
$query = mysql_query("select * from users where users.usage = 1 order by weight desc");
while ($result = mysql_fetch_array($query)) {
    echo "<div style='border:1px solid #000;padding:5px 15px;margin-top:5px;''>";
    echo "<div style='font-size:2em'>" . $result['cn_name'] . "</div>";
    getMeeting($result['u_ID'], $year, $level);
    echo "</div>";
}
$query = mysql_query("select * from users where users.usage = 2 order by weight desc");
while ($result = mysql_fetch_array($query)) {
    echo "<div style='border:1px solid #000;padding:5px 15px;margin-top:5px'>";
    echo $result['cn_name'];
    getMeeting($result['u_ID'], $year, $level);
    echo "</div>";
}
function getMeeting($u_ID, $year, $level)
{
    $query = mysql_query("select distinct meeting.meeting from content, event, content_user, meeting where content_user.u_ID = '{$u_ID}' and content_user.c_ID = content.c_ID and content.e_ID = event.e_ID and event.m_ID = meeting.m_ID and meeting.year = '{$year}'");
    while ($ans = mysql_fetch_array($query)) {
        echo "<div style='border:1px solid #000;padding:5px 15px;margin-top:5px'>";
        echo "<h3 style='margin:10px'>" . $year . "-第" . $ans['meeting'] . "次校长办公会" . "</h3>";
        if ($level > 1) {
            getEvent($ans['meeting'], $u_ID, $level);
        }
        echo "</div>";
    }
}
function getEvent($meeting, $u_ID, $level)