Esempio n. 1
0
<?php

include 'class.ezpdf.php';
include 'db_connection.php';
$v = base64_decode($_REQUEST['v']);
$v = explode("-", $v);
if ($v[2] == md5(date("mdy")) && check_data($v[3], $v[0])) {
    $datatest = check_data($v[3], $v[0]);
    $userdata = userdata($v[0]);
    $coursedata = coursedata($v[1]);
    stampa($userdata, $coursedata, $datatest);
} else {
    echo "Stampa non permessa";
}
function idelemento_to_idcorso($idelemento)
{
    $query = "\n\tSELECT\n\t\tjos_tt_corsi.id  as result\n\tFROM\n\t\tjos_tt_corsi\n\tLEFT JOIN jos_tt_moduli ON jos_tt_moduli.id_corso = jos_tt_corsi.id\n\tLEFT JOIN jos_tt_elementi ON jos_tt_elementi.id_modulo = jos_tt_moduli.id\n\tWHERE\n\t\tjos_tt_elementi.id = '" . $idelemento . "'\n\tLIMIT 1\n\t";
    $db_query = mysql_query($query) or die(mysql_error());
    $riga = mysql_fetch_array($db_query);
    return $riga['result'];
}
function check_data($id_elemento, $id_utente)
{
    $query = "SELECT\njos_quiz_r_student_quiz.c_date_time,\nDATE_FORMAT(jos_quiz_r_student_quiz.c_date_time, '%d/%m/%Y') as timemodified\nFROM\njos_quiz_r_student_quiz\nWHERE\njos_quiz_r_student_quiz.c_quiz_id = '" . $id_elemento . "' AND\njos_quiz_r_student_quiz.c_student_id = '" . $id_utente . "' AND\njos_quiz_r_student_quiz.c_passed = 1\n";
    /*
    	$query="
    			SELECT
    				DATE_FORMAT(jos_tt_track.data, '%d/%m/%Y') as timemodified
    			FROM
    				jos_tt_track
    			WHERE
Esempio n. 2
0
include 'class.ezpdf.php';
include 'db_connection.php';
$ku = base64_decode($_REQUEST['ku']);
$kq = base64_decode($_REQUEST['kq']);
$ki = base64_decode($_REQUEST['ki']);
$dbg = $_REQUEST['dbg'];
if ($dbg == "1") {
    echo "<br> ku=" . $ku;
    echo "<br> kq=" . $kq;
    echo "<br> ki=" . $ki;
}
if (check_data($ku, $kq)) {
    $datatest = check_data($ku, $kq);
    $userdata = userdata($ku);
    $coursedata = coursedata($ki);
    if ($datatest && $userdata && $coursedata) {
        stampa($userdata, $coursedata, $datatest);
    } else {
        echo "Dati non corretti";
    }
}
function check_data($ku, $kq)
{
    $query = "\n         SELECT\n         DATE_FORMAT(c_date_time,'%d-%m-%Y') as datatest\n         FROM\n            jos_quiz_r_student_quiz\n         WHERE c_student_id= {$ku} \n         AND c_quiz_id = {$kq} \n         AND c_passed=1";
    $db_query = mysql_query($query) or die(mysql_error());
    $riga = mysql_fetch_array($db_query);
    return $riga['datatest'];
}
function userdata($ku)
{