Advertisement
Guest User

Untitled

a guest
Jul 4th, 2013
991
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.53 KB | None | 0 0
  1. $styleTable = array('borderColor'=>'#006699',
  2.                   'borderSize'=>6,
  3.                   'cellMargin'=>50,
  4.                   'valign'=>'center');
  5.         $styleFirstRow = array('bgColor'=>'#6086B8',
  6.                                 'color'=>'white',
  7.                                 'bold'=>true,
  8.                                 'size'=>11,
  9.                                 'valign'=>'center'
  10.                                 );
  11.         $PHPWord->addTableStyle('myTable', $styleTable, $styleFirstRow);
  12.  
  13.         $styleCell = array('valign'=>'center');
  14.        
  15.         // initialisation de la variable id_form
  16.         $id_form = $message[0]['id_form'];
  17.         // Ajout du type item sur la ligne
  18.         $section->addText('Validation de l\'item : '.$id_item.' '.utf8_decode($this->Structure->getLibelleItemById($id_item, $id_form)), array('name'=>'Verdana', 'color'=>'006699'));
  19.         // Add table
  20.         $table = $section->addTable('myTable');
  21.  
  22.         // Add row
  23.         $table->addRow(1200);
  24.         // Add Title Cell
  25.         $table->addCell(2200, $styleCell)->addText('Type du rapporteur');
  26.         $table->addCell(2200, $styleCell)->addText('Nom du rapporteur');
  27.         $table->addCell(2200, $styleCell)->addText(utf8_decode('Validé ou refusé'));
  28.         $table->addCell(2200, $styleCell)->addText('Commentaire');
  29.         // Add cells
  30.         for($i=0;$i<count($message);$i++){
  31.             $table->addRow(1200);
  32.             $table->addCell(2200, $styleCell)->addText(utf8_decode($message[$i]['rapporteur']));
  33.             $table->addCell(2200, $styleCell)->addText(utf8_decode($message[$i]['name']));
  34.             $table->addCell(2200, $styleCell)->addText(utf8_decode(($message[$i]['valeur']?'Validé':'Refusé')));
  35.             $table->addCell(2200, $styleCell)->addText(utf8_decode($message[$i]['commentaire']));
  36.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement