'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', 'е' => 'e', 'ж' => 'zh', 'з' => 'z', 'и' => 'i', 'й' => 'y', 'к' => 'k', 'л' => 'l', 'м' => 'm', 'н' => 'n', 'о' => 'o', 'п' => 'p', 'р' => 'r', 'с' => 's', 'т' => 't', 'у' => 'u', 'ф' => 'f', 'х' => 'h', 'ц' => 'c', 'ч' => 'ch', 'ш' => 'sh', 'щ' => 'sht', 'ъ' => 'a', 'ь' => 'y', 'ю' => 'yu', 'я' => 'ya', 'А' => 'a', 'Б' => 'b', 'В' => 'v', 'Г' => 'g', 'Д' => 'd', 'Е' => 'e', 'Ж' => 'zh', 'З' => 'z', 'И' => 'i', 'Й' => 'y', 'К' => 'k', 'Л' => 'l', 'М' => 'm', 'Н' => 'n', 'О' => 'o', 'П' => 'p', 'Р' => 'r', 'С' => 's', 'Т' => 't', 'У' => 'u', 'Ф' => 'f', 'Х' => 'h', 'Ц' => 'c', 'Ч' => 'ch', 'Ш' => 'sh', 'Щ' => 'sht', 'Ъ' => 'a', 'Ь' => 'y', 'Ю' => 'yu', 'Я' => 'ya' ); return strtr($zagl, $latime); } $jpeg_quality = 90; if(!isset($_SESSION["stomatolozi_login"]) || empty($_SESSION["stomatolozi_login"])) { header("Location: http://stomatolozi.bg/login.html"); exit; } $email = mysql_real_escape_string($_SESSION["stomatolozi_login"]); $query = sprintf("select * from personal where dent_email = '%s'", $email); $result = mysql_query($query, $db1); $row = mysql_fetch_array($result); $id = $row["dent_id"]; $time = time(); if(isset($_GET["updateview"]) && !empty($_GET["updateview"]) && $_GET["updateview"] == 1) { sleep(3); header("Location: http://stomatolozi.bg/edit-gallery.html"); exit(); } if($_SERVER['REQUEST_METHOD'] == "POST" && isset($_GET["action"]) && $_GET["action"] == "upload_gallery_image") { if (!empty($_FILES) && $_FILES['upload_img']['error'] < 1) { if(isset($_POST["upload_title"]) && !empty($_POST["upload_title"])) { $gallery_img_name = $time . "_" . $id . "_" . urlencode(getSEOUrl(str_replace(" ", "-", $_POST["upload_title"]))); } else { $gallery_img_name = $time . "_" . $id . "_" . str_replace(" ", "-", getSEOUrl($row["dent_name"])); } // Validate the file type $fileTypes = array('jpg','jpeg','gif','png'); // File extensions $fileParts = pathinfo($_FILES['upload_img']['name']); $targetPath = $_SERVER['DOCUMENT_ROOT'] . '/user_assets/'; $tempFile = $_FILES['upload_img']['tmp_name']; $fileName = strtolower($gallery_img_name . "." . $fileParts['extension']); $targetFile = rtrim($targetPath,'/') . '/' . $fileName; list($width,$height)=getimagesize($tempFile); if($width > $height) { #landscape mode if($width >= 500) { $newwidth=500; $newheight=($height/$width)*$newwidth; } else { $newwidth = $width; $newheight=($height/$width)*$newwidth; } } else { #portrait mode if($height >= 500) { $newheight=500; $newwidth=($width/$height)*$newheight; } else { $newheight=$height; $newwidth=($width/$height)*$newheight; } } if(in_array(strtolower($fileParts['extension']),$fileTypes)) { if(file_exists($targetFile)) { unlink($targetFile); } if(strtolower($fileParts['extension']) == "jpg" || strtolower($fileParts['extension']) == "jpeg") { $img_r = imagecreatefromjpeg($tempFile); $dst_r = ImageCreateTrueColor( $newwidth, $newheight ); imagecopyresampled($dst_r, $img_r, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); imagejpeg($dst_r, $targetFile, $jpeg_quality); } if(strtolower($fileParts['extension']) == "png") { $img_r = imagecreatefrompng($tempFile); $dst_r = ImageCreateTrueColor( $newwidth, $newheight ); imagecopyresampled($dst_r, $img_r, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); imagepng($dst_r, $targetFile); } if(strtolower($fileParts['extension']) == "gif") { $img_r = imagecreatefromgif($tempFile); $dst_r = ImageCreateTrueColor( $newwidth, $newheight ); imagecopyresampled($dst_r, $img_r, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); imagegif($dst_r, $targetFile); } //move_uploaded_file($tempFile,$targetFile); #$q = sprintf("update media set dent_profile = '%s' where dent_id = '%s'", $fileName, $id); $q = sprintf("insert into gallery values('', '%s', '%s', '%s')", $id, $fileName, $_POST["upload_title"]); $r = mysql_query($q, $db1); } sleep(3); header("Location: http://stomatolozi.bg/edit-gallery.html?updateview=1"); exit(); } } if($_SERVER['REQUEST_METHOD'] == "POST" && isset($_GET["update"]) && $_GET["update"] !== "") { $edit_user = $id; $edit_img = $_GET["update"]; $edit_title = $_POST["title"][$edit_img]; $edit_q = sprintf("update gallery set caption='%s' where dent_id='%s' and img='%s'", mysql_real_escape_string($edit_title), mysql_real_escape_string($edit_user), mysql_real_escape_string($edit_img)); mysql_query($edit_q, $db1); header("Location: http://stomatolozi.bg/edit-gallery.html"); exit(); } if($_SERVER['REQUEST_METHOD'] == "POST" && isset($_GET["delete"]) && $_GET["delete"] !== "") { $targetPath = $_SERVER['DOCUMENT_ROOT'] . '/user_assets/'; $targetFile = rtrim($targetPath,'/') . '/' . $_GET["delete"]; $del_id = $id; if(unlink($targetFile)) { $del_q = sprintf("delete from gallery where dent_id='%s' and img='%s'", mysql_real_escape_string($del_id), mysql_real_escape_string($_GET["delete"])); mysql_query($del_q, $db1); } header("Location: http://stomatolozi.bg/edit-gallery.html"); exit(); } $m_q = sprintf("select * from gallery where dent_id = '%s' order by img_id desc", $id); $m_r = mysql_query($m_q, $db1); ?>
Условия за ползване на Stomatolozi.BG Затвори
Stomatolozi.BG

Зъболекари България онлайн

Намерете най-пълната и прозрачна информация за българските стоматолози и изберете при кого да отидете

0){ ?>