Your IP : 216.73.216.48
<?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");
if (isset($_POST["adt"]))
{
$adt=$_POST["adt"];
$adt=str_replace(" ", " ", $adt);
$adt=str_replace(" ", " ", $adt);
$adt=str_replace(" ", " ", $adt);
$adt=str_replace(" ", " ", $adt);
$adt=str_replace(" ", " ", $adt);
$adt=str_replace("__ ", "__", $adt);
$adt=str_replace("__ ", "__", $adt);
$adt=str_replace("__ ", "__", $adt);
$adt=str_replace("__ ", "__", $adt);
$adt=str_replace("__ ", "__", $adt);
$adt=str_replace(" __", "__", $adt);
$adt=str_replace(" __", "__", $adt);
$adt=str_replace(" __", "__", $adt);
$adt=str_replace(" __", "__", $adt);
$adt=str_replace(" __", "__", $adt);
$allt=$adt;
$adt=explode("__", $adt);
$tm=time();
$sql=mysqli_query($db, "INSERT INTO `docsz` (`i`, `n`, `d`, `a`, `f`, `t`, `m`) VALUES (NULL, '".$adt[2]."', '".$tm."', '".$adt[0]."', '".$adt[1]."', '".$allt."', '1');");
}
if (isset($_POST["edt"]))
{
$edt=$_POST["edt"];
$edt=str_replace(" ", " ", $edt);
$edt=str_replace(" ", " ", $edt);
$edt=str_replace(" ", " ", $edt);
$edt=str_replace(" ", " ", $edt);
$edt=str_replace(" ", " ", $edt);
$edt=str_replace("__ ", "__", $edt);
$edt=str_replace("__ ", "__", $edt);
$edt=str_replace("__ ", "__", $edt);
$edt=str_replace("__ ", "__", $edt);
$edt=str_replace("__ ", "__", $edt);
$edt=str_replace(" __", "__", $edt);
$edt=str_replace(" __", "__", $edt);
$edt=str_replace(" __", "__", $edt);
$edt=str_replace(" __", "__", $edt);
$edt=str_replace(" __", "__", $edt);
$allt=$edt;
$edt=explode("__", $edt);
$tm=time();
$ne=mysqli_query($db, "SELECT `m` FROM `docsz` WHERE `n`='".$edt[2]."' ORDER by `m` DESC LIMIT 1");
while ($res=mysqli_fetch_row($ne))
{
$fn=$res[0];
}
$fn++;
$sql=mysqli_query($db, "INSERT INTO `docsz` (`i`, `n`, `d`, `a`, `f`, `t`, `m`) VALUES (NULL, '".$edt[2]."', '".$tm."', '".$edt[0]."', '".$edt[1]."', '".$allt."', '".$fn."');");
}
if (isset($_POST["delt"]))
{
$delt=$_POST["delt"];
$fd=mysqli_query($db, "SELECT * FROM `docsz` WHERE `i`='".$delt."' LIMIT 1");
while ($res=mysqli_fetch_row($fd))
{
$n=$res[1];
$a=$res[3];
}
$sql=mysqli_query($db, "UPDATE `docsz` SET `m`='0' WHERE `n`='".$n."';");
}
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/js/bootstrap-datepicker.js"></script>
<script src="/assets/js/jquery.dataTables.min.js"></script>
<script src="/assets/js/dataTables.bootstrap4.min.js"></script>
<script src="/assets/fa6/js/all.min.js" defer></script>
<script>
delid=0;
usrs="";
function chk(id)
{
var v=$("#"+id+"").html();
var vchk=v.replace("fas fa-square", "");
if (v!=vchk)
{
$("#"+id+"").html("<i style=\"font-size: 22px; color: #DDDD00;\" class=\"fas fa-check-square\"></i>");
usrs+=""+id+"";
}
else
{
$("#"+id+"").html("<i style=\"font-size: 22px;\" class=\"fas fa-square\"></i>");
usrs=usrs.replaceAll(""+id+"", "");
}
$("#v3").val(usrs);
}
function chke(id)
{
var v=$("#"+id+"edit").html();
var vchk=v.replace("fas fa-square", "");
if (v!=vchk)
{
$("#"+id+"edit").html("<i style=\"font-size: 22px; color: #DDDD00;\" class=\"fas fa-check-square\"></i>");
usrs+=""+id+"";
}
else
{
$("#"+id+"edit").html("<i style=\"font-size: 22px;\" class=\"fas fa-square\"></i>");
usrs=usrs.replaceAll(""+id+"", "");
}
$("#e3").val(usrs);
}
function fkl()
{
<?php
$nq=mysqli_query($db, "SELECT `sha` FROM `stuff` WHERE `a`='1' AND `k`<>'' ORDER by `n1` ASC, `n2` ASC, `n3` ASC");
while ($res=mysqli_fetch_row($nq))
{
print("chk('tstart".$res[0]."tending'); ");
}
?>
}
function fkle()
{
<?php
$nq=mysqli_query($db, "SELECT `sha` FROM `stuff` WHERE `a`='1' AND `k`<>'' ORDER by `n1` ASC, `n2` ASC, `n3` ASC");
while ($res=mysqli_fetch_row($nq))
{
print("chke('tstart".$res[0]."tending'); ");
}
?>
}
function fcoud()
{
<?php
$nq=mysqli_query($db, "SELECT `sha` FROM `stuff` WHERE `a`='1' AND `m`='2' ORDER by `n1` ASC, `n2` ASC, `n3` ASC");
while ($res=mysqli_fetch_row($nq))
{
print("chk('tstart".$res[0]."tending'); ");
}
?>
}
function fcoude()
{
<?php
$nq=mysqli_query($db, "SELECT `sha` FROM `stuff` WHERE `a`='1' AND `m`='2' ORDER by `n1` ASC, `n2` ASC, `n3` ASC");
while ($res=mysqli_fetch_row($nq))
{
print("chke('tstart".$res[0]."tending'); ");
}
?>
}
function fall()
{
<?php
$nq=mysqli_query($db, "SELECT `sha` FROM `stuff` WHERE `a`='1' ORDER by `n1` ASC, `n2` ASC, `n3` ASC");
while ($res=mysqli_fetch_row($nq))
{
print("chk('tstart".$res[0]."tending'); ");
}
?>
}
function falle()
{
<?php
$nq=mysqli_query($db, "SELECT `sha` FROM `stuff` WHERE `a`='1' ORDER by `n1` ASC, `n2` ASC, `n3` ASC");
while ($res=mysqli_fetch_row($nq))
{
print("chke('tstart".$res[0]."tending'); ");
}
?>
}
function uplf(id,n)
{
$("#fnm").val(id);
$("#mupl").modal("show");
$("#muplt").html("<i class=\"fas fa-cloud-upload-alt\"></i> Добавяне на файл към сед. зад. №"+n+"");
}
function ade()
{
$("#madd").modal("show");
}
function dl(id,n)
{
delid=id;
$("#mdel").modal("show");
$("#mdelt").html("<i class=\"fas fa-trash\"></i> Изтривате ли сед. зад. №"+n+"?");
}
function dln()
{
if (delid!=0)
{
$("#delt").val(delid);
$("#delfrm").submit();
}
}
function s(id, n)
{
$("#msf").modal("show");
$("#msft").html("<i class=\"fas fa-file-pdf\"></i> Преглед на файла към сед. зад. №"+n+"");
$("#ise").html("<object id=\"isfo"+id+"\" name=\"isfo"+id+"\" data=\"./s.php?i="+id+"#view=FitH&toolbar=0\" type=\"application/pdf\" style=\"position: relative; width: 100%; min-height: "+ah+"px; height: "+ah+"px; boder: none;\"></object>");
$("#isf").html("<button type=\"button\" class=\"btn btn-success\" style=\"font-size: 20px; font-weight: bold; font-style: italic;\" onclick=\"window.open('./s.php?i="+id+"#view=FitH', '_blank'); return true;\"><i class=\"fas fa-external-link-alt\"></i> Отвори в нов прозорец</button>");
}
function entrs(event)
{
if ((event.keyCode==13) || (event.keyCode==13 && event.shiftKey))
{
event.preventDefault();
return false;
}
}
function svr()
{
var i=1;
var dt="<?php print("".$uin."__".$tnr.""); ?>";
var n="";
var err=0;
while (i<=5)
{
eval('n=$("#v'+i+'").val().trim();');
if (n=="")
{
err=1;
}
dt+="__"+n;
i++;
}
n=$("#v6").text().trim();
dt+="__"+n;
if (n=="")
{
err=1;
}
var tchk=$("#v5").val();
var tchkh=parseInt(tchk.substring(0, 2));
var tchkm=parseInt(tchk.substring(3, 5));
if (isNaN(tchkh) || isNaN(tchkm))
{
err=1;
}
else if ((tchkh>23) || (tchkh>59))
{
err=1;
}
if (err==1)
{
$("#mfill").modal("show");
}
else
{
$("#adt").val(dt);
$("#addnew").submit();
}
}
function sv()
{
var id=$("#v1").val().trim();
$.ajax({url: "./e.php", type: "POST", data:{"id": ""+id+""}, success: function(data) { if (data!="ERR") { setTimeout(function() { svr(); }, 100); } else { $("#mtkn").modal("show"); } } });
}
function sve()
{
var i=1;
var dt="<?php print("".$uin."__".$tnr.""); ?>";
var n="";
var err=0;
while (i<=5)
{
eval('n=$("#e'+i+'").val().trim();');
if (n=="")
{
err=1;
}
dt+="__"+n;
i++;
}
n=$("#e6").text().trim();
dt+="__"+n;
if (n=="")
{
err=1;
}
var tchk=$("#e5").val();
var tchkh=parseInt(tchk.substring(0, 2));
var tchkm=parseInt(tchk.substring(3, 5));
if (isNaN(tchkh) || isNaN(tchkm))
{
err=1;
}
else if ((tchkh>23) || (tchkh>59))
{
err=1;
}
if (err==1)
{
$("#mfill").modal("show");
}
else
{
$("#edt").val(dt);
$("#ednew").submit();
}
}
function edt(d)
{
$("#med").modal("show");
var f=d.split("__");
$("#e1").val(f[2]);
$("#d1").html(f[2]);
$("#e2").val(f[3]);
$("#e3").val(f[4]);
$("#e4").val(f[5]);
$("#e5").val(f[6]);
$("#e6").html(f[7]);
var mrke=f[4].replaceAll("tstart", "");
mrke=mrke.split("tending");
var mrkn=mrke.length;
mrkn-=2;
for (i=0; i<=mrkn; i++)
{
chke("tstart"+mrke[i]+"tending");
}
}
function ed(id)
{
$.ajax({url: "./r.php", type: "POST", data:{"id": ""+id+""}, success: function(data) { if (data!="ERR") { setTimeout(function() { edt(data); }, 100); } else { uplerr(); } } });
}
function uplok()
{
$("#mww").modal("hide");
window.open("./", "_self");
}
function uplerr()
{
$("#merr").modal("show");
$("#merrb").html("Нещо се обърка!<br />Презаредете страницата<br />и опитайте отново!");
}
function uplem()
{
$("#merr").modal("show");
$("#merrb").html("Файлът е празен!<br />Презаредете страницата<br />и опитайте отново!");
}
var fSize=25000000;
function chr()
{
var err=0;
var upl=document.getElementById("upf").value;
if (upl=="")
{
$("#merr").modal("show");
$("#merrb").html("Не сте избрали файл!<br />Презаредете страницата<br />и опитайте отново!");
err++;
}
else if (fSize>=25000000)
{
$("#merr").modal("show");
$("#merrb").html("Файлът не може да е по-голям от 25МB!<br />Презаредете страницата<br />и опитайте отново!");
err++;
}
else if (fSize==0)
{
$("#merr").modal("show");
$("#merrb").html("Файлът е празен!<br />Презаредете страницата<br />и опитайте отново!");
err++;
}
if (err==0)
{
$("#mww").modal("show");
setTimeout(function(){ $("#frm").submit(); }, 1500);
}
}
function s(id, n)
{
$("#msf").modal("show");
$("#msft").html("<i class=\"fas fa-file-pdf\"></i> Преглед на файла към сед. зад. №"+n+"");
$("#ise").html("<object id=\"isfo"+id+"\" name=\"isfo"+id+"\" data=\"./s.php?i="+id+"#view=FitH&toolbar=0\" type=\"application/pdf\" style=\"position: relative; width: 100%; min-height: "+ah+"px; height: "+ah+"px; boder: none;\"></object>");
$("#isf").html("<button type=\"button\" class=\"btn btn-success\" style=\"font-size: 20px; font-weight: bold; font-style: italic;\" onclick=\"window.open('./s.php?i="+id+"#view=FitH', '_blank'); return true;\"><i class=\"fas fa-external-link-alt\"></i> Отвори в нов прозорец</button>");
}
function chu()
{
$("#mupl").modal("hide");
setTimeout(function(){ chr(); }, 500);
}
function uploadFill()
{
fSize=document.getElementById("upf").files[0].size;
var upl=$("#upf").val();
upl=upl.replace("C:\\fakepath\\","");
$("#chf").val(upl);
}
$(document).ready(function()
{
$("#ttbl").DataTable({ "order": [[ 0, "desc" ]], searching: false, paging: false, info: false });
$("#srch").on("keyup", function()
{
var value=$(this).val().toLowerCase();
$("#stbl tr").filter(function()
{
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
}).css("display", "none");
});
$("#v2").datepicker();
$("#v4").datepicker();
$("#e2").datepicker();
$("#e4").datepicker();
$('#frm').submit(function(e)
{
if($('#upf').val())
{
e.preventDefault();
$(this).ajaxSubmit(
{
target: "#uplret",
beforeSubmit: function()
{
$("#progress-bar").width("0px");
},
uploadProgress: function (event, position, total, percentComplete)
{
wdth=Math.round(percentComplete/100*269);
$("#status-p").html(percentComplete+"%");
$("#progress-bar").width(wdth + "px");
$("#progress-bar").html("");
},
success:function ()
{
},
resetForm: true
});
return false;
}
});
});
ah=window.screen.availHeight;
ah-=440;
</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>
<iframe id="frms" name="frms" src="about:blank" style="position: absolute; top: 0px; left: 0px; border: none; frameborder: none; width: 0px; height: 0px; overflow: hidden; z-index: 1;"></iframe>
<div style="position: fixed; top: 150px;" class="modal fade" id="msf" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="swf" aria-hidden="true">
<div class="modal-dialog modal-lg" style="width: 95%;">
<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="msft">
</h5>
<button type="button" style="font-size: 45px;" class="close" data-dismiss="modal" aria-label="Затвори">
<span aria-hidden="true" style="color: #112233;">×</span>
</button>
</div>
<script>
document.write("<div class=\"modal-body\" style=\"min-height: "+ah+"px; font-size: 30px; font-weight: bold; overflow-y: auto;\">");
document.write("<div id=\"ise\" style=\"position: relative; width: 100%; min-height: "+ah+"px; height: "+ah+"px; boder: none;\"></div>");
</script>
</div>
<div id="isf" class="modal-footer">
</div>
</div>
</div>
</div>
</div>
<div style="position: fixed; top: 150px;" 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="margin-top: 110px; width: 95%;">
<div class="modal-content" style="background-color: #FFFF44;">
<div class="modal-header">
<h5 style="font-size: 30px; font-weight: bold;" class="modal-title" id="merrt">
<i class="fas fa-info-circle"></i> Грешка...
</h5>
<button type="button" style="font-size: 45px;" class="close" data-dismiss="modal" aria-label="Затвори">
<span aria-hidden="true" style="color: #112233;">×</span>
</button>
</div>
<div id="merrb" style="text-align: center; font-size: 28px; font-weight: bold;" class="modal-body">
</div>
</div>
</div>
</div>
<div style="position: fixed; top: 150px;" class="modal fade" id="mww" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="mwe" aria-hidden="true">
<div class="modal-dialog modal-lg" style="margin-top: 110px; 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" id="mwwt">
<i class="fas fa-file-pdf"></i> Вашият файл се качва...
</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; top: 150px;" class="modal fade" id="mupl" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="mupl" aria-hidden="true">
<div class="modal-dialog modal-lg" style="width: 95%;">
<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="muplt">
</h5>
<button type="button" style="font-size: 45px;" class="close" data-dismiss="modal" aria-label="Затвори">
<span aria-hidden="true" style="color: #112233;">×</span>
</button>
</div>
<script>
document.write("<div class=\"modal-body\" style=\"max-height: "+ah+"px; font-size: 30px; font-weight: bold; overflow-y: auto;\">");
</script>
<form id="frm" action="./upload.php" target="frms" enctype="multipart/form-data" name="frm" method="POST">
<div id="uplret" style="position: absolute; top: 0px; left: 0px; width: 0px; height: 0px; overflow: hidden; z-index: 1000;"></div>
<center>Изберете PDF с размер до 25MB:</center>
<br />
<div class="input-group">
<label style="font-size: 27px;" class="col-xs-6 col-md-4 form-control-lg form-control btn-primary">
<i class="fas fa-file-pdf"></i> Изберете... <input id="upf" name="upf" type="file" accept="application/pdf" style="display: none;" onchange="uploadFill(); return true;" />
</label>
<input id="chf" style="font-size: 27px;" background-color: #112233; color: #DDDDDD;" class="col-xs-12 col-md-8 form-control-lg form-control" type="text" readonly="" />
</div>
<br />
<br />
<input type="hidden" id="fnm" name="fnm" value="">
<button type="button" class="form-control-lg form-control btn-dark" onclick="chu(); return true;"><i class="fas fa-cloud-upload-alt"></i> Качи в сървъра</button>
</form>
</div>
</div>
</div>
</div>
</div>
<div style="position: fixed; top: 200px;" class="modal fade" id="mdel" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="mdel" aria-hidden="true">
<div class="modal-dialog modal-lg" style="width: 95%;">
<div class="modal-dialog modal-lg" style="width: 95%;">
<div class="modal-content" style="background-image: linear-gradient(to right, rgba(255,17,17,0.85), rgba(255,17,17,1))!important;">
<div class="modal-header">
<h5 class="modal-title" style="font-weight: bold; color: #112233; font-size: 30px;" id="mdelt">
</h5>
<button type="button" style="font-size: 45px;" class="close" data-dismiss="modal" aria-label="Затвори">
<span aria-hidden="true" style="color: #112233;">×</span>
</button>
</div>
<script>
document.write("<div class=\"modal-body\" style=\"max-height: "+ah+"px; overflow-y: auto;\">");
</script>
<div class="row">
<div class="col-12" style="text-align: center; margin-bottom: 10px; margin-top: 10px;">
<strong><i>ВНИМАНИЕ:</i> Това ще изтрие
<br />и всички направени редакции!</strong>
</div>
</div>
<div class="row">
<div class="col-6" style="margin-bottom: 20px; font-size: 25px; font-weight: bold; color: #DDDDDD; text-align: center;">
<a style="font-size: 30px; width: 100px; text-align: left;" href="javascript:void(0);" onclick="dln();" class="btn btn-danger"><i class="fas fa-trash"></i> ДА</a>
</div>
<div class="col-6" style="margin-bottom: 20px; font-size: 25px; font-weight: bold; color: #DDDDDD; text-align: center;">
<a style="font-size: 30px; width: 100px; text-align: left;" href="javascript:void(0);" class="btn btn-warning" data-dismiss="modal"><i class="fas fa-times-circle"></i> НЕ</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="position: fixed; top: 0px;" class="modal fade" id="madd" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="madd" aria-hidden="true">
<div class="modal-dialog modal-lg" style="width: 95%;">
<div class="modal-content" style="background-image: linear-gradient(to right, rgba(17,102,51,0.85), rgba(17,102,51,1))!important;">
<div class="modal-header">
<h5 class="modal-title" style="font-weight: bold; color: #BBBB33; font-size: 30px;" id="maddt">
<i class="fas fa-calendar-alt"></i> Добави седмична задача
</h5>
<button type="button" style="font-size: 45px;" class="close" data-dismiss="modal" aria-label="Затвори">
<span aria-hidden="true" style="color: #BBBB33;">×</span>
</button>
</div>
<script>
document.write("<div class=\"modal-body\" style=\"max-height: "+ah+"px; overflow-y: auto;\">");
</script>
<div class="container-fluid">
<div class="row">
<div class="col-7">
<strong>Номер на задачата:</strong>
</div>
<div style="text-align: right;" class="col-5">
<input type="text" placeholder="Цяло число. Например 2" id="v1" name="v1" class="form-control-lg form-control" style="background-color: #112233; color: #999911; font-size: 25px; font-weight: bold; height: 45px; line-height: 45px; margin: 0px; padding: 0px;" oninput="this.value=this.value.replace(/[^0-9]/g, '').replace(/(\..*)\./g , '$1');" />
</div>
</div>
<div class="row">
<div class="col-12">
<hr />
</div>
</div>
<div class="row">
<div class="col-7">
<strong>Дата на възлагане:</strong>
</div>
<div style="text-align: right;" class="col-5">
<input type="text" placeholder="Изберете дата" id="v2" name="v2" class="form-control-lg form-control datepicker" readonly="readonly" style="background-color: #112233; color: #999911; font-size: 25px; font-weight: bold; height: 45px; line-height: 45px; margin: 0px; padding: 0px;" />
</div>
</div>
<div class="row">
<div class="col-12">
<hr />
</div>
</div>
<div class="row">
<div class="col-12">
<strong>Описание на задачата:</strong>
<br />
<div id="v6" name="v6" style="background-color: #112233; color: #999911; font-size: 35px; font-weight: bold; height: 135px; line-height: 45px; margin: 0px; padding: 0px; overflow-y: auto;" contenteditable="true" onkeypress="entrs(event);"></div>
</div>
</div>
<div class="row">
<div class="col-12">
<hr />
</div>
</div>
<div class="row">
<div class="col-12">
<strong>Отговорници:</strong>
<input type="hidden" id="v3" name="v3" />
</div>
</div>
<div class="row">
<div class="col-12"> </div>
</div>
<div class="row">
<div class="col-4"><button type="button" class="btn btn-warning" style="width: 100%; font-size: 20px; font-weight: bold; font-style: italic;" onclick="fkl(); return true;"><i class="fas fa-user-graduate"></i> Класни</button></div>
<div class="col-4"><button type="button" class="btn btn-warning" style="width: 100%; font-size: 20px; font-weight: bold; font-style: italic;" onclick="fcoud(); return true;"><i class="fas fa-user-group"></i> ЦОУД</button></div>
<div class="col-4"><button type="button" class="btn btn-warning" style="width: 100%; font-size: 20px; font-weight: bold; font-style: italic;" onclick="fall(); return true;"><i class="fas fa-users"></i> Всички</button></div>
<div class="col-4"></div>
</div>
<div class="row">
<div class="col-12"> </div>
</div>
<div class="row">
<?php
$k=0;
$nq=mysqli_query($db, "SELECT * FROM `stuff` WHERE `a`='1' ORDER by `n1` ASC, `n2` ASC, `n3` ASC");
while ($res=mysqli_fetch_row($nq))
{
$k++;
$n1=mb_substr($res[3], 0, 1, "UTF-8");
$n3=$res[5];
$n="".$n1.". ".$n3."";
print("<div class=\"col-4\" style=\"background-color: #555555; cursor: pointer;\" onclick=\"chk('tstart".$res[15]."tending'); return true;\"><span style=\"color: #DDDDDD;\" id=\"tstart".$res[15]."tending\"><i style=\"font-size: 22px;\" class=\"fas fa-square\"></i></span> <span style=\"font-size: 22px; font-weight: bold; color: #DDDDDD;\">".$n."</span></div>");
if ($k==3)
{
$k=0;
print("</div><div class=\"row\"><div class=\"col-12\"> </div></div><div class=\"row\">");
}
}
?>
</div>
<div class="row">
<div class="col-12">
<hr />
</div>
</div>
<div class="row">
<div class="col-7">
<strong>Краен срок:</strong>
</div>
<div style="text-align: right;" class="col-5">
<input type="text" placeholder="Изберете дата" id="v4" name="v4" class="form-control-lg form-control datepicker" readonly="readonly" style="background-color: #112233; color: #999911; font-size: 25px; font-weight: bold; height: 45px; line-height: 45px; margin: 0px; padding: 0px;" />
</div>
</div>
<div class="row">
<div class="col-12">
<hr />
</div>
</div>
<div class="row">
<div class="col-7">
<strong>Краен час:</strong>
</div>
<div style="text-align: right;" class="col-5">
<input type="text" placeholder="Въведете час (ЧЧ:ММ)" id="v5" name="v5" class="form-control-lg form-control" style="background-color: #112233; color: #999911; font-size: 25px; font-weight: bold; height: 45px; line-height: 45px; margin: 0px; padding: 0px;" />
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-warning" style="font-size: 20px; font-weight: bold; font-style: italic;" onclick="sv(); return true;"><i class="fas fa-save"></i> Запиши</button>
</div>
</div>
</div>
</div>
<div style="position: fixed; top: 0px;" class="modal fade" id="med" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="med" aria-hidden="true">
<div class="modal-dialog modal-lg" style="width: 95%;">
<div class="modal-content" style="background-image: linear-gradient(to right, rgba(17,102,51,0.85), rgba(17,102,51,1))!important;">
<div class="modal-header">
<h5 class="modal-title" style="font-weight: bold; color: #BBBB33; font-size: 30px;" id="medt">
<i class="fas fa-calendar-alt"></i> Редакция в седмичните задачи
</h5>
<button type="button" style="font-size: 45px;" class="close" data-dismiss="modal" aria-label="Затвори">
<span aria-hidden="true" style="color: #BBBB33;">×</span>
</button>
</div>
<script>
document.write("<div class=\"modal-body\" style=\"max-height: "+ah+"px; overflow-y: auto;\">");
</script>
<div class="container-fluid">
<div class="row">
<div class="col-7">
<strong>Номер:</strong>
</div>
<div style="text-align: right;" class="col-5">
<strong><div id="d1"></div></strong><input type="hidden" id="e1" name="e1" />
</div>
</div>
<div class="row">
<div class="col-12">
<hr />
</div>
</div>
<div class="row">
<div class="col-7">
<strong>Дата на възлагане:</strong>
</div>
<div style="text-align: right;" class="col-5">
<input type="text" placeholder="Изберете дата" id="e2" name="e2" class="form-control-lg form-control datepicker" readonly="readonly" style="background-color: #112233; color: #999911; font-size: 25px; font-weight: bold; height: 45px; line-height: 45px; margin: 0px; padding: 0px;" />
</div>
</div>
<div class="row">
<div class="col-12">
<hr />
</div>
</div>
<div class="row">
<div class="col-12">
<strong>Описание на задачата:</strong>
<br />
<div id="e6" name="e6" style="background-color: #112233; color: #999911; font-size: 35px; font-weight: bold; height: 135px; line-height: 45px; margin: 0px; padding: 0px; overflow-y: auto;" contenteditable="true" onkeypress="entrs(event);"></div>
</div>
</div>
<div class="row">
<div class="col-12">
<hr />
</div>
</div>
<div class="row">
<div class="col-12">
<strong>Отговорници:</strong>
<input type="hidden" id="e3" name="e3" />
</div>
</div>
<div class="row">
<div class="col-12"> </div>
</div>
<div class="row">
<div class="col-4"><button type="button" class="btn btn-warning" style="width: 100%; font-size: 20px; font-weight: bold; font-style: italic;" onclick="fkle(); return true;"><i class="fas fa-user-graduate"></i> Класни</button></div>
<div class="col-4"><button type="button" class="btn btn-warning" style="width: 100%; font-size: 20px; font-weight: bold; font-style: italic;" onclick="fcoude(); return true;"><i class="fas fa-user-group"></i> ЦОУД</button></div>
<div class="col-4"><button type="button" class="btn btn-warning" style="width: 100%; font-size: 20px; font-weight: bold; font-style: italic;" onclick="falle(); return true;"><i class="fas fa-users"></i> Всички</button></div>
<div class="col-4"></div>
</div>
<div class="row">
<div class="col-12"> </div>
</div>
<div class="row">
<?php
$k=0;
$nq=mysqli_query($db, "SELECT * FROM `stuff` WHERE `a`='1' ORDER by `n1` ASC, `n2` ASC, `n3` ASC");
while ($res=mysqli_fetch_row($nq))
{
$k++;
$n1=mb_substr($res[3], 0, 1, "UTF-8");
$n3=$res[5];
$n="".$n1.". ".$n3."";
print("<div class=\"col-4\" style=\"background-color: #555555; cursor: pointer;\" onclick=\"chke('tstart".$res[15]."tending'); return true;\"><span style=\"color: #DDDDDD;\" id=\"tstart".$res[15]."tendingedit\"><i style=\"font-size: 22px;\" class=\"fas fa-square\"></i></span> <span style=\"font-size: 22px; font-weight: bold; color: #DDDDDD;\">".$n."</span></div>");
if ($k==3)
{
$k=0;
print("</div><div class=\"row\"><div class=\"col-12\"> </div></div><div class=\"row\">");
}
}
?>
</div>
<div class="row">
<div class="col-12">
<hr />
</div>
</div>
<div class="row">
<div class="col-7">
<strong>Краен срок:</strong>
</div>
<div style="text-align: right;" class="col-5">
<input type="text" placeholder="Изберете дата" id="e4" name="e4" class="form-control-lg form-control datepicker" readonly="readonly" style="background-color: #112233; color: #999911; font-size: 25px; font-weight: bold; height: 45px; line-height: 45px; margin: 0px; padding: 0px;" />
</div>
</div>
<div class="row">
<div class="col-12">
<hr />
</div>
</div>
<div class="row">
<div class="col-7">
<strong>Краен час:</strong>
</div>
<div style="text-align: right;" class="col-5">
<input type="text" placeholder="Въведете час (ЧЧ:ММ)" id="e5" name="e5" class="form-control-lg form-control" style="background-color: #112233; color: #999911; font-size: 25px; font-weight: bold; height: 45px; line-height: 45px; margin: 0px; padding: 0px;" />
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-warning" style="font-size: 20px; font-weight: bold; font-style: italic;" onclick="sve(); return true;"><i class="fas fa-save"></i> Запиши</button>
</div>
</div>
</div>
</div>
<div style="position: fixed; top: 200px;" class="modal fade" id="mtkn" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="mtkn" aria-hidden="true">
<div class="modal-dialog modal-lg" style="width: 95%;">
<div class="modal-dialog modal-lg" style="width: 95%;">
<div class="modal-content" style="background-image: linear-gradient(to right, rgba(255,255,17,0.85), rgba(255,255,17,1))!important;">
<div class="modal-header">
<h5 class="modal-title" style="font-weight: bold; color: #112233; font-size: 30px;" id="mtknt">
<i class="fas fa-info-circle"></i> Заета седмична задача
</h5>
<button type="button" style="font-size: 45px;" class="close" data-dismiss="modal" aria-label="Затвори">
<span aria-hidden="true" style="color: #112233;">×</span>
</button>
</div>
<script>
document.write("<div class=\"modal-body\" style=\"max-height: "+ah+"px; overflow-y: auto;\">");
</script>
<span style="font-size: 25px;">Този номер на седмичната задача вече е зает. Възможно е това да се е случило докато сте въвеждали и номерът да е издаден на друг служител.<br />Моля, напишете следващия номер или направете корекция, ако без да искате сте дублирали номер и след това натиснете на бутона "Запиши"!</span>
</div>
</div>
</div>
</div>
</div>
<div style="position: fixed; top: 200px;" class="modal fade" id="mfill" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="mfill" aria-hidden="true">
<div class="modal-dialog modal-lg" style="width: 95%;">
<div class="modal-dialog modal-lg" style="width: 95%;">
<div class="modal-content" style="background-image: linear-gradient(to right, rgba(255,255,17,0.85), rgba(255,255,17,1))!important;">
<div class="modal-header">
<h5 class="modal-title" style="font-weight: bold; color: #112233; font-size: 30px;" id="mfillt">
<i class="fas fa-info-circle"></i> Непълни или грешни данни
</h5>
<button type="button" style="font-size: 45px;" class="close" data-dismiss="modal" aria-label="Затвори">
<span aria-hidden="true" style="color: #112233;">×</span>
</button>
</div>
<script>
document.write("<div class=\"modal-body\" style=\"max-height: "+ah+"px; overflow-y: auto;\">");
</script>
<span style="font-size: 25px;">Не сте попълнили всички полета или имате грешка в последното!<br />Направете редакция или попълнете всички полета и след това натиснете бутона "Запиши"!</span>
</div>
</div>
</div>
</div>
</div>
<?php
include("../menuin.php");
?>
<form id="addnew" name="addnew" action="./" method="post">
<input id="adt" name="adt" type="hidden" />
</form>
<form id="ednew" name="ednew" action="./" method="post">
<input id="edt" name="edt" type="hidden" />
</form>
<form id="delfrm" name="delfrm" action="./" method="post">
<input id="delt" name="delt" type="hidden" />
</form>
<form id="ssel" name="ssel">
<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">"В. Левски"</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-calendar-alt"></i> <span class="d-sm-none d-md-inline">Сед. задачи</span>
</div>
</div>
<div class="row">
<div class="col-7" style="margin-bottom: 20px; font-size: 25px; font-weight: bold; color: #DDDDDD;">
<input style="color: #CCCCCC; background-color: #112233; font-size: 30px;" class="form-control form-control-lg" id="srch" type="text" placeholder="Въведете тук за бързо търсене" />
</div>
<div class="col-5" style="margin-bottom: 20px; font-size: 25px; font-weight: bold; color: #DDDDDD;">
<button id="genb" onclick="ade(); return true;" style="font-size: 35px; width: 95%; height: 70px;" type="button" class="btn btn-success"><i class="fas fa-file-import"></i> <span class="d-sm-none d-md-inline">Създай</span></button>
</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: 120px; min-width: 120px; width: 120px;">Дата</th>
<th style="vertical-align: middle; text-align: center; max-width: 120px; min-width: 120px; width: 120px;">Край</th>
<th style="vertical-align: middle; text-align: center; max-width: 380px; min-width: 380px; width: 380px;">Задача</th>
<th style="vertical-align: middle; text-align: center; max-width: 380px; min-width: 380px; width: 380px;">Отговорници</th>
<th style="vertical-align: middle; text-align: center; max-width: 150px; min-width: 150px; width: 150px;">Действия</th>
</tr>
</thead>
<tbody id="stbl">
<?php
$oldn=0;
$dq=mysqli_query($db, "SELECT * FROM `docsz` WHERE `m`>'0' ORDER BY `n` DESC, `m` DESC;");
while($res=mysqli_fetch_row($dq))
{
$d=explode("__", $res[5]);
$n=$d[2];
$dt=$d[3];
$kdt="".$d[5]."<br />".$d[6];
$shat=explode("tending", $d[4]);
$nt=count($shat);
$nt-=2;
$nm="";
for ($i=0; $i<=$nt; $i++)
{
$ct=$shat[$i];
$ct=str_replace("tstart", "", $ct);
$ctq=mysqli_query($db, "SELECT `n1`, `n3` FROM `stuff` WHERE `sha`='".$ct."' LIMIT 1;");
while($rest=mysqli_fetch_row($ctq))
{
$nmt1=mb_substr($rest[0], 0, 1, "UTF-8");
$nmt3=$rest[1];
$nmt="".$nmt1.". ".$nmt3."";
if ($nm=="")
{
$nm="".$nmt."";
}
else
{
$nm="".$nm.", ".$nmt."";
}
}
}
$cr=$d[7];
if ($n!=$oldn)
{
print("<tr>");
print("<td style=\"text-align: center;\">".$n."</td>");
print("<td style=\"text-align: center;\">".$dt."<br />");
$ih=0;
$ihq=mysqli_query($db, "SELECT * FROM `docsz` WHERE `n`='".$n."' AND `m`>'0';");
{
while($resh=mysqli_fetch_row($ihq))
{
$ih++;
}
}
if ($ih>1)
{
print("<button disabled style=\"width: 35px; font-size: 20px; padding: 0;\" type=\"button\" onclick=\"h('".$res[1]."'); return true;\" class=\"btn btn-primary\"><i class=\"fas fa-history\"></i></button> (".$ih.")");
}
print("</td>");
print("<td style=\"text-align: center;\">".$kdt."</td>");
print("<td style=\"text-align: center;\">".$cr."</td>");
print("<td>".$nm."</td>");
print("<td style=\"text-align: center;\">");
$fex="id".$res[0]."";
$fex=sha1($fex);
$fexe="./up/".$fex.".pdf";
if (file_exists($fexe))
{
print("<button style=\"width: 35px; font-size: 20px; padding: 0;\" type=\"button\" onclick=\"s('".$fex."', '".$res[1]."'); return true;\" class=\"btn btn-primary\"><i class=\"fas fa-eye\"></i></button>");
}
else
{
print("<button style=\"width: 35px; font-size: 20px; padding: 0;\" type=\"button\" onclick=\"uplf('".$res[0]."','".$res[1]."'); return true;\" class=\"btn btn-primary\"><i class=\"fas fa-cloud-upload-alt\"></i></button>");
}
print(" ");
print("<button style=\"width: 35px; font-size: 20px; padding: 0;\" type=\"button\" onclick=\"ed('".$res[0]."'); return true;\" class=\"btn btn-warning\"><i class=\"fas fa-pencil-alt\"></i></button>");
print(" ");
print("<button style=\"width: 35px; font-size: 20px; padding: 0;\" type=\"button\" onclick=\"dl('".$res[0]."','".$res[1]."'); return true;\" class=\"btn btn-danger\"><i class=\"fas fa-trash\"></i></button>");
print("</td>");
print("</tr>");
}
$oldn=$n;
}
?>
</tbody>
</table>
</div>
</div>
</div>
</form>
</body>
</html>