{$ErrMsg}

"; if ($ErrDie): die; endif; } function PHPErro($ErrNo, $ErrMsg, $ErrFile, $ErrLine) { $CssClass = ($ErrNo == E_USER_NOTICE ? WS_INFOR : ($ErrNo == E_USER_WARNING ? WS_ALERT : ($ErrNo == E_USER_ERROR ? WS_ERROR : $ErrNo))); echo "

"; echo "Erro na Linha: #{$ErrLine} :: {$ErrMsg}
"; echo "{$ErrFile}"; echo "

"; if ($ErrNo == E_USER_ERROR): die; endif; } ?>redimensiona($dim[0], $dim[1], 'crop'); } else { $img->redimensiona($dim); } $img->grava($caminho . $imagem); } function EnviaEmail($nome = null, $remetente = null, $destinatario, $assunto, $conteudo, $imagens = NULL) { require "../class/PhpMailer.class.php"; if ($nome == null) { $nome = $_SESSION['nome_cliente']; } if ($remetente == null) { $remetente = $Smtp->getResult()[0]['smtp_email']; } $Smtp = new Read; $Smtp->FullRead("SELECT * FROM _smtp LIMIT 1"); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->CharSet = 'UTF-8'; if ($Smtp->getResult()[0]['smtp_auth'] == 'S') { $mail->SMTPAuth = true; } $mail->SMTPDebug = 1; if ($Smtp->getResult()[0]['smtp_port'] != '') { $mail->Port = $Smtp->getResult()[0]['smtp_port']; } $mail->SMTPSecure = 'tls'; $mail->Host = $Smtp->getResult()[0]['smtp_host']; $mail->Username = $Smtp->getResult()[0]['smtp_username']; $mail->Password = $Smtp->getResult()[0]['smtp_password']; $mail->From = $Smtp->getResult()[0]['smtp_email']; $mail->Sender = $Smtp->getResult()[0]['smtp_email']; $mail->FromName = $nome; $mail->AddAddress($destinatario); if (isset($imagens)) { foreach ($imagens as $imagem) { $mail->AddEmbeddedImage($imagem['caminho'], $imagem['cid'], $imagem['name']); } } $mail->IsHTML(true); $mail->Subject = $assunto; $mail->Body = $conteudo; $enviado = $mail->Send(); $mail->ClearAllRecipients(); $mail->ClearAttachments(); if ($enviado) { return true; } else { return false; } } function UrlAmigavel($string) { $table = 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', ); $string = strtr($string, $table); $string = strtolower($string); $string = preg_replace("/[^a-z0-9_\s-]/", "", $string); $string = preg_replace("/[\s-]+/", " ", $string); $string = preg_replace("/[\s_]/", "-", $string); return $string; } function menuCategorias($id){ $Dados = new Read; $Dados->FullRead("SELECT id, nome, id_categoria FROM categorias WHERE id_categoria = $id ORDER BY id_categoria, nome"); $Categorias = $Dados->getResult(); if(count($Categorias) == 0){ return ""; } if($id == ''){ $Icon = ""; $Back = '#F8F8F8'; $Style= "color:#ec1c23;text-decoration:underline"; } else { $Icon = ''; $Back = ''; $Style= ''; } $menu = '"; return $menu; } 'SET NAMES UTF8']; self::$Connect = new PDO($dsn, self::$User, self::$Pass, $options); endif; } catch (PDOException $e) { PHPErro($e->getCode(), $e->getMessage(), $e->getFile(), $e->getLine()); die; } self::$Connect->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); return self::$Connect; } protected static function getConn() { return self::Conectar(); } }