<!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=utf-8" />
<title>Kayıt Formu</title>
<style type="text/css">
table { margin:10px auto}
}
#form1{ font: bold 15px Tahoma, Geneva, sans-serif #000}
</style>
</head>

<body>
<a href="starter.php">Yönetim Paneline Geri Dön</a>
<form action="form2.php" method="post" enctype="multipart/form-data">
<table width="1000" border="1" cellpadding="0" cellspacing="0" >
  <tr>
     <td width="307" height="71"><img src="indir.png" width="307" height="76" /></td>
    <td colspan="2" id="form1" align="center">ÖN KAYIT BAŞARI FORMU </td>
    <td width="241">&nbsp;&nbsp;Başvuru No:</td>
   
    </tr>
  <tr>
    <td colspan="4" align="center" id="form1"> I.BÖLÜM - ÖĞRENCİ ÖN BİLGİ FORMU (KAYIT DANIŞMANI)</td>
    </tr>
  <tr>
    <td colspan="4" align="center" id="form1">Öğrenci Bilgileri</td>
    </tr>
  <tr>
    <td width="307" height="35">&nbsp;&nbsp;Öğrenci Adı Soyadı</td>
    <td width="271">&nbsp;&nbsp;&nbsp;<input name="ad" type="text" id="ad" /></td>
    <td width="171">&nbsp;&nbsp;Doğum Tarihi</td>
    <td width="241">&nbsp;&nbsp;&nbsp;<input name="dtarih" type="text" id="dtarih" /></td>
  </tr>
  <tr>
    <td width="307" height="35">&nbsp;&nbsp;Geldiği Okul</td>
    <td width="271">&nbsp;&nbsp;&nbsp;<input name="okul" type="text" id="okul" /></td>
    <td width="171">&nbsp;&nbsp;TC Kimlik No</td>
    <td width="241">&nbsp;&nbsp;&nbsp;<input name="no" type="text" id="no" /></td>
  </tr>
  <tr>
    <td width="307" height="35">&nbsp;&nbsp;Okuyacağı Sınıf</td>
    <td width="271">&nbsp;&nbsp;&nbsp;<input name="sinif" type="text" id="sinif" /></td>
    <td width="171">&nbsp;&nbsp;Başvuru Tarihi</td>
    <td width="241">&nbsp;&nbsp;&nbsp;<input name="btarih" type="text" id="btarih" /></td>
  </tr>
  <tr>
    <td width="307" height="35">&nbsp;&nbsp;LGS Puanı</td>
    <td width="271">&nbsp;&nbsp;&nbsp;<input name="puan" type="text" id="puan" /></td>
    <td width="307" >&nbsp;Okul Türü</td>
    <td width="271">&nbsp;&nbsp;&nbsp;<label for="osekil"></label>
      <select name="osekil" id="osekil">
      <option value="Anaokulu">Anaokulu</option>
        <option value="İlkokul">İlkokul</option>
        <option value="Ortaokul">Ortaokul</option>
        <option value="Lise">Lise</option>
      </select></td>
   
    </tr>
  <tr>
   <td colspan="4" align="center" id="form1">Aile Bilgileri</td>
    </tr>
  <tr>
    <td width="307" height="35">&nbsp;&nbsp;Anne Adı</td>
    <td width="271" height="35">&nbsp;&nbsp;&nbsp;<input name="anne" type="text" id="anne" /></td>
    <td width="171" height="35">&nbsp;&nbsp;Baba Adı</td>
    <td width="241" height="35">&nbsp;&nbsp;&nbsp;<input name="baba" type="text" id="baba" /></td>
  </tr>
  <tr>
   <td width="307" height="35">&nbsp;&nbsp;Telefon</td>
    <td width="271">&nbsp;&nbsp;&nbsp;<input name="tel1" type="text" id="tel1" /></td>
    <td width="171" height="35">&nbsp;&nbsp;Telefon</td>
    <td width="241">&nbsp;&nbsp;&nbsp;<input name="tel2" type="text" id="tel2" /></td>
  </tr>
  <tr>
    <td width="307" height="35">&nbsp;&nbsp;Mesleği</td>
    <td width="271">&nbsp;&nbsp;&nbsp;<input name="mes1" type="text" id="mesl" /></td>
    <td width="171" height="35">&nbsp;&nbsp;Mesleği</td>
    <td width="241">&nbsp;&nbsp;&nbsp;<input name="mes2" type="text" id="mes2" /></td>
  </tr>
  <tr>
   <td colspan="4" height="81">&nbsp;&nbsp;Adres Bilgisi:&nbsp;&nbsp;&nbsp;
     <input name="adres" type="text" value="" size="100" id="adres" /></td>
    </tr>
  <tr>
    <td colspan="4" height="80" align="center" id="form1">OKULUMUZDAN HABERDAR OLMA ŞEKLİNİZ<p><input name="rkl" type="checkbox"  id="rkl" value="Reklam"/>Reklam &nbsp;&nbsp; <input name="ssy" type="checkbox" value="Sosyal Medya" />Sosyal Medya &nbsp;&nbsp; <input name="okl" type="checkbox" id="okl" value="Okulumuz velileri" />&nbsp;&nbsp;Okulumuz Velileri &nbsp;&nbsp; <input name="cevre" type="checkbox" value="Çevre" id="cevre"  />Çevre</p></td>
    </tr>
  <tr>
    <td height="78" colspan="2" id="form1">&nbsp;&nbsp;Ön Görüşmeyi Yapan (Formu Dolduran) Danışman:&nbsp;&nbsp;&nbsp;<input name="dnsmn" type="text" id="dsmn" /></td>
    <td colspan="2" rowspan="2" id="form1">&nbsp;&nbsp;Görüşme Notları:&nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp;<textarea name="not" id="not" ></textarea></td>
    </tr>
  <tr>
    <td height="75" colspan="2" id="form1">&nbsp;&nbsp;Yönlendirilen İdareci:&nbsp;&nbsp;&nbsp;<input name="idare" type="text" id="idare" /></td>
    </tr>
     <tr>
    <td height="75" colspan="2" id="form1"><input type="submit" value="Kaydet" name="kaydet"  />&nbsp;&nbsp;<input type="button" onclick="window.print();" value="Yazdır" /></td>
    </tr>
</table>
</form>
<?php
error_reporting(0);
$baglan=@mysql_connect("localhost","root","");
if(!$baglan) die("MySQL BAĞLANTI HATASI");
mysql_select_db("panel",$baglan) or die ("VT BAĞLANTI HATASI");
mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER SET utf8_general_ci");
$ad=$_POST["ad"];
$dtarih=$_POST["dtarih"];
$okul=$_POST["okul"];
$no=$_POST["no"];
$sinif=$_POST["sinif"];
$btarih=$_POST["btarih"];
$puan=$_POST["puan"];
$osekil=$_POST["osekil"];
$anne=$_POST["anne"];
$baba=$_POST["baba"];
$tel1=$_POST["tel1"];
$tel2=$_POST["tel2"];
$mes1=$_POST["mes1"];
$mes2=$_POST["mes2"];
$adres=$_POST["adres"];
$sekil=" ";
if(isset($_POST["rkl"]))
$sekil=$sekil." ".$_POST["rkl"];
if(isset($_POST["ssy"]))
$sekil=$sekil." ".$_POST["ssy"];
if(isset($_POST["okl"]))
$sekil=$sekil." ".$_POST["okl"];
if(isset($_POST["cevre"]))
$sekil=$sekil." ".$_POST["cevre"];
$dnsmn=$_POST["dnsmn"];
$not=$_POST["not"];
$idare=$_POST["idare"];
$aciklama=$_POST["aciklama"];
$ob=$_POST["ob"];
$om=$_POST["om"];
$ss=$_POST["ss"];
$sg=$_POST["sg"];
$sn=$_POST["sn"];
$veli=$_POST["veli"];
$starih=$_POST["starih"];
$syeri=$_POST["syeri"];
$adsoyad1=$_POST["adsoyad1"];

if($_POST["osekil"]=="Anaokulu"){
  $sorgu="select * from anaokulu where ad='".$ad."' and dtarih='".$dtarih."' ";
  $veri=mysql_query($sorgu);
  while($oku=mysql_fetch_array($veri))
  {
    if($oku["ad"]!=""){
    echo "<script> alert('".$oku["ad"]." daha önceden kayıt olmuştur.Başvuru Tarihi: ".$oku["btarih"]." ');  </script>";
    }
    else{
      $sorgu="insert into anaokulu values('','$ad','$dtarih','$okul','$no','$sinif','$btarih','$puan','$osekil','$anne','$baba','$tel1','$tel2','$mes1','$mes2','$adres','$sekil','$dnsmn','$not','$idare','$aciklama','$ob','$om','$ss','$sg','$sn','$veli','$adsoyad1','$starih','$syeri','$kytsonuc','$vsonuc','$adsoyad2')";

      mysql_query($sorgu);
      header("Location:starter.php");
    }
  }
}

else if($_POST["osekil"]=="İlkokul"){
$sorgu="insert into ilkokul values('','$ad','$dtarih','$okul','$no','$sinif','$btarih','$puan','$osekil','$anne','$baba','$tel1','$tel2','$mes1','$mes2','$adres','$sekil','$dnsmn','$not','$idare','$aciklama','$adsoyad1','$starih','$syeri','$kytsonuc','$vsonuc','$adsoyad2','$veli','$ob','$om','$ss','$sg','$sn')";

mysql_query($sorgu);
header("Location:starter.php");
}
else if($_POST["osekil"]=="İlkokul"){
$sorgu="insert into ogrenciekle values('','$ad','$dtarih','$okul','$no','$sinif','$btarih','$puan','$osekil','$anne','$baba','$tel1','$tel2','$mes1','$mes2','$adres','$sekil','$dnsmn','$not','$idare','$aciklama','$ksekil','$bsekil','$adsoyad1','$starih','$syeri','$kytsonuc','$vsonuc','$adsoyad2','$veli','$ob','$om','$ss','$sg','$sn')";

mysql_query($sorgu);
header("Location:starter.php");
}
else if($_POST["osekil"]=="Ortaokul"){
$sorgu="insert into ortaokul values('','$ad','$dtarih','$okul','$no','$sinif','$btarih','$puan','$osekil','$anne','$baba','$tel1','$tel2','$mes1','$mes2','$adres','$sekil','$dnsmn','$not','$idare','$aciklama','$adsoyad1','$starih','$syeri','$kytsonuc','$vsonuc','$adsoyad2','$veli','$ob','$om','$ss','$sg','$sn')";

mysql_query($sorgu);
header("Location:starter.php");
};
if($_POST["osekil"]=="Lise"){
  $sorgu="select * from lise where ad='".$ad."' and dtarih='".$dtarih."'";
  $veri=mysql_query($sorgu);
  while($oku=mysql_fetch_array($veri))
  {
    if($oku["ad"]!=""){
    echo "<script> alert('".$oku["ad"]." daha önceden kayıt olmuştur.Başvuru Tarihi: ".$oku["btarih"]." ');  </script>";
    }
    else{
      $sorgu="insert into lise values('','$ad','$dtarih','$okul','$no','$sinif','$btarih','$puan','$osekil','$anne','$baba','$tel1','$tel2','$mes1','$mes2','$adres','$sekil','$dnsmn','$not','$idare','$aciklama','$ob','$om','$ss','$sg','$sn','$veli','$adsoyad1','$starih','$syeri','$kytsonuc','$vsonuc','$adsoyad2')";

      mysql_query($sorgu);
      header("Location:starter.php");
    }
  }
}

?>
</body>
</html>