27 require
'../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
"/core/lib/admin.lib.php";
29 require_once DOL_DOCUMENT_ROOT.
"/core/lib/files.lib.php";
30 require_once DOL_DOCUMENT_ROOT.
"/opensurvey/class/opensurveysondage.class.php";
33 $action =
GETPOST(
'action',
'aZ09');
36 $numsondage =
GETPOST(
"id",
'alpha');
41 $result = $object->fetch(0, $numsondage);
47 if (empty($user->rights->opensurvey->read)) {
64 $nbcolonnes = substr_count($object->sujet,
',') + 1;
65 $toutsujet = explode(
",", $object->sujet);
68 $input = $langs->trans(
"Name").
";";
69 for ($i = 0; $toutsujet[$i]; $i++) {
70 if ($object->format ==
"D") {
73 $input .= $toutsujet[$i].
';';
79 if (strpos($object->sujet,
'@') !==
false) {
81 for ($i = 0; $toutsujet[$i]; $i++) {
82 $heures = explode(
"@", $toutsujet[$i]);
83 $input .= $heures[1].
';';
90 $sql =
'SELECT nom as name, reponses';
91 $sql .=
' FROM '.MAIN_DB_PREFIX.
"opensurvey_user_studs";
92 $sql .=
" WHERE id_sondage='".$db->escape($numsondage).
"'";
93 $sql .=
" ORDER BY id_users";
96 $num = $db->num_rows(
$resql);
99 $obj = $db->fetch_object(
$resql);
102 $nombase = str_replace(
"°",
"'", $obj->name);
103 $input .= $nombase.
';';
106 $ensemblereponses = $obj->reponses;
107 for ($k = 0; $k < $nbcolonnes; $k++) {
108 if (empty($somme[$k])) {
111 $car = substr($ensemblereponses, $k, 1);
115 } elseif ($car ==
"2") {
131 $filesize = strlen($input);
132 $filename = $numsondage.
"_".
dol_print_date($now,
'%Y%m%d%H%M').
".csv";
136 header(
'Content-Type: text/csv; charset=utf-8');
137 header(
'Content-Length: '.$filesize);
138 header(
'Content-Disposition: attachment; filename="'.$filename.
'"');
139 header(
'Cache-Control: max-age=10');
Put here description of your class.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.