*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see
| '. $langs->trans("Survey").' | '. $langs->trans("Type") .' | '. $langs->trans("Title") .' | '. $langs->trans("Author") .' | '. $langs->trans("ExpireDate") .' | '. $langs->trans("NbOfVoters") .' | '."\n"; $sql = "SELECT id_sondage, id_sondage_admin, mail_admin, format, origin, date_fin, titre, nom_admin"; $sql.= " FROM ".MAIN_DB_PREFIX."opensurvey_sondage as p"; // Count total nb of records $nbtotalofrecords = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); } $sql.= " ORDER BY $sortfield $sortorder "; $sql.= " ".$db->plimit($conf->liste_limit+1, $offset); $resql=$db->query($sql); if (! $resql) dol_print_error($db); $num=$db->num_rows($resql); $i = 0; $var = true; while ($i < min($num,$limit)) { $obj=$db->fetch_object($resql); $sql2='select COUNT(*) as nb from '.MAIN_DB_PREFIX."opensurvey_user_studs where id_sondage='".$db->escape($obj->id_sondage)."'"; $resql2=$db->query($sql2); if ($resql2) { $obj2=$db->fetch_object($resql2); $nbuser=$obj2->nb; } else dol_print_error($db); $var=!$var; print ' | |
| '; print ''.img_picto('','object_opensurvey').' '.$obj->id_sondage.''; print ' | '; $type=($obj->format=='A' || $obj->format=='A+')?'classic':'date'; print img_picto('',dol_buildpath('/opensurvey/img/'.($type == 'classic'?'chart-32.png':'calendar-32.png'),1),'width="16"',1); print ' '.$langs->trans($type=='classic'?"TypeClassic":"TypeDate"); print ' | '.$obj->titre.' | '.$obj->nom_admin.' | '; print ''.dol_print_date($db->jdate($obj->date_fin),'day'); if ($db->jdate($obj->date_fin) < time()) { print ' '.img_warning(); } print ' | '; print''.$nbuser.' | '."\n"; print 'id_sondage_admin.'&action=delete">'.img_picto('', 'delete.png').' | '."\n"; print '|