Beispiel #1
0
<?php

/**
 * Created by PhpStorm.
 * User: SHESHA
 * Date: 14-07-2015
 * Time: 08:17 PM
 */
//Includes
require_once "./dbconnect.php";
$dbobj = new dbconnect();
//Check for all required post params
$isValidPost = $dbobj->validatePost(array("mid"));
if ($isValidPost) {
    $connection = $dbobj->getDB();
    $epost = $dbobj->escapePost(array("mid"), $connection);
    $get_query = "SELECT id,thread,catid,time,modified_time,subject from rnbje_kunena_messages WHERE id='{$epost["mid"]}'";
    $get_res = mysqli_query($connection, $get_query);
    $ids = array();
    while ($row = mysqli_fetch_assoc($get_res)) {
        $ids[] = $row["id"];
        $tid = $row["thread"];
        $cid = $row["catid"];
        $time[] = $row["time"];
        $mtime[] = $row["modified_time"];
        $sub[] = json_encode($row["subject"]);
    }
    $len = count($ids);
    $attachments = array();
    for ($i = 0; $i < $len; $i++) {
        $attach_query = "SELECT id from rnbje_kunena_attachments WHERE mesid='{$ids[$i]}'";
Beispiel #2
0
 */
//Includes
require_once "./dbconnect.php";
$dbobj = new dbconnect();
function getMeWeeks($week, $sec)
{
    $length = count($week);
    for ($j = 0; $j < $length; $j++) {
        if ($sec == substr($week[$j], 0, 1)) {
            return substr($week[$j], 1, 5);
        }
    }
    return "none";
}
//Check for all required post params
$isValidPost = $dbobj->validatePost(array("sec"));
if ($isValidPost) {
    $connection = $dbobj->getDB();
    $epost = $dbobj->escapePost(array("sec"), $connection);
    $getTt = "SELECT * from timetable";
    $getres = mysqli_query($connection, $getTt);
    while ($row = mysqli_fetch_assoc($getres)) {
        $times[] = $row['time'];
        $monday[] = $row['monday'];
        $tuesday[] = $row['tuesday'];
        $wednesday[] = $row['wednesday'];
        $thursday[] = $row['thursday'];
        $friday[] = $row['friday'];
        $saturday[] = $row['saturday'];
    }
    echo "{";