Initial commit
This commit is contained in:
@@ -0,0 +1,204 @@
|
||||
<?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>Historia pomiarów studni</title>
|
||||
|
||||
<!-- Bootstrap -->
|
||||
<link href="./bootstrap.min.css" rel="stylesheet">
|
||||
<link href="./datepicker/css/datepicker.css" rel="stylesheet">
|
||||
|
||||
<script src="./jquery.min.js"></script>
|
||||
<script src="./datepicker/js/bootstrap-datepicker.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
|
||||
if (!empty($_GET['param']))
|
||||
{
|
||||
unset($paramArray);
|
||||
$paramArray = explode(',', $_GET['param']);
|
||||
}
|
||||
if (strlen($_POST['drsID'])>0) $paramArray[0]=$_POST['drsID'];
|
||||
if (strlen($_POST['rep017_date_f'])>8) $paramArray[1]=$_POST['rep017_date_f'];
|
||||
if (strlen($_POST['rep017_date_t'])>8) $paramArray[2]=$_POST['rep017_date_t'];
|
||||
|
||||
$fileName=base64_encode($_SESSION['user']."_".date("YmdHis")."_rep017");
|
||||
//base64_encode($_GET['dev']);
|
||||
//base64_decode($_GET['dev']);
|
||||
?>
|
||||
|
||||
|
||||
<form action="./rep_017_print.php?param=<?php echo $_GET['param']; ?>" method="post">
|
||||
<div class="panel panel-danger">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Historia pomiarów studni</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label class="sr-only" for="exampleInputAmount"></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">Studnia:</div>
|
||||
|
||||
<select class="form-control" name="drsID" id="drsID">
|
||||
|
||||
<?php
|
||||
unset($expArray);
|
||||
$expArray = sqlGetResAsArray("select DRS_ID,WLL_NAME from seg_wells,seg_dev_resources where DRS_DEV_TYPE=12 and DRS_DEV_ID=WLL_ID and DRS_DEPARTMENT='".$_SESSION['syndis_eq_stock']."' and DRS_STATUS_DIC_ID=3 order by WLL_NAME");
|
||||
echo'<option value="-1">Studnie w eksploatacji</option>';
|
||||
for ($i=0; $i<count($expArray);$i++)
|
||||
{
|
||||
if ($_POST['drsID']==$expArray[$i]['DRS_ID'] || ($paramArray[0]>0 && $paramArray[0]==$expArray[$i]['DRS_ID']))
|
||||
echo"<option value='".$expArray[$i]['DRS_ID']."' selected>".$expArray[$i]['WLL_NAME']."</option>";
|
||||
else
|
||||
echo"<option value='".$expArray[$i]['DRS_ID']."'>".$expArray[$i]['WLL_NAME']."</option>";
|
||||
}
|
||||
echo'<option value="-1"></option>';
|
||||
|
||||
|
||||
|
||||
unset($outArray);
|
||||
$outArray = sqlGetResAsArray("select DRS_ID,WLL_NAME from seg_wells,seg_dev_resources where DRS_DEV_TYPE=12 and DRS_DEV_ID=WLL_ID and DRS_DEPARTMENT='".$_SESSION['syndis_eq_stock']."' and DRS_STATUS_DIC_ID=4 order by WLL_NAME");
|
||||
echo'<option value="-1">Studnie zdjęte z eksploatacji</option>';
|
||||
for ($i=0; $i<count($outArray);$i++)
|
||||
{
|
||||
if ($_POST['drsID']==$outArray[$i]['DRS_ID'] || ($paramArray[0]>0 && $paramArray[0]==$outArray[$i]['DRS_ID']))
|
||||
echo"<option value='".$outArray[$i]['DRS_ID']."' selected>".$outArray[$i]['WLL_NAME']."</option>";
|
||||
else
|
||||
echo"<option value='".$outArray[$i]['DRS_ID']."'>".$outArray[$i]['WLL_NAME']."</option>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label class="sr-only" for="dataOD"></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">Data od</div>
|
||||
<input type="text" class="form-control" id="dataOD" name="rep017_date_f" value="<?php echo $paramArray[1]; ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-2">
|
||||
<label class="sr-only" for="dataDO"></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">Data do</div>
|
||||
<input type="text" class="form-control" id="dataDO" name="rep017_date_t" value="<?php echo $paramArray[2]; ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<button id="butShow" type="submit" class="btn btn-info" value="Generuj">Generuj</button>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<a class="btn btn-default" href="#" role="button" onclick="window.print();">Drukuj <span class="glyphicon glyphicon-print" aria-hidden="true"></span></a>
|
||||
<a class="btn btn-success" href="./rep_017_xls.php?fm=<?php echo $fileName; ?>" target="_blank" role="button">Eksport do Excel <span class="glyphicon glyphicon-file" aria-hidden="true"></span></a>
|
||||
<a class="btn btn-danger" href="./rep_017_pdf.php?fm=<?php echo $fileName; ?>" target="_blank" role="button">Eksport do PDF <span class="glyphicon glyphicon-file" aria-hidden="true"></span></a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
<?php
|
||||
mysql_close($polacz);
|
||||
?>
|
||||
|
||||
<script src="./bootstrap.min.js"></script>
|
||||
<link href="../style/select2.min.css" rel="stylesheet" />
|
||||
<script src="../js/select2.min.js"></script>
|
||||
|
||||
<script>
|
||||
$('#drsID').select2();
|
||||
|
||||
$('#butShow').click(function() {
|
||||
$('#butShow').prop('disabled', true);
|
||||
$('#loader').show();
|
||||
});
|
||||
|
||||
|
||||
$(window).load(function() {
|
||||
// Animate loader off screen
|
||||
//$('#preloader').hide();
|
||||
//$('#loader').hide();
|
||||
$.post( "./ajax_gen_reports.php", { post_action: "rep017", done: "create", well: "<?php echo $paramArray[0]; ?>",file: "<?php echo $fileName; ?>",date_f: "<?php echo $paramArray[1];?>",date_t: "<?php echo $paramArray[2];?>"}).done(function(data)
|
||||
{
|
||||
$('#main_table').html(data);
|
||||
$('#loader').hide();
|
||||
$('#butShow').prop('disabled', false);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$('#dataOD').datepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
autoclose: true,
|
||||
weekStart: 1
|
||||
});
|
||||
$('#dataDO').datepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
autoclose: true,
|
||||
weekStart: 1
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<div id="main_table">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<?php ob_end_flush();?>
|
||||
Reference in New Issue
Block a user