Initial commit
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?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");
|
||||
|
||||
$del = 0;
|
||||
|
||||
unset($wellArray);
|
||||
$wellArray = sqlGetResAsArray("select * from seg_dev_resources,seg_wells where DRS_DEV_TYPE=12 and DRS_DEV_ID=WLL_ID and WLL_CAT_DIC_ID=20");
|
||||
for($i=0; $i<count($wellArray); $i++)
|
||||
{
|
||||
unset($wellRecords);
|
||||
$wellRecords = sqlGetResAsArray("select * from rep_his_data_everyday where RHD_Q_VAL>0 and RHD_DRS_ID=".$wellArray[$i]['DRS_ID']);
|
||||
|
||||
for($w=0; $w<count($wellRecords); $w++)
|
||||
{
|
||||
$onOffArray = sqlGetResAsArray("select * from softspm_rep.rep_002_avg_pump_working where WST_ID=(select max(WST_ID) from softspm_rep.rep_002_avg_pump_working where WST_DRS_ID=".$wellArray[$i]['DRS_ID']." and WST_DATE<='".$wellRecords[$w]['RHD_DATE']."')");
|
||||
|
||||
if ($onOffArray[0]['WST_STATUS_VAL'] != 'ON')
|
||||
{
|
||||
//usuwa dane
|
||||
mysql_query("DELETE FROM rep_his_data_everyday WHERE RHD_ID=".$wellRecords[$w]['RHD_ID']);
|
||||
|
||||
echo("select * from softspm_rep.rep_002_avg_pump_working where WST_ID=(select max(WST_ID) from softspm_rep.rep_002_avg_pump_working where WST_DRS_ID=".$wellArray[$i]['DRS_ID']." and WST_DATE<='".$wellRecords[$w]['RHD_DATE']."')");
|
||||
echo'<br/>';
|
||||
echo("DELETE FROM rep_his_data_everyday WHERE RHD_ID=".$wellRecords[$w]['RHD_ID']);
|
||||
echo'<br/>';
|
||||
echo'<br/>';
|
||||
$del++;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo'Usunął '.$del. ' rekordy <br/>';
|
||||
|
||||
mysql_close($polacz);
|
||||
Reference in New Issue
Block a user