
    <main>
        <section id="user-information">
            <div class="container">
                <div class="user__info-wrapper row">
			<?php include(__ROOT__."/public/panel/sidebar.php"); ?>
			
<?php $data = destek(get("id")); if (!destek(get("id"))) {header("location: ".$site."panel");die();}
if($data["user"]!=$_SESSION["user"]){
	header("location: ".$site."panel");die();
}
 ?>
<div class="form__wrapper">
                            <span><i class="ri-hand-heart-line"></i> Cevap Yaz</span>
                            <form action="" method="post">
							<input type="hidden" name="islem" value="ticketcevap">
							<input type="hidden" name="id" value="<?=get("id");?>">
                                <div class="form__content row">
                                    <div class="form-group adress col-md-12">
                                        <label for="">Mesajınız</label>
                                        <textarea name="cevap" required id="" placeholder="Lütfen mesajınızı ayrıntılı ve detaylı olarak yazınız."></textarea>
                                    </div>
                                    <div class="form-group col-md-12 mb-0">
                                        <button type="submit" class="btn">
                                            Yanıt Gönder <i class="ri-arrow-right-line"></i>
                                    </button>
                                    </div>
                                </div>
                            </form>
                        </div>
<div class="form__wrapper ticket__detail">
                            <div class="ticket__top">
                                <span><i class="ri-hand-heart-line"></i> <?=$data["baslik"];?></span>
                         
				<?php if($data["durum"]=="0"){ ?>
                                                <h5 class="bekliyor">Cevap Bekliyor</h5>
				<?php } ?>
				<?php if($data["durum"]=="1"){ ?>
                                                <h5 class="yanitlandi">Yanıtlandı</h5>
				<?php } ?>
				<?php if($data["durum"]=="2"){ ?>
                                                <h5 class="cozumlendi">Çözümlendi</h5>
				<?php } ?>
				<?php if($data["durum"]=="3"){ ?>
                                                <h5 class="islemde">İşlemde</h5>
				<?php } ?>
                            </div>
                            <div class="message">
								
									<?php 
$query = $db->query("SELECT * FROM destek_cevap where destek='".get("id")."' ORDER BY id DESC"); 
                while ($datax = $query->fetch(PDO::FETCH_OBJ)) { ?>
                                <div class="message__content">
                                    <div class="message__top">
									<?php if($datax->user=="0"){ ?>
                                        <span><strong style="color: #dc3545 !important;">Yönetici</strong> (<?=$datax->tarih;?>)</span>
                                        <h5 class="yetkili">Yetkili</h5>
									<?php } else{ ?>
                                        <span><strong><?=$puser["ad"];?> <?=$puser["soyad"];?></strong> (<?=$datax->tarih;?>)</span>
                                        <h5 class="kullanici">Müşteri</h5>
									<?php } ?>
                                    </div>
                                    <div class="message__text">
                                       <?=$datax->mesaj;?>
                                    </div>
				</div>
				<?php } ?>
                                <div class="message__content">
                                    <div class="message__top">
                                        <span><strong><?=$puser["ad"];?> <?=$puser["soyad"];?></strong> (<?=$data["tarih"];?>)</span>
                                        <h5 class="kullanici">Müşteri</h5>
                                    </div>
                                    <div class="message__text">
                                        <?=$data["mesaj"];?>
                                    </div>
                                </div>
                           
                            </div>
                        </div>
						</div>
                </div>
            </div>
        </section>
    </main>
