- Posts: 5
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
<script> jQuery(document).ready( function(){ // console.log('onload alert!'); $('table.printouttable > tbody > tr').each(function(i) { if ( $('td:first-child', this).text().substr('Classement') && $('td:last-child', this).text() == '' ) { $('td', this).remove(); } if (( $('td:first-child', this).text() == 'id' ) ) { $('td', this).remove(); } if (( $('td:first-child', this).text() == 'Adresse IP' ) ) { $('td', this).remove(); } if (( $('td:first-child', this).text() == 'Carnet soumis au vote du CS' ) ) { $('td', this).remove(); } }) ; $("tr:not(:has(td))").remove(); }); </script> {ANSWERTABLE}
<?php /* * affichage récapitulatif uniquement des informations non vides * LimeSurvey * Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz * All rights reserved. * License: GNU/GPL License v2 or later, see LICENSE.php * LimeSurvey is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. * * $Id: printanswers.php 9858 2011-03-08 12:50:47Z c_schmitz $ * */ $H1entete = "" ; require_once('formation_config.php'); @session_start(); if (isset($_REQUEST['id'])) $id=(int)$_REQUEST['id']; else die("Identifiant manquant"); if (isset($_REQUEST['sid'])) $sid=(int)$_REQUEST['sid']; else die("Numéro de questionnaire manquant"); if (isset($_REQUEST['cl'])) $cl=$_REQUEST['cl']; else $cl = 'fr' ; if (!(in_array($cl, array_values($langs)))) { $cl = 'fr' ; } if (!$formation->validUserHypo()) { header('location:connexion.php?sid='.$sid.'&id='.$id); } if (!$formation->checkActiveSurvey ($surveyid)) { $formation->safe_die ("Problème sur l'identifiant du questionnaire") ; } require_once($oldversion.'/classes/core/startup.php'); require_once($oldversion.'/config-defaults.php'); require_once($oldversion.'/common.php'); $printoutput = "" ; $aFullResponseTable = @aGetFullResponseTable ($surveyid, $id, $cl); //Get the fieldmap @TODO: do we need to filter out some fields? unset ($aFullResponseTable['id']); unset ($aFullResponseTable['token']); unset ($aFullResponseTable['lastpage']); unset ($aFullResponseTable['startlanguage']); unset ($aFullResponseTable['datestamp']); unset ($aFullResponseTable['startdate']); $printoutput .= "<table class='printouttable' >\n"; $oldgid = 0; $oldqid = 0; foreach ($aFullResponseTable as $sFieldname=>$fname) { if (substr($sFieldname,0,4)=='gid_') { $printoutput .= "\t<tr class='printanswersgroup'><td colspan='2'>{$fname[0]}</td></tr>\n"; } elseif (substr($sFieldname,0,4)=='qid_') { $printoutput .= "\t<tr class='printanswersquestionhead'><td colspan='2'>{$fname[0]}</td></tr>\n"; } else { // AD : suppression des valeurs des réponses (mises entre crochets après le libellé de la réponse) if ($fname[2] != '') { $fname[2] = preg_replace('!\[.*?\]$!', '', $fname[2]); // AD : il manque un espace avant le libellé de la sous-réponse $fname[1] = str_replace ('[', ' [', $fname[1]) ; $printoutput .= "\t<tr class='printanswersquestion'><td class='printanswersanswerlabel'>{$fname[0]} {$fname[1]}</td><td class='printanswersanswertext'>{$fname[2]}</td></tr>"; } } } $printoutput .= "</table>\n"; //sendcacheheaders(); //doHeader();
$templatesdir = "upload/templates/openedition" ; $html = ' <html xmlns="https://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"><head> <script type="text/javascript" src="'.$urlscript.'/scripts/jquery/jquery.js"></script> <script type="text/javascript" src="'.$urlscript.'/scripts/jquery/jquery-ui.js"></script> <script type="text/javascript" src="'.$urlscript.'/scripts/jquery/jquery.ui.touch-punch.min.js"></script> <link href="'.$urlscript.'/scripts/jquery/css/start/jquery-ui.css" media="all" type="text/css" rel="stylesheet"><link href="'.$urlscript.'/scripts/jquery/css/start/lime-progress.css" media="all" type="text/css" rel="stylesheet"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Formulaire d\'inscription à la plateforme Hypotheses.org – </title> <meta name="generator" content="Inscription d\'un nouveau carnet"> <!-- The following CSS hides visual elements of the progress bar from screen readers. --> <style type="text/css" media="aural tty"> progress-graph .zero, progress-graph .graph, progress-graph .cent { display: none; } </style> /* appel à template.js */ /* favicon */ <script type="text/javascript" src="'.$urlscript.'/scripts/survey_runtime.js"></script> </head> <body id="page_bg"> <div id="wrapper2"> <div id="wrapper"> <div id="header"> <div class="rk-1"> <div class="rk-2"> /* une image */ </div> </div> </div> <div class="survey-main"><script>' ; $html .= " jQuery(document).ready( function(){ $('table.printouttable > tbody > tr').each(function(i) { if ( $('td:first-child', this).text().substr('Classement') && $('td:last-child', this).text() == '' ) { $('td', this).remove(); } if (( $('td:first-child', this).text() == 'id' ) ) { $('td', this).remove(); } if (( $('td:first-child', this).text() == 'Adresse IP ' ) ) { $('td', this).remove(); } if (( $('td:first-child', this).text() == 'Carnet soumis au vote du CS' ) ) { $('td', this).remove(); } if (( $('td:first-child', this).text() == '<ul></ul>' ) ) { $('td', this).remove(); } }) ; $(\"tr:not(:has(td))\").remove(); }); </script>\n" ; $html .= $printoutput ; $html .= "</body></html>"; echo $html ;