26 require
'../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.
"/core/lib/admin.lib.php";
28 require_once DOL_DOCUMENT_ROOT.
"/core/lib/files.lib.php";
29 require_once DOL_DOCUMENT_ROOT.
"/opensurvey/class/opensurveysondage.class.php";
31 $action =
GETPOST(
'action',
'aZ09');
35 $numsondage =
GETPOST(
"id",
'alpha');
39 $result = $object->fetch(0, $numsondage);
40 if ($result <= 0)
dol_print_error(
'',
'Failed to get survey id '.$numsondage);
55 $nbcolonnes = substr_count($object->sujet,
',') + 1;
56 $toutsujet = explode(
",", $object->sujet);
59 $input .= $langs->trans(
"Name").
";";
60 for ($i = 0; $toutsujet[$i]; $i++)
62 if ($object->format ==
"D")
64 $input .=
''.dol_print_date($toutsujet[$i],
'dayhour').
';';
66 $input .=
''.$toutsujet[$i].
';';
72 if (strpos($object->sujet,
'@') !==
false)
75 for ($i = 0; $toutsujet[$i]; $i++)
77 $heures = explode(
"@", $toutsujet[$i]);
78 $input .=
''.$heures[1].
';';
85 $sql =
'SELECT nom as name, reponses';
86 $sql .=
' FROM '.MAIN_DB_PREFIX.
"opensurvey_user_studs";
87 $sql .=
" WHERE id_sondage='".$db->escape($numsondage).
"'";
88 $sql .=
" ORDER BY id_users";
92 $num = $db->num_rows(
$resql);
96 $obj = $db->fetch_object(
$resql);
99 $nombase = str_replace(
"°",
"'", $obj->name);
100 $input .= $nombase.
';';
103 $ensemblereponses = $obj->reponses;
104 for ($k = 0; $k < $nbcolonnes; $k++)
106 $car = substr($ensemblereponses, $k, 1);
111 } elseif ($car ==
"2")
126 $filesize = strlen($input);
127 $filename = $numsondage.
"_".
dol_print_date($now,
'%Y%m%d%H%M').
".csv";
131 header(
'Content-Type: text/csv; charset=utf-8');
132 header(
'Content-Length: '.$filesize);
133 header(
'Content-Disposition: attachment; filename="'.$filename.
'"');
134 header(
'Cache-Control: max-age=10');
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_now($mode= 'auto')
Return date for now.
Put here description of your class.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $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...