public static function kadreoDevis8524147851()
{
global $core;
+ wsDroits::admin(true);
$xls = new PHPExcel();
$batch[] = array_merge($e[$user['entreprise']], array('email' => $user['email'], 'LOCALE' => $user['lang'], 'FNAME' => $user['prenom'], 'LNAME' => $user['nom']));
}
- $api = new CubeIT_Services_Mailchimp('2b255293f3595181dd7d079d29dc6b99-us14');
- $res = $api->batchSubscribe('8ff710b78e', $batch);
+// $api = new CubeIT_Services_Mailchimp('2b255293f3595181dd7d079d29dc6b99-us14');
+// $res = $api->batchSubscribe('8ff710b78e', $batch);
echo '<pre>OK</pre>';
}
}\r
\r
if ($assoc) {\r
- $worksheets[$title] = self::_assocSheet($worksheet->toArray(null, true, true));\r
+ $worksheets[$title] = self::_assocSheet(self::worksheetToArray($worksheet));\r
} else {\r
- $worksheets[$title] = $worksheet->toArray(null, true, true);\r
+ $worksheets[$title] = self::worksheetToArray($worksheet);\r
}\r
}\r
file_put_contents($cacheFile, json_encode($worksheets));\r
return $worksheets;\r
}\r
\r
+ /**\r
+ * @param $worksheet PHPExcel_Worksheet\r
+ * @return array\r
+ */\r
+ public static function worksheetToArray($worksheet)\r
+ {\r
+ $w = $worksheet->toArray(null, true, true);\r
+ $res = [];\r
+ foreach ($w as $line) {\r
+ $empty = true;\r
+ foreach ($line as $k => $v) {\r
+ if (null === $v || $v === '') {\r
+ $v = '';\r
+ } else {\r
+ $empty = false;\r
+ }\r
+ $line[$k] = $v;\r
+ }\r
+ if ($empty) {\r
+ continue;\r
+ }\r
+ $res[] = $line;\r
+ }\r
+ return $res;\r
+ }\r
+\r
public static function excelToArrayKeyVal($excelFile, $reader = 'Excel2007')\r
{\r
$worksheets = self::excelToArray($excelFile, false, $reader);\r