FactSentSms->findFacts('Sum(FactSentSms.num_smses)',array( 'group'=>'DimensionTime.day_of_week', 'order'=>'DimensionTime.day_of_week', 'conditions'=>array( '(FactSentSms.response_code IN ('.implode(',',$this->billableResponseCodes).') )' ), 'mapped'=>true )); $this->set('weekly_smses',$weekly_smses); } // show which modules (=parts of the system) have sent which types of messages function modules_and_types() { $all_modules = $this->FactSentSms->findFacts($sum,array( 'fields' => array('Sum(FactSentSms.tarif_total) AS FactSentSms__tarif_total'), // additional fields can be defined 'group'=>'DimensionModule.name, DimensionType.type', // multiple dimensions are possible 'order'=>'DimensionModule.name', 'conditions'=>array( '(FactSentSms.response_code IN ('.implode(',',$this->billableResponseCodes).') )' ), 'mapped'=>true )); $this->set('all_modules',$all_modules); } // show error types for this month function errors_this_month() { $responses = $this->FactSentSms->findFacts($sum,array( 'group'=>'FactSentSms.response_code', 'order'=>'FactSentSms.response_code', 'conditions'=>array( '(FactSentSms.response_code NOT IN ('.implode(',',$this->billableResponseCodes).') )', 'DimensionTime.month'=>date('m'), 'DimensionTime.year'=>date('Y') ), 'mapped'=>true )); $this->set('responses',$responses); } } ?>