<div class="v8-tabs-seans">
	<div id="tab-locales">
		<ul class="v8-mini-tabs v8-no-margin v8-js-tabs v8-same-height">
			<li><a href="#">Seanslar</a></li>
		</ul>
		<div id="tab-ext<?php echo $y?>">
			<fieldset class="grey-bg row">
				<legend>Seanslar</legend>
				<table class="table table-no-more table-bordered table-striped mb-0">
					<tr class="addtr" style="min-height: 30px;" data-id="">
						<form action="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $_GET["id"];?>&durum=seans" method="post" id="fseans0" class="nfx0" name="nfx0" autocomplete="off">
							<input type="hidden" name="sx2" value="<?php echo $y?>">
							<td>
								<input type="text" name="nx1" style="" class="nx1 form-control v3-input-sm" title="" placeholder="Seans Tanım">
							</td>
							<td>
								<input type="number" name="nx2" style="" class="nx2 form-control v3-input-sm" title="" placeholder="Seans Sayısı">
							</td>
							<td>
								<input type="text" name="nx3" style="" class="nx3 form-control v3-input-sm" title="" placeholder="Tarih" value="<?php echo "".date(d).".".date(m).".".date(Y)."";?>" data-plugin-masked-input="" data-input-mask="99.99.9999" placeholder="__.__.____">
							</td>
							<td>
								<input type="number" name="nx4" style="" class="nx4 form-control v3-input-sm" title="" placeholder="Seans Aralığı [Gün]">
							</td>
							<td class="w5">
								<input type="text" name="sx10" style="" class="form-control v3-input-sm" title="<?php echo $sdil[74]?>" placeholder="<?php echo $sdil[74]?>" value="0" onfocus="if(this.value == '0') { this.value = ''} "  onblur="if(this.value == '') { this.value='0'; }">
							</td>
							<td class="w8">
								<div class="input-group-btn">
									<a tabindex="-1" onclick="document.getElementById('fseans0').submit();" class="btn btn-warning mbtn" type="submit" <?php if ($e10==1 and $_SESSION["user"]<>"Master"){?>disabled<?php }?>><i class="fa fa-plus cw"></i><span class="ddn"> <?php echo $sdil[201]; //ekle?></span></a>
								</div>
							</td>
							<input type="submit" style="display:none;" />
						</form>
					</tr>
					<?php $sql=mysqli_query($conn, "select * from t1 where ne='seans' and  t1='".$_GET['ne']."' and t2='".$_SESSION['lang']."' and s1=".$_GET["id"].""); while($nx=mysqli_fetch_assoc($sql)){ ?>
						<tr data-id="<?php echo $nx["id"];?>" style="min-height: 30px;">
							<form action="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $_GET["id"];?>&durum=seans&seans_id=<?php echo $nx["id"];?>" method="post" autocomplete="off" id="gseans<?php echo $nx["id"];?>" class="gfx<?php echo $b?>">
								<input type="hidden" name="sx2" value="<?php echo $nx["s2"];?>">
								<td>
									<input type="text" name="nx1" style="" value="<?php echo $nx["n1"];?>" class="ox1 form-control v3-input-sm" title="" placeholder="">
								</td>
								<td>
									<input type="number" name="nx2" style="" value="<?php echo $nx["n2"];?>" class="ox1 form-control v3-input-sm" title="" placeholder="">
								</td>
								<td>
									<input type="text" name="nx3" style="" value="<?php echo $nx["n3"];?>" class="ox1 form-control v3-input-sm" title="" placeholder="">
								</td>
								<td>
									<input type="number" name="nx4" style="" value="<?php echo $nx["n4"];?>" class="ox1 form-control v3-input-sm" title="" placeholder="">
								</td>
								<td class="w5">
									<input type="text" name="sx10" style="" class="form-control v3-input-sm" title="<?php echo $sdil[74]?>" value="<?php echo $nx["s10"]?>" placeholder="<?php echo $sdil[74]?>" onfocus="if(this.value == '0') { this.value = ''} "  onblur="if(this.value == '') { this.value='0'; }">
								</td>
								<td class="w8">
									<div class="input-group-btn">
										<a tabindex="-1" class="btn btn-warning mbtn" onclick="document.getElementById('gseans<?php echo $nx["id"];?>').submit();" <?php if ($e10==1 and $_SESSION["user"]<>"Master"){?>disabled<?php }?>><i class="fa fa-refresh cw"></i><span class="ddn"> <?php echo $sdil[203]; //Güncelle?></span></button>
											<a style="margin-left: 1px" tabindex="-1" class="btn btn-danger btn-delete-row mbtn" data-href="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $_GET["id"];?>&durum=seans_s&seans_id=<?php echo $nx["id"];?>&sx2=<?php echo $nx["s2"];?>"><i class="fa fa-times cw"></i><span class="ddn"> <?php echo $sdil[204]; //Kaldır?></span></a>
										</div>
									</td>
									<input type="submit" style="display:none;" />
								</form>
							</tr>
						<?php }?>
					</table>
				</fieldset>
			</div>
		</div>
	</div>
	<?php
	if($_GET["durum"]=="seans"){
//-------------------------------------------------------------------------------->
		if(!empty($_GET["seans_id"])){
			$Rsq = mysqli_query($conn, "update t1 set t3='".$_POST['tx3']."', n1='".$_POST['nx1']."', n2='".$_POST['nx2']."', n3='".$_POST['nx3']."', n4='".$_POST['nx4']."', n5='".$_POST['nx5']."', n6='".$_POST['nx6']."', n7='".$_POST['nx7']."', n8='".$_POST['nx8']."', n9='".$_POST['nx9']."', n10='".$_POST['nx10']."', s10='".$_POST['sx10']."' Where t1='".$_GET['ne']."' and id='".$_GET['seans_id']."' ");
		}else{
			if($_POST["nx2"]==1){
				$conn->query("insert INTO t1(t1,t2,t3,ne,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,s1,s2,s10) VALUES ('".$_GET['ne']."', '".$_SESSION['lang']."', '".$_POST['tx3']."', 'seans', '".$_POST['nx1']."', '".$_POST['nx2']."', '".$_POST['nx3']."', '".$_POST['nx4']."', '".$_POST['nx5']."', '".$_POST['nx6']."', '".$_POST['nx7']."', '".$_POST['nx8']."', '".$_POST['nx9']."', '".$_POST['nx10']."', '".$_GET['id']."', '".$_POST['sx2']."', '".$_POST['sx10']."');");
			}else{
				$s=0; for($t=0; $t<=$_POST["nx2"]-1; $t++){$s++;
					if($s==1){
						$nx3=$_POST["nx3"];
					}else{
						$nx3=date("d.m.Y", strtotime($_POST["nx3"]."+".($_POST["nx4"]*$s-$_POST["nx4"])." day"));
					}
					$starih = explode('.',$nx3);
					$conn->query("insert INTO t1(t1,t2,t3,ne,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,s1,s2,s10) VALUES ('".$_GET['ne']."', '".$_SESSION['lang']."', '".$_POST['tx3']."', 'seans', '".$_POST['nx1']."', '".$s."', '".$nx3."', '".$_POST['nx4']."', '".$_POST['nx5']."', '".$_POST['nx6']."', '".$_POST['nx7']."', '".$_POST['nx8']."', '".$_POST['nx9']."', '".$_POST['nx10']."', '".$_GET['id']."', '".$_POST['sx2']."', '".$_POST['sx10']."');");
					$sqls=mysqli_query($conn, "select * from t1 where ne='seans' order by id desc"); $rss=mysqli_fetch_assoc($sqls);
					$sql1 = $conn->query("insert into genel (ne,t1,t2,n1,s1,s2,s3,s6,s7,s8) values ('not', '".$_POST["nx1"]."', '00:00', '".$_POST["nx1"].", ".$s.".Seans', '".$_POST["s1"]."', '".$rss["id"]."', '".$_GET["id"]."', '".$starih[0]."', '".$starih[1]."', '".$starih[2]."')");
				}
			}
		}
		echo location("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&id=".$_GET["id"]."&durum=ok&#tab-seans&tab-ext".$_POST["sx2"]."",self,500,1);
//------------------------------------------------------------------------------------------------>
	}elseif($_GET["durum"]=="seans_s"){
		$sql = mysqli_query($conn, "delete from t1 where id=".$_GET["seans_id"]);	
		$sql = mysqli_query($conn, "delete from genel where s2=".$_GET["seans_id"]);	
		echo location("?ne=".$_GET["ne"]."&islem=".$_GET["islem"]."&id=".$_GET["id"]."&durum=ok&#tab-seans&tab-ext".$_POST["sx2"]."",self,500,1);
//------------------------------------------------------------------------------------------------>
	}
	?>