| | |
| | | class functions { |
| | | |
| | | |
| | | public function mail($to, $subject, $text, $from, $filepath = '', $filetype = 'application/pdf', $filename = '', $cc = '', $bcc = '') { |
| | | public function mail($to, $subject, $text, $from, $filepath = '', $filetype = 'application/pdf', $filename = '', $cc = '', $bcc = '', $from_name = '') { |
| | | global $app,$conf; |
| | | |
| | | if($conf['demo_mode'] == true) $app->error("Mail sending disabled in demo mode."); |
| | |
| | | $mail_config['use_smtp'] = true; |
| | | $app->ispcmail->setOptions($mail_config); |
| | | } |
| | | $app->ispcmail->setSender($from); |
| | | $app->ispcmail->setSender($from, $from_name); |
| | | $app->ispcmail->setSubject($subject); |
| | | $app->ispcmail->setMailText($text); |
| | | |
| | |
| | | return $out; |
| | | } |
| | | |
| | | public function currency_format($number) { |
| | | public function currency_format($number, $view = '') { |
| | | global $app; |
| | | $number_format_decimals = (int)$app->lng('number_format_decimals'); |
| | | if($view != '') $number_format_decimals = (int)$app->lng('number_format_decimals_'.$view); |
| | | if(!$number_format_decimals) $number_format_decimals = (int)$app->lng('number_format_decimals'); |
| | | |
| | | $number_format_dec_point = $app->lng('number_format_dec_point'); |
| | | $number_format_thousands_sep = $app->lng('number_format_thousands_sep'); |
| | | if($number_format_thousands_sep == 'number_format_thousands_sep') $number_format_thousands_sep = ''; |
| | |
| | | return $result_array; |
| | | } |
| | | |
| | | |
| | | public function intval($string, $force_numeric = false) { |
| | | if(intval($string) == 2147483647) { |
| | | if($force_numeric == true) return floatval($string); |
| | | elseif(preg_match('/^([-]?)[0]*([1-9][0-9]*)([^0-9].*)*$/', $string, $match)) return $match[1].$match[2]; |
| | | else return 0; |
| | | } else { |
| | | return intval($string); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |