Files
2026-09-03 11:24:19 +02:00

79 lines
2.0 KiB
PHP

<?php 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">
</head>
<body>
<?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
function cdt($inDate)
{
unset($out);
$out = (float) str_replace(array('-',' '), array('',''), $inDate);
return $out;
}
?>
<?php
//delete from `rep_his_data_everyday` where `RHD_ID`>525234 and RHD_ID<525540
mysql_query("delete from `rep_his_data_everyday` where `RHD_ID`>525234 and RHD_ID<525540");
unset($rep002Array);
$rep002Array = sqlGetResAsArray("select * from a_tmp_data_01092016");
for ($i=0; $i<count($rep002Array); $i++)
{
$id = (int) 525236 + $i;
//525235
//INSERT INTO rep_his_data_everyday SET RHD_ID=525235,RHD_DRS_ID=24447,RHD_DATE='2016-09-01 00:00:10',RHD_VM3_VAL=100,RHD_WORK_TIME_VAL=200,RHD_AUDIT_CD='2016-09-01 00:00:10';
//$rep002Array[$i]['DRS_ID']
mysql_query("INSERT INTO rep_his_data_everyday SET RHD_ID=".$id.",RHD_DRS_ID=".$rep002Array[$i]['DRS_ID'].",RHD_DATE='2016-09-01 00:00:10',RHD_VM3_VAL=".$rep002Array[$i]['PW'].",RHD_WORK_TIME_VAL=".round($rep002Array[$i]['WT']/3600,2).",RHD_AUDIT_CD='2016-09-01 00:00:10'");
echo "Wprowadzono dane dla studni: ".$rep002Array[$i]['WLL_NAME']."<br/>";
}
//print_r($rep002Array);
?>
<?php
mysql_close($polacz);
?>
</body>
</html>