223 lines
6.3 KiB
PHP
223 lines
6.3 KiB
PHP
<?php @ob_start(); session_start();?>
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="pl">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="shortcut icon" href="../images/SoftSPM.ico">
|
|
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
|
|
<title>Wykaz pracy studni</title>
|
|
|
|
<!-- Bootstrap -->
|
|
<link href="./bootstrap.min.css" rel="stylesheet">
|
|
<link href="./datepicker/css/datepicker.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="../style/sweetalert.css">
|
|
|
|
<script src="./jquery.min.js"></script>
|
|
<script src="./datepicker/js/bootstrap-datepicker.js"></script>
|
|
<script src="../js/sweetalert.min.js"></script>
|
|
|
|
|
|
<style type="text/css">
|
|
#loader {
|
|
border: 16px solid #f3f3f3; /* Light grey */
|
|
border-top: 16px solid #3498db; /* Blue */
|
|
border-radius: 50%;
|
|
width: 120px;
|
|
height: 120px;
|
|
animation: spin 2s linear infinite;
|
|
|
|
position:absolute;
|
|
left:50%; /* wyśrodkowujemy w poziomie */
|
|
top:50%; /* wyśrodkowujemy w pionie */
|
|
background-position:center;
|
|
margin:-64px 0 0 -64px; /* no bo chcemy idealnie wycentrować, nie? */
|
|
}
|
|
|
|
@keyframes spin {
|
|
0% { transform: rotate(0deg); }
|
|
100% { transform: rotate(360deg); }
|
|
}
|
|
</style>
|
|
|
|
</head>
|
|
<body>
|
|
<div id="loader"></div>
|
|
|
|
<?php
|
|
date_default_timezone_set('Europe/Warsaw');
|
|
require_once("../func.php");
|
|
require_once("../dbaccess.php");
|
|
$polacz = mysql_connect($db_host, $db_user, $db_user_pass) or die ('cannot connect to db');
|
|
mysql_select_db($db_name);
|
|
mysql_query("SET NAMES utf8");
|
|
mysql_query("SET CHARACTER_SET utf8_general_ci");
|
|
?>
|
|
|
|
|
|
<?php
|
|
$tbaName = "rep_002_data_pazd";
|
|
$last_day = date("t", strtotime("2016-10-".date('d')));
|
|
|
|
if ($_POST['subReset']=='Resetuj')
|
|
{
|
|
unset($_POST['from_date']);
|
|
unset($_POST['to_date']);
|
|
}
|
|
|
|
if (empty($_POST['from_date'])) $_POST['from_date'] = '01';
|
|
if (empty($_POST['to_date'])) $_POST['to_date'] = '31';
|
|
|
|
|
|
?>
|
|
|
|
<form action="./rep_002_pazd_print.php" method="post">
|
|
<input type="hidden" name="isGenerate" value="ok">
|
|
<div class="panel panel-danger">
|
|
<div class="panel-heading">
|
|
<h3 class="panel-title">Wykaz pracy studni <?php echo $_SESSION['syndis_eq_stock'];?></h3>
|
|
</div>
|
|
<div class="panel-body">
|
|
|
|
<div class="form-group col-md-2">
|
|
<label class="sr-only" for="exampleInputAmount"></label>
|
|
<div class="input-group">
|
|
<div class="input-group-addon">Miesiąc:</div>
|
|
<input class="form-control" type="text" value="Październik" readonly="readonly">
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="form-group col-md-2">
|
|
<label class="sr-only" for="exampleInputAmount"></label>
|
|
<div class="input-group">
|
|
<div class="input-group-addon">Dzień od:</div>
|
|
<select class="form-control" id="from_date" name="from_date">
|
|
<?php
|
|
for ($i=1; $i<=$last_day; $i++)
|
|
{
|
|
if ($i<10) $ii='0'.$i;
|
|
else $ii=$i;
|
|
|
|
if ($_POST['from_date']==$ii)
|
|
echo"<option value='".$ii."' selected>".$ii."</option>";
|
|
else
|
|
echo"<option value='".$ii."'>".$ii."</option>";
|
|
}
|
|
?>
|
|
</select>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group col-md-2">
|
|
<label class="sr-only" for="exampleInputAmount"></label>
|
|
<div class="input-group">
|
|
<div class="input-group-addon">Dzień do:</div>
|
|
<select class="form-control" id="to_date" name="to_date">
|
|
<?php
|
|
for ($i=1; $i<=$last_day; $i++)
|
|
{
|
|
if ($i<10) $ii='0'.$i;
|
|
else $ii=$i;
|
|
|
|
if ($_POST['to_date']==$ii)
|
|
echo"<option value='".$ii."' selected>".$ii."</option>";
|
|
else
|
|
echo"<option value='".$ii."'>".$ii."</option>";
|
|
}
|
|
?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<button id="butShow" type="submit" class="btn btn-info" value="Pokaż">Pokaż</button>
|
|
<button id="butRes" type="submit" class="btn btn-default" name="subReset" value="Resetuj">Resetuj</button>
|
|
|
|
|
|
|
|
</div>
|
|
<div class="panel-footer">
|
|
<a id="but1" class="btn btn-default" href="#" role="button" onclick="window.print();">Drukuj <span class="glyphicon glyphicon-print" aria-hidden="true"></span></a>
|
|
<a id="but2" class="btn btn-success" href="./rep_002_xls.php" target="_blank" role="button">Eksport do Excel <span class="glyphicon glyphicon-file" aria-hidden="true"></span></a>
|
|
<a id="but3" class="btn btn-danger" href="./rep_002_pdf.php" target="_blank" role="button">Eksport do PDF <span class="glyphicon glyphicon-file" aria-hidden="true"></span></a>
|
|
</div>
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|
|
<?php
|
|
//październik
|
|
if ($_POST['isGenerate']=='ok')
|
|
{
|
|
$date_f = "2016-10-".$_POST['from_date']." 00:00:00";
|
|
$date_t = "2016-10-".$_POST['to_date']." 23:59:59";
|
|
|
|
}
|
|
|
|
unset($rp_name);
|
|
if (str_replace(array('-',' ',':'), array('','',''), $date_f) > str_replace(array('-',' ',':'), array('','',''), $date_t))
|
|
{
|
|
$rp_name = "nie ma takiego";
|
|
echo('<script>sweetAlert("Uwaga!", "Operacja niemożliwa! Dzień DO jest większy od dnia OD. \n Spróbuj ponownie.", "warning");</script>');
|
|
}
|
|
else $rp_name = "rep002";
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<?php
|
|
mysql_close($polacz);
|
|
?>
|
|
|
|
<script src="./bootstrap.min.js"></script>
|
|
<script>
|
|
|
|
$('#butShow').prop('disabled', true);
|
|
$('#butRes').prop('disabled', true);
|
|
|
|
$('#but1').prop('disabled', true);
|
|
$('#but2').prop('disabled', true);
|
|
$('#but3').prop('disabled', true);
|
|
|
|
$(window).load(function() {
|
|
// Animate loader off screen
|
|
//$('#preloader').hide();
|
|
//$('#loader').hide();
|
|
$.post( "./ajax_gen_reports.php", { post_action: "<?php echo $rp_name; ?>", done: "create", dep: "<?php echo $_SESSION['syndis_eq_stock'];?>", post_dt_from: "<?php echo $date_f; ?>", post_dt_to: "<?php echo $date_t; ?>"}).done(function(data)
|
|
{
|
|
$('#main_table').html(data);
|
|
$('#loader').hide();
|
|
|
|
$('#butShow').prop('disabled', false);
|
|
$('#butRes').prop('disabled', false);
|
|
|
|
$('#but1').prop('disabled', false);
|
|
$('#but2').prop('disabled', false);
|
|
$('#but3').prop('disabled', false);
|
|
}
|
|
);
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<div id="main_table">
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|
|
<?php ob_end_flush();?>
|