if (!file_exists($destDir)) {\r
mkdir($destDir, 0777, true);\r
}\r
- $fname = md5(implode(',%ù', $range)) . '.pdf';\r
+ $fname = md5(implode(',%Ã\83¹', $range)) . '.pdf';\r
$destFile = $destDir . '/' . $fname;\r
$destURL = '/fluidbook/cache/exportpdf/' . $book->book_id . '/' . $fname;\r
// If result exists, don't make the pdf again\r
exit;\r
}\r
\r
+ public function grdfValidForm() {\r
+ $notempty = array('civilite', 'prenom', 'nom', 'email', 'adresse', 'codepostal', 'ville', 'telephone', 'optin', 'connu', 'echeance');\r
+ $error = false;\r
+ $errors = array();\r
+ foreach ($notempty as $f) {\r
+ if (!isset($this->args[$f]) || is_null($this->args[$f]) || $this->args[$f] == 'null' || trim($this->args[$f]) == '') {\r
+ $error = true;\r
+ $errors[] = $f;\r
+ }\r
+ }\r
+\r
+ if (!cubeMail::isEmail($this->args['email'])) {\r
+ $error = true;\r
+ $errors[] = 'email_valid';\r
+ }\r
+\r
+ $this->xml->addChild('ok', $error ? '0' : '1');\r
+ $this->xml->addChild('errors', implode(',', $errors));\r
+ }\r
+\r
+ public function grdfSendForm() {\r
+ global $core;\r
+\r
+ $fields = array('Civilité' => 'civilite', 'Prénom' => 'prenom', 'Nom' => 'nom',\r
+ 'E-mail' => 'email', 'Adresse' => 'adresse', 'Code postal' => 'codepostal', 'Ville' => 'ville',\r
+ 'Téléphone' => 'telephone', 'Connu par' => 'connu', 'Echéance' => 'echeance',\r
+ 'Optin' => 'optin', 'Coupons sélectionnés' => 'reflist');\r
+\r
+ $mail = new cubeMail();\r
+ $mail->charset = 'UTF-8';\r
+ $mail->subject = '[Chéquier avantages] Validation de coupon';\r
+ $mail->from = 'noreply@chequieravantages.fr';\r
+ $mail->replyTo = 'noreply@chequiavantages.fr';\r
+ $mail->cc = 'gerald@sensoa.fr';\r
+ $mail->to = 'chequieravantages@gmail.com';\r
+ $body = '';\r
+\r
+\r
+\r
+ foreach ($fields as $k => $f) {\r
+ $body.=$k . ' : ' . $this->args[$f] . "\r\n";\r
+ $datas[$f] = $this->args[$f];\r
+ }\r
+ $datas['date'] = TIME;\r
+\r
+ $c = $core->con->openCursor('grdf');\r
+ $c->datas = json_encode($datas);\r
+ $c->insert();\r
+\r
+ $mail->body = $body;\r
+ $mail->send();\r
+ }\r
+\r
public function grdfCoupon() {\r
$this->outputXML = false;\r
$couponsRoot = WS_BOOKS . '/working/10828/commerce/';\r
$pdf->SetXY(15, 10);\r
$pdf->SetFont('Helvetica', '', 12);\r
$pdf->SetTextColor(0, 0, 0);\r
- $pdf->Cell(180, 10, trim($_GET['civilite'] . ' ' . $_GET['prenom'] . ' ' . $_GET['nom']) . ',');\r
+ $pdf->Cell(180, 10, utf8_decode(trim($_GET['civilite'] . ' ' . $_GET['prenom'] . ' ' . $_GET['nom']) . ','));\r
$pdf->SetXY(143, 203);\r
$pdf->SetFont('Helvetica', 'B', 18);\r
$pdf->Cell(33, 15, $code);\r
$pdf->Output('coupon.pdf', 'I');\r
}\r
\r
+ public function grdfExcel12568() {\r
+ global $core;\r
+ $this->outputXML = false;\r
+\r
+\r
+ $couponsRoot = WS_BOOKS . '/working/10828/commerce/';\r
+\r
+ $xml = simplexml_load_file($couponsRoot . 'references.xml');\r
+\r
+ $cols = array('Date' => 'date', 'Civilité' => 'civilite', 'Prénom' => 'prenom', 'Nom' => 'nom',\r
+ 'E-mail' => 'email', 'Adresse' => 'adresse', 'Code postal' => 'codepostal', 'Ville' => 'ville',\r
+ 'Téléphone' => 'telephone', 'Connu par' => 'connu', 'Echéance' => 'echeance',\r
+ 'Optin' => 'optin');\r
+ $refs = array();\r
+ foreach ($xml->xpath('//item') as $i) {\r
+ $refs[(string) $i['reference']] = $i['name'];\r
+ }\r
+\r
+ // \r
+ $h = '<table>';\r
+ $h.='<tr>';\r
+ foreach ($cols as $l => $k) {\r
+ $h.='<th>' . utf8_decode($l) . '</th>';\r
+ }\r
+ foreach ($refs as $k => $l) {\r
+ $h.='<th>' . utf8_decode($l) . '</th>';\r
+ }\r
+ $h.='</tr>';\r
+\r
+ $r = $core->con->select('SELECT * FROM grdf');\r
+ while ($r->fetch()) {\r
+ $d = json_decode($r->datas);\r
+ $rl = explode(',', $d->reflist);\r
+ $h.='<tr>';\r
+ foreach ($cols as $l => $k) {\r
+ $v = $d->$k;\r
+ if ($k == 'date') {\r
+ $v = date('Y-m-d H:i', $v);\r
+ }\r
+ $h.='<td>' . utf8_decode($v) . '</td>';\r
+ }\r
+ foreach ($refs as $k => $l) {\r
+ $v = in_array($k, $rl) ? '1' : '0';\r
+ $h.='<td>' . utf8_decode($v) . '</td>';\r
+ }\r
+ $h.='</tr>';\r
+ }\r
+\r
+ $h.='</table>';\r
+\r
+ ob_end_clean();\r
+ cubeHTTP::forceDownload('chequieravantages.xls');\r
+ echo $h;\r
+ return;\r
+ }\r
+\r
public function proxy() {\r
ob_end_clean();\r
fb(netHttp::quickGet($_GET['u'], 'php://output'));\r
$this->fields['linkTracker'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Tracking des liens'), 'grade' => 5);\r
$this->fields['linkTrackerRegexp'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Tracking des liens applicables aux liens du domaine'), 'grade' => 5);\r
$this->fields['linkMultimediaPerformanceMode'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Mode perfomance pour les liens multimédia'), 'grade' => 5);\r
+ $this->fields['linkMultimediaQuality'] = array('type' => 'float', 'default' => 1.0, 'editable' => true, 'label' => __('Qualité de rendu des animations'), 'grade' => 5);\r
$this->fields['linkCornerSize'] = array('type' => 'integer', 'default' => '10', 'editable' => true, 'label' => __('Taille des liens de coins de page'), 'hint' => __("Pourcentage de la largeur de la page"));\r
$this->forms['multimedia'] = array('label' => __('Liens et multimédia'),\r
- 'fieldsnames' => array('permanentLinks', 'linkBlinkTime', 'customLinkClass', 'linkTooltipManager', 'linkCornerSize', '|', 'linkTracker', 'linkTrackerRegexp', '|', 'linkMultimediaPerformanceMode'));\r
+ 'fieldsnames' => array('permanentLinks', 'linkBlinkTime', 'customLinkClass', 'linkTooltipManager', 'linkCornerSize', '|', 'linkTracker', 'linkTrackerRegexp', '|', 'linkMultimediaPerformanceMode','linkMultimediaQuality'));\r
//.\r
$this->fields['externalArchives'] = array('type' => 'freefile', 'default' => '', 'editable' => true,\r
'label' => __('Archives'), 'grade' => 3, 'fileFilter' => $swfFilter);\r