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 `docvh` (`i`, `n`, `d`, `a`, `f`, `t`, `m`) VALUES (NULL, '".$adt[2]."', '".$tm."', '".$adt[0]."', '".$adt[1]."', '".$allt."', '1');");
}
if (isset($_POST["delt"]))
{
$delt=$_POST["delt"];
$sql=mysqli_query($db, "UPDATE `docvh` SET `m` = '0' WHERE `i` = '".$delt."';");
}
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/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;
function ade()
{
$("#madd").modal("show");
}
function dl(id,n)
{
delid=id;
$("#mdel").modal("show");
$("#mdelt").html("<i class=\"fa fa-trash\"></i> Изтривате ли вх. №"+n+"?");
}
function dln()
{
if (delid!=0)
{
$("#delt").val(delid);
$("#delfrm").submit();
}
}
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").html().trim();
dt+="__"+n;
if (n=="")
{
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 edt(d)
{
var f=d.split("|");
i=1;
id=f[0];
$("#madd").modal("hide");
eval('$("#m'+id+'").modal("show");');
if (id=="bsk")
{
while (i<=45)
{
eval('$("#a'+i+'").val(f['+i+']);');
i++;
}
}
else
{
}
setTimeout(function() { gf(id); }, 750);
}
function ed(id)
{
$.ajax({url: "/e.php", type: "POST", data:{"id": ""+id+""}, success: function(data) { if (data!="ERR") { setTimeout(function() { edt(data); }, 100); } else { alert("Грешка при редакцията!\nПрезаредете страницата!"); } } });
}
$(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");
});
$("#v3").select2({ width: "100%", dropdownParent: $("#madd") });
$("#v4").select2({ width: '100%', dropdownParent: $("#madd") });
$("#v2").datepicker();
});
ah=window.screen.availHeight;
ah-=440;
</script>
<style>
html, body
{
background-color: #112233;
}
strong
{
font-weight: bold;
color: #DDDDDD;
font-size: 25px;
}
th
{
cursor: pointer;
}
a, div, input
{
font-family: Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif;
}
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>
<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-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="fa 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="fa 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="fa fa-sign-in-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>
</div>
</div>
<div class="row">
<div class="col-11">
<select id="v3" name="v3" title="Моля, изберете номенклатура" class="form-control-lg form-control" style="background-color: #112233; color: #DDDDDD; font-weight: bold; height: 45px; line-height: 45px; margin: 0px; padding: 0px;">
<option value="">Моля, изберете номенклатура</option>
<?php
$nq=mysqli_query($db, "SELECT * FROM `docnom` ORDER by `d` ASC");
while ($res=mysqli_fetch_row($nq))
{
print("<option value=\"".$res[1]."\">".$res[2]." - ".$res[1]."</option>");
}
?>
</select>
</div>
<div style="text-align: right;" class="col-1">
<button disabled type="button" class="btn btn-warning" style="max-width: 45px; max-height: 45px; font-size: 15px; font-weight: bold; font-style: italic;"><i class="fa fa-plus-square"></i></button>
</div>
</div>
<div class="row">
<div class="col-12">
<hr />
</div>
</div>
<div class="row">
<div class="col-12">
<strong>Вид на документа:</strong>
</div>
</div>
<div class="row">
<div class="col-11">
<select id="v4" name="v4" title="Моля, изберете вид на документа" class="form-control-lg form-control" style="background-color: #112233; color: #DDDDDD; font-weight: bold; height: 45px; line-height: 45px; margin: 0px; padding: 0px;">
<option value="">Моля, изберете вид на документа</option>
<?php
$nq=mysqli_query($db, "SELECT * FROM `doctype` ORDER by `d` ASC");
while ($res=mysqli_fetch_row($nq))
{
print("<option value=\"".$res[1]."\">".$res[1]."</option>");
}
?>
</select>
</div>
<div style="text-align: right;" class="col-1">
<button disabled type="button" class="btn btn-warning" style="max-width: 45px; max-height: 45px; font-size: 15px; font-weight: bold; font-style: italic;"><i class="fa fa-plus-square"></i></button>
</div>
</div>
<div class="row">
<div class="col-12">
<hr />
</div>
</div>
<div class="row">
<div class="col-12">
<strong>Кореспондент:</strong>
<br />
<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 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>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-warning" style="z-index: 2000; font-size: 20px; font-weight: bold; font-style: italic;" onclick="sv(); return true;"><i class="fa 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="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="fa fa-sign-in-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: 90px; min-width: 90px; width: 90px;">№</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: 100px; min-width: 100px; width: 100px;">НМ</th>
<th style="vertical-align: middle; text-align: center; max-width: 210px; min-width: 210px; width: 210px;">Вид<br />документ</th>
<th style="vertical-align: middle; text-align: center; max-width: 210px; min-width: 210px; width: 210px;">Кореспондент</th>
<th style="vertical-align: middle; text-align: center; max-width: 340px; min-width: 340px; width: 340px;">Описание</th>
<th style="vertical-align: middle; text-align: center; max-width: 150px; min-width: 150px; width: 150px;">Действия</th>
</tr>
</thead>
<tbody id="stbl">
<?php
$dq=mysqli_query($db, "SELECT * FROM `docvh` WHERE `m`>'0' ORDER BY `n` DESC;");
while($res=mysqli_fetch_row($dq))
{
$d=explode("__", $res[5]);
$n=$d[2];
$dt=$d[3];
$nm=$d[4];
$td=$d[5];
$cr=$d[6];
$ds=$d[7];
print("<tr>");
print("<td style=\"text-align: center;\">".$n."</td>");
print("<td style=\"text-align: center;\">".$dt."</td>");
print("<td style=\"text-align: center;\">".$nm."</td>");
print("<td style=\"text-align: center;\">".$td."</td>");
print("<td style=\"text-align: center;\">".$cr."</td>");
print("<td>".$ds."</td>");
print("<td style=\"text-align: center;\">");
print("<button disabled style=\"width: 35px; font-size: 20px; padding: 0;\" type=\"button\" onclick=\"window.open('./".$l.".php?id=".$res[0]."','_blank'); return true;\" class=\"btn btn-primary\"><i class=\"fa fa-clipboard-list\"></i></button>");
print(" ");
print("<button disabled style=\"width: 35px; font-size: 20px; padding: 0;\" type=\"button\" onclick=\"ed('".$res[0]."'); return true;\" class=\"btn btn-warning\"><i class=\"fa 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=\"fa fa-trash\"></i></button>");
print("</td>");
print("</tr>");
}
?>
</tbody>
</table>
</div>
</div>
</div>
</form>
</body>
</html>