Your IP : 216.73.217.87


Current Path : /hdd/hdd11/www/vlevski/enter/b/
Upload File :
Current File : /hdd/hdd11/www/vlevski/enter/b/index2.php

<?php
	session_start();
	if (($_SESSION["acc"]==6) || ($_SESSION["acc"]==9))
	{
		$tnr=$_SESSION["tname"];
		$tn=explode(" ", $_SESSION["tname"]);
		$tfn=mb_substr($tn[0], 0, 1);
		$tln=mb_substr($tn[1], 0, 1);
		$uin="".$tfn."".$tln."";
	}
	else
	{
		header("location: /");
	}
	include("./conn.php");
	date_default_timezone_set("Europe/Sofia");
	$cd=date("d.m.Y", time());
?><!DOCTYPE HTML>
<html lang="bg">
	<head>
		<meta charset="utf-8" />
		<title>Училищен звънец</title>
		<link rel="shortcut icon" type="image/png" href="/assets/images/site/enter.png" />
		<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
		<link rel="stylesheet" href="/assets/css/select2.min.css" />
		<link rel="stylesheet" href="/assets/css/bootstrap.min.css" />
		<link rel="stylesheet" href="/assets/css/datepicker.css" />
		<script src="/assets/js/jquery.min.js"></script>
		<script src="/assets/js/form.min.js"></script>
		<script src="/assets/js/select.min.js"></script>
		<script src="/assets/js/popper.min.js"></script>
		<script src="/assets/js/bootstrap.min.js"></script>
		<script src="/assets/fa6/js/all.min.js" defer></script>
		<script>
			"use strict";
			let mainid="";
			let maincbell="";
			function addb()
			{
			}
			function showcs()
			{
				$("#mcs").modal("show");
			}
			svedit()
			{
			}
			function as2(i, l)
			{
				const newSelectId="e"+i+""+l+"";
				const $newSelectElement=$("#" + newSelectId);
				if ($newSelectElement.length > 0)
				{
					$newSelectElement.select2(
					{
						width: "80%",
						minimumInputLength: 0,
						dropdownParent: $("#meb"),
						language:
						{
							noResults: function() { return "Няма такъв час"; },
							escapeMarkup: function (markup) { return markup; }
						}
					});
				}
			}
			function ebell(id, cbell)
			{
				mainid=id;
				maincbell=cbell;
				let b=1;
				let bb="";
				bb+="<div class=\"container-fluid\">";
				bb+="<div class=\"row\">";
				bb+="<div class=\"col-3\" style=\"font-size: 25px; font-weight: bold; color: #000000;\">";
				bb+="Час";
				bb+="</div>";
				bb+="<div class=\"col-9\" style=\"font-size: 25px; font-weight: bold; color: #000000;\">";
				bb+="<div class=\"container-fluid m-0 p-0\">";
				bb+="<div class=\"row m-0 p-0\">";
				bb+="<div class=\"col-12 m-0 p-0\" style=\"border-bottom: dashed 1px #000099;\">";
				bb+="Звънци";
				bb+="</div>";
				bb+="</div>";
				bb+="<div class=\"row m-0 p-0\">";
				bb+="<div class=\"col-4 m-0 p-0\">";
				bb+="Първи";
				bb+="</div>";
				bb+="<div class=\"col-4 m-0 p-0\">";
				bb+="Втори";
				bb+="</div>";
				bb+="<div class=\"col-4 m-0 p-0\">";
				bb+="Край";
				bb+="</div>";
				bb+="</div>";
				bb+="</div>";
				bb+="</div>";
				bb+="</div>";
				for (let i=1; i<=7; i++)
				{
					bb+="<div class=\"row\">";
					bb+="<div class=\"col-3\" style=\"font-size: 25px; font-weight: bold; color: #000000;\">";
					bb+=""+i+".";
					bb+="</div>";
					bb+="<div class=\"col-3\" style=\"font-size: 25px; font-weight: bold; color: #000000;\">";
					bb+="<select id=\"e"+i+"f\">";
					bb+="<option value=\"-\">-</option>";
					for (let j=0; j<=425; j=j+5)
					{
						let h=7;
						let m=55;
						m+=j;
						if (m>=60)
						{
							while (m>=60)
							{
								m-=60;
								h++;
							}
						}
						let t=`${h<10?'0':''}${h}:${m<10?'0':''}${m}`;
						bb+="<option value=\""+t+"\">"+t+"</option>";
					}
					bb+="</select>";
					bb+="</div>";
					bb+="<div class=\"col-3\" style=\"font-size: 25px; font-weight: bold; color: #000000;\">";
					bb+="<select id=\"e"+i+"s\">";
					bb+="<option value=\"-\">-</option>";
					for (let j=0; j<=425; j=j+5)
					{
						let h=7;
						let m=55;
						m+=j;
						if (m>=60)
						{
							while (m>=60)
							{
								m-=60;
								h++;
							}
						}
						let t=`${h<10?'0':''}${h}:${m<10?'0':''}${m}`;
						bb+="<option value=\""+t+"\">"+t+"</option>";
					}
					bb+="</select>";
					bb+="</div>";
					bb+="<div class=\"col-3\" style=\"font-size: 25px; font-weight: bold; color: #000000;\">";
					bb+="<select id=\"e"+i+"l\">";
					bb+="<option value=\"-\">-</option>";
					for (let j=0; j<=425; j=j+5)
					{
						let h=7;
						let m=55;
						m+=j;
						if (m>=60)
						{
							while (m>=60)
							{
								m-=60;
								h++;
							}
						}
						let t=`${h<10?'0':''}${h}:${m<10?'0':''}${m}`;
						bb+="<option value=\""+t+"\">"+t+"</option>";
					}
					bb+="</select>";
					bb+="</div>";
					bb+="</div>";
				}
				bb+="</div>";
				$("#mebb").html(""+bb+"");
				if (cbell=="")
				{
					cbell="07:55|08:00|08:40|08:50|08:55|09:35|09:40|09:45|10:25|10:45|10:50|11:30|11:35|11:40|12:20|12:25|12:30|13:10|13:15|13:20|14:00";
				}
				let cbella=cbell.split("|");
				let bc=0;
				for (let i=1; i<=7; i++)
				{
					as2(i, "f");
					as2(i, "s");
					as2(i, "l");
					eval("$(\"#e"+i+"f\").val(\""+cbella[bc]+"\").trigger(\"change\");");
					bc++;
					eval("$(\"#e"+i+"s\").val(\""+cbella[bc]+"\").trigger(\"change\");");
					bc++;
					eval("$(\"#e"+i+"l\").val(\""+cbella[bc]+"\").trigger(\"change\");");
					bc++;
				}
				$("#meb").modal("show");
			}
			function editb(cbell)
			{
				let b=1;
				let bb="";
				bb+="<div class=\"container-fluid\">";
				bb+="<div class=\"row\">";
				bb+="<div class=\"col-3\" style=\"font-size: 25px; font-weight: bold; color: #000000;\">";
				bb+="Час";
				bb+="</div>";
				bb+="<div class=\"col-9\" style=\"font-size: 25px; font-weight: bold; color: #000000;\">";
				bb+="<div class=\"container-fluid m-0 p-0\">";
				bb+="<div class=\"row m-0 p-0\">";
				bb+="<div class=\"col-12 m-0 p-0\" style=\"border-bottom: dashed 1px #000099;\">";
				bb+="Звънци";
				bb+="</div>";
				bb+="</div>";
				bb+="<div class=\"row m-0 p-0\">";
				bb+="<div class=\"col-4 m-0 p-0\">";
				bb+="Първи";
				bb+="</div>";
				bb+="<div class=\"col-4 m-0 p-0\">";
				bb+="Втори";
				bb+="</div>";
				bb+="<div class=\"col-4 m-0 p-0\">";
				bb+="Край";
				bb+="</div>";
				bb+="</div>";
				bb+="</div>";
				bb+="</div>";
				bb+="</div>";
				for (let i=1; i<=7; i++)
				{
					bb+="<div class=\"row\">";
					bb+="<div class=\"col-3\" style=\"font-size: 25px; font-weight: bold; color: #000000;\">";
					bb+=""+i+".";
					bb+="</div>";
					bb+="<div class=\"col-3\" style=\"font-size: 25px; font-weight: bold; color: #000000;\">";
					bb+="<select id=\"e"+i+"f\">";
					bb+="<option value=\"-\">-</option>";
					for (let j=0; j<=425; j=j+5)
					{
						let h=7;
						let m=55;
						m+=j;
						if (m>=60)
						{
							while (m>=60)
							{
								m-=60;
								h++;
							}
						}
						let t=`${h<10?'0':''}${h}:${m<10?'0':''}${m}`;
						bb+="<option value=\""+t+"\">"+t+"</option>";
					}
					bb+="</select>";
					bb+="</div>";
					bb+="<div class=\"col-3\" style=\"font-size: 25px; font-weight: bold; color: #000000;\">";
					bb+="<select id=\"e"+i+"s\">";
					bb+="<option value=\"-\">-</option>";
					for (let j=0; j<=425; j=j+5)
					{
						let h=7;
						let m=55;
						m+=j;
						if (m>=60)
						{
							while (m>=60)
							{
								m-=60;
								h++;
							}
						}
						let t=`${h<10?'0':''}${h}:${m<10?'0':''}${m}`;
						bb+="<option value=\""+t+"\">"+t+"</option>";
					}
					bb+="</select>";
					bb+="</div>";
					bb+="<div class=\"col-3\" style=\"font-size: 25px; font-weight: bold; color: #000000;\">";
					bb+="<select id=\"e"+i+"l\">";
					bb+="<option value=\"-\">-</option>";
					for (let j=0; j<=425; j=j+5)
					{
						let h=7;
						let m=55;
						m+=j;
						if (m>=60)
						{
							while (m>=60)
							{
								m-=60;
								h++;
							}
						}
						let t=`${h<10?'0':''}${h}:${m<10?'0':''}${m}`;
						bb+="<option value=\""+t+"\">"+t+"</option>";
					}
					bb+="</select>";
					bb+="</div>";
					bb+="</div>";
				}
				bb+="</div>";
				$("#mebb").html(""+bb+"");
				if (cbell=="")
				{
					cbell="07:55|08:00|08:40|08:50|08:55|09:35|09:40|09:45|10:25|10:45|10:50|11:30|11:35|11:40|12:20|12:25|12:30|13:10|13:15|13:20|14:00";
				}
				let cbella=cbell.split("|");
				let bc=0;
				for (let i=1; i<=7; i++)
				{
					as2(i, "f");
					as2(i, "s");
					as2(i, "l");
					eval("$(\"#e"+i+"f\").val(\""+cbella[bc]+"\").trigger(\"change\");");
					bc++;
					eval("$(\"#e"+i+"s\").val(\""+cbella[bc]+"\").trigger(\"change\");");
					bc++;
					eval("$(\"#e"+i+"l\").val(\""+cbella[bc]+"\").trigger(\"change\");");
					bc++;
				}
				$("#meb").modal("show");
			}
			function stops(id)
			{
				$("#aplays")[0].pause();
				$("#psng"+id+"").removeClass("btn-danger");
				$("#psng"+id+"").addClass("btn-primary");
				$("#psng"+id+"").attr("onclick", "plays('"+id+"'); return true;");
				$("#psng"+id+"").html("<i class=\"fas fa-volume-high\"></i>");
			}
			function plays(id)
			{
				$("#psng"+id+"").removeClass("btn-primary");
				$("#psng"+id+"").addClass("btn-danger");
				$("#psng"+id+"").attr("onclick", "stops('"+id+"'); return true;");
				$("#psng"+id+"").html("<i class=\"fas fa-volume-mute\"></i>");
				$("#aplays").attr("src", "/b/up/"+id+".mp3");
				$("#aplays")[0].load();
				$("#aplays")[0].pause();
				$("#aplays")[0].play();
			}
			$(document).ready(function()
			{
				$(".modal").on("hidden.bs.modal", function(e)
				{
					if ($(".modal:visible").length)
					{
						$("body").addClass("modal-open");
					}
				});
			});
		</script>
		<style>
			html, body
			{
				background-color: #112233;
			}
			strong
			{
				font-weight: bold;
				color: #DDDDDD;
				font-size: 25px;
			}
			a, div, input
			{
				font-family: Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif;
			}
			th
			{
				cursor: pointer;
			}
			a.dropdown-item
			{
				color: #DDDDDD!important;
			}
			a.dropdown-item:hover
			{
				color: #FFFFFF!important;
				background-color: transparent!important;
			}
			.dropdown .dropdown-menu
			{
				-webkit-transition: all 0.5s;
				-moz-transition: all 0.5s;
				-ms-transition: all 0.5s;
				-o-transition: all 0.5s;
				transition: all 0.5s;
				max-height: 0;
				display: block;
				overflow: hidden;
				opacity: 0;
			}
			.dropdown.show .dropdown-menu
			{
				max-height: 300px;
				opacity: 1;
			}
			.select2-search, .select2-search input, .select2-results, .select2-container--default .select2-selection--single, .select2-selection__rendered
			{
				background-color: #112233!important;
				color: #999911!important;
				font-weight: bold!important;
				min-height: 35px!important;
				line-height: 35px!important;
				font-size: 25px!important;
			}
			.datepicker
			{
				z-index: 1600!important;
				background-color: #112233!important;
				color: #999911!important;
				border: none;
			}
			::-webkit-scrollbar
			{
				width: 10px;
			}
			::-webkit-scrollbar-track
			{
				background-color: #116633;
			}
			::-webkit-scrollbar-thumb
			{
				background-color: #BBBB33;
				border-radius: 5px;
			}
		</style>
	</head>
	<body>
<audio id="aplays" style="display: none;"></audio>
<div style="position: fixed; z-index: 3210;" class="modal fade" id="meb" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="meb" aria-hidden="true">
	<div class="modal-dialog modal-lg" style="width: 95%;">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title" style="font-weight: bold; color: #112233; font-size: 30px;" id="mebt">
					<i class="fas fa-pen"></i> Редактиране на текущия звънец
				</h5>
			</div>
			<div id="mebb" class="modal-body" style="text-align: center;">
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-primary btn-lg" onclick="svedit(); return true;"><i class="fas fa-save"></i> Запиши</button>
				<button type="button" class="btn btn-danger btn-lg" data-dismiss="modal" aria-label="Затвори"><i class="fas fa-times"></i> Затвори</button>
			</div>
		</div>
	</div>
</div>
<div style="position: fixed; z-index: 3210;" class="modal fade" id="mcs" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="mcs" aria-hidden="true">
	<div class="modal-dialog modal-lg" style="width: 95%;">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title" style="font-weight: bold; color: #112233; font-size: 30px;" id="mcst">
					<i class="fas fa-music"></i> Списък с песни
				</h5>
			</div>
			<div class="modal-body" style="text-align: center;">
				<div class="container-fluid">
					<div class="row">
						<div style="font-weight: bold; text-align: center; padding-top: 10px; padding-bottom: 10px; border: dashed 1px #000099" class="col-9">
							Песен
						</div>
						<div style="font-weight: bold; text-align: center; padding-top: 10px; padding-bottom: 10px; border: dashed 1px #000099" class="col-3">
							Действия
						</div>
					</div>
					<?php
						$currentsong=1;
						$sq=mysqli_query($db, "SELECT * FROM `songs` ORDER BY `d` ASC;");
						while($ress=mysqli_fetch_row($sq))
						{
							print("<div class=\"row align-items-center\" style=\"border: dashed 1px #000099;\">");
							print("<div style=\"font-weight: bold; text-align: left;\" class=\"col-9\">");
							print("".$ress[2]."");
							print("</div>");
							print("<div style=\"font-weight: bold; text-align: center; border-left: dashed 1px #000099\" class=\"col-3\">");
							print("<button id=\"psng".$ress[1]."\" onclick=\"plays('".$ress[1]."'); return true;\" style=\"margin-top: 5px; margin-bottom: 5px; width: 45%;\" type=\"button\" class=\"btn btn-primary\">");
							print("<i class=\"fas fa-volume-high\"></i>");
							print("</button>&nbsp;");
							if ($currentsong==1)
							{
								print("<button id=\"ssng".$ress[1]."\" onclick=\"sets('".$ress[1]."'); return true;\" style=\"margin-top: 5px; margin-bottom: 5px; width: 45%;\" type=\"button\" class=\"btn btn-success\">");
								print("<i class=\"fas fa-toggle-on\"></i>");
								print("</button>");
							}
							else
							{
								print("<button id=\"ssng".$ress[1]."\" onclick=\"sets('".$ress[1]."'); return true;\" style=\"margin-top: 5px; margin-bottom: 5px; width: 45%;\" type=\"button\" class=\"btn btn-dark\">");
								print("<i class=\"fas fa-toggle-off\"></i>");
								print("</button>");
							}
							print("</div>");
							print("</div>");
							$currentsong++;
						}
					?>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-primary btn-lg" data-dismiss="modal" aria-label="Затвори"><i class="fas fa-times"></i> Затвори</button>
			</div>
		</div>
	</div>
</div>
<div style="position: fixed; z-index: 3999;" class="modal fade" id="mww" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="mww" aria-hidden="true">
	<div class="modal-dialog modal-lg" style="width: 95%;">
		<div style="font-size: 30px; font-weight: bold;" class="modal-content" style="background-color: #FFFF44;">
			<div class="modal-header">
				<h5 class="modal-title" style="font-weight: bold; color: #112233; font-size: 30px;" id="mwwt">
				</h5>
			</div>
			<div class="modal-body">
				<div id="mwwb" style="text-align: center; font-size: 28px; font-weight: bold;" class="modal-body">
					Моля, изчакайте...
					<br />
				</div>
				<hr />
				<center>
					<div style="position: relative; margin: 0 auto; width: 280px; height: 25px; border: none; text-align: left;">
						<div style="position: absolute; top: 0px; left: 5px; width: 180px; text-align: left; font-style: italic; font-size: 18px; z-index: 1000;">
							Статус:
						</div>
						<div id="status-p" style="position: absolute; top: 0px; left: 190px; width: 85px; text-align: right; font-weight: bold; font-size: 18px; z-index: 1000;">
							0%
						</div>
					</div>
					<div style="position: relative; margin: 0 auto; width: 280px; border-radius: 3px; height: 20px; border: 1px solid #000000; text-align: left;"><div id="progress-bar" style="margin: 5px; border-radius: 2px; background-color: #000099; height: 10px; color: #FFFFFF; width: 0px; -webkit-transition: width 0.3s; -moz-transition: width 0.3s; transition: width 0.3s;"></div>
				</center>
			</div>
		</div>
	</div>
</div>
<div style="position: fixed; z-index: 3210;" class="modal fade" id="merr" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="merr" aria-hidden="true">
	<div class="modal-dialog modal-lg" style="width: 95%;">
		<div class="modal-content" style="background-color: #DD3333;">
			<div class="modal-header">
				<h5 class="modal-title" style="font-weight: bold; color: #DDDDDD; font-size: 30px;" id="merrt">
				</h5>
				<button type="button" style="font-size: 45px;" class="close" data-dismiss="modal" aria-label="Затвори">
					<span aria-hidden="true" style="color: #DDDDDD;">&times;</span>
				</button>
			</div>
			<div class="modal-body" style="color: #DDDDDD;">
			<div id="merrb">
			</div>
			<div id="merry" style="text-align: center;">
			</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-warning btn-lg" data-dismiss="modal" aria-label="Затвори"><i class="fas fa-times"></i> Затвори</button>
			</div>
		</div>
	</div>
</div>
<div style="position: fixed; z-index: 3210;" class="modal fade" id="mok" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="mok" aria-hidden="true">
	<div class="modal-dialog modal-lg" style="width: 95%;">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title" style="font-weight: bold; color: #112233; font-size: 30px;" id="mokt">
					<i class="fas fa-check-circle"></i> Готово
				</h5>
			</div>
			<div class="modal-body" style="text-align: center;">
				<br /><b>Готово!</b>
				<br />
				<br />
				<div id="moky">
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" onclick="location.reload(); return true;" class="btn btn-primary btn-lg"><i class="fas fa-check"></i> Добре</button>
			</div>
		</div>
	</div>
</div>
		<?php
			include("../menuin.php");
		?>
		<div style="margin-top: 55px;" class="container-fluid">
			<div class="row">
				<div class="col-1" style="margin-bottom: 20px; font-size: 25px; font-weight: bold; color: #DDDDDD;">
					<img src="/assets/images/site/enter.png" style="height: 100px; border: none;" alt="" />
				</div>
				<div class="col-5" style="margin-bottom: 20px; font-size: 60px; font-weight: bold; color: #DDDDDD;">
					<span class="d-sm-none d-md-inline">&quot;Васил Левски&quot;</span>
				</div>
				<div class="col-6" style="margin-bottom: 20px; font-size: 60px; font-weight: bold; color: #DDDDDD; text-align: right; padding-right: 30px; border-radius: 15px; background-image: linear-gradient(to right, rgba(51,51,255,0), rgba(51,51,255,1))!important;">
					<i class="fas fa-bell"></i> <span class="d-sm-none d-md-inline">Училищен звънец</span>
				</div>
			</div>
			<div class="row">
				<div class="col-8" style="margin-bottom: 20px; font-size: 25px; font-weight: bold; color: #DDDDDD;">
					<div class="container-fluid">
						<div class="row">
							<div class="col-6">
								<i class="fas fa-bell" style="min-width: 50px;"></i> Текущ звънец:
								<br /><i class="fas fa-clock" style="min-width: 50px;"></i> Начало и край: <b>07:55-14:00</b>
							</div>
							<div class="col-6">
								<button id="editb" onclick="ebell('c', '07:55|08:00|08:40|08:50|08:55|09:35|09:40|09:45|10:25|10:45|10:50|11:30|11:35|11:40|12:20|12:25|12:30|13:10|13:15|13:20|14:00'); return true;" style="margin-bottom: 5px; font-size: 35px; width: 95%; height: 70px;" type="button" class="btn btn-warning">
									<div class="container-fluid">
										<div class="row">
											<div class="col-sm-12 col-md-2">
												<i class="fas fa-pencil"></i>
											</div>
											<div style="text-align: right; paddin-right: 5px;" class="d-sm-none d-md-inline col-sm-12 col-md-10">
												Редактирай
											</div>
										</div>
									</div>
								</button>
							</div>
						</div>
						<div class="row">
							<div class="col-12">
								<i class="fab fa-itunes-note" style="min-width: 50px;"></i> <button class="btn btn-primary" onclick="showcs(); return true;"><i class="fas fa-refresh"></i></button> Песен: <i>Lady Gaga - Abracadabra</i>
								<br /><i class="fas fa-volume-high" style="min-width: 50px;"></i> <button class="btn btn-primary" onclick="showcs(); return true;"><i class="fas fa-refresh"></i></button> Сила на звука: <b>100%</b>
								<br /><i class="fas fa-clock" style="min-width: 50px;"></i> <button class="btn btn-warning" onclick="showcs(); return true;"><i class="fas fa-pen"></i></button> Час за влизане на ЦОУД: <b>15:00</b>
								<br /><i class="fas fa-info-circle" style="min-width: 50px;"></i> <button class="btn btn-warning" onclick="showcs(); return true;"><i class="fas fa-pen"></i></button> Описание: <i>Часове 40 минути, първо - 15 и голямо - 25 - стандартен</i>
							</div>
						</div>
					</div>
				</div>
				<div class="col-4" style="margin-bottom: 20px; font-size: 25px; font-weight: bold; color: #DDDDDD;">
					<button id="addb" onclick="addb(); return true;" style="margin-bottom: 5px; font-size: 35px; width: 95%; height: 70px;" type="button" class="btn btn-success">
						<div class="container-fluid">
							<div class="row">
								<div class="col-sm-12 col-md-2">
									<i class="fas fa-file-audio"></i>
								</div>
								<div style="text-align: right; paddin-right: 5px;" class="d-sm-none d-md-inline col-sm-12 col-md-10">
									Създай нов звънец
								</div>
							</div>
						</div>
					</button><br />
					<button id="adds" onclick="adds(); return true;" style="margin-bottom: 5px; font-size: 35px; width: 95%; height: 70px;" type="button" class="btn btn-primary">
						<div class="container-fluid">
							<div class="row">
								<div class="col-sm-12 col-md-2">
									<i class="fas fa-music"></i>
								</div>
								<div style="text-align: right; paddin-right: 5px;" class="d-sm-none d-md-inline col-sm-12 col-md-10">
									Добави мелодия
								</div>
							</div>
						</div>
					</button><br />
					<button id="stopb" onclick="stopb(); return true;" style="margin-bottom: 5px; font-size: 35px; width: 95%; height: 70px;" type="button" class="btn btn-danger">
						<div class="container-fluid">
							<div class="row">
								<div class="col-sm-12 col-md-2">
									<i class="fas fa-power-off"></i>
								</div>
								<div style="text-align: right; paddin-right: 5px;" class="d-sm-none d-md-inline col-sm-12 col-md-10">
									Спри звънеца
								</div>
							</div>
						</div>
					</button>
				</div>
			</div>
			<div class="row">
				<div class="col-12" style="border-top: solid 1px #DDDDDD; margin-top: 20px; font-size: 40px; font-weight: bold; color: #DDDDDD;">
					<i class="fas fa-bell"></i> Съществуващи звънци
				</div>
			</div>
			<div class="row">
				<div class="col-12" style="margin-bottom: 20px; font-size: 25px; font-weight: bold; color: #DDDDDD;">
					<table id="ttbl" style="width: 1250px; min-width: 1250px; max-width: 1250px; margin: 0 auto;" class="table table-bordered table-striped table-dark">
						<thead>
							<tr>
								<th style="vertical-align: middle; text-align: center; max-width: 80px; min-width: 80px; width: 80px;">№</th>
								<th style="vertical-align: middle; text-align: center; max-width: 550px; min-width: 550px; width: 550px;">Описание на звънеца</th>
								<th style="vertical-align: middle; text-align: center; max-width: 150px; min-width: 150px; width: 150px;">Начало</th>
								<th style="vertical-align: middle; text-align: center; max-width: 150px; min-width: 150px; width: 150px;">Край</th>
								<th style="vertical-align: middle; text-align: center; max-width: 300px; min-width: 300px; width: 300px;">Действия</th>
							</tr>
						</thead>
						<tbody id="stbl">
							<?php
								$i=1;
								$dq=mysqli_query($db, "SELECT * FROM `schoolbell` ORDER BY `d` ASC;");
								while($res=mysqli_fetch_row($dq))
								{
									$vl=$res[0];
									$des=$res[4];
									$starth=$res[2];
									$endh=$res[3];
									$schbell=$res[1];
									print("<tr>");
									print("<td style=\"text-align: center;\">".$i."</td>");
									print("<td>".$des."</td>");
									print("<td style=\"text-align: center;\">".$starth."</td>");
									print("<td style=\"text-align: center;\">".$endh."</td>");
									print("<td style=\"text-align: center;\">");
									print("<button id=\"view".$vl."\" onclick=\"vbell('".$vl."'); return true;\" style=\"font-size: 35px; width: 85px; height: 70px;\" type=\"button\" class=\"btn btn-primary\"><i class=\"fas fa-eye\"></i></button>&nbsp;");
									print("<button id=\"edit".$vl."\" onclick=\"ebell('".$vl."', '".$schbell."'); return true;\" style=\"font-size: 35px; width: 85px; height: 70px;\" type=\"button\" class=\"btn btn-warning\"><i class=\"fas fa-pencil\"></i></button>&nbsp;");
									if ($i!=17)
									{
										print("<button id=\"stat".$vl."\" onclick=\"sbell('".$vl."'); return true;\" style=\"font-size: 35px; width: 85px; height: 70px;\" type=\"button\" class=\"btn btn-dark\"><i class=\"fas fa-toggle-off\"></i></button>");
									}
									else
									{
										print("<button id=\"stat".$vl."\" onclick=\"sbell('".$vl."'); return true;\" style=\"font-size: 35px; width: 85px; height: 70px;\" type=\"button\" class=\"btn btn-success\"><i class=\"fas fa-toggle-on\"></i></button>");
									}
									print("</td>");
									print("<tr>");
									$i++;
								}
							?>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</body>
</html>