<?php
	header('Content-Type: text/html; charset=utf-8');
	error_reporting(0);
	$path="../../";
	include("../../map.php");
	include("../../scripts.php");
	include("../../secure.php");
	//findDirectoryPath("deppo")
$sayfa = $_GET['sayfa'];
	if($sayfa == "") {$sayfa = 0;}else{$sayfa = ($sayfa-1) * 10;} 
	$sql = mysqli_query($conn, "select * from ".$_SESSION["lang"]." where ne='doping' order by id desc limit $sayfa,10");
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo $rs["t1"];?></title>
</head>
<body>
    <div class="qmodal">
        <div class="qmodal-content">
		<div class="alert alert-warning" id="result" style="display:none;"></div>
            <!-- Header with Action Buttons -->
            <div class="qmodal-header">
			<div class="header-title">
				<nav aria-label="breadcrumb">
					<ol class="breadcrumb">
						<li class="breadcrumb-item"><a href="?"><i class="fa fa-home"></i></a></li>
						<li class="breadcrumb-item active" aria-current="page">Dopingler</li>
					</ol>
				</nav>
			</div>
                <button type="button" class="btn btn-warning" onclick="location.href='?ne=<?php echo $_GET['ne'];?>&islem=<?php echo $_GET['islem'];?>&durum=ydoping&s2=<?php echo $_GET["s2"];?>'; return confirm('<?php echo "Doping"; echo $sdil[201]; //Ekle?> ?')" title="<?php echo "Doping"; echo $sdil[201]; //Ekle?>"><i class="fa fa-plus" aria-hidden="true"></i></button>
            </div>
            <!-- Left Tab Menu -->
            <div class="v8-columns">
                <!-- Content Area -->
                <div class="" ts1="<?php echo dtarih($rs["ts1"],"gg ka yy time");?>" ts2="<?php echo dtarih($rs["ts2"],"gg ka yy time");?>" ts3="<?php echo dtarih($rs["ts3"],"gg ka yy time");?>">
<form method="post" action="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&sayfa=<?php echo $_GET["sayfa"];?>&key=<?php echo $_GET["key"];?>&durum=isle">
							<table class="table">
								<thead>
									<tr>
										<th class="w6" style="text-align:center;">ID</span></th>
										<th>Doping</th>
										<th class="w10">Süre</th>
										<th class="w10">Fiyat</th>
										<th class="w8"><?php echo $sdil[213]; //İşlemler?></th>
									</tr>
								</thead>
								<tbody>
									<?php while($rs=mysqli_fetch_assoc($sql)){ ?>
										<input type="hidden" name="KID[]" value="<?php echo $rs["id"]?>" />
										<tr data-id="<?php echo $rs["id"];?>">
											<th><?php echo i2a($rs["id"],7);?></th>
											<td style="cursor:pointer;">
												<select name="t1[]" class="form-control" style="font-size: 11px; background: transparent; border: 0px;">
													<option value="" <?php if($rs["t1"]=="".trim($sdil[200])." Doping") {?>Selected<?php }?>>Seçiniz</option>											
													<option value="acil" <?php if($rs["t1"]=="acil") {?>Selected<?php }?>>Acil</option>
													<option value="kalin" <?php if($rs["t1"]=="kalin") {?>Selected<?php }?>>Kalın</option>
													<option value="firsat" <?php if($rs["t1"]=="firsat") {?>Selected<?php }?>>Fırsat</option>
													<option value="vitrin" <?php if($rs["t1"]=="vitrin") {?>Selected<?php }?>>Vitrin</option>
												</select>
											</td>
											<td style="cursor:pointer;">
												<select name="i1[]" class="form-control" style="font-size: 11px; background: transparent; border: 0px;">
													<option value="999" <?php if($rs["i1"]=="999"){?>Selected<?php }?>>Süresiz</option>
													<option value="7" <?php if($rs["i1"]=="7") {?>Selected<?php }?>>1 Hafta</option>
													<option value="14" <?php if($rs["i1"]=="14") {?>Selected<?php }?>>2 Hafta</option>
													<option value="21" <?php if($rs["i1"]=="21") {?>Selected<?php }?>>3 Hafta</option>
													<option value="30" <?php if($rs["i1"]=="30") {?>Selected<?php }?>>4 Hafta</option>
												</select>
											</td>
											<td>
												<input type="text" name="pb1[]" onfocus="if(this.value == '0') { this.value = ''} "  onblur="if(this.value == '') { this.value='0'; }" value="<?php echo para($rs["pb1"]);?>" class="form-control" style="width:55%; font-size:11px; float:left; background: transparent; border: 0px">
												<select size=1 name="t2[]" class="form-control" style="float:left; width:40%; padding: 6px 0px; font-size: 11px; background: transparent; border: 0px;<?php if($b4==1){?>display:none;<?php }?>">
													<option value="TRY" <?php if($rs["t2"]=="TL" or $rs["t2"]=="TRY") {?>Selected<?php }?>>TRY</option>
													<option value="EUR" <?php if($rs["t2"]=="EUR") {?>Selected<?php }?>>EUR</option>
													<option value="USD" <?php if($rs["t2"]=="USD") {?>Selected<?php }?>>USD</option>
													<option value="GBP" <?php if($rs["t2"]=="GBP") {?>Selected<?php }?>>GBP</option>
												</select>
											</td>
											<td class="table-actions" style="text-align: center;">
												<div class="input-group-btn">
													<div class="input-group-btn" id="btns<?php echo $rs["id"];?>">
														<button type="button" class="btn btn-primary mr2" type="submit"><i class="fa fa-refresh"></i><span class="ddn"> <?php echo $sdil[199]; //Güncelle?></span></button>
														<!--<a class="btn btn-info mr2" href="?ne=<?php echo $_GET["ne"];?>&islem=ddoping&id=<?php echo $rs["id"];?>" title="<?php echo $sdil[199]; //Düzenle?>"><i class="fa fa-pencil"></i></a>-->
														<button type="button" title="<?php echo $sdil[204]; //Kaldir?>" class="btn btn-danger" href="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $rs["id"];?>&durum=sdoping"><i class="fa fa-times" aria-hidden="true"></i></button>
													</div>
												</div>
											</td>
										</tr>
									<?php }?>
								</tbody>
							</table>
                 </div>
            </div>
</form>
</body>
<?php echo $footer?>
</html>
<?php
if($_GET["durum"] == "ydoping"){
	$rt1="".trim($sdil[200])." Doping";
	$sql = $conn->query("insert into ".$_SESSION["lang"]." (ne,t1,ts1,s12,s13,s5) values ('doping', '".$rt1."', now(), '0', '1','99999')");
	$sql=mysqli_query($conn, "select * from ".$_SESSION["lang"]." where ne='doping' order by id desc"); $rs=mysqli_fetch_assoc($sql);
	echo location("?ne=".$_GET["ne"]."&islem=doping&id=".$rs["id"]."&durum=ok",self,500,1);
}elseif($_GET["durum"] == "sdoping"){
	$sqlr=mysqli_query($conn, "select * from ".$_SESSION["lang"]." where ne='doping' and id=".$_GET["id"].""); $rsr=mysqli_fetch_assoc($sqlr);
	$aql = mysqli_query($conn, "delete from ".$_SESSION["lang"]." where ne='doping' and id=".$_GET["id"]."");	
	echo location("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&durum=ok",self,500,1);
}elseif($_GET["durum"] == "isle"){
	$KID_ = implode(',',$_POST["KID"]); $KIDs = explode(',',$KID_);
	$T1_ = implode(',',$_POST["t1"]); $T1s = explode(',',$T1_);
	$w=0; foreach($T1s as $T) {$w++;
		$Rs = mysqli_query($conn, "update ".$_SESSION["lang"]." set t1='".addslashes(stripslashes($T))."' where id=".$KIDs[$w-1]."");
	}
	$pb1_ = implode(',',$_POST["pb1"]); $pb1s = explode(',',$pb1_);
	$y=0;foreach($pb1s as $pb1) {$y++;
		for ($l = 1; $l <= $lx; $l++) {$Rs = mysqli_query($conn, "update ".$_SESSION['lang']." set pb1='".$pb1."' where id=".$KIDs[$y-1]."");}
	}
$t2_ = implode(',',$_POST["t2"]); $t2s = explode(',',$t2_);
$z=0;foreach($t2s as $t2) {$z++;
	for ($l = 1; $l <= $lx; $l++) {$Rs = mysqli_query($conn, "update ".$_SESSION['lang']." set t2='".$t2."' where id=".$KIDs[$z-1]."");}
}
$i1_ = implode(',',$_POST["i1"]); $i1s = explode(',',$i1_);
$z=0;foreach($i1s as $i1) {$z++;
	for ($l = 1; $l <= $lx; $l++) {$Rs = mysqli_query($conn, "update ".$_SESSION['lang']." set i1='".$i1."', n2='(".$i1.") Gün' where id=".$KIDs[$z-1]."");}
}
echo location("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&sayfa=".$_GET["sayfa"]."&key=".$_GET["key"]."&durum=ok",self,500,1);
}
?>