| version 1.22, 2023/12/10 01:38:47 |
version 1.23, 2023/12/14 00:21:13 |
|
|
| * 2017-10-07 - added import of expired domains (droplist) |
* 2017-10-07 - added import of expired domains (droplist) |
| */ |
*/ |
| |
|
| /* $Platon: scripts/php/sk-nic/SK-NIC.php,v 1.21 2023/12/09 16:48:57 nepto Exp $ */ |
/* $Platon: scripts/php/sk-nic/SK-NIC.php,v 1.22 2023/12/10 01:38:47 nepto Exp $ */ |
| |
|
| require_once 'DB.php'; |
require_once 'DB.php'; |
| |
|
|
|
| DB::isError($result) && $this->error($result); |
DB::isError($result) && $this->error($result); |
| } /* }}} */ |
} /* }}} */ |
| |
|
| function doComparison() /* {{{ */ |
function doComparison($debug = false) /* {{{ */ |
| { |
{ |
| $changed = 0; |
$changed = 0; |
| $import_cols = $this->_tableColumns($this->table_import); |
$import_cols = $this->_tableColumns($this->table_import); |
|
|
| $subqryres = $this->_db->query(sprintf($query, $subquery)); |
$subqryres = $this->_db->query(sprintf($query, $subquery)); |
| while ($subqryres->fetchInto($rec)) { |
while ($subqryres->fetchInto($rec)) { |
| if (@strlen($rec["c_$this->primary_key"]) <= 0) { // new domain |
if (@strlen($rec["c_$this->primary_key"]) <= 0) { // new domain |
| //echo 'new domain: ',$rec["i_$pkey"],"\n"; |
if ($debug) { |
| |
echo 'NEW: ',$rec["i_domain"],"\n"; |
| |
} |
| $changed++; |
$changed++; |
| $this->_insertRecord($rec); |
$this->_insertRecord($rec); |
| continue; |
continue; |
| } |
} |
| if (@strlen($rec["i_$this->primary_key"]) <= 0) { // deleted domain |
if (@strlen($rec["i_$this->primary_key"]) <= 0) { // deleted domain |
| //echo 'deleted domain: ',$rec["c_$pkey"],"\n"; |
if ($debug) { |
| |
echo 'DELETED: ',$rec["c_domain"],"\n"; |
| |
} |
| $changed++; |
$changed++; |
| $this->_writeHistory($rec, 1); |
$this->_writeHistory($rec, 1); |
| $query = sprintf('DELETE FROM %s WHERE %s = %s', |
$query = sprintf('DELETE FROM %s WHERE %s = %s', |
|
|
| if (count($changed_cols) == 1 && $changed_cols[0] = 'dt_changed') { |
if (count($changed_cols) == 1 && $changed_cols[0] = 'dt_changed') { |
| // do nothing |
// do nothing |
| } elseif (count($changed_cols) > 0) { |
} elseif (count($changed_cols) > 0) { |
| //echo 'changed fields in domain ',$rec['i_domain'],':',"\n\t"; |
if ($debug) { |
| //echo join("\n\t",$changed_cols),"\n"; |
echo 'CHANGED: ',$rec['i_domain']; |
| |
echo ' [', join('][',$changed_cols),"]\n"; |
| |
} |
| $changed++; |
$changed++; |
| $this->_writeHistory($rec); |
$this->_writeHistory($rec); |
| $this->_updateRecord($rec, $changed_cols); |
$this->_updateRecord($rec, $changed_cols); |