issue #0001700: DB log for Options

This commit is contained in:
Arman KYOKCHAN 2013-09-10 13:53:27 +00:00
parent 1a209af098
commit 8fc68ff6c6
6 changed files with 64 additions and 20 deletions

View File

@ -75,7 +75,9 @@ class GiantController extends Zend_Controller_Action
$total = 0;
$liste = $giantFunction->divCommande($listeCommandes, $total);
$ListeRapport = new GiantRechercheController($params['pays'], $this->TestIndication);
$result = $ListeRapport->ListeRapport($this->getRequest()->getParam('CompanyId'));
$giantController = new GiantControllerLib($this->getRequest()->getParam('CompanyId'));
$resultDB = $giantController->commandePays($this->getRequest()->getParam('CompanyId'),$params['pays'], $this->TestIndication);
$result = unserialize($resultDB);
$this->view->total = $total;
$this->view->listeCommandes = $liste;
$this->view->modification = (isset($result->MonitoringOptions))?($ListeRapport->getModification($result->MonitoringOptions->MonitoringOption[0])):null;
@ -377,9 +379,8 @@ class GiantController extends Zend_Controller_Action
public function retAction()
{
$giantController = new GiantControllerLib();
$type = $this->getRequest()->getParam('type');
$resultDB = $giantController->retrivDB($this->getRequest()->getParam('date_st'));
print_r($resultDB[0][$type]);
print_r(serialize($resultDB[0]));
}
public function reteventsAction()
{

View File

@ -0,0 +1,20 @@
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
class Application_Model_PaysGiants extends Zend_Db_Table_Abstract
{
protected $_name = 'pays_giants';
public function getPays($pays)
{
$sql = $this->select()
->where('pays = ?', $pays);
$result = $this->getAdapter()->fetchRow($sql);
return ($result);
}
}
?>

View File

@ -132,7 +132,7 @@
<?php if(!empty($this->modification)): ?>
<h1>Liste des monitoring<img style="margin-top:4px;float:right" src="/themes/default/images/giant/expanded.gif" ></h1>
<div class='monitor_but'>
<!-- <div class='monitor_but'>
<a class="dial" title="Start Monitoring" href='/giant/startmonitoring/CompanyId/<?=$this->CompanyId?>/Pays/<?=$this->Pays?>/lang/<?=serialize($this->listeRapport->MonitoringOptions->MonitoringOption[0]->LanguageCodes->LanguageCode)?>/CompanyName/<?=str_replace(' ', '+', $this->raisonSociale)?>'>Start monitoring</a>
<a class="dial" title="Stop Monitoring" href='/giant/stopmonitoring/CompanyId/<?=$this->CompanyId?>/Pays/<?=$this->Pays?>/CompanyName/<?=str_replace(' ', '+', $this->raisonSociale)?>'>Stop monitoring</a>
<a class="dial" title="Update Monitoring" href='/giant/updatemonitoring/CompanyId/<?=$this->CompanyId?>/Pays/<?=$this->Pays?>/lang/<?=serialize($this->listeRapport->MonitoringOptions->MonitoringOption[0]->LanguageCodes->LanguageCode)?>/CompanyName/<?=str_replace(' ', '+', $this->raisonSociale)?>'>Update monitoring</a>
@ -150,12 +150,12 @@
<option value='Order'>Order</option>
</select><br /><br />
<strong>StartFrom: </strong><br />
<input type="text" name="StartFrom" value="" /> optional<br /><br />
<input type="text" name="StartFrom" value="" /><br /><br />
<div class='int_order'><strong>InternalOrderId: </strong><br />
<input type="text" class='datepicker' name="InternalOrderId" value="32768032781"/> <br /><br /></div>
<input type="text" name="InternalOrderId" value="32768032781"/> <br /><br /></div>
</fieldset>
</form>
</div>
</div> -->
<?php echo'<pre>';print_r($this->modification); ?>
<?php endif;?>

View File

@ -81,32 +81,28 @@ if ( empty($this->source) ){
}
endforeach;
?>
<?$resultDB=unserialize($this->action('ret', 'giant',null,array('date_st'=>current($merged_type)[0]->ProviderOrderId)));?>
<pre><?var_dump($resultDB);?></pre>
<tr>
<td>
<p><?=$MonitoringEv[0]->Company->CompanyName['0']->_ ?> (<?=$MonitoringEv[0]->Company->CompanyId ?>)</p>
<a class="dialogsurv dial" title="Start Monitoring" href='/giant/startmonitoring/CompanyId/<?=$this->CompanyId?>/Pays/<?=$this->Pays?>/lang/<?=serialize($this->listeRapport->MonitoringOptions->MonitoringOption[0]->LanguageCodes->LanguageCode)?>/CompanyName/<?=str_replace(' ', '+', $this->raisonSociale)?>'><img src="/themes/default/images/interfaces/ajouter.png"/></a>
<a class="dialogsurv dial" title="Stop Monitoring" href='/giant/stopmonitoring/CompanyId/<?=$this->CompanyId?>/Pays/<?=$this->Pays?>/CompanyName/<?=str_replace(' ', '+', $this->raisonSociale)?>'><img src="/themes/default/images/interfaces/supprimer.png"/></a>
<a class="dialogsurv dial" title="Update Monitoring" href='/giant/updatemonitoring/CompanyId/<?=$this->CompanyId?>/Pays/<?=$this->Pays?>/lang/<?=serialize($this->listeRapport->MonitoringOptions->MonitoringOption[0]->LanguageCodes->LanguageCode)?>/CompanyName/<?=str_replace(' ', '+', $this->raisonSociale)?>'><img src="/themes/default/images/interfaces/editer.png"/></a>
<a class="dialogsurv dial" title="Start Monitoring" href='/giant/startmonitoring/CompanyId/<?=$MonitoringEv[0]->Company->CompanyId?>/Pays/<?=$resultDB->Pays?>/lang/<?=serialize($resultDB->Language)?>/CompanyName/<?=str_replace(' ', '+',$MonitoringEv[0]->Company->CompanyName['0']->_)?>'><img src="/themes/default/images/interfaces/ajouter.png"/></a>
<a class="dialogsurv dial" title="Stop Monitoring" href='/giant/stopmonitoring/CompanyId/<?=$MonitoringEv[0]->Company->CompanyId?>/Pays/<?=$resultDB->Pays?>/CompanyName/<?=str_replace(' ', '+', $MonitoringEv[0]->Company->CompanyName['0']->_)?>'><img src="/themes/default/images/interfaces/supprimer.png"/></a>
<a class="dialogsurv dial" title="Update Monitoring" href='/giant/updatemonitoring/CompanyId/<?=$MonitoringEv[0]->Company->CompanyId?>/Pays/<?=$resultDB->Pays?>/lang/<?=serialize($resultDB->Language)?>/CompanyName/<?=str_replace(' ', '+', $MonitoringEv[0]->Company->CompanyName['0']->_)?>'><img src="/themes/default/images/interfaces/editer.png"/></a>
</td>
<td>
<?php
foreach ($merged_type as $monitor_type) {
echo "<p>".$this->action('ret', 'giant',null,array('date_st'=>$monitor_type->ProviderOrderId, 'type'=>'ActualStartDate')).'</p>';
}
echo "<p>".$resultDB['ActualStartDate'].'</p>';
?>
</td>
<td>
<?php
foreach ($merged_type as $monitor_type) {
echo "<p>".$this->action('ret', 'giant',null,array('date_st'=>$monitor_type->ProviderOrderId, 'type'=>'ActualEndDate')).'</p>';
}
echo "<p>".$resultDB['ActualEndDate'].'</p>';
?>
</td>
<td>
<?php
foreach ($merged_type as $monitor_type) {
echo "<p>".$this->action('ret', 'giant',null,array('date_st'=>$monitor_type->ProviderOrderId, 'type'=>'Language')).'</p>';
}
echo "<p>".$resultDB['Language'].'</p>';
?>
</td>
<td>

View File

@ -68,6 +68,18 @@ Class GiantControllerLib
return ($id);
}
public function commandePays($CompanyId,$Pays,$TestIndication)
{
$Rapport = new Rapports($Pays, $TestIndication);
$id = $Rapport->getPaysExist($Pays)['result'];
if(empty($id)) {
$rapport = new GiantRechercheController($Pays, $TestIndication);
$result = $rapport->ListeRapport($CompanyId);
$result = serialize($result);
$id = $Rapport->setPaysReport($Pays,$result);
}
return ($id);
}
public function startmonitoring($CompanyId, $CategorieName, $EventType, $PreferredStartDate, $PreferredEndDate, $Version, $LanguageCode,$Pays,$TestIndication,$CompanyName)
{

View File

@ -108,7 +108,16 @@ Class Rapports
$report->insert($datas);
return ($reportSerial);
}
public function setPaysReport($pays, $reportSerial)
{
$report = new Application_Model_PaysGiants();
$datas = array('date' => date('Y-m-d'),
'pays' => $pays,
'result' => $reportSerial,
);
$report->insert($datas);
return ($reportSerial);
}
public function getRapportExist($companyId, $type, $Language)
{
$rapports = new Application_Model_RapportsGiants();
@ -121,6 +130,12 @@ Class Rapports
$id = $rapports->getReportById($companyId, $Language);
return ($id);
}
public function getPaysExist($pays)
{
$rapports = new Application_Model_PaysGiants();
$id = $rapports->getPays($pays);
return ($id);
}
public function getRetrive($date_st)
{
$rapports = new Application_Model_MonitoringGiants();