fixing gauge open vs completed

This commit is contained in:
Fernando Ontiveros
2011-10-31 18:25:11 -04:00
parent 776bd1ce8d
commit 767e158e9b
3 changed files with 12 additions and 46 deletions

View File

@@ -38,20 +38,19 @@ Array
$con = Propel::getConnection("workflow");
$stmt = $con->createStatement();
$sql = "select count(*) as CANT from APPLICATION where APP_STATUS = 'TO_DO' ";
$rs1 = $stmt->executeQuery($sql, ResultSet::FETCHMODE_NUM);
$rs1->next();
$row = $rs1->getRow();
$rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
$casesTodo = $row['CANT'];
$stmt = $con->createStatement();
$sql = "select count(*) as CANT from APPLICATION where APP_STATUS = 'COMPLETED' ";
$rs1 = $stmt->executeQuery($sql, ResultSet::FETCHMODE_NUM);
$rs1->next();
$row = $rs1->getRow();
$rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
$casesCompleted = $row['CANT'];
if ( $casesCompleted + $casesTodo != 0 ) {
$this->value = $casesTodo / ($casesCompleted + $casesTodo);
$this->value = $casesTodo / ($casesCompleted + $casesTodo)*100;
}
else {
$this->value = 0;
@@ -64,7 +63,7 @@ Array
$g = new pmGauge();
$g->w = $width;
$g->value = $this->value;
//$g->maxValue = $this->value + 5; //default 100 is ok,
$g->maxValue = 100;
$g->render();
}

View File

@@ -91,10 +91,10 @@
imagefilledellipse($im, $cX, $cY, $dXRing, $dYRing, $bgcolor);
//drawing the red arc
if ( $this->redFrom > $maxValue ) $this->redFrom = $maxValue;
if ( $this->redTo > $maxValue ) $this->redTo = $maxValue;
if ( $this->yellowFrom > $maxValue ) $this->yellowFrom = $maxValue;
if ( $this->yellowTo > $maxValue ) $this->yellowTo = $maxValue;
if ( $this->redFrom > $this->maxValue ) $this->redFrom = $this->maxValue;
if ( $this->redTo > $this->maxValue ) $this->redTo = $this->maxValue;
if ( $this->yellowFrom > $this->maxValue ) $this->yellowFrom = $this->maxValue;
if ( $this->yellowTo > $this->maxValue ) $this->yellowTo = $this->maxValue;
$redFrom = $this->redFrom/$this->maxValue*300 - 240 ;
$redTo = $this->redTo/$this->maxValue*300 - 240;

View File

@@ -84,39 +84,6 @@ Ext.onReady(function(){
}
});
var vp = Ext.getCmp('viewportDashboard');
var pd = Ext.getCmp('portalDashboard');
pd.items.items[0].add( np );
pd.doLayout();
//vp.doLayout();
}
},
{
xtype: 'tbbutton',
text : 'new trend graph',
handler : function(a) {
var np = new Ext.ux.Portlet ( {
//title: 'Panel nuevo',
tools: tools,
html: 'hello world',
listeners: {
'render': function(p){
p.html = 'hello ' + p.getWidth();
},
'move' : function(p){
Ext.Msg.alert('Portlet ', 'move ' + p.getWidth() );
p.html = 'show ' + p.getWidth();
},
'resize' : function(p,w,h){
var randomnumber=Math.floor(Math.random()*1000000)
var img = new Ext.XTemplate("<img src='{page}?w={width}&r={random}'>").apply({
page: 'http://javaserver.colosa.net/ext/examples/portal/history.php', width:w, random: randomnumber })
p.update(img );
}
}
});
var vp = Ext.getCmp('viewportDashboard');
var pd = Ext.getCmp('portalDashboard');
pd.items.items[0].add( np );