'; echo $mod_strings['leadCustomFieldDescription']; echo '

'; global $adb; global $theme; $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; require_once($theme_path.'layout_utils.php'); $xtpl=new XTemplate('modules/Settings/LeadCustomFieldMapping.html'); $xtpl->assign("MOD", $mod_strings); $xtpl->assign("APP", $app_strings); $xtpl->assign("RETURN_MODULE","Settings"); $xtpl->assign("RETURN_ACTION",""); function getAccountCustomValues($leadid,$accountid) { global $adb; $sql="select fieldid,fieldlabel from field,tab where field.tabid=tab.tabid and generatedtype=2 and tab.name='Accounts'"; $result = $adb->query($sql); $noofrows = $adb->num_rows($result); $combo=""; return $combo; } function getContactCustomValues($leadid,$contactid) { global $adb; $sql="select fieldid,fieldlabel from field,tab where field.tabid=tab.tabid and generatedtype=2 and tab.name='Contacts'"; $result = $adb->query($sql); $noofrows = $adb->num_rows($result); $combo=""; return $combo; } function getPotentialCustomValues($leadid,$potentialid) { global $adb; $sql="select fieldid,fieldlabel from field,tab where field.tabid=tab.tabid and generatedtype=2 and tab.name='Potentials'"; $result = $adb->query($sql); $noofrows = $adb->num_rows($result); $combo=""; return $combo; } $lead_sql="select fieldid,fieldlabel from field,tab where field.tabid=tab.tabid and generatedtype=2 and tab.name='Leads'"; $result = $adb->query($lead_sql); $noofrows = $adb->num_rows($result); $display_val=""; for($i=0; $i<$noofrows; $i++) { $lead_field_id=$adb->query_result($result,$i,"fieldid"); $lead_field_label=$adb->query_result($result,$i,"fieldlabel"); $display_val.=""; $display_val.=""; $display_val.=""; $display_val.=""; $display_val.=""; } $display_val.="
".$lead_field_label; $convert_sql="select * from convertleadmapping where leadfid=".$lead_field_id; $convert_result = $adb->query($convert_sql); $no_rows = $adb->num_rows($convert_result); for($j=0; $j<$no_rows; $j++) { $accountid=$adb->query_result($convert_result,$j,"accountfid"); $contactid=$adb->query_result($convert_result,$j,"contactfid"); $potentialid=$adb->query_result($convert_result,$j,"potentialfid"); } $account_combo=getAccountCustomValues($lead_field_id,$accountid); $contact_combo=getContactCustomValues($lead_field_id,$contactid); $potential_combo=getPotentialCustomValues($lead_field_id,$potentialid); $display_val.="".$account_combo."".$contact_combo."".$potential_combo."
"; if (isset($display_val)) $xtpl->assign("CUSTOMFIELDMAPPING",$display_val); $xtpl->parse("main"); $xtpl->out("main"); ?>