/* Decoded by unphp.net */
?>
0.00 AND t_contract_due.isstatus ='W'";
$results5 = odbc_exec($conn,$sql5);
while (odbc_fetch_row( $results5 )) {
$contractid_due = odbc_result($results5,"contractid");
$contractid = iconv("windows-874","UTF-8",$contractid_due );
$memberid = odbc_result($results5,"memberid");
$duedate = odbc_result($results5,"duedate");
$d =substr($duedate, 0, 2);
$m =substr($duedate, 2, 2);
$y =substr($duedate, 4, 4);
$data_add = $y.'-'.$m.'-'.$d;
$d1 =substr($duedate, 0, 2);
$m1 =substr($duedate, 2, 2);
$y1 =substr($duedate, 4, 4);
$r = $y1-543;
$data_add2 = $r.'-'.$m1.'-'.$d1;
$data_add3 = odbc_result($results5,"duedate");
$isstatus = odbc_result($results5,"isstatus");
$balancedue = odbc_result($results5,"balancedue");
$loanid = odbc_result($results5,"loanid");
$dueid = odbc_result($results5,"dueid");
$mss5 = "INSERT INTO t_contract_due (id,memberid,contractid,balancedue,isstatus,duedate,loanid,dueid,duedate2,duedate3) values
(null,'$memberid','$contractid','$balancedue','$isstatus','$data_add','$loanid','$dueid','$data_add2','$data_add3');";
$results6 = mysql_db_query($dbname,$mss5);
$rf++;
};
};
if($results6==1){
$del6 ="TRUNCATE `t_gua`"; //OK
$rows6 = mysql_db_query($dbname,$del6);
$sql6 ="Select
t_gua.contractid,
t_gua.isstatus,
t_gua.propamt,
t_gua.guaamt,
t_gua.guamember,
t_gua.guatype,
t_gua.guanote,
t_gua.groupid
From t_gua Where t_gua.isstatus = 'Y'";
$results6 = odbc_exec($conn,$sql6);
$rf=1;
while (odbc_fetch_row( $results6 )) {
$contractid_gua = odbc_result($results6,"contractid");
$contractid = iconv("windows-874","UTF-8",$contractid_gua );
$guaamt = odbc_result($results6,"guaamt");
$propamt = odbc_result($results6,"propamt");
$gua = odbc_result($results6,"guatype");
$guamember = odbc_result($results6,"guamember");
$groupid = odbc_result($results6,"groupid");
$guanote0 = odbc_result($results6,"guanote");
$guanote1 = iconv("windows-874","UTF-8",$guanote0);
$guanote = trim($guanote1);
$isstatus = odbc_result($results6,"isstatus");
$mss6 = "INSERT INTO t_gua (id,contractid,guamt,propamt,guamember,guanote,isstatus,groupid,gua) values
(null,'$contractid','$guaamt','$propamt','$guamember','$guanote','$isstatus','$groupid','$gua');";
$results7 = mysql_db_query($dbname,$mss6);
$rf++;
};
};
// constsys
if($results7==1){
$del7 ="TRUNCATE `constsys`"; //OK
$rows7 = mysql_db_query($dbname,$del7);
$sql7 ="Select coname,co_reg,prov From constsys";
$results7 = odbc_exec($conn,$sql7);
$i7;
while (odbc_fetch_row( $results7 )) {
$coname = odbc_result($results7,"coname");
$pn1 = iconv("windows-874","UTF-8",$coname );
$reg = odbc_result($results7,"co_reg");
$pn2 = iconv("windows-874","UTF-8",$reg );
$pn3 = odbc_result($results7,"prov");
$mss7 = "INSERT INTO constsys ";
$mss7 .="(constsys_id,constsys_name,constsys_reg,prov) ";
$mss7 .="VALUES ";
$mss7 .="('null','$pn1','$pn2','$pn3') ";
$results8 = mysql_query($mss7);
$i7++;
}
}
if($results8==1){
$del8 ="TRUNCATE `m_loan_fee`";
$rows8 = mysql_db_query($dbname,$del8);
$sql8 ="Select feeid,feerate,creatby,isstatus From m_loan_fee";
$results8 = odbc_exec($conn,$sql8);
$i8;
while (odbc_fetch_row( $results8 )) {
$sh2 = odbc_result($results8,"feerate");
$sh3 = odbc_result($results8,"creatby");
$sh4 = odbc_result($results8,"isstatus");
$mss8 = "INSERT INTO `cad_memdata`.`m_loan_fee` (`Feeid` ,`Feerate` ,`Creatby` ,`isstatus`)VALUES ('null', '$sh2', '$sh3', '$sh4')";
$results9 = mysql_db_query($dbname,$mss8);
$i8++;
}
}
if($results9==1){
$del9 ="TRUNCATE `t_workdate`";
$rows9 = mysql_db_query($dbname,$del9);
$sql9 ="Select * From t_workdate where isstatus='Y'";
$results9 = odbc_exec($conn,$sql9);
$i9;
while (odbc_fetch_row( $results9 )) {
$sh1 = odbc_result($results9,"workdate");
$sh2 = odbc_result($results9,"isstatus");
$sh3 = odbc_result($results9,"yearid");
$sh4 = odbc_result($results9,"creaby");
$d1 =substr($sh1, 0, 2);
$m1 =substr($sh1, 2, 2);
$y1 =substr($sh1, 4, 4);
$r = $y1-543;
$sh5 = $r.'-'.$m1.'-'.$d1;
$mss9 = "INSERT INTO `cad_memdata`.`t_workdate`
(`workdate` ,`isstatus` ,`yearid` ,`createby` ,`workymd`)
VALUES ('$sh1', '$sh2', '$sh3', '$sh4', '$sh5');";
$results10 = mysql_db_query($dbname,$mss9);
$i9++;
}
}
if($results10==1){
$del10 ="TRUNCATE `t_year`";
$rows10 = mysql_db_query($dbname,$del10);
$sql10 ="Select * From t_year where isstatus='Y'";
$results10 = odbc_exec($conn,$sql10);
$i10;
while (odbc_fetch_row( $results10 )) {
$sh1 = odbc_result($results10,"yearid");
$sh2 = odbc_result($results10,"begindate");
$d1 =substr($sh2, 0, 2);
$m1 =substr($sh2, 2, 2);
$y1 =substr($sh2, 4, 4);
$r = $y1-543;
$sh3 = $r.'-'.$m1.'-'.$d1;
$sh4 = odbc_result($results10,"enddate");
$d1 =substr($sh4, 0, 2);
$m1 =substr($sh4, 2, 2);
$y1 =substr($sh4, 4, 4);
$r = $y1-543;
$sh5 = $r.'-'.$m1.'-'.$d1;
$sh6 = odbc_result($results10,"isstatus");
$sh7 = odbc_result($results10,"createby");
$mss10 = "INSERT INTO `cad_memdata`.`t_year` (`yearid` ,`begindate` ,`begindate1` ,`enddate` ,`enddate2` ,`isstatus` ,`createby`)
VALUES ('$sh1', '$sh2', '$sh3', '$sh4', '$sh5', '$sh6', '$sh7')";
$results11 = mysql_db_query($dbname,$mss10);
$i10++;
}
}
?>