$max_char){ $stringa_tagliata=substr($stringa, 0,$max_char); $last_space=strrpos($stringa_tagliata," "); $stringa_ok=substr($stringa_tagliata, 0,$last_space); return $stringa_ok."..."; }else{ return $stringa; } } function PubPath() { $NumC = substr_count($_SERVER["PHP_SELF"],'/'); $path = ""; if ( $NumC > 1 ) { for ($i = 1; $i<$NumC; $i++) { $path = $path ."../" ; } } return $path; } function resizeImmagine($src, $imageWidth, $imageHeight, $desiredWidth, $desiredHeight) { $newWidth = $desiredWidth; $newHeight = $desiredHeight; $newX = 0; $newY = 0; $scaleFactor = min($desiredWidth / $imageWidth, $desiredHeight / $imageHeight); $newWidth = ceil($imageWidth * $scaleFactor); $newHeight = ceil($imageHeight * $scaleFactor); $newX = ($desiredWidth - $newWidth) / 2; $newY = ($desiredHeight - $newHeight) / 2; $imageResized = imagecreatetruecolor($desiredWidth, $desiredHeight); $background = imagecolorallocate($imageResized, 255, 255, 255); imagefilledrectangle($imageResized, 0, 0, $desiredWidth, $desiredHeight, $background); imagecopyresampled($imageResized, $src, $newX, $newY, 0, 0, $newWidth, $newHeight, $imageWidth, $imageHeight); return $imageResized; } function nMesetoStr($num) { if ($num == '1') { $mese = 'GEN'; } if ($num == '2') { $mese = 'FEB';} if ($num == '3') { $mese = 'MAR';} if ($num == '4') { $mese = 'APR';} if ($num == '5') { $mese = 'MAG';} if ($num == '6') { $mese = 'GIU';} if ($num == '7') { $mese = 'LUG';} if ($num == '8') { $mese = 'AGO';} if ($num == '9') { $mese = 'SET';} if ($num == '10') { $mese = 'OTT';} if ($num == '11') { $mese = 'NOV';} if ($num == '12') { $mese = 'DIC';} return $mese; } function ControlloEmail($email){ $result = eregi("^[_a-z0-9+-]+(\.[_a-z0-9+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$",$email); if($result == false){ return false; }else{ return true; } } function Mio_decode($string){ $accent=array(""=>"à",""=>"è",""=>"ì",""=>"ò",""=>"ù",""=>"á",""=>"é",""=>"í",""=>"ó",""=>"ú"); foreach($accent as $char=>$entity){ $string=str_replace("$char","$entity","$string"); } return $string; } function Sconto($prezzo, $sconto){ if ($sconto > 0){ $NewPrezzo = $prezzo - (($prezzo * $sconto ) / 100); } else { $NewPrezzo = $prezzo; } return $NewPrezzo; } function ImgArt($id){ $SelFoto = mysql_query("SELECT art_foto FROM articoli where art_id=".$id) or die(mysql_error()); $foto = mysql_fetch_array($SelFoto); return ''.$foto['art_foto']; } ?> Girarrosti Allegri
THE ONLY TRUE SARDINIAN ROTISSERIE FOR OVER 40 YEARS
IT - UK - FR
Interio

The only true Sardinian rotisserie for over 40 years

OFFICIAL ONLINE SHOP DIRECTLY FROM FACTORY