1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| public function listerpararchiveAction()
{
// On récupère l'ID de l'archive passé en Get
if ( $this->getRequest()->isGet() ) {
$archive = $this->getRequest()->getParam( 'num_archive' ); //echo $archive;
$archive = str_replace('__', '/', $archive);
}
$scelles = new Application_Model_DbTable_Scelles();
$select = $scelles->select()
->setIntegrityCheck(false)
->from (array('sc'=>'scelles'))
->joininner (array('sr'=>'service'),'sr.id=sc.id_service',array('nom_service'=>'sr.nom'))
->where ( 'sc.num_archive="' . $archive . '"' )
->order(array('sc.id desc'));
// exit ("$select");
//*** TEST TINYBUTSTRONG ***
$TBS = new clsTinyButStrong;
$TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
$TBS->LoadTemplate(APPLICATION_PATH . '\..\library\tbs_plugin_opentbs_1.7.4\tbs.odt'); // Load the archive 'document.odt'.
//Prepare some data for the demo
$data = array();
$data[] = array('firstname'=>'Sandra' , 'name'=>'Hill' , 'number'=>'1523d', 'score'=>200, 'email_1'=>'sh@tbs.com', 'email_2'=>'sandra@tbs.com', 'email_3'=>'s.hill@tbs.com');
$data[] = array('firstname'=>'Roger' , 'name'=>'Smith' , 'number'=>'1234f', 'score'=>800, 'email_1'=>'rs@tbs.com', 'email_2'=>'robert@tbs.com', 'email_3'=>'r.smith@tbs.com' );
$data[] = array('firstname'=>'William', 'name'=>'Mac Dowell', 'number'=>'5491y', 'score'=>130, 'email_1'=>'wmc@tbs.com', 'email_2'=>'william@tbs.com', 'email_3'=>'w.m.dowell@tbs.com' );
//Merge data
$TBS->MergeBlock('a,b', $data);
//Define the name of the output file
$file_name = 'test-tbs-' . date('Y-m-d') . '.odt';
//$TBS->Plugin(OPENTBS_DEBUG_XML_SHOW);
$TBS->Show(OPENTBS_DOWNLOAD, $file_name);
$this->view->scelles = $scelles->fetchAll($select);
} |
Partager