fixing gauge open vs completed
This commit is contained in:
@@ -38,20 +38,19 @@ Array
|
|||||||
$con = Propel::getConnection("workflow");
|
$con = Propel::getConnection("workflow");
|
||||||
$stmt = $con->createStatement();
|
$stmt = $con->createStatement();
|
||||||
$sql = "select count(*) as CANT from APPLICATION where APP_STATUS = 'TO_DO' ";
|
$sql = "select count(*) as CANT from APPLICATION where APP_STATUS = 'TO_DO' ";
|
||||||
$rs1 = $stmt->executeQuery($sql, ResultSet::FETCHMODE_NUM);
|
$rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
||||||
$rs1->next();
|
$rs->next();
|
||||||
$row = $rs1->getRow();
|
$row = $rs->getRow();
|
||||||
$casesTodo = $row['CANT'];
|
$casesTodo = $row['CANT'];
|
||||||
|
|
||||||
$stmt = $con->createStatement();
|
$stmt = $con->createStatement();
|
||||||
$sql = "select count(*) as CANT from APPLICATION where APP_STATUS = 'COMPLETED' ";
|
$sql = "select count(*) as CANT from APPLICATION where APP_STATUS = 'COMPLETED' ";
|
||||||
$rs1 = $stmt->executeQuery($sql, ResultSet::FETCHMODE_NUM);
|
$rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
||||||
$rs1->next();
|
$rs->next();
|
||||||
$row = $rs1->getRow();
|
$row = $rs->getRow();
|
||||||
$casesCompleted = $row['CANT'];
|
$casesCompleted = $row['CANT'];
|
||||||
|
|
||||||
if ( $casesCompleted + $casesTodo != 0 ) {
|
if ( $casesCompleted + $casesTodo != 0 ) {
|
||||||
$this->value = $casesTodo / ($casesCompleted + $casesTodo);
|
$this->value = $casesTodo / ($casesCompleted + $casesTodo)*100;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->value = 0;
|
$this->value = 0;
|
||||||
@@ -64,7 +63,7 @@ Array
|
|||||||
$g = new pmGauge();
|
$g = new pmGauge();
|
||||||
$g->w = $width;
|
$g->w = $width;
|
||||||
$g->value = $this->value;
|
$g->value = $this->value;
|
||||||
//$g->maxValue = $this->value + 5; //default 100 is ok,
|
$g->maxValue = 100;
|
||||||
$g->render();
|
$g->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,10 +91,10 @@
|
|||||||
imagefilledellipse($im, $cX, $cY, $dXRing, $dYRing, $bgcolor);
|
imagefilledellipse($im, $cX, $cY, $dXRing, $dYRing, $bgcolor);
|
||||||
|
|
||||||
//drawing the red arc
|
//drawing the red arc
|
||||||
if ( $this->redFrom > $maxValue ) $this->redFrom = $maxValue;
|
if ( $this->redFrom > $this->maxValue ) $this->redFrom = $this->maxValue;
|
||||||
if ( $this->redTo > $maxValue ) $this->redTo = $maxValue;
|
if ( $this->redTo > $this->maxValue ) $this->redTo = $this->maxValue;
|
||||||
if ( $this->yellowFrom > $maxValue ) $this->yellowFrom = $maxValue;
|
if ( $this->yellowFrom > $this->maxValue ) $this->yellowFrom = $this->maxValue;
|
||||||
if ( $this->yellowTo > $maxValue ) $this->yellowTo = $maxValue;
|
if ( $this->yellowTo > $this->maxValue ) $this->yellowTo = $this->maxValue;
|
||||||
|
|
||||||
$redFrom = $this->redFrom/$this->maxValue*300 - 240 ;
|
$redFrom = $this->redFrom/$this->maxValue*300 - 240 ;
|
||||||
$redTo = $this->redTo/$this->maxValue*300 - 240;
|
$redTo = $this->redTo/$this->maxValue*300 - 240;
|
||||||
|
|||||||
@@ -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 vp = Ext.getCmp('viewportDashboard');
|
||||||
var pd = Ext.getCmp('portalDashboard');
|
var pd = Ext.getCmp('portalDashboard');
|
||||||
pd.items.items[0].add( np );
|
pd.items.items[0].add( np );
|
||||||
|
|||||||
Reference in New Issue
Block a user