dbf_num_rec;
for($i=0;$i<$num_rec;$i++){
$row=$dbf->getRowAssoc($i);
for($j=2;$j<=20;$j++){
if($row['N'.$j]){
$nn='N'.$j;
break;
}
}
if($row['N1']=="" || $row[$nn]=="")continue;
$name=trim($row['N1']);
$name=str_replace(" ","",$name);
$name=substr($name,2);
$value=trim($row[$nn]);
$value=str_replace(" ","",$value);
//$value=substr($value,2);
$value=str_replace(",",".",$value);
$value=floatval($value);
$p=new EcmPayment();
$p->name=$name;
$p->parent_id=$_POST['account_id'];
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select ems_system_id from accounts where id='".$_POST['account_id']."'"));
$p->parent_name=$_POST['account_name'];
$p->ems_system_id=$r['ems_system_id'];
$p->value=$value;
$p->payment_date=$_REQUEST['date'];
//echo $name."#######".$value."
";
$id=$p->save();
$GLOBALS['db']->query("update ecmpayments set value='".$value."' where id='".$id."'");
}
header("Location: index.php?module=EcmPaymentStates&action=index&account_id=".$_POST['account_id']);
}
?>