Commit 5ccb0643 by sn

einfach so commitet und gepusht .. keine Ahnung was der letzte Stand bei mir war…

… ... zulange her .... auf Wunsch vom um
1 parent 3bac88ba
<?php
class mcCsv {
public static function exportCsv($param_xml,$param_name){
$cut_Array=explode('CUT_VALUE_FOR_NOT_THE_HEADER',$param_xml);
//file_name
$var_filename = 'export_'.$param_name.'.csv';
/**
* transform array to csv format and export as file
*
* @since 20110920 @author n@mensch.coop
* @static
* @downgraded for php4
*
* @param array $param_array
* @param type $param_filename
* @param array $param_search
* @param array $param_replace
*/
function exportArrayToCsv(array $param_array, $param_charset='utf-8', $param_filename='download.csv', array $param_search = array('"', ';'), array $param_replace = array("'", " ")) {
$ausgabe = '';
if (is_array($param_array) && count($param_array)!=0) {
foreach ($param_array as $daten) {
if (is_array($daten) == true) {
foreach ($daten as $key => $value) {
$ausgabe .= '"'.str_replace($param_search, $param_replace, $daten[$key]).'";';
}
}
$ausgabe .= "\n";
}
} else {
$ausgabe .= '"no data;"';
}
// Header senden
header("Content-Disposition: attachment; filename =".$var_filename);
header("Content-Type: text/plain");
// Datei ausgeben
echo trim($cut_Array[1]);
if (headers_sent() == false) {
header("Content-type: text/csv; charset='.$param_charset");
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header("Content-Disposition: attachment; filename =".$param_filename);
header('Pragma: no-cache');
}
echo $ausgabe;
}
}
?>
\ No newline at end of file
......@@ -5,14 +5,19 @@
* require_once('lib/phpqrcode/qrlib.php');
*/
class mcQRCode {
public static function createQRCode($param_txt, $param_filename, $param_dir=null) {
public static function createQRCode($param_txt, $param_filename=null, $param_dir=null) {
if($param_txt && $param_filename) {
if(is_null($param_dir)) {
$param_dir = mcConfig::getConfig('tmpdir');
if(!is_null($param_filename)) {
if(is_null($param_dir)) {
$param_dir = mcConfig::getConfig('tmpdir');
}
QRcode::png($param_txt, $param_dir.$param_filename);
return $param_dir.$param_filename;
} else {
return QRcode::png($param_txt);
}
QRcode::png($param_txt, $param_dir.$param_filename);
return $param_dir.$param_filename;
} else {
return false;
}
......
<?php
require_once("../include.php");
$content = mcFile::getFileContent('Adressbuch_geli-hh_namen.ldif');
$content = mcFile::getFileContent('Adressbuch_joufixe20110806.ldif');
//print_r($content);
$array_mail = array();
......@@ -23,6 +23,6 @@ foreach($content as $lnr => $line) {
}
print_r($array_mail);
mcFile::write('mail.txt', $string_mail);
mcFile::write('Adressbuch_joufixe20110806.txt', $string_mail);
?>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!