i want to add customer mortgage terms to their close dates in order to determine their maturity date
the mortgage term is retrieved from the database as 'cf_555' in 'Y-m-d' format along with 'closingdate' in string formats ranging from '6 months' to '60 months'
- Code: Select all
$term = "SELECT vtiger_potentialscf.potentialid, vtiger_potentialscf.cf_555 FROM vtiger_potentialscf WHERE vtiger_potentialscf.cf_555 <>'' LIMIT 0, 10";
$terms = mysql_query($term);
while($trow=mysql_fetch_array($terms)) { $cf_555=mktime(0,0,0,str_replace(' months','',$trow["cf_555"]));
$potentialid=$trow["potentialid"];
$close = "SELECT vtiger_potential.closingdate FROM vtiger_potential
WHERE vtiger_potential.potentialid = '$potentialid'";
$closedate = mysql_query($close);
while($crow=mysql_fetch_array($closedate)) { $closingdate=strtotime($crow["closingdate"]);
echo date('Y-m-d',$closingdate)."+".date('Y-m-d',$cf_555)."=".date('Y-m-d',$closingdate+$cf_555)."<br>";
}}
thanks in advance for your help

