$value) { foreach($value as $field => $value) { $SQLvalues .= mysql_escape_string($value).","; } } $SQLvalues=substr($SQLvalues,0,-1); $leadnum=strlen($SQLvalues); if($leadnum>1){ mysql_select_db($database_propconnection, $propconnection); $ownersql="SELECT count(*) FROM property_communities WHERE primary_id in($SQLvalues)"; if ( "" != $monthstart && "" != $monthend) { $ownersql.= " AND lastupdated between '$monthstart' and '$monthend'"; } $ownerrow=getOneRow($ownersql, $database_propconnection, $propconnection); } */ //get account /* $accountsql="SELECT count(distinct agent_id) as ct FROM kw_referrals kr LEFT JOIN mym_sources ms ON kr.account_id=ms.id LEFT JOIN company c ON ms.company_id=c.id WHERE kr.account_id>0 AND(kr.type='agent' or kr.type='manager') AND kr.agent_id=".$_SESSION['id']; if ( "" != $monthstart && "" != $monthend) { $accountsql.= " AND kr.date_started between '$monthstart' and '$monthend'"; } $accountrow=getOneRow($accountsql, $database_myconnection, $myconnection); */ //get commissions amount /* $paidsql="SELECT sum(kr.fee_paid) amount " ."FROM leads l,clients c" .",kw_referrals kr" .",placements p " ."where l.leadstatus='client' and kr.agent_id=".$_SESSION['id'] ." and l.id=c.lead_id " ."and l.id=kr.lead_id " ."and kr.lead_id=p.client_id and (l.clientstatus = 'Placed' and kr.fee_paid>0)"; $comsql="SELECT sum(kr.fee_due) amount " ."FROM leads l,clients c" .",kw_referrals kr" .",placements p " ."where l.leadstatus='client' and kr.agent_id=".$_SESSION['id'] ." and l.id=c.lead_id " ."and l.id=kr.lead_id " ."and kr.lead_id=p.client_id and ((l.clientstatus = 'Pending' or l.clientstatus = 'Placed') and kr.fee_paid=0)"; if ( "" != $monthstart && "" != $monthend) { $comsql.= " AND p.movein_date between '$monthstart' and '$monthend'"; $paidsql.= " AND p.movein_date between '$monthstart' and '$monthend'"; } $comamount=getOneRow($comsql, $database_myconnection, $myconnection); $paidamount=getOneRow($paidsql, $database_myconnection, $myconnection); $amount=$comamount["amount"]+$paidamount["amount"] */ ?>
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
J. Ellis Apartment Locators, a Licensed Real Estate Broker, is an Equal Housing Opportunity rental service. Copyright 2009. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||