Bienvenido, Invitado
Recordarme

TEMA:

Forms 1 año 3 meses antes #238912

  • Autor del tema
  • trucks79
  • Fuera de línea
  • Senior Breezer
  • Senior Breezer
  • Mensajes: 88
  • Gracias recibidas: 0
I am still trying to see if this works for me.
what i am trying to do is-
create a series of forms that we can use at work to carry out monthly checks, almost all of the forms will consist of

Date box
approx 8-10 tick boxes for pre set questions
option to upload a couple of photos for evidence
signature

sounds simple but i need to be able to able to make sure that each form submitted is sent via email as a pdf and includes everything on the form including any pictures and signature rather than file attachment links.

can someone please advise how i can do this?

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Forms 1 año 3 meses antes #238925

  • mihaela
  • Fuera de línea
  • Developer
  • Developer
  • Mensajes: 3128
  • Karma: 105
  • Gracias recibidas: 415
Hello,

Here crosstec.org/en/support/online-documenta...68-admin-emails.html it is explained how to set a PDF attachment to be sent along with an email after the form is submitted.

You can change the looks of the PDF by alternating the pdf template as explained here crosstec.org/en/support/online-documenta...-s-pdf-template.html .

Here is the code for the template that should show images and signature in the PDF as you have explained:
<?php
/**
 * BreezingForms - A Joomla Forms Application
 * @version 1.8
 * @package BreezingForms
 * @copyright (C) 2008-2012 by Markus Bopp
 * @license Released under the terms of the GNU General Public License
 **/
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
// IMPORTANT!
// Supported Tags: h1, h2, h3, h4, h5, h6, b, u, i, a, img, p, br, strong, em, font, blockquote, li, ul, ol, hr, td, th, tr, table, sup, sub, small
?>
<table border="1" width="100%">
	<tr>
		<td colspan="2" bgcolor="#cccccc" align="left" valign="middle">
			<h2><?php echo $this->submitted; ?></h2>
		</td>
	</tr>
	<tr>
		<td>
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_ID') ?>:</strong>
		</td>
		<td>
			<?php echo $this->form; ?>
		</td>
	</tr>
	<tr>
		<td>
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_PROCESS_SUBMITTEDAT') ?>:</strong>
		</td>
		<td>
			<?php echo $this->submitted; ?>
		</td>
	</tr>
	<tr>
		<td>
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_IP') ?>:</strong>
		</td>
		<td>
			<?php echo $this->ip; ?>
		</td>
	</tr>
	<tr>
		<td>
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_BROWSER') ?>:</strong>
		</td>
		<td>
			<?php echo htmlentities($this->browser, ENT_QUOTES, 'UTF-8');  ?>
		</td>
	</tr>
	<tr>
		<td>
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_PROCESS_OPSYS') ?>:</strong>
		</td>
		<td>
			<?php echo htmlentities($this->opsys, ENT_QUOTES, 'UTF-8');  ?>
		</td>
	</tr>
	<tr>
		<td colspan="2" bgcolor="#cccccc">
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_DATA') ?>:</strong>
		</td>
	</tr>
	<?php
	if (count($xmldata)){
		foreach ($xmldata as $data) {
			?>
			<tr>
				<td>
					<strong>   <?php echo wordwrap(htmlentities($data[_FF_DATA_TITLE], ENT_QUOTES, 'UTF-8'), 40, '<br />', true); ?>:</strong>
				</td>
				<td>

					<?php if( $data[_FF_DATA_TYPE] == "File Upload" ) {
						 $image = nl2br(htmlentities(substr(is_array($data[_FF_DATA_VALUE]) ? implode('|',$data[_FF_DATA_VALUE]) : $data[_FF_DATA_VALUE],0,10000), ENT_QUOTES, 'UTF-8'));
                echo '<img src="' . $image . '" width="150" height="150" border="0"/> ' ; 
					}

					else { echo $data[_FF_DATA_TYPE] == 'Signature' && file_exists(JPATH_SITE.'/media/breezingforms/signatures/'.$data[_FF_DATA_VALUE]) ? '<img src="'.JPATH_SITE.'/media/breezingforms/signatures/'.$data[_FF_DATA_VALUE].'" />' : nl2br(htmlentities(substr(is_array($data[_FF_DATA_VALUE]) ? implode('|',$data[_FF_DATA_VALUE]) : $data[_FF_DATA_VALUE],0,10000), ENT_QUOTES, 'UTF-8')); } 
					 ?> 
				</td>
			</tr>
			<?php
		}
	}
	?>
</table>

I'm also sending you an example of a PDF generated for a test form using this code.


Let me know whether this is what you wanted to achieve.

Regards,

Mihaela
Adjuntos:
El siguiente usuario dijo gracias: trucks79

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Forms 1 año 3 meses antes #238938

  • Autor del tema
  • trucks79
  • Fuera de línea
  • Senior Breezer
  • Senior Breezer
  • Mensajes: 88
  • Gracias recibidas: 0
thanks mate i am now getting an error?

TCPDF ERROR: [Image] Unable to get the size of the image: /var/www/vhosts/jpsdocportal.co.uk/httpdocs/media/breezingforms/signatures/

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Forms need help ;( 1 año 3 meses antes #238941

  • Autor del tema
  • trucks79
  • Fuera de línea
  • Senior Breezer
  • Senior Breezer
  • Mensajes: 88
  • Gracias recibidas: 0
thanks, the screen shot you sent is perfect!
however i cant get it to work, i have removed and reinstalled breezing forms as i think i deleted some scripts in error

so so i replace all the code in the pdf_attachment file with the code that you put?

mihaela escribió: Hello,

Here crosstec.org/en/support/online-documenta...68-admin-emails.html it is explained how to set a PDF attachment to be sent along with an email after the form is submitted.

You can change the looks of the PDF by alternating the pdf template as explained here crosstec.org/en/support/online-documenta...-s-pdf-template.html .

Here is the code for the template that should show images and signature in the PDF as you have explained:

<?php
/**
 * BreezingForms - A Joomla Forms Application
 * @version 1.8
 * @package BreezingForms
 * @copyright (C) 2008-2012 by Markus Bopp
 * @license Released under the terms of the GNU General Public License
 **/
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
// IMPORTANT!
// Supported Tags: h1, h2, h3, h4, h5, h6, b, u, i, a, img, p, br, strong, em, font, blockquote, li, ul, ol, hr, td, th, tr, table, sup, sub, small
?>
<table border="1" width="100%">
	<tr>
		<td colspan="2" bgcolor="#cccccc" align="left" valign="middle">
			<h2><?php echo $this->submitted; ?></h2>
		</td>
	</tr>
	<tr>
		<td>
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_ID') ?>:</strong>
		</td>
		<td>
			<?php echo $this->form; ?>
		</td>
	</tr>
	<tr>
		<td>
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_PROCESS_SUBMITTEDAT') ?>:</strong>
		</td>
		<td>
			<?php echo $this->submitted; ?>
		</td>
	</tr>
	<tr>
		<td>
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_IP') ?>:</strong>
		</td>
		<td>
			<?php echo $this->ip; ?>
		</td>
	</tr>
	<tr>
		<td>
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_BROWSER') ?>:</strong>
		</td>
		<td>
			<?php echo htmlentities($this->browser, ENT_QUOTES, 'UTF-8');  ?>
		</td>
	</tr>
	<tr>
		<td>
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_PROCESS_OPSYS') ?>:</strong>
		</td>
		<td>
			<?php echo htmlentities($this->opsys, ENT_QUOTES, 'UTF-8');  ?>
		</td>
	</tr>
	<tr>
		<td colspan="2" bgcolor="#cccccc">
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_DATA') ?>:</strong>
		</td>
	</tr>
	<?php
	if (count($xmldata)){
		foreach ($xmldata as $data) {
			?>
			<tr>
				<td>
					<strong>   <?php echo wordwrap(htmlentities($data[_FF_DATA_TITLE], ENT_QUOTES, 'UTF-8'), 40, '<br />', true); ?>:</strong>
				</td>
				<td>

					<?php if( $data[_FF_DATA_TYPE] == "File Upload" ) {
						 $image = nl2br(htmlentities(substr(is_array($data[_FF_DATA_VALUE]) ? implode('|',$data[_FF_DATA_VALUE]) : $data[_FF_DATA_VALUE],0,10000), ENT_QUOTES, 'UTF-8'));
                echo '<img src="' . $image . '" width="150" height="150" border="0"/> ' ; 
					}

					else { echo $data[_FF_DATA_TYPE] == 'Signature' && file_exists(JPATH_SITE.'/media/breezingforms/signatures/'.$data[_FF_DATA_VALUE]) ? '<img src="'.JPATH_SITE.'/media/breezingforms/signatures/'.$data[_FF_DATA_VALUE].'" />' : nl2br(htmlentities(substr(is_array($data[_FF_DATA_VALUE]) ? implode('|',$data[_FF_DATA_VALUE]) : $data[_FF_DATA_VALUE],0,10000), ENT_QUOTES, 'UTF-8')); } 
					 ?> 
				</td>
			</tr>
			<?php
		}
	}
	?>
</table>

I'm also sending you an example of a PDF generated for a test form using this code.


Let me know whether this is what you wanted to achieve.

Regards,

Mihaela

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Forms need help ;( 1 año 3 meses antes #239026

  • Autor del tema
  • trucks79
  • Fuera de línea
  • Senior Breezer
  • Senior Breezer
  • Mensajes: 88
  • Gracias recibidas: 0
Thanks again, the issue I am getting is any pictures uploaded are too big for the box section and over shoots the box?

How can I set it so it resizes the picture to fit the box ? Like in your example

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Forms need help ;( 1 año 3 meses antes #239048

  • mihaela
  • Fuera de línea
  • Developer
  • Developer
  • Mensajes: 3128
  • Karma: 105
  • Gracias recibidas: 415
Hello,

This part should resize the pictures to fit:
echo '<img src="' . $image . '" width="150" height="150" border="0"/> ' ;

Is that not having effect?

Regards,

Mihaela

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

  • Página:
  • 1
Tiempo de carga de la página: 0.106 segundos