<?php include("header.php");?>
<?php
if(p('isim') && g('islem')=="duzenle")
{
	$isim = p('isim');
	$durum 	= p('durum');
	$d_id 	= g('id');
	
	$Yorum_duzenle_sorgu = Sorgu("UPDATE yorumlar SET 
											durum	=	'$durum',  
											isim	=	'$isim',
											where id=	'$d_id'");
	if($Yorum_duzenle_sorgu){
				  $bilgi = '  <div class="alert alert-success alert-block fade in">
                                  <button data-dismiss="alert" class="close close-sm" type="button">
                                      <i class="fa fa-times"></i>
                                  </button>
                                  <h4>
                                      <i class="fa fa-ok-sign"></i>
                                      Başarılı!
                                  </h4>
                                  <p>Başarıyla yorum onaylanmıştır...</p>
                              </div>
		 ' ;
	}else{
		$bilgi = '  <div class="alert alert-danger alert-block fade in">
                                  <button data-dismiss="alert" class="close close-sm" type="button">
                                      <i class="fa fa-times"></i>
                                  </button>
                                  <h4>
                                      <i class="fa fa-ok-sign"></i>
                                      Hata!
                                  </h4>
                                  <p>Bir Hata oluştu...</p>
                              </div>
		 ' ;
		
	}
}

if($_GET['islem']=="duzenle")
{
	$sayfaid = $_GET['id'];	
	$durum = "duzenle" ;
	$YorumSonuc = Sonuc(Sorgu("SELECT * FROM yorumlar WHERE id='$sayfaid'"));
}

?>
 <!--main content start-->
      <section id="main-content">
          <section class="wrapper">
              <!-- page start-->
        
            

              <div class="row">
                  <div class="col-lg-12">
				    <?php echo $bilgi;?>
                      <section class="panel">
                          <header class="panel-heading">
                           Gelen Yorum
                          </header>
                          <div class="panel-body">
                              <form class="form-horizontal tasi-form" method="post" action="" enctype="multipart/form-data">
							  
							  

                                  <div class="form-group">
                                      <label class="col-sm-2 col-sm-2 control-label">Adı ve Soyadı</label>
                                      <div class="col-sm-10">
                                     <input type="text" class="form-control" name="isim" value="<?php echo $YorumSonuc->isim;?>" id="isim" placeholder="">
                                      </div>
                                  </div>
                             
                                  <div class="form-group">
                                      <label class="col-sm-2 col-sm-2 control-label">Email Adresi</label>
                                      <div class="col-sm-10">
                                     <input type="text" class="form-control" name="email" value="<?php echo $YorumSonuc->email;?>" id="email" placeholder="">
                                      </div>
                                  </div>
                             
                         
					    <div class="form-group">
                                         <label class="col-sm-2 col-sm-2 control-label">Yapılan Yorum</label>
                                          <div class="col-sm-10">
                                              <textarea name="mesaj" class="form-control ckeditor" rows="10"><?php echo $YorumSonuc->mesaj;?></textarea>
                                          </div>
                                      </div>
						 
						 
						       
						 
						 
						 
						          <div class="row m-bot15">
                                  <?php if($_GET['islem']=="duzenle"){?>
								 <label class="col-sm-2 col-sm-2 control-label">Durumu</label>
                                           <div class="col-sm-10">
                                           <input type="checkbox" name="durum" <?php if($YorumSonuc->durum == '1') {?> checked <?php } ?> value="1" data-toggle="switch"/>
                                          </div>
                                        	<?php }else{?>
											 <label class="col-sm-2 col-sm-2 control-label">Durumu</label>
                                          <div class="col-sm-10">
                                           	<input type="checkbox" name="durum" value="1" checked data-toggle="switch"/>
                                          </div>
										  <?php } ?>
                                      </div>
						 
						 
						 
						 
						      
						 
						 
						 
						 
						 
						         <div class="form-group">
                                        <div class="col-sm-10">
									    <?php if($_GET['islem']=="duzenle"){?>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                          <button class="btn btn-shadow btn-danger" type="submit">Güncelle</button>
										  <?php }else{?>
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
										  <button class="btn btn-shadow btn-success" type="submit">Kaydet</button>
										   <?php } ?>
                                      </div>
                                  </div>
						 
						 
						 
						 
						 
						 
                              </form>
                          </div>
                      </section>
                  
                      

           

               

                  </div>
              </div>
              <!-- page end-->
          </section>
      </section>
      <!--main content end-->





















<?php include("footer.php");?>