Initial commit

This commit is contained in:
2026-09-03 11:24:19 +02:00
commit 6ed3153f36
1897 changed files with 538007 additions and 0 deletions
+101
View File
@@ -0,0 +1,101 @@
<?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`>525540 and RHD_ID<525840");
mysql_query("drop table if exists a_tmp_data_02092016_01");
mysql_query("create table a_tmp_data_02092016_01 select DRS_ID,WLL_ID,WLL_NAME,WLE_DATE_TO from seg_wells_exchanged,seg_wells left join seg_dev_resources on DRS_DEV_ID=WLL_ID where WLL_ID=WLE_WLL_ID and WLL_CAT_DIC_ID=20 and WLE_DATE_FROM<='2016-09-01 00:00:01' and WLE_DATE_TO>='2016-09-01 00:00:01' and DRS_DEV_TYPE=12");
mysql_query("drop table if exists a_tmp_data_02092016_02");
mysql_query("create table a_tmp_data_02092016_02 select WMS_DRS_ID,WMS_WORK_STATUS,WMS_DATETIME from seg_wells_manual_work");
mysql_query("truncate table a_tmp_data_02092016_02");
mysql_query("");
mysql_query("");
mysql_query("");
mysql_query("");
mysql_query("INSERT INTO rep_his_data_everyday SET RHD_ID=525541,RHD_DRS_ID=1,RHD_DATE='2016-09-01 00:00:10',RHD_VM3_VAL=1,RHD_WORK_TIME_VAL=1,RHD_AUDIT_CD='2016-09-01 00:00:10';");
$id = 525541;
unset($rep002Array);
$rep002Array = sqlGetResAsArray("select * from a_tmp_data_02092016_01");
for ($i=0; $i<count($rep002Array); $i++)
{
unset($tmpONOFF);
$tmpONOFF = sqlGetResAsArray("select DRD_DRS_ID,DRD_VALUE,DRD_AUDIT_DATE from seg_dev_resources_det where DRD_RESOURCES_DETAIL=507 and DRD_AUDIT_DATE<='".$rep002Array[$i]['WLE_DATE_TO']."' and DRD_DRS_ID=".$rep002Array[$i]['DRS_ID']." order by DRD_AUDIT_DATE");
for($j=0; $j<count($tmpONOFF); $j++)
{
mysql_query("INSERT INTO a_tmp_data_02092016_02 SET WMS_DRS_ID=".$tmpONOFF[$j]['DRD_DRS_ID'].",WMS_WORK_STATUS='".$tmpONOFF[$j]['DRD_VALUE']."',WMS_DATETIME='".$tmpONOFF[$j]['DRD_AUDIT_DATE']."'");
}
if (count($tmpONOFF)>0)
{
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=pw_tmp_01(".$rep002Array[$i]['DRS_ID'].",'2016-09-01 00:00:10'),RHD_WORK_TIME_VAL=round(wt_tmp_01(".$rep002Array[$i]['DRS_ID'].",'2016-09-01 00:00:10')/3600,2),RHD_AUDIT_CD='2016-09-01 00:00:10';");
$id++;
mysql_query("INSERT INTO rep_his_data_everyday SET RHD_ID=".$id.",RHD_DRS_ID=".$rep002Array[$i]['DRS_ID'].",RHD_DATE='".$rep002Array[$i]['WLE_DATE_TO']."',RHD_VM3_VAL=pw_tmp_01(".$rep002Array[$i]['DRS_ID'].",'".$rep002Array[$i]['WLE_DATE_TO']."'),RHD_WORK_TIME_VAL=round(wt_tmp_01(".$rep002Array[$i]['DRS_ID'].",'".$rep002Array[$i]['WLE_DATE_TO']."')/3600,2),RHD_AUDIT_CD='".$rep002Array[$i]['WLE_DATE_TO']."';");
$id++;
}
echo "Wprowadzono dane dla studni: ".$rep002Array[$i]['WLL_NAME'].", DRS: ".$rep002Array[$i]['DRS_ID'].", DATE: ".$rep002Array[$i]['WLE_DATE_TO']."<br/>";
}
mysql_query("drop table if exists a_tmp_data_02092016_01");
mysql_query("drop table if exists a_tmp_data_02092016_02");
//print_r($rep002Array);
?>
<br/>DONE<br/>
<?php
mysql_close($polacz);
?>
</body>
</html>