/** * Extracts the array elements with given keys * * @param array $array * @param array $keys * * @return array the filtered array **/ function arrayByKeys($array, $keys = array(), $keep_keys = true) { $returned = array(); foreach ($array as $key => $value) { if (in_array($key, $keys)) { if ($keep_keys == true) { $returned[$key] = $value; } else { $returned[] = $value; } } } return $returned; } ?> /** * Subtracts $arr2 from $arr1 * * @param array $arr1 * @param array $arr2 * * @return array the array after the subtraction **/ function arrayDiffKeyRecursive(array $arr1, array $arr2) { $diff = array_diff_key($arr1, $arr2); $intersect = array_intersect_key($arr1, $arr2); foreach ($intersect as $k => $v) { if (is_array($arr1[$k]) && is_array($arr2[$k])) { $d = arrayDiffKeyRecursive($arr1[$k], $arr2[$k]); if ($d) { $diff[$k] = $d; } } } return $diff; } ?> ########################################### # # name: MONEY_EXCHANGE # function: MONEY_EXCHANGE # author: erdsoft.com # ########################################### # DESCRIPTION: # A funkcio visszaadja a felvaltott penz osszeget. ########################################### # INPUT: # 1. $src_valuta - forras valuta (amibol valtunk) # 2. $dest_valuta - cel valuta (amibe valtunk) # 3. $amount - az osszeg amit valtani szeretnenk ########################################### # OUPTUP: a felvaltott osszeg ########################################### function money_exchange($src_valuta, $dest_valuta, $amount){ $link = 'http://finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s='. $src_valuta . $dest_valuta .'=X'; $fetch = @fopen($link, 'r'); if ($fetch) { $data = fgets($fetch, 4096); fclose($fetch); } $filtered = explode(',', $data); return round(($filtered[1] * $amount), 2); } ?> ########################################### # # name: CSV 2 ARRAY # function: CSV2ARRAY # author: erdsoft.com # ########################################### # DESCRIPTION: # A funkcio a CSV fajlbol az oszlopokat tombe rendezi. ########################################### # INPUT: # 1. $file - fajl elerhetosege # 2. $startROW - hanyadik sortol kezdje az adatfeltoldozast # 3. $stopCOL - a nulladik oszloptol hanyadik oszlopig vegye ki az adaokat ########################################### # OUPTUP: a TOMB[SOR][OSZLOP], vagy rovid uzenet az allapotrol ha nem sikerult ########################################### function CSV2ARRAY($file, $startROW = 0, $stopCOL){ if(($handle = fopen($file, "r")) !== FALSE){ $i=0; $tomb = array(); while(($data = fgetcsv($handle, 1000, ";")) !== FALSE){ if($i >= $startROW){ for($z=0; $z<$stopCOL; $z++){ if(isset($data[$z])){ $tomb[$i][$z] = $data[$z]; } } } $i++; } return $tomb; }else{ return "CANTOPEN"; } } ?> function endsWith($string, $test) { $strlen = strlen($string); $testlen = strlen($test); if ($testlen > $strlen) return false; return substr_compare($string, $test, -$testlen) === 0; } ?> ########################################### # # name: HTML2PDF # function: HTML2PDF # author: erdsoft.com # ########################################### # DESCRIPTION: # A funkcio html kodbol elkesziti es elmenti a pdf fajlt. ########################################### # INPUT: # 1. $url - az oldal linkjet tartalmazza # 2. $savetofile - ha igaz, akkor lementi a megadott helyre a fajlt es visszaadja a fajl eleresi utvonalat a roothoz kepest # 3. $filename - fajl neve direktoriumokhoz kepest, roothoz kepest kell megadni ########################################### # OUPTUP: a pdf fajl linkje ########################################### function HTML2PDF($url, $savetofile = true, $filename = 'files/other/ErdsoftPDF.pdf') { error_reporting(E_ALL); ini_set('display_errors', TRUE); ini_set('display_startup_errors', TRUE); define("_MAINPATH", realpath(dirname(__FILE__) . '/..')); define("_CLASS_FOLDER", _MAINPATH . '/class/mPDF'); // pdf osztaly betoltese require_once(_CLASS_FOLDER . '/mpdf.php'); // temp folderek definialasa define("_MPDF_TEMP_PATH", _CLASS_FOLDER . '/tmp'); define("_MPDF_TTFONTDATAPATH", _CLASS_FOLDER . '/tmp'); // oldal tartalmanak lekerese if (strpos($url, '://') === false) { $url = $_CONFIG['url'] . '/' . $url; } $htmlcode = implode(file($url)); // stiluslapok keresese a kodban $dom = new DOMDocument(); $dom->loadHTML($htmlcode); $linktags = $dom->getElementsByTagName('link'); $stylesheets = array(); foreach ($linktags as $lt) { foreach ($lt->attributes as $name => $attr) { if ($name == 'href' && strpos($attr->value, '.css') !== false) { $stylesheets[] = str_replace('DOMNamedNodeMap Object ( )', '', $attr->value); } } } $mpdf = new mPDF( 'utf-8', // mode - default '' 'A4', // format - A4, for example, default '' 0, // font size - default 0 '', // default font family 0, // margin_left 0, // margin right 0, // margin top 0, // margin bottom 0, // margin header 0, // margin footer 'P' // L - landscape, P - portrait ); // fajlba iras foreach ($stylesheets as &$stylesheet) { if (strpos($stylesheet, '://') === false) { $stylecode = file_get_contents($_CONFIG['url'] . '/' . $stylesheet); } $mpdf->WriteHTML( str_replace( array('"../', "'../", '(../'), array('"' . $_CONFIG['url'], "'" . $_CONFIG['url'], '(' . $_CONFIG['url']), $stylecode ), 1 ); } $mpdf->WriteHTML($htmlcode, 2); // fajlba mentes, ha igaz // kulonben csak megjelenitjuk legeneralt pdf fajlt if ($savetofile) { $mpdf->Output(_MAINPATH . '/' . $filename, 'F'); return $filename; } else { $mpdf->Output(); } exit; } ?> function ID_COLLECTOR($table, $lng, $id = 0, &$a = array(), $depth = 0) { global $SQL; $sql = "SELECT cat_group_id AS id, parent, name FROM $table WHERE lng = '$lng' AND parent = " . $id . " AND parent != 0 AND deleted = 0 ORDER BY cat_group_id ASC"; if($SQL->sqlNum($sql) > 0) { $sql = $SQL->sqlAllAssoc($sql); foreach($sql as $v) { $id = $v['id']; $a[$id] = array( 'id'=>$v['id'], 'name'=>$v['name'], 'parent'=>$v['parent'], 'depth'=>$depth+1 ); $c_1 = count($a); $a = ID_COLLECTOR($table, $lng, $id, $a, ($depth+1) ); $c_2 = count($a); if($c_2 > $c_1) { $a[$id]['disabled'] = true; } else { $a[$id]['disabled'] = false; } } } return $a; } ?> ########################################### # # name: IMAGE UPLOAD # function: IMAGE_UPLOAD # author: erdsoft.com # ########################################### # DESCRIPTION: # A funkció elmenti a képeket a megfelelő helyre ########################################### # INPUT: # 1. $f - a feltöltendő képek # 2. $folder - hova mentse el ########################################### # OUPTUP: mappa és alapnév, false ########################################### function IMAGE_UPLOAD($f, $folder, $sizes = 'default', $as_png = false, $return_full_name = false) { global $_CONFIG; $type = $f['type']; if ($type == "image/jpeg" || $type == "image/png" || $type == "image/gif") { if ($f['error'] == 0) { if (!file_exists($folder)) { mkdir($folder, 0755, true); } $file = explode('.', $f['name']); $ext = strtolower(end($file)); unset($file[count($file) - 1]); $filename = implode('.', $file); // removeDiacritics is in file_upload.php $filename = date("Y.m.d.H.i.s") . '_' . uniqid() . '_' . removeDiacritics(str_replace(' ', '-', $filename)); $moved = move_uploaded_file($f['tmp_name'], $folder . $filename . '.' . $ext); if ($moved === false) { $moved = copy($f['tmp_name'], $folder . $filename . '.' . $ext); } if ($moved !== false) { if ($type == "image/gif") { $img = @imagecreatefromgif($folder . $filename . '.gif'); unlink($folder . $filename . '.gif'); } else if ($type == "image/png") { $img = @imagecreatefrompng($folder . $filename . '.png'); imagealphablending($img, false); imagesavealpha($img, true); if (!$as_png) { unlink($folder . $filename . '.png'); } } else { $img = @imagecreatefromjpeg($folder . $filename . '.jpg'); unlink($folder . $filename . '.' . $ext); } if (!$img) { return false; } else { if ($as_png !== false) { $full_name = $folder . $filename . '.png'; imagepng($img, $full_name); } else { $full_name = $folder . $filename . '.jpg'; $quality = end($_CONFIG[$sizes]); // make bg // check color if ($type == "image/png") { if (!isset($quality['base_color'])) { $quality['base_color'] = $_CONFIG['base_color']; } $w = imagesx($img); $h = imagesy($img); $color = $quality['base_color']; $color = str_replace('#', '', $color); $color = str_split($color, 2); $color = (count($color) === 3 ? $color : str_split('ffffff', 2)); foreach ($color as $k => $c) { $color[$k] = hexdec($c); } $bg = imagecreatetruecolor($w, $h); $bgColor = imagecolorallocate($bg, $color[0], $color[1], $color[2]); imagefill($bg, 0, 0, $bgColor); imagealphablending($bg, true); imagesavealpha($bg, true); imagecopy($bg, $img, 0, 0, 0, 0, $w, $h); $img = $bg; } imagejpeg($img, $full_name, (isset($quality['image_quality']) ? $quality['image_quality'] : $_CONFIG['image_quality'])); } foreach ($_CONFIG[$sizes] as $key => $value) { resize($filename, $folder, $value[0], $value[1], $key, $sizes, $as_png); } return ($return_full_name === true ? $full_name : $folder.$filename); } } else { return false; } } else { return false; } } else { return false; } } function after($this_, $inthat) { $pos = strpos($inthat, $this_); if (!is_bool(strpos($inthat, $this_))) { return $pos !== false ? substr($inthat, strpos($inthat,$this_) + strlen($this_)) : $inthat; } else { return $inthat; } }; function afterLast($this_, $inthat) { $pos = strpos($inthat, $this_); if (!is_bool(strrevpos($inthat, $this_))) { return $pos !== false ? substr($inthat, strrevpos($inthat, $this_) + strlen($this_)) : $inthat; } else { return $inthat; } }; function before($this_, $inthat) { $pos = strpos($inthat, $this_); return $pos !== false ? substr($inthat, 0, strpos($inthat, $this_)) : $inthat; }; function beforeLast($this_, $inthat) { $pos = strpos($inthat, $this_); return $pos !== false ? substr($inthat, 0, strrevpos($inthat, $this_)) : $inthat; }; function between($this_, $that, $inthat) { return before($that, after($this_, $inthat)); }; function betweenLast($this_, $that, $inthat) { return afterLast($this_, beforeLast($that, $inthat)); }; // use strrevpos function in case your php version does not include it function strrevpos($instr, $needle) { $rev_pos = strpos(strrev($instr), strrev($needle)); if ($rev_pos === false) { return false; } else { return strlen($instr) - $rev_pos - strlen($needle); } }; ?>
Ubrusi u rolni odličnog kvaliteta. Dvoslojni, sa perforacijom na svaki 20 cm.
Vrsta papira | čista celuloza |
Boja | beli |
Dužina | 110 m |
Broj sloja | 2 |
Prečnik rolne | 19 cm |
Visina rolne | 20 cm |
Pakovanje | 6 rolni |
Dimenzija lista | 20 x 20 cm |