function RandevuTamamalaErtele(MusteriDetay $musteri)
 {
     try {
         $baglanti = new VeriTabaniBaglanti();
         $conn = $baglanti->pdo_baglanti();
         $guncelle = $conn->prepare("update musteri set randevuTarihi=?, saat_id=?, doktor_id=?, randevuOnay=?, mesaj=? where id=?");
         $sonuc = $guncelle->execute(array($musteri->getRandevuTarihi(), $musteri->getSaatId(), $musteri->getDoktorId(), $musteri->getRandevuOnay(), $musteri->getMesaj(), $musteri->getMusteriId()));
         if ($sonuc) {
             ?>
           <div class="form-signin" style="color: green; background-color: white;">
               Randevu  Güncellendi.
           </div>
         <?php 
             //header("refresh:1;url=../musteriekle.php");
         } else {
             echo $bilgi = '<div class="form-signin" style="color: red; background-color: pink;"><p style="color: red;">Hata Oluştu</p></div>';
         }
     } catch (Exception $ex) {
         echo $bilgi = '<p style="color: red;">Hata Oluştu: ' . $ex->getMessage() . '</p>';
     } finally {
         if ($conn != null) {
             $conn = $baglanti->pdo_sonlandir();
         }
     }
 }
 function MusteriDoktorGunGoster($tarih, $id)
 {
     $musteriList = array();
     try {
         $sutunlar = "id,musteriAd,musteriSoyad,email,tel,randevuTarihi,mesaj,saat_id,doktor_id,randevuOnay";
         $baglanti = new VeriTabaniBaglanti();
         $conn = $baglanti->pdo_baglanti();
         $tarihSorgu = $conn->query("select {$sutunlar}  from musteri where randevuTarihi='{$tarih}' and doktor_id={$id} and CURDATE()<=randevuTarihi ");
         $rows = $tarihSorgu->fetchAll(PDO::FETCH_CLASS);
         foreach ($rows as $row) {
             $musteri = new Musteri();
             $musteri->setMusteriId($row->id);
             $musteri->setAd($row->musteriAd);
             $musteri->setSoyad($row->musteriSoyad);
             $musteri->setEmail($row->email);
             $musteri->setTel($row->tel);
             $musteri->setRandevuTarihi($row->randevuTarihi);
             $musteri->setSaatId($row->saat_id);
             $musteri->setMesaj($row->mesaj);
             $musteri->setDoktorId($row->doktor_id);
             array_push($musteriList, $musteri);
         }
     } catch (Exception $ex) {
         die($ex->getMessage());
     } finally {
         if ($conn != null) {
             $conn = $baglanti->pdo_sonlandir();
         }
     }
     return $musteriList;
 }
 function IletisimSil(Iletisim $ilt)
 {
     try {
         $baglanti = new VeriTabaniBaglanti();
         $conn = $baglanti->pdo_baglanti();
         $ekle = $conn->prepare("delete from iletisim where id=?");
         $sonuc = $ekle->execute(array($ilt->getIletisimId()));
         if ($sonuc) {
             header("Location:../iletisim.php");
         } else {
             echo '<div class="row"><div class="col-sm-12 form-group"><p style="color: red;">Hata Oluştu</p></div></div>';
         }
     } catch (PDOException $ex) {
         die($ex->getMessage());
     } finally {
         if ($conn != null) {
             $conn = $baglanti->pdo_sonlandir();
         }
     }
 }
 function sifreGuncelle(KullaniciGiris $kul)
 {
     try {
         $baglanti = new VeriTabaniBaglanti();
         $conn = $baglanti->pdo_baglanti();
         $update = $conn->prepare("update kullanicigiris set sifre=? where email=?");
         $sonuc = $update->execute(array($kul->getSifre(), $kul->getEmail()));
         if ($sonuc) {
             echo '<center><p style="color:green;">Şifreniz Güncellendi</p></center>';
             header("refresh:2;url=profilGoruntule.php");
         } else {
             echo '<center><p style="color: red;">Şifreniz Güncellenemedi</p></center>';
         }
     } catch (PDOException $ex) {
         die($ex->getMessage());
     } finally {
         if ($conn != null) {
             $conn = $baglanti->pdo_sonlandir();
         }
     }
 }
 function DoktorMusteri(Doktor $doktor)
 {
     $id = $doktor->getDoktorId();
     $musteriList = array();
     try {
         $baglanti = new VeriTabaniBaglanti();
         $conn = $baglanti->pdo_baglanti();
         $sorgu = $conn->query("Select *from musteri where doktor_id={$id} and randevuOnay=1");
         $rows = $sorgu->fetchAll(PDO::FETCH_CLASS);
         foreach ($rows as $row) {
             $musteri = new Musteri();
             $musteri->setAd($row->musteriAd);
             $musteri->setSoyad($row->musteriSoyad);
             $musteri->setRandevuTarihi($row->randevuTarihi);
             $musteri->setSaatId($row->saat_id);
             $musteri->setEmail($row->email);
             $musteri->setTel($row->tel);
             array_push($musteriList, $musteri);
         }
     } catch (Exception $ex) {
         die($ex->getMessage());
     } finally {
         if ($conn != null) {
             $conn = $baglanti->pdo_sonlandir();
         }
     }
     return $musteriList;
 }