<?php session_start();
include_once ("../../functions/init.php"); 
include_once ($thisUrl."adm1n/functions/access.php");
include_once ($thisUrl."adm1n/functions/koneksi.php");
include_once ($thisUrl."functions/indonesian_date.php");
$sql =
" SELECT header_id FROM ".
" kontak_dagang_header as a,  ".
" kontak_dagang_transaksi as b ".
" WHERE header_id = to_kontak_dagang_header  ".
" AND day(tgl_transaksi) = '15'  ".
" and jn_trans not in (1214, 1215)  ".
" AND day(tgl_transaksi) <> day(b.date_updated) ";
if ($hasil = mysql_query($sql)) {
	$list_ = '';
	while ($data = mysql_fetch_array($hasil)) {
		if ($list_) $list_ .= ',';
		$list_ .= $data["header_id"];
	}
}
//echo $list_;
$sql =
" UPDATE kontak_dagang_header ".
" SET tgl_transaksi = '2019-10-17' ".
" WHERE header_id in ($list_) ";
echo $sql;
if ($hasil = mysql_query($sql)) {
	echo 'Reset Data Completed ..';	
}

?>
