Commit f3898423 by Frederick d. Maus

mal so zwischen durch

1 parent 2e44eb72
...@@ -33,6 +33,10 @@ class D { ...@@ -33,6 +33,10 @@ class D {
// $param_htmlstring = str_replace(mcCONST::LINEBREAK, '', $param_htmlstring); // $param_htmlstring = str_replace(mcCONST::LINEBREAK, '', $param_htmlstring);
$textstring = str_replace($html_elements, $text_elements, $param_htmlstring); $textstring = str_replace($html_elements, $text_elements, $param_htmlstring);
$textstring = strip_tags($textstring);
return $textstring; return $textstring;
} }
......
...@@ -3,17 +3,66 @@ ...@@ -3,17 +3,66 @@
class mcConfig { class mcConfig {
private static $configs = array ( private static $configs = array (
'tmpdir' => '/tmp/', 'tmpdir' => '/tmp/',
'charset' => 'utf-8',
'storable_data' => array(
'kindof' => 'MySql',
'user' => 'user',
'db' => 'database',
'passwd' => 'password',
'host' => 'localhost',
),
); );
public static function getConfig($param_column) {
public static function setConfig(array $param_Configs) {
if(is_array($param_Configs) && !empty($param_Configs)) {
self::$configs = $param_Configs;
return true;
} else {
return false;
}
}
public static function getConfig($param_column, $param_param=null) {
if(array_key_exists($param_column, self::$configs)) { if(array_key_exists($param_column, self::$configs)) {
return self::$configs[$param_column];
if(is_null($param_param)) {
return self::$configs[$param_column];
} else if(array_key_exists($param_param, self::$configs[$param_column])) {
return self::$configs[$param_column][$param_param];
} else {
return false;
}
} else { } else {
return false; return false;
} }
} }
public static function getDSN() {
if(array_key_exists('storable_data', self::$configs) && is_array(self::$configs['storable_data'])
&& array_key_exists('kindof', self::$configs['storable_data']) && self::$configs['storable_data']['kindof']
&& array_key_exists('user', self::$configs['storable_data']) && self::$configs['storable_data']['user']
&& array_key_exists('db', self::$configs['storable_data']) && self::$configs['storable_data']['db']
&& array_key_exists('passwd', self::$configs['storable_data']) && self::$configs['storable_data']['passwd']
&& array_key_exists('host', self::$configs['storable_data']) && self::$configs['storable_data']['host']
) {
$dsn= strtolower(self::$configs['storable_data']['kindof'])
.'://'.self::$configs['storable_data']['user']
.':'.self::$configs['storable_data']['passwd']
.'@'.self::$configs['storable_data']['host']
.'/'.self::$configs['storable_data']['db'];
D::li($dsn);
return $dsn;
} else {
return false;
}
}
} }
?> ?>
...@@ -38,5 +38,45 @@ class mcCsv { ...@@ -38,5 +38,45 @@ class mcCsv {
echo $ausgabe; echo $ausgabe;
} }
/**
*
* @param array $param_csvConfig -- array(0=>'col1',1=>'col2',2=>'col3')
* @param array $param_csvValues -- array(0=>'val1',1=>'val2',2=>'val3')
* @return array|boolean
*/
public static function getCsvArrayForWriteDB(array $param_csvConfig, array $param_csvValues) {
if(is_array($param_csvConfig) && !empty($param_csvConfig)) {
$values = array();
foreach($param_csvConfig as $csv_coloum => $tab_cloumn) {
$values[$tab_cloumn] = $param_csvValues[$csv_coloum];
}
return $values;
} else {
return false;
}
}
/**
* show how the format for csv
*
* @param array $param_csvConfig -- array(0=>'col1',1=>'col2',2=>'col3')
*/
public static function showCsvFormatAsHtml(array $param_csvConfig) {
if(!is_null($param_csvConfig)) {
// $csv_columns = mcConfig::getConfig('csv', 'product');
$cvs_import_header = array();
$csv_header = '';
for($i=0; $i<count($param_csvConfig); $i++) {
if($param_csvConfig[$i]) {
$cvs_import_header[] = mcLanguage::getWord($param_csvConfig[$i]);
$csv_header .= '"'.mcLanguage::getWord($param_csvConfig[$i]).'", ';
}
}
mcTableHtml::showTable(array($cvs_import_header), mcLanguage::getWord('rowformat').': '.$csv_header);
}
}
} }
?> ?>
\ No newline at end of file
...@@ -63,5 +63,35 @@ class mcDate { ...@@ -63,5 +63,35 @@ class mcDate {
} }
} }
public static function getNowAsDatetime() {
$return = date('o-m-d H:i:s');
return $return;
}
/**
*
* @param array $param_date
* @return type
*/
private static function transformToDatetime(array $param_date) {
return ''.$param_date['Y'].'-'.$param_date['m'].'-'.$param_date['d'].' '.$param_date['H'].':'.$param_date['i'].':'.$param_date['s'].'';
}
public static function transformToArrayDatetime($param_date=null) {
if($param_date) {
if(is_array($param_date)) {
$tmp_date = mcDate::transformToDatetime($param_date);
} else {
$tmp_date = $param_date;
}
} else {
$tmp_date = mcDate::getNowAsDatetime();
}
return $tmp_date;
}
} }
?> ?>
...@@ -40,7 +40,7 @@ class mcFile { ...@@ -40,7 +40,7 @@ class mcFile {
} }
} }
public static function getFileContent($param_filename) { public static function getFileContent($param_filename, $param_asString = false) {
if(is_readable($param_filename)) { if(is_readable($param_filename)) {
try { try {
$handle = fopen ($param_filename, "r"); $handle = fopen ($param_filename, "r");
...@@ -49,7 +49,17 @@ class mcFile { ...@@ -49,7 +49,17 @@ class mcFile {
$array_content[] = fgets($handle); $array_content[] = fgets($handle);
} }
fclose ($handle); fclose ($handle);
return $array_content;
if($param_asString) {
$filecontent_string = '';
foreach($array_content as $line) {
$filecontent_string .= $line;
}
return $filecontent_string;
} else {
return $array_content;
}
} catch (Exception $e) { } catch (Exception $e) {
mcException::handleException($e); mcException::handleException($e);
return false; return false;
...@@ -58,6 +68,10 @@ class mcFile { ...@@ -58,6 +68,10 @@ class mcFile {
return Error::newError('DevError', 'file could not read', $param_code); return Error::newError('DevError', 'file could not read', $param_code);
} }
} }
public static function deleteFile($param_filename) {
return unlink($param_filename);
}
} }
?> ?>
...@@ -5,8 +5,8 @@ class mcLanguage { ...@@ -5,8 +5,8 @@ class mcLanguage {
'deu' => array( 'deu' => array(
) )
); );
public static function setLanguage($param_Language, $param_LanguageTranslationArray=null) { public static function setLanguage($param_Language, array $param_LanguageTranslationArray=null) {
if(array_key_exists($param_Language, Language::$Words)) { if(array_key_exists($param_Language, self::$Words) && is_null($param_LanguageTranslationArray)) {
self::$Language = $param_Language; self::$Language = $param_Language;
} else if(is_array($param_LanguageTranslationArray)) { } else if(is_array($param_LanguageTranslationArray)) {
......
...@@ -3,5 +3,38 @@ class mcNumber { ...@@ -3,5 +3,38 @@ class mcNumber {
public static function form2($param_number) { public static function form2($param_number) {
return number_format(round($param_number, 2), 2, ",", "."); return number_format(round($param_number, 2), 2, ",", ".");
} }
public static function form5($param_number) {
return number_format(round($param_number, 5), 2, ",", ".");
}
public static function transformStringToFloat($param_string) {
// D::ulli($param_string);
if(strpos($param_string, ',')!==false) {
$param_string = str_replace(',', '.', $param_string);
}
// D::ulli('return '.$price);
return $param_string;
}
public static function transformProcentToInt($param_procent) {
if(strpos($param_procent, '%')!==false) {
$percent = str_replace('%', '', $param_procent);
$percent = trim($percent);
} else if(strpos($param_procent, '0,')!==false) {
$percent = 100*mcNumber::transformStringToFloat($param_procent);
} else {
$percent = $param_procent;
}
// D::li('transformProcentToInt '.$param_procent.' => '.$percent);
return trim($percent);
}
} }
?> ?>
...@@ -113,7 +113,7 @@ class mcPerformance { ...@@ -113,7 +113,7 @@ class mcPerformance {
public static function showStats() { public static function showStats() {
global $_LOSP_DEV; global $_LOSP_DEV;
if($_LOSP_DEV) { if($_LOSP_DEV) {
D::h1('static calls'); D::h2('static calls');
foreach(mcPerformance::$StaticCalls as $classname => $fnc) { foreach(mcPerformance::$StaticCalls as $classname => $fnc) {
D::li('<b>'.$classname.'</b>'); D::li('<b>'.$classname.'</b>');
foreach($fnc as $fncname => $FncCalls) { foreach($fnc as $fncname => $FncCalls) {
...@@ -145,7 +145,7 @@ class mcPerformance { ...@@ -145,7 +145,7 @@ class mcPerformance {
} }
} }
D::h1('object calls'); D::h2('object calls');
foreach(mcPerformance::$ObjectCalls as $classname => $fnc) { foreach(mcPerformance::$ObjectCalls as $classname => $fnc) {
if(array_search('getID', get_class_methods($classname))) { if(array_search('getID', get_class_methods($classname))) {
$getIDFnc = true; $getIDFnc = true;
......
<? <?
class mcQuickForm {
private static $quickform = null;
private static $file = null;
public static function start($param_FormName) {
self::$quickform = new HTML_QuickForm2($param_FormName, "post", 'index.php?action=' );
}
public static function file($param_element_name='datei', $param_maxfilesize=null, $param_mimetype=null) {
self::$file = self::$quickform->addElement('file', $param_element_name, mcLanguage::getWord('fileForm'));
// self::$quickform->setMaxFileSize($maxfilesize);
if($param_maxfilesize!=null) {
// Regel zum Pruefen der Dateigroesse
self::$quickform->addRule($param_element_name, mcLanguage::getWord('fileToBig'),'maxfilesize', $param_maxfilesize);
}
if($param_mimetype!=null) {
self::$quickform->addRule($param_element_name, mcLanguage::getWord('onlyFileMime').' ('.$param_mimetype,'mimetype'.')', $param_mimetype);
}
}
public static function procedure() {
// if (self::$quickform->validate()) {
//
//// if (self::$file->isUploadedFile()) {
//
//// self::$file->moveUploadedFile('/tmp');
//
// $fileInfo = self::$file->getValue();
//
// print_r($fileInfo);
//
//// }
//
// } else {
//
// self::$quickform->display();
//
// }
if (false===self::$quickform->validate()) {
self::$quickform->display();
echo self::$quickform;
}
else
{
// D::show(self::$quickform,1,1,1);
// Daten auslesen
$datei = self::$quickform->getElement('datei');
// D::show(self::$quickform,' '.self::$quickform->elementExists('datei'),1,1);
$daten= $datei->getValue();
// Fehler aufgetreten?
if (0!=$datei['error'])
{
echo 'Ein Fehler ist aufgetreten';
}
else
{
// Datei verschieben
if (false === $datei->moveUploadedFile('/daten'))
{
if (false===copy ($daten['tmp_name'], "/daten/$daten[name]")) {
die ('Konnte Datei nicht kopieren ');
}
}
// Informationen zur Datei ausgeben
echo "Name: $daten[name]<br />";
echo "MIME-Type: $daten[type]<br />";
echo "Tempor&auml;rer Name: $daten[tmp_name]<br />";
echo "Gr&ouml;&szlig;e: $daten[size]<br />";
}
}
}
public static function end() {
self::$quickform->addElement( 'button', 'SubmitButton', array('type' => 'submit'), array('content' => mcLanguage::getWord('save')) );
}
public static function getForm() {
return self::$quickform;
}
}
//{
//
// $fsText = $quickform->addElement('fieldset')->setLabel(Language::getWord('edit_Zinsbenachrichtigung_Textfeld'));
//
// $defaults = array();
//
// $qf_Subject = $fsText->addElement('textarea', 'edit_Zinsbenachrichtigung_Textfeld', array('style' => self::$Zinsbenachrichtigung_Textfeld_Size ), array('label' => Language::getWord('edit').' '.Language::getWord('Text').':'));
// $defaults['edit_Zinsbenachrichtigung_Textfeld'] = $TextfeldActiveRecord->text;
//
// $quickform->addDataSource(new HTML_QuickForm2_DataSource_Array($defaults));
//
//
//
//
//}
?> ?>
...@@ -19,6 +19,7 @@ if($_LOSP_DEV) { ...@@ -19,6 +19,7 @@ if($_LOSP_DEV) {
D::printToScreen(); D::printToScreen();
} }
if($__mc_D_LOGFILE) { if($__mc_D_LOGFILE) {
D::li($__mc_D_LOGFILE);
D::printToFile($__mc_D_LOGFILE,'a'); D::printToFile($__mc_D_LOGFILE,'a');
} }
} }
......
...@@ -17,11 +17,23 @@ if($__mc_ERRORHANDLER) { ...@@ -17,11 +17,23 @@ if($__mc_ERRORHANDLER) {
if($_LOSP_DEV) { if($_LOSP_DEV) {
error_reporting(E_ALL); error_reporting(E_ALL);
$var_message = '['.date('d. m. Y G:i').'] DEVMODE: logfile wurde zurvor geloescht';
if($__mc_D_LOGFILE) { if($__mc_D_LOGFILE) {
unlink ( $__mc_D_LOGFILE ); if($__mc_D_LOGFILE_RESET) {
mcFile::write($__mc_D_LOGFILE, $var_message, 'w'); $var_message = '['.date('d. m. Y G:i').'] DEVMODE: logfile wurde zurvor geloescht';
unlink ( $__mc_D_LOGFILE );
mcFile::write($__mc_D_LOGFILE, $var_message, 'w');
} else {
$var_message = mcCONST::LINEBREAK.mcCONST::LINEBREAK.mcCONST::LINEBREAK.mcCONST::LINEBREAK.mcCONST::LINEBREAK.mcCONST::LINEBREAK
.'################################################'.mcCONST::LINEBREAK
.'################################################'.mcCONST::LINEBREAK
.'################################################'.mcCONST::LINEBREAK
.'# ['.date('d. m. Y G:i').'] DEVMODE #'.mcCONST::LINEBREAK
.'################################################'.mcCONST::LINEBREAK;
mcFile::write($__mc_D_LOGFILE, $var_message, 'a');
}
} }
//mcFile::write('log/tmp.bla', date('d.m.Y G:i:s').': '.$_SERVER['SCRIPT_NAME'].' -- '.$_SERVER['REQUEST_URI'].mcCONST::TAB.($_SERVER['SCRIPT_NAME']==$_SERVER['REQUEST_URI']).mcCONST::LINEBREAK, 'a'); //mcFile::write('log/tmp.bla', date('d.m.Y G:i:s').': '.$_SERVER['SCRIPT_NAME'].' -- '.$_SERVER['REQUEST_URI'].mcCONST::TAB.($_SERVER['SCRIPT_NAME']==$_SERVER['REQUEST_URI']).mcCONST::LINEBREAK, 'a');
foreach($__mc_Report as $Report) { foreach($__mc_Report as $Report) {
......
...@@ -28,6 +28,18 @@ require_once $__PATH_to_mcClasses . 'class_mcDeprecated.inc.php'; ...@@ -28,6 +28,18 @@ require_once $__PATH_to_mcClasses . 'class_mcDeprecated.inc.php';
require_once $__PATH_to_mcClasses . 'class_mcArray.inc.php'; require_once $__PATH_to_mcClasses . 'class_mcArray.inc.php';
require_once $__PATH_to_mcClasses . 'class_mcDate.inc.php'; require_once $__PATH_to_mcClasses . 'class_mcDate.inc.php';
require_once $__PATH_to_mcClasses . 'class_mcQRCode.inc.php'; require_once $__PATH_to_mcClasses . 'class_mcQRCode.inc.php';
require_once $__PATH_to_mcClasses . 'class_mcInputHandler.inc.php';
require_once $__PATH_to_mcClasses . 'class_mcSort.inc.php';
//require_once $__PATH_to_mcClasses . 'class_.inc.php';
//require_once $__PATH_to_mcClasses . 'class_.inc.php';
require_once $__PATH_to_mcClasses . 'ReportHandling/class_mcMessageReport.inc.php';
require_once $__PATH_to_mcClasses . 'html/class_mcTableHtml.inc.php';
require_once $__PATH_to_mcClasses . 'html/class_mcQuickform2.inc.php';
require_once $__PATH_to_mcClasses . 'html/class_mcHelp.inc.php';
require_once $__PATH_to_mcClasses . 'ReportHandling/class_mcReport.inc.php'; require_once $__PATH_to_mcClasses . 'ReportHandling/class_mcReport.inc.php';
require_once $__PATH_to_mcClasses . 'ReportHandling/class_Error.inc.php'; require_once $__PATH_to_mcClasses . 'ReportHandling/class_Error.inc.php';
...@@ -41,7 +53,7 @@ require_once $__PATH_to_mcClasses . 'class_mcCrypt.inc.php'; ...@@ -41,7 +53,7 @@ require_once $__PATH_to_mcClasses . 'class_mcCrypt.inc.php';
require_once $__PATH_to_mcClasses . 'class_mcString.inc.php'; require_once $__PATH_to_mcClasses . 'class_mcString.inc.php';
require_once $__PATH_to_mcClasses . 'class_mcNumber.inc.php'; require_once $__PATH_to_mcClasses . 'class_mcNumber.inc.php';
require_once $__PATH_to_mcClasses . 'class_mcFPDF.inc.php'; require_once $__PATH_to_mcClasses . 'class_mcFPDF.inc.php';
require_once $__PATH_to_mcClasses . 'class_mcQuickForm.inc.php';
require_once $__PATH_to_mcClasses . 'class_mcLanguage.inc.php'; require_once $__PATH_to_mcClasses . 'class_mcLanguage.inc.php';
require_once $__PATH_to_mcClasses . 'finance/class_mcZinsmethoden.inc.php'; require_once $__PATH_to_mcClasses . 'finance/class_mcZinsmethoden.inc.php';
......

578 Bytes | W: | H:

566 Bytes | W: | H:

service/qrcode/tmp/tmp_qrfile.png
service/qrcode/tmp/tmp_qrfile.png
service/qrcode/tmp/tmp_qrfile.png
service/qrcode/tmp/tmp_qrfile.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!