This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.ttc-validation-error { | |
position: absolute; | |
left: -700px; | |
top: -50px; | |
top: -35px\9; | |
background: pink; | |
border: solid white; | |
padding: 5px; | |
font-size: 12px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StatsComponent<?php | |
App::uses('Component', 'Controller'); | |
App::uses('Program', 'Model'); | |
class StatsComponent extends Component { | |
public function getRedis() | |
{ | |
$redis = new Redis(); | |
$redis->connect('127.0.0.1'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::uses('Component', 'Controller'); | |
App::uses('Program', 'Model'); | |
class StatsComponent extends Component { | |
public function getRedis() | |
{ | |
$redis = new Redis(); | |
$redis->connect('127.0.0.1'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::uses('Component', 'Controller'); | |
App::uses('Program', 'Model'); | |
App::uses('ProgramSetting', 'Model'); | |
class StatsComponent extends Component { | |
public $Controller = null; | |
public $redis = null; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo $this->Html->tag( | |
'div', | |
'<b title = "'.__('Optin / Total participant(s)').'">'.$program['Program']['stats']['active-participant-count'].'/'. | |
$program['Program']['stats']['participant-count'].'</b> '.__(' participant(s)').'<br/>'. | |
'<b title = "'.__('Total (total current month) message(s)').'">'.$program['Program']['stats']['history-count'].'('. | |
$program['Program']['stats']['total-current-month-messages-count'].') </b>'.__(' total message(s)').'<br/>'. | |
'<b title = "'.__('Total (current month) received - Total(current month) sent').'">'.$program['Program']['stats']['all-received-messages-count'].'('. | |
$program['Program']['stats']['current-month-received-messages-count'].') </b>'.__('received'). | |
' - <b title = "'.__('Total (current month) received - Total (current month) sent').'">'.$program['Program']['stats']['all-sent-messages-count'].'('. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo $this->Js->object(); | |
?> | |
the out put is "[ ]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getProgramStats() | |
{ | |
if(isset($this->params['url']['program'])){ | |
$programUrl = $this->Program->find('first', array('conditions' => array('url'=> $this->params['url']['program']))); | |
$programStats = $this->Stats->getProgramStats($programUrl['Program']['database']); | |
$this->set(compact('programStats')); | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function loadProgramStats(){ | |
var programs = window.app.programs; | |
if(programs !== null){ | |
var program = {}; | |
for(var i = 0; i< programs.length; i++){ | |
program = programs[i]; | |
var programUrl = program['Program']['url']; | |
$.ajax({ | |
type: "GET", | |
dataType: "json", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getProgramStats() | |
{ | |
$user = $this->Auth->user(); | |
if(isset($this->params['url']['program'])){ | |
$programUrls = $this->Program->find('authorized', array( | |
'specific_program_access' => 'true', | |
'user_id' => $user['id'], | |
'conditions' => array('url'=> $this->params['url']['program']))); | |
foreach($programUrls as $programUrl) | |
$programDatabase = $programUrl['Program']['database']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generateHtmlProgramStats(programStats) { | |
var myTemplate = ((programStats != null)? | |
'<div>'+ | |
'<span title = "Optin/Total participant(s)" class=stat>'+ | |
'Activeparticipant/Totalparticipantstats'+ | |
'</span> participant(s)'+ | |
'</div>'+ | |
'<div>'+ | |
'<span title = "Total(total currentmonth) message(s)" class=stat>'+ | |
'Totalhistory(Totalcurrentmonthmessages)'+ |
OlderNewer