<?
$ix = $_POST['ix'];
if($ix == "1"){
$adi = $_POST['adi'];
$kat = $_POST['kat'];
$aciklama = $_POST['aciklama'];
$resim = $_POST['resim'];
$adres = $_POST['adres'];
$hit = $_POST['hit'];
$nasil = $_POST['nasil'];
$sure = $_POST['sure'];
$max_size = $_POST['max_size'];
$q2=mysql_query("select * from ha order by haber_id DESC");
$r2=mysql_fetch_array($q2);
$i=$r2['haber_id'];
$ii=$i+1;
if ( isset ( $resim )) {
$max_size = $_POST['max_size'];
if ($resim_type == "image/gif" or $resim_type == "image/jpeg" or $resim_type == "image/pjpeg" or $resim_type == "image/x-png") {
if ( $resim_size < $max_size ) {
copy ( $resim, "tvimg/$resim_name" ) or die ("<font size='1' face='Verdana'>Dosya Kopyalanamiyor!</font>");
echo "Dosya gönderimi basarili";
} else {
print ("<font size='1' face='Verdana'>Resmin boyu 10MB'dan fazla olamaz.</font>");
}
} else {
print ("<font size='1' face='Verdana'>Sadece JPG, GIF veya PNG Dosyalarini gönderebilirsiniz.</font>");
}
} else {
print ("<font size='1' face='Verdana'>Lütfen Gözat'dan bir resim seçip Gönder butonuna tiklayiniz.</font>");
}
echo "<b>Eklendi!!<br> ";
}else{
?>
<form name="form1" enctype="multipart/form-data" method="post" action=""><input type="hidden" name="ix" value="1">
<TABLE cellSpacing=0 cellPadding=0
width=450 align="center" border=0>
<TR>
<TD width="100%">Kampanya ekle :</TD>
<td> </td>
</TR>
<tr>
<TD align=left><b>Title:</B></TD>
<TD><INPUT class=field
style="WIDTH: 200px; HEIGHT: 20px" size=10
name="adi"></TD></TR>
<TR height=25>
<TD align=left><B>Category :</B></TD>
<TD width="504" ><select name="kat">
<?
$q2=mysql_query("select * from hkategori");
while ($r2=mysql_fetch_array($q2))
echo "<option value=$r2[id]>$r2[katadi]</option>";
?>
</select>
*</TD>
</TR>
<TR height=25>
<TD align=left><p> <strong>Resim : </strong></p>
</TD>
<TD ><p>
<input type="hidden" name="max_size" value="1048576">
<input name="resim" type="file" id="resim"> <br>
</p>
</TD></tr>
<TR height=120>
<TD align=left><B>Kýsa Açýklama</B></TD>
<TD >
<TEXTAREA class=field style="WIDTH: 350; HEIGHT: 159" name=aciklama rows=6 cols=10></TEXTAREA></TD></TR>
<TR height=120>
<TD align=left><B>Uzun Açýklama <br>
</B></TD>
<TD >
<TEXTAREA class=field style="WIDTH: 350; HEIGHT: 159" name=nasil rows=6 cols=10></TEXTAREA></TD></TR>
<TR height=25>
<TD align=left><B>Baþlama T. :</B></TD>
<TD ><INPUT class=field
style="WIDTH: 200px; HEIGHT: 20px" size=10 name=hit>
0000-00-00</TD>
</TR>
<TR height=25>
<TD align=left><B>DateBitiþ T.:</B></TD>
<TD ><INPUT name=sure class=field id="sure"
style="WIDTH: 200px; HEIGHT: 20px" size=10> 0000-00-00 </TD>
</TR>
</TR><TR height=35>
<TD align=left></TD>
<TD><INPUT class=button type=submit value=Ekle name=send_button></TD></TR></table>
<p><BR>
<BR>
</p>
<?
}
?>
<table><form ENCtype="multipart/form-data" action="" method="POST">
<tr>
<TD align=left><B>Kategori :</B></TD>
<TD width="472" ><select name="kat">
<?
$q2=mysql_query("select * from hkategori");
while ($r2=mysql_fetch_array($q2))
echo "<option value=$r2[id]>$r2[katadi]</option>";
?>
</select>
</TD>
</TR>
<TR height=25>
<TD align=left>Ba?lyk:
</TD>
<TD valign="top">
<input type="text" name="resadi">
Maks. 250 karakter. </TD>
</TR>
<TR height=25>
<TD align=left>Açyklama :
</TD>
<TD valign="top">
<textarea name="full"></textarea>
Maks. 1000 karakter.
</TD>
</TR>
<TR height=25>
<TD align=left>Resim :
</TD>
<TD valign="top"><p>
<input type="hidden" name="max_size" value="1048576">
<input type="file" name="resim"><br>
</p>
</TD>
</TR>
<TR height=35>
<TD align=left></TD>
<TD><input type="submit" value="Dosya Yolla"> </TD></TR></form></table>
<?
if ( isset ( $resim )) {
$resim_name = trsi($resim_name);
$q3=mysql_query("select * from resim where file = '$resim_name'");
if ($r3=!mysql_fetch_array($q3)) {
$max_size = $_POST['max_size'];
if ($resim_type == "image/gif" or $resim_type == "image/jpeg" or $resim_type == "image/pjpeg" or $resim_type == "image/x-png") {
if ( $resim_size < $max_size ) {
copy ( $resim, "$THIS_DIRI/tvimg/$resim_name" ) or die ("<font size='1' face='Verdana'>Dosya Kopyalanamiyor!</font>");
if($resim_type == "image/jpeg" or $resim_type == "image/pjpeg") {
$filename = $resim_name;
@header('Content-type: image/jpeg');
list($width, $height) = getimagesize("$THIS_DIRI/tvimg/".$filename);
$new_width = 120;
$new_height = 120;
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg("$THIS_DIRI/tvimg/".$filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
imagejpeg($image_p, "$THIS_DIRI/thimg/k".$resim_name, 100);
echo"<font size='1' face='Verdana'>JPG Resmin gönderimi ba?aryly.</font>";
//yuklenenleri db ye gir
$resadi = $_POST['resadi'];
$full = $_POST['full'];
$saat = date("F d, Y / h:i:sa");
$ip = $_SERVER["REMOTE_ADDR"];
$kat = $_POST['kat'];
$result = mysql_query("Insert Into resim (kat,date,file,thumb,ip,baslikresim,konuresim) values ('$kat','$saat','$filename','k$filename','$ip','$resadi','$full')") or die ("Fakat veriler Db ye yazilamadi");
//nelerin yuklendigini goster
//nelerin yuklendigini goster
echo "<br>Yuklenen Dosya : ".$filename."<br>";
}
if($resim_type == "image/gif") {
$filename = $resim_name;
@header('Content-type: image/gif');
list($width, $height) = getimagesize("$THIS_DIRI/tvimg/".$filename);
$new_width = 120;
$new_height = 120;
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromgif("$THIS_DIRI/tvimg/".$filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
imagegif($image_p, "$THIS_DIRI/thimg/k".$resim_name, 100);
echo"<font size='1' face='Verdana'>GYF Resmin gönderimi ba?aryly.</font>";
//yuklenenleri db ye gir
$user = $_POST['user'];
$saat = date("F d, Y / h:i:sa");
$ip = $_SERVER["REMOTE_ADDR"];
$kat = $_POST['kat'];
$result = mysql_query("Insert Into resim (kat,date,file,thumb,ip,baslikresim,konuresim) values ('$kat','$saat','$filename','k$filename','$ip','$resadi','$full')") or die ("Fakat veriler Db ye yazilamadi");
//nelerin yuklendigini goster
//nelerin yuklendigini goster
echo "<br>Yuklenen Dosya : ".$filename."<br>";
}
if($resim_type == "image/x-png") {
$filename = $resim_name;
@header('Content-type: image/png');
list($width, $height) = getimagesize("$THIS_DIRI/tvimg/".$filename);
$new_width = 120;
$new_height = 120;
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefrompng("$THIS_RESIM/tvimg/".$filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
imagepng($image_p, "$THIS_DIRI/thimg/k".$resim_name, 100);
echo"<font size='1' face='Verdana'>PNG Resmin gönderimi ba?aryly.</font>";
//yuklenenleri db ye gir
$user = $_POST['user'];
$saat = date("F d, Y / h:i:sa");
$ip = $_SERVER["REMOTE_ADDR"];
$kat = $_POST['kat'];
$result = mysql_query("Insert Into resim (kat,date,file,thumb,ip,baslikresim,konuresim) values ('$kat','$saat','$filename','k$filename','$ip','$resadi','$full')") or die ("Fakat veriler Db ye yazilamadi");
//nelerin yuklendigini goster
echo "<br>Yuklenen Dosya : ".$filename."<br>";
}
} else {
print ("<font size='1' face='Verdana'>Resmin boyu 10MB'dan fazla olamaz.</font>");
}
} else {
print ("<font size='1' face='Verdana'>Sadece JPG, GYF veya PNG Dosyalaryny gönderebilirsiniz.</font>");
}
}
else
{
echo "Bu adda Bir resim var!";
}
} else {
print ("<font size='1' face='Verdana'>Lütfen Gözat'dan bir resim seçip Gönder butonuna tyklayynyz.</font>");
}
if ($resim_type == "image/gif" or $resim_type == "image/jpeg" or $resim_type == "image/pjpeg" or $resim_type == "image/x-png") {