function stampa($komentari, $a) { if ($komentari) { foreach ($komentari as $komentar) { array_push($a, $komentar); $sledeci = App\Comment::where('parent_id', '=', $komentar->id)->where('article_id', '=', $komentar->article_id)->get(); $a = stampa($sledeci, $a); } } return $a; }
<?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
} echo '<table class="tabl">'; echo "\n <!-- DIRECTORIES -->\n " . '<tr><td><img src="img/ext_icons/folder.gif" alt="folder"/></td><td class="tc"><a href="javascript: changedir(\'' . $back . '\');" >..</a></td><td></td><td></td><td></td></div>' . "\n"; $files = array_diff(scandir($dir), array(".", "..")); foreach ($files as $key => $value) { if (is_dir($dir . "/" . $value)) { $dirlist[$key] = $files[$key]; } else { $filelist[$key] = $files[$key]; } } foreach ($dirlist as $key => $value) { stampa($key, $dir, $value, 0, $d); } echo " <!-- FILES -->\n"; foreach ($filelist as $key => $value) { stampa($key, $dir, $value); if (in_array(array_pop(explode(".", $value)), array(gif, png, jpg, jpeg))) { array_push($piclist, $value); } //inserisco le immagini nella lista pic } eval("stampa_t(\"" . GetTemplate("lib/templates/bottomlist.html") . "\");"); if (count($piclist) > 0) { echo " <!-- GALLERY -->\n <center>\n"; foreach ($piclist as $i) { eval("stampa_t(\"" . GetTemplate("lib/templates/galist.html") . "\");"); } echo " </center>\n"; } echo "\n";
require_once 'pclzip.lib.php'; $archive = new PclZip($p); $dirname = explode("/", $p); array_pop($dirname); $dirname = implode("/", $dirname); if ($archive->extract(PCLZIP_OPT_PATH, $dirname) == 0) { die("Error : " . $archive->errorInfo(true)); } break; case 'filelist': $files = array_diff(scandir($p), array(".", "..")); $id = $_GET['nm']; if (is_dir($p . $files[$id])) { stampa($id, $p, $files[$id], 0, str_replace("../", "", $p)); } else { stampa($id, $p, $files[$id]); } break; } function GetTemplate($template) { return str_replace("\"", "\\\"", implode("", file($template))); } function stampa_t($template) { echo $template; } function item($i) { if ($i == 1) { return '1 item';
function print_msg($result, $msg, $verbosity) { array_push($result, $msg); if ($verbosity) { $ks = " {$msg}<br>"; stampa($ks); } return $result; }
<?php include 'class.ezpdf.php'; include 'db_connection.php'; $scoid = "34"; $cf = base64_decode($_REQUEST['key']); stampa($cf, $scoid); function check_data($_scoid, $_id_utente) { $query = "SELECT\njos_lms_quiz_r_student_quiz.c_date_time,\nDATE_FORMAT(jos_lms_quiz_r_student_quiz.c_date_time, '%d/%m/%Y') as timemodified\nFROM\njos_lms_quiz_r_student_quiz\nWHERE\njos_lms_quiz_r_student_quiz.c_quiz_id = '" . $_scoid . "' AND\njos_lms_quiz_r_student_quiz.c_student_id = '" . $_id_utente . "' AND\njos_lms_quiz_r_student_quiz.c_passed = 1\n"; $db_query = mysql_query($query) or die(mysql_error()); $riga = mysql_fetch_array($db_query); //echo $riga['c_date_time']; if ($riga['timemodified']) { return $riga['timemodified']; } else { return false; } } function stampa($cf, $scoid) { $query = "SELECT *\n\t\t\tFROM jos_comprofiler_2011\n\t\t\tWHERE cb_codicefiscale='" . $cf . "'\n\t\t\tLIMIT 1\n\t\t\t"; $db_query = mysql_query($query) or die(mysql_error()); $riga = mysql_fetch_array($db_query); //$riga=$riga[0]; $firstname = $riga['firstname']; $lastname = $riga['lastname']; $nome = $lastname . " " . $firstname; $professione = $riga['cb_professionedisciplina']; $datanascita = substr($riga['cb_datadinascita'], 8, 2) . "-" . substr($riga['cb_datadinascita'], 5, 2) . "-" . substr($riga['cb_datadinascita'], 0, 4); $luogonascita = $riga['cb_luogodinascita'];