public function getProspectsDataByDate($type = 'daily', $date){
	    
	    $prospectsTable = $this->getServiceLocator()->get('MelisProspects');
	    $dataProspects = $prospectsTable->getProspectsOrderByDate('DESC');
	
	    // Set Number of Prospect to Zero as default Value
	    $nb = 0;
	
	    if (!empty($dataProspects)){
	
	        $res = $dataProspects->toArray();
	
	        if (!empty($res)){
	
	            switch ($type) {
	                case 'daily':
	                    for ($i = 0 ; $i < count($res); $i++){
	                        // Checking if Date is same as the Param data
	                        if ($date==date('Y-m-d',strtotime($res[$i]['pros_contact_date']))){
	                            $nb++;
	                        }
	                    }
	                    break;
	                case 'monthly':
	                    for ($i = 0 ; $i < count($res); $i++){
	                        // Checking if Date is same as the Param data
	                        if (date('Y-m',strtotime($date))==date('Y-m',strtotime($res[$i]['pros_contact_date']))){
	                            $nb++;
	                        }
	                    }
	                    break;
	                case 'yearly':
	                    for ($i = 0 ; $i < count($res); $i++){
	                        // Checking if Date is same as the Param data
	                        if (date('Y',strtotime($date))==date('Y',strtotime($res[$i]['pros_contact_date']))){
	                            $nb++;
	                        }
	                    }
	                    break;
	                default:
	                    break;
	            }
	        }
	    }
	
	    return $nb;
	
	}
public function getProspectsDataByDate($type = 'daily', $date){
	    
	    $prospectsTable = $this->getServiceLocator()->get('MelisProspects');
	    $dataProspects = $prospectsTable->getProspectsOrderByDate('DESC');
	
	    // Set Number of Prospect to Zero as default Value
	    $nb = 0;
	
	    if (!empty($dataProspects)){
	
	        $res = $dataProspects->toArray();
	
	        if (!empty($res)){
	
	            switch ($type) {
	                case 'daily':
	                    for ($i = 0 ; $i < count($res); $i++){
	                        // Checking if Date is same as the Param data
	                        if ($date==date('Y-m-d',strtotime($res[$i]['pros_contact_date']))){
	                            $nb++;
	                        }
	                    }
	                    break;
	                case 'monthly':
	                    for ($i = 0 ; $i < count($res); $i++){
	                        // Checking if Date is same as the Param data
	                        if (date('Y-m',strtotime($date))==date('Y-m',strtotime($res[$i]['pros_contact_date']))){
	                            $nb++;
	                        }
	                    }
	                    break;
	                case 'yearly':
	                    for ($i = 0 ; $i < count($res); $i++){
	                        // Checking if Date is same as the Param data
	                        if (date('Y',strtotime($date))==date('Y',strtotime($res[$i]['pros_contact_date']))){
	                            $nb++;
	                        }
	                    }
	                    break;
	                default:
	                    break;
	            }
	        }
	    }
	
	    return $nb;
	
	}
public function getProspectsDataByDate ( $ type = 'daily' , $ date ) { $ prospectsTable = $ this -> getServiceLocator ( ) -> get ( 'MelisProspects' ) ; $ dataProspects = $ prospectsTable -> getProspectsOrderByDate ( 'DESC' ) ; // Set Number of Prospect to Zero as default Value $ nb = 0 ; if ( ! empty ( $ dataProspects ) ) { $ res = $ dataProspects -> toArray ( ) ; if ( ! empty ( $ res ) ) { switch ( $ type ) { case 'daily' : for ( $ i = 0 ; $ i < count ( $ res ) ; $ i ++ ) { // Checking if Date is same as the Param data if ( $ date == date ( 'Y-m-d' , strtotime ( $ res [ $ i ] [ 'pros_contact_date' ] ) ) ) { $ nb ++ ; } } break ; case 'monthly' : for ( $ i = 0 ; $ i < count ( $ res ) ; $ i ++ ) { // Checking if Date is same as the Param data if ( date ( 'Y-m' , strtotime ( $ date ) ) == date ( 'Y-m' , strtotime ( $ res [ $ i ] [ 'pros_contact_date' ] ) ) ) { $ nb ++ ; } } break ; case 'yearly' : for ( $ i = 0 ; $ i < count ( $ res ) ; $ i ++ ) { // Checking if Date is same as the Param data if ( date ( 'Y' , strtotime ( $ date ) ) == date ( 'Y' , strtotime ( $ res [ $ i ] [ 'pros_contact_date' ] ) ) ) { $ nb ++ ; } } break ; default : break ; } } } return $ nb ; }
This method will get Prospect Data

@param string $type, this will determine what type of request
@param string $date, if specified this will return only from the date to the current date
@return number
This method will get Prospect Data