Ajout indiScoreData

This commit is contained in:
Michael RICOIS 2012-02-20 13:06:43 +00:00
parent 17c9b69058
commit 24546077c2

View File

@ -219,8 +219,6 @@ $tabDico = array(
'situationDernEven',
'indiScore',
'dirigeant',
'encours',
'dateBilan',
'bilanN',
'bilanN1',
'bilanN2',
@ -1043,6 +1041,33 @@ function annoncesData($siren, $nic, $values = false)
return $tabData;
}
function indiScoreEntete($values)
{
return array(
'indiScore',
'encours',
'dateBilan',
);
}
function indiScoreData($siren, $nic, $values = false)
{
$tabData = array();
$iDb = new WDB();
$ret = $iDb->select('jo.scores_surveillance', 'indiScore, encours, indiScoreDate, dateBilan, indiScorePre, encoursPre, indiScoreDatePre', 'siren='.$siren, false, MYSQL_ASSOC);
if (isset($ret[0]['indiScore'])) {
$tabData['indiScore'] = $ret[0]['indiScore'];
$tabData['encours'] = $ret[0]['encours'];
$tabData['dateBilan'] = $ret[0]['dateBilan'];
} else {
$iDb->insert('scores_surveillance', array('siren'=>$siren), false);
$tabData['indiScore'] = 'En cours';
$tabData['encours'] = 'En cours';
$ret = $iDb->select('jo.bilans', 'MAX(dateExercice) as dateBilan', 'siren='.$siren, false, MYSQL_ASSOC);
$tabData['dateBilan']= $ret[0]['dateBilan'];
}
}
/* == FUNCTION == */