[code]
docx = new CreateDocx();
$id = req('fd_id');
$field = Field_day::db_field_day($id);
$text = array();
$factory = new employee_factory();
$salesperson = new Salesperson($field->employee_id);
if(!($salesperson instanceof Salesperson))
die('You must be a salesperson to use the field day tool');
$filename = $salesperson->get_lname() . "_" . date('m-d-Y', strtotime($field->date)) . "_" . time();
$text[] = array('text'=>"Field Day For: " . $salesperson->get_full_name(), 'b'=>'on', 'lineBreak'=>'both');
$text[] = array('text'=>'Date: ' . $field->date);
$text[] = array('text'=>'Starting Mileage: ' . $field->starting_mileage . ' Ending Mileage: ' . $field->ending_mileage);
$docx->addText($text);
foreach($field->stops as $stop)
{
$text = array();
$stop['phone'] = 'change this, its static';
$text[]=array('text'=>'Referral: ' . $stop['name'], 'spaces'=>2, 'lineBreak'=>'after');
$text[]=array('text'=>'Mileage: ' . $stop['mileage'],'spaces'=>2, 'lineBreak'=>'after');
$text[]=array('text'=>'Address: ' . $stop['address'],'spaces'=>2, 'lineBreak'=>'after');
$text[]=array('text'=>'Phone: ' . $stop['phone'], 'spaces'=>2, 'lineBreak'=>'after');
$docx->addText($text);
$tbox = array(
'width'=> 18,
'height'=>10,
'padding_left'=> 1,
'padding_top'=>1,
'margin_top'=>2,
'margin_left'=>2,
'border'=> 5,
'border_color'=>'black'
);
$docx->addTextBox(array('text'=>$stop['note'], 'args'=>array(), $tbox));
$docx->addTextBox(array('text'=>$stop['result'], 'args'=>array(), $tbox));
}
$docx->createDocxAndDownload($filename);
[/code]
The problem I am having is that my 'lineBreak'=>'after' option is being ignored. I have tried using 'both' and 'before' also and don't get any results. My goal is to have each array in $text get added to a new line (I tried adding it like a paragraph using addText on each array of text, but that puts 10 pts of spacing after each line, and it is too large then).
Any suggestions would be very appreciated.