-------------------->>>>>>>'.$msg.'

'; return array($msg,$poza_uploadata); } function copyphoto( $file_c, $finaldir_c, $name_c, $maxw_c, $maxh_c ) { //copies a photo in a desired directory resizing it and renaming it $succes = 0; $t = $finaldir_c; //get the picture sizes $list = getimagesize($file_c); $width_c = $list[0]; $height_c= $list[1]; if( (int)$width_c > (int)$maxw_c ) { $percent = $maxw_c / $width_c; $height_c = round($height_c * $percent); $width_c = $maxw_c; } if( (int)$height_c > (int)$maxh_c ) { $percent = $maxh_c / $height_c; $width_c = round($width_c * $percent); $height_c = $maxh_c; } $msg = "Fisier neredimensionat din motive necunoscute!"; $raspuns = false; $raspuns = create_thumbnail($file_c, $finaldir_c."/" . $name_c, $width_c, $height_c, 100); if ( $raspuns == true ) $msg = "succes"; return $msg; } function LastPage(){ //return the curent url replacing ? and & ( usefull when wanting to put return to page link in a $_GET element $lp = Util::GetCurrentUrl(); $lp = str_replace("?","~",$lp); $lp = str_replace("&","$",$lp); $lp = substr($lp,1); return $lp; } function ReturnLastPage( $lp ){ //the reversed process of LastPage() but you have to give it the procesed link $lp = str_replace("~","?",$lp); $lp = str_replace("$","&",$lp); return $lp; } function Eroare($msg){ //displays an error message $smarty = $_SESSION['smarty']; $smarty->assign("msg",$msg); return $smarty->fetch("ClassObjects/MessageModule.tpl"); } function Redirect($url){ //redirects you to desired page echo ' '; } function NumberFormatPrice( $price ){ //creates the number format from xx.yy to xx,yy return number_format($price,2,",","."); } function GetCurrentUrl(){ //return current url $ret = $_SERVER['PHP_SELF']."?"; $arr = $_GET; $vals= array_keys($arr); foreach($vals as $val){ $ret.= $val."=".$arr[$val]."&"; } $ret = substr($ret,0, strlen($ret)-1); return $ret; } function GetCurrentUrlWithoutKeys($keys){ //return current url without desired keys $ret = $_SERVER['PHP_SELF']."?"; $arr = $_GET; $vals= array_keys($arr); foreach($vals as $val){ if( array_search($val, $keys) === false ) $ret .= $val."=".$arr[$val]."&"; } $ret = substr($ret,0, strlen($ret)-1); return $ret; } function GetCurrentUrlReplacingVal($key,$val){ //return desired url replacing the desired key value with the new $val $ret = $_SERVER['PHP_SELF']."?"; $arr = $_GET; $vals= array_keys($arr); foreach($vals as $val){ if( $val != $key ){ $ret .= $val."=".$arr[$val]."&"; }else{ $ret .= $val."=".$val."&"; } } $ret = substr($ret,0, strlen($ret)-1); return $ret; } } //aici voi pune niste functii globale function ParsMysql($sql){ //returns the sql error more nicely $keywordColor = '#0000ff'; $wordColor = '#ff9900'; $tab = '     '; $ret = strtolower( $sql ); $ret = str_replace("select", "
SELECT
".$tab, $ret); $ret = str_replace("where", "
WHERE
".$tab, $ret); $ret = str_replace("asc", "ASC", $ret); $ret = str_replace("as", "AS", $ret); $ret = str_replace("and", "AND", $ret); $ret = str_replace("order by", "
ORDER BY", $ret); $ret = str_replace("group by", "
GROUP BY", $ret); $ret = str_replace("limit", "LIMIT", $ret); $ret = str_replace("update", "
UPDATE
".$tab, $ret); $ret = str_replace("delete", "
DELETE
".$tab, $ret); $ret = str_replace("from", "
FROM
".$tab, $ret); $ret = str_replace("set", "WHERE", $ret); $ret = "".$ret.""; return $ret; } function CleanPostAndGet(){ //security for post and get foreach($_POST as $key => $val){ $_POST[$key] = stripslashes(strip_tags(htmlspecialchars($val, ENT_QUOTES))); $$key = stripslashes(strip_tags(htmlspecialchars($val, ENT_QUOTES))); } foreach($_GET as $key => $val){ $_GET[$key] = stripslashes(strip_tags(htmlspecialchars($val, ENT_QUOTES))); $$key = stripslashes(strip_tags(htmlspecialchars($val, ENT_QUOTES))); } } if (!function_exists('cal_days_in_month')) { function cal_days_in_month($calendar, $month, $year) { return date('t', mktime(0, 0, 0, $month, 1, $year)); } } if (!defined('CAL_GREGORIAN')) define('CAL_GREGORIAN', 1); /** * Flattens an array, or returns FALSE on fail. */ function array_flatten($array) { if (!is_array($array)) { return FALSE; } $result = array(); foreach ($array as $key => $value) { if (is_array($value)) { $result = array_merge($result, array_flatten($value)); } else { $result[$key] = $value; } } return $result; } //run background scripts and go further function backgroundPost($url){ $parts=parse_url($url); $fp = fsockopen($parts['host'], isset($parts['port'])?$parts['port']:80, $errno, $errstr, 30); if (!$fp) { return false; } else { $out = "POST ".$parts['path']." HTTP/1.1\r\n"; $out.= "Host: ".$parts['host']."\r\n"; $out.= "Content-Type: application/x-www-form-urlencoded\r\n"; $out.= "Content-Length: ".strlen($parts['query'])."\r\n"; $out.= "Connection: Close\r\n\r\n"; if (isset($parts['query'])) $out.= $parts['query']; fwrite($fp, $out); fclose($fp); return true; } } function getMonth($var){ switch($var) {case 1: return 'Januari'; break; case 2: return 'Februari'; break; case 3: return 'Maart'; break; case 4: return 'April'; break; case 5: return 'Mei'; break; case 6: return 'Juni'; break; case 7: return 'Juli'; break; case 8: return 'Augustus'; break; case 9: return 'Septmber'; break; case 10: return 'Oktober'; break; case 11: return 'November'; break; case 12: return 'December'; break; } } function makePin($lenth =20) { // makes a random alpha numeric string of a given lenth $aZ09 = array_merge(range('A', 'Z'), range('a', 'z'),range(0, 9)); $out =''; for($c=0;$c < $lenth;$c++) { $out .= $aZ09[mt_rand(0,count($aZ09)-1)]; } return $out; } function makeurl($string, $is_filename = FALSE){ // Replace all weird characters with dashes $string = preg_replace('/[^\w\-'. ($is_filename ? '~_\.' : ''). ']+/u', '_', $string); // Only allow one dash separator at a time (and make string lowercase) return mb_strtolower(preg_replace('/--+/u', '-', $string), 'UTF-8'); } function normalize_str($str) { $invalid = array('"'=>'','.'=>'','!'=>'','?'=>'','?'=>'','Š'=>'S', 'š'=>'s', 'Đ'=>'Dj', 'đ'=>'dj', 'Ž'=>'Z', 'ž'=>'z', 'Č'=>'C', 'č'=>'c', 'Ć'=>'C', 'ć'=>'c', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss', 'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'ý'=>'y', 'þ'=>'b', 'ÿ'=>'y', 'Ŕ'=>'R', 'ŕ'=>'r', "`" => "", "´" => "", "\"" => "", "`" => "", "´" => "", "\"" => "", "´" => "", "’" => "'"," –" => "-"," " => "-", "{" => "", "~" => "", "'" => ""); $str = str_replace(array_keys($invalid), array_values($invalid), $str); return strtolower($str); } ?>
Fatal error: Call to undefined function CleanPostAndGet() in /var/www/vhosts/dianalepelaar.nl/httpdocs/index.php on line 12