<?php require_once('../../Connections/baglantim.php'); ?>
<?php
require_once('../../includes/common/KT_common.php');
?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "admin";
$MM_donotCheckaccess = "false";
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
$isValid = False;
if (!empty($UserName)) {
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && false) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "../index.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?php
// Load the tNG classes
require_once('../../includes/tng/tNG.inc.php');
// Make a transaction dispatcher instance
$tNGs = new tNG_dispatcher("../../");
// Make unified connection variable
$conn_baglantim = new KT_connection($baglantim, $database_baglantim);
// Start trigger
$formValidation = new tNG_FormValidation();
$formValidation->addField("ResimAdi", true, "text", "", "", "", "Lütfen dosya Adını Giriniz..(Ör:süleyman)");
$tNGs->prepareValidation($formValidation);
// End trigger
//start Trigger_ImageUpload trigger
//remove this line if you want to edit the code by hand
function Trigger_ImageUpload(&$tNG) {
$uploadObj = new tNG_ImageUpload($tNG);
$uploadObj->setFormFieldName("Dosya_Logo");
$uploadObj->setDbFieldName("dosyalogo");
$uploadObj->setFolder("../../site/upload/resimlerim/");
$uploadObj->setResize("true", 100, 0);
$uploadObj->setMaxSize(15000);
$uploadObj->setAllowedExtensions("gif, jpg, jpe, jpeg, png, bmp");
$uploadObj->setRename("auto");
return $uploadObj->Execute();
}
//end Trigger_ImageUpload trigger
//dosya düzenleme kodları ve repeatregion
mysql_select_db($database_baglantim, $baglantim);
$query_rcAllowedExtension = "SELECT Turuzantisi FROM resim_turleri";
$rcAllowedExtension = mysql_query($query_rcAllowedExtension, $baglantim) or die(mysql_error());
$row_rcAllowedExtension = mysql_fetch_assoc($rcAllowedExtension);
$totalRows_rcAllowedExtension = mysql_num_rows($rcAllowedExtension);
do {
$uzantilar .= $row_rcAllowedExtension['Turuzantisi'] . ',';
} while ($row_rcAllowedExtension = mysql_fetch_assoc($rcAllowedExtension));
//2.adım
function tirnakEkle($yazi)
{
$tirnaklihali ="'". $yazi."'";
return $tirnaklihali;
}
//3.adım
$_GET['uzanti'] = tirnakEkle($uzantilar);
//remove this line if you want to edit the code by hand
function Trigger_FileUpload(&$tNG) {
$uploadObj = new tNG_FileUpload($tNG);
$uploadObj->setFormFieldName("ResimURL");
$uploadObj->setDbFieldName("ResimURL");
$uploadObj->setFolder("../../site/upload/");
$uploadObj->setMaxSize(20000);
//dosya uzantıları düzenlenmesi
//4.adım
$allowedExtension = $_GET['uzanti'];
$uploadObj->setAllowedExtensions($allowedExtension);
//dosya uzantıları düzenlenmesi
$uploadObj->setRename("auto");
return $uploadObj->Execute();
}
//end Trigger_FileUpload trigger
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_baglantim, $baglantim);
$query_rcdosyaturu = "SELECT * FROM resim_turleri";
$rcdosyaturu = mysql_query($query_rcdosyaturu, $baglantim) or die(mysql_error());
$row_rcdosyaturu = mysql_fetch_assoc($rcdosyaturu);
$totalRows_rcdosyaturu = mysql_num_rows($rcdosyaturu);
mysql_select_db($database_baglantim, $baglantim);
$query_rsresimturu = "SELECT * FROM resim_turleri";
$rsresimturu = mysql_query($query_rsresimturu, $baglantim) or die(mysql_error());
$row_rsresimturu = mysql_fetch_assoc($rsresimturu);
$totalRows_rsresimturu = mysql_num_rows($rsresimturu);
mysql_select_db($database_baglantim, $baglantim);
$query_rcdosyakategori = "SELECT * FROM resim_kategori";
$rcdosyakategori = mysql_query($query_rcdosyakategori, $baglantim) or die(mysql_error());
$row_rcdosyakategori = mysql_fetch_assoc($rcdosyakategori);
$totalRows_rcdosyakategori = mysql_num_rows($rcdosyakategori);
mysql_select_db($database_baglantim, $baglantim);
$query_rsresimkategori = "SELECT * FROM resim_kategori";
$rsresimkategori = mysql_query($query_rsresimkategori, $baglantim) or die(mysql_error());
$row_rsresimkategori = mysql_fetch_assoc($rsresimkategori);
$totalRows_rsresimkategori = mysql_num_rows($rsresimkategori);
// Make an insert transaction instance
$ins_resim = new tNG_insert($conn_baglantim);
$tNGs->addTransaction($ins_resim);
// Register triggers
$ins_resim->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");
$ins_resim->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
$ins_resim->registerTrigger("END", "Trigger_Default_Redirect", 99, "index.php");
$ins_resim->registerTrigger("AFTER", "Trigger_FileUpload", 97);
$ins_resim->registerTrigger("AFTER", "Trigger_ImageUpload", 97);
// Add columns
$ins_resim->setTable("resim");
$ins_resim->addColumn("KategoriID", "NUMERIC_TYPE", "POST", "KategoriID");
$ins_resim->addColumn("TurID", "NUMERIC_TYPE", "POST", "TurID");
$ins_resim->addColumn("ResimAdi", "STRING_TYPE", "POST", "ResimAdi");
$ins_resim->addColumn("Resimaciklama", "STRING_TYPE", "POST", "Resimaciklama");
$ins_resim->addColumn("dosyalogo", "FILE_TYPE", "FILES", "dosyalogo");
$ins_resim->addColumn("ResimURL", "FILE_TYPE", "FILES", "ResimURL");
$ins_resim->setPrimaryKey("ResimID", "NUMERIC_TYPE");
// Execute all the registered transactions
$tNGs->executeTransactions();
// Get the transaction recordset
$rsresim = $tNGs->getRecordset("resim");
$row_rsresim = mysql_fetch_assoc($rsresim);
$totalRows_rsresim = mysql_num_rows($rsresim);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9" />
<title>Dosya Ekleme Sayfası</title>
<script type="text/javascript" src="../../../site/editor/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
plugins :"pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : "site/editor/css/content.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "site/editor/lists/template_list.js",
external_link_list_url : "site/editor/lists/link_list.js",
external_image_list_url : "site/editor/lists/image_list.js",
media_external_list_url : "site/editor/lists/media_list.js",
// Style formats
style_formats : [
{title : 'Bold text', inline : 'b'},
{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
{title : 'Example 1', inline : 'span', classes : 'example1'},
{title : 'Example 2', inline : 'span', classes : 'example2'},
{title : 'Table styles'},
{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
],
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
</script>
<script src="../../Scripts/swfobject_modified.js" type="text/javascript"></script>
<style type="text/css">
<!--
#form1 ul {
margin: 0px;
padding: 0px;
list-style-type: none;
}
#form1 ul li {
}
#form1 ul li {
float: left;
}
#form1 ul li a {
line-height: 28px;
color: #000;
text-decoration: none;
background-color: #FFF;
display: block;
margin-bottom: 1px;
padding-left: 10px;
padding-right: 10px;
font-family: "Arabic Typesetting";
font-size: 22px;
}
#form1 ul li a:hover {
color: #FFF;
background-color: #F00;
font-family: "Arabic Typesetting";
font-size: 22px;
line-height: 28px;
}
body {
background-image: url(../images/arkaplanson.jpg);
font-family: "Arabic Typesetting";
font-size: 24px;
font-weight: bold;
}
#form2 {
font-family: "Arabic Typesetting";
text-align: left;
}
#form2 #form2 {
font-size: 20px;
font-weight: bold;
}
#form3 ul {
list-style-type: none;
font-family: "Arabic Typesetting";
line-height: 20px;
color: #000;
text-decoration: none;
background-color: #FFF;
display: block;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 1px;
margin-left: 0px;
padding-top: 0px;
padding-right: 0px;
padding-bottom: 0px;
padding-left: 10px;
text-align: left;
}
#form3 ul li a {
}
#form3 ul li a:hover {
color: #FFF;
background-color: #F00;
}
body table tr th ul {
margin: 0px;
padding: 0px;
list-style-type: none;
text-align: left;
}
body table tr th ul li a {
font-family: "Arabic Typesetting";
line-height: 22px;
color: #000;
text-decoration: none;
background-color: #FFF;
display: block;
margin-bottom: 1px;
padding-left: 10px;
font-size: 22px;
}
body table tr th ul li a:hover {
font-family: "Arabic Typesetting";
color: #FFF;
background-color: #F00;
font-size: 22px;
}
#gy {
text-align: center;
color: #F00;
font-family: "Courier New", Courier, monospace;
font-size: 18px;
}
#gy {
text-align: center;
}
-->
</style>
<link href="../../includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
<script src="../../includes/common/js/base.js" type="text/javascript"></script>
<script src="../../includes/common/js/utility.js" type="text/javascript"></script>
<script src="../../includes/skins/style.js" type="text/javascript"></script>
<?php echo $tNGs->displayValidationRules();?>
</head>
<body>
<table width="868" bordercolor="#FF0000" border="0" align="center" background="../images/tableplan.jpg">
<tr>
<th scope="row"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="860" height="140" align="absmiddle" id="FlashID">
<param name="movie" value="../images/banner.swf" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="8.0.35.0" />
<param name="expressinstall" value="../../Scripts/expressInstall.swf" />
<!-- Sonraki nesne etiketi IE tarayıcısı dışındaki tarayıcılara yöneliktir. Bu nedenle IECC'yi kullanarak bu etiketi IE'de gizleyin. -->
<!--[if !IE]>-->
<object data="../images/banner.swf" type="application/x-shockwave-flash" width="860" height="140" align="absmiddle">
<!--<![endif]-->
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="8.0.35.0" />
<param name="expressinstall" value="../../Scripts/expressInstall.swf" />
<!-- Tarayıcı, Flash Player 6.0 ve daha eskisini kullanan kullanıcılar için aşağıdaki alternatif içeriği görüntüler. -->
<div>
<h4>Bu sayfadaki içerik, Adobe Flash Player'ın daha yeni bir sürümünü gerektiriyor.</h4>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Adobe Flash player Edinin" width="112" height="33" /></a></p>
</div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object></th>
</tr>
<tr>
<th scope="row"></th>
</tr>
<tr>
<td id="gy"><a href="../yonetim.php">Yönetim Anasayfa</a></td>
</tr>
<tr>
<td id="gy"><a href="../galeri.php">Dosya Anasayfa</a></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<?php
echo $tNGs->getErrorMsg();
?>
<form method="post" id="form1" action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>" enctype="multipart/form-data">
<table cellpadding="2" cellspacing="0" class="KT_tngtable">
<tr>
<td class="KT_th"><label for="KategoriID">Dosya Kategorileri:</label></td>
<td><select name="KategoriID" id="KategoriID">
<?php
do {
?>
<option value="<?php echo $row_rcdosyakategori['KategoriID']?>"<?php if (!(strcmp($row_rcdosyakategori['KategoriID'], $row_rsresim['KategoriID']))) {echo "SELECTED";} ?>><?php echo $row_rcdosyakategori['Kategoriadi']?></option>
<?php
} while ($row_rcdosyakategori = mysql_fetch_assoc($rcdosyakategori));
$rows = mysql_num_rows($rcdosyakategori);
if($rows > 0) {
mysql_data_seek($rcdosyakategori, 0);
$row_rcdosyakategori = mysql_fetch_assoc($rcdosyakategori);
}
?>
</select>
<?php echo $tNGs->displayFieldError("resim", "KategoriID"); ?></td>
</tr>
<tr>
<td class="KT_th"><label for="TurID">Dosya Türü:</label></td>
<td><select name="TurID" id="TurID">
<?php
do {
?>
<option value="<?php echo $row_rcdosyaturu['Turid']?>"<?php if (!(strcmp($row_rcdosyaturu['Turid'], $row_rsresim['TurID']))) {echo "SELECTED";} ?>><?php echo $row_rcdosyaturu['Turadi']?></option>
<?php
} while ($row_rcdosyaturu = mysql_fetch_assoc($rcdosyaturu));
$rows = mysql_num_rows($rcdosyaturu);
if($rows > 0) {
mysql_data_seek($rcdosyaturu, 0);
$row_rcdosyaturu = mysql_fetch_assoc($rcdosyaturu);
}
?>
</select>
<?php echo $tNGs->displayFieldError("resim", "TurID"); ?></td>
</tr>
<tr>
<td class="KT_th"><label for="ResimAdi">Dosya Adı:</label></td>
<td><input type="text" name="ResimAdi" id="ResimAdi" value="<?php echo KT_escapeAttribute($row_rsresim['ResimAdi']); ?>" size="60" />
<?php echo $tNGs->displayFieldHint("ResimAdi");?> <?php echo $tNGs->displayFieldError("resim", "ResimAdi"); ?></td>
</tr>
<tr>
<td class="KT_th"><label for="Resimaciklama">Dosya Açıklama:</label></td>
<td><textarea name="Resimaciklama" id="Resimaciklama" cols="70" rows="7"><?php echo KT_escapeAttribute($row_rsresim['Resimaciklama']); ?></textarea>
<?php echo $tNGs->displayFieldHint("Resimaciklama");?> <?php echo $tNGs->displayFieldError("resim", "Resimaciklama"); ?></td>
</tr>
<tr>
<td class="KT_th">Dosya Logo</td>
<td><input name="Dosya_Logo" type="file" id="Dosya_Logo" size="45" /></td>
</tr>
<tr>
<td class="KT_th"><label for="ResimURL">DosyaURL:</label></td>
<td><input type="file" name="ResimURL" id="ResimURL" size="50" />
<?php echo $tNGs->displayFieldError("resim", "ResimURL"); ?></td>
</tr>
<tr class="KT_buttons">
<td colspan="2"><input type="submit" name="KT_Insert1" id="KT_Insert1" value="Kayıt Ekle" /></td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<script type="text/javascript">
<!--
swfobject.registerObject("FlashID");
//-->
</script>
</body>
</html>
<?php
mysql_free_result($rcdosyaturu);
mysql_free_result($rsresimturu);
mysql_free_result($rcdosyakategori);
mysql_free_result($rsresimkategori);
mysql_free_result($rcAllowedExtension);
?>