issue #0001687: generate start date from db

This commit is contained in:
Arman KYOKCHAN 2013-08-22 13:23:41 +00:00
parent 56f3a99dad
commit 2319e1f136
6 changed files with 28 additions and 32 deletions

View File

@ -319,13 +319,13 @@ class GiantController extends Zend_Controller_Action
$this->getRequest()->getParam('CompanyName')
);
$this->view->result = $result;
$merged =Array();
foreach ($result->MonitoringEvents->MonitoringEvent as $MonitoringEvent):
if ($merged[$MonitoringEvent->Company->Event[0]->EventCode]){
array_push($merged[$MonitoringEvent->Company->Event[0]->EventCode],$MonitoringEvent) ;
array_push($merged[$MonitoringEvent->Company->Event[0]->EventCode],$MonitoringEvent) ;
} else {
$merged[$MonitoringEvent->Company->Event[0]->EventCode][]=$MonitoringEvent;
$merged[$MonitoringEvent->Company->Event[0]->EventCode][]=$MonitoringEvent;
}
endforeach;
$this->view->val = $merged;
@ -340,6 +340,7 @@ class GiantController extends Zend_Controller_Action
$this->TestIndication,
'RetrieveMonitoringEventsForCustomer'
);
$this->view->resultDB = $resultDB;
$this->view->result = $result;
$merged =Array();
@ -351,7 +352,7 @@ class GiantController extends Zend_Controller_Action
}
endforeach;
$this->view->val = $merged;
$merged_siren =Array();
foreach ($result->MonitoringEvents->MonitoringEvent as $MonitoringEvent):
if ($merged_siren[$MonitoringEvent->Company->CompanyId]){
@ -361,6 +362,12 @@ class GiantController extends Zend_Controller_Action
}
endforeach;
$this->view->val_siren = $merged_siren;
}
public function retAction()
{
$giantController = new GiantControllerLib();
$resultDB = $giantController->retrivDB($this->getRequest()->getParam('date_st'));
print_r($resultDB[0]['ActualStartDate']);
}
}

View File

@ -8,12 +8,14 @@ class Application_Model_MonitoringGiants extends Zend_Db_Table_Abstract
{
protected $_name = 'monitoring_giants';
public function getRetrive($companyId, $Language)
public function getRetrive($date_st)
{
$sql = $this->select();
$sql = $this->select()
->where('ProviderOrderId = ?', (int)$date_st)
->limit(1);
$result = $this->getAdapter()->fetchAll($sql);
return ($result);
}
}
?>
?>

View File

@ -88,17 +88,16 @@ par
<thead>
<tr>
<th width="75">Siren</th>
<th width="150">Raison Sociale</th>
<th width="90">Référence</th>
<th width="110">Raison Sociale</th>
<th width="150">Surveillance</th>
<th width="75">Ajout le</th>
<th width="75">Envoyé le</th>
<th width="110">Ajout le</th>
<th width="110">Envoyé le</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->val_siren as $monitor) {?>
<pre><? print_r($monitor);?></pre>
<pre><? //print_r($monitor);?></pre>
<tr>
<td class="aleft">
<p><?=$monitor[0]->Company->CompanyId ?></p>
@ -106,28 +105,16 @@ par
<td>
<p><?=$monitor[0]->Company->CompanyName['0']->_ ?></p>
</td>
<td>
<?php
foreach ($monitor as $monitor_order) {
?><p><?=$monitor_order->ProviderOrderId?></p><?
}
?>
</td>
<td style='text-align: left'>
<?php
foreach ($monitor as $monitor_type) {
echo "<p>".$monitor_type->Company->Event[0]->EventCode."</p>";
echo "<p>".$monitor_type->Company->Event[0]->EventCode."</p>";
} //Fin foreach?>
</td>
<td>
<?php
foreach ($monitor as $monitor_type) {
echo "<p>".$monitor_type->Company->Event[0]->Date->_."</p>";
echo "<p>".$this->action('ret', 'giant',null,array('date_st'=>$monitor_type->ProviderOrderId)).'</p>';
}
?>
</td>

View File

@ -137,10 +137,10 @@ Class GiantControllerLib
return ($result);
}
public function retrivDB()
public function retrivDB($date_st)
{
$Rapport = new Rapports();
$id = $Rapport->getRetrive();
$id = $Rapport->getRetrive($date_st);
return $id;
}
public function retrive($StartFrom,$TestIndication,$EventType)

View File

@ -121,10 +121,10 @@ Class Rapports
$id = $rapports->getReportById($companyId, $Language);
return ($id);
}
public function getRetrive()
public function getRetrive($date_st)
{
$rapports = new Application_Model_MonitoringGiants();
$id = $rapports->getRetrive();
$id = $rapports->getRetrive($date_st);
return ($id);
}
}