• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: RSform Pro - Community Builder Fields

RSform Pro - Community Builder Fields 8 years 2 weeks ago #36741

  • pereira.edgar
  • pereira.edgar's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 1
Hi,
i have put this code in default value on one field of my form:
//<code>
$user   = JFactory::getUser();
$db   = JFactory::getDbo();
$userId  = $user->get('id');
 
// Is the user logged in?
if ($userId) {
  // Grab the value from the database.
    $db->setQuery("SELECT `cb_info_client` FROM `#__comprofiler` WHERE `user_id`='".$userId."'");
    return $db->loadResult();
}
//</code>

This work properly and i can obtain the value of the fiels in form! But i use one script to create emails after the user has click on send button!

My problem is where this field is placed on the mail, i cannot see the content of field in mail but i can see only the content of code!

Can you help me to put this on correct format?

Here the code of my script mail:
$modAdminEmailText = $form->UserEmailText;
$modAdminEmailText= "<table style=\"width: 100%;\">
<tbody>
<tr>
<td>&nbsp;<img src=\"http://www.xxxxxxxx.ch/images/Logo__color_150_1200.png\" alt=\"Logo OG\" width=\"200\" height=\"86\" /></td>
<td>&nbsp;</td>
<td style=\"text-align: right; vertical-align: top;\">
<p><span style=\"font-size: 10pt;\">xxxxxxx SA</span><br /><span style=\"font-size: 10pt;\">Route des Tuileries 9, Z.I.</span><br /><span style=\"font-size: 10pt;\">1754 Ros&eacute;<br />http://www-xxxxxxxx.ch<br />+41 26 470 45 45</span></p>
</td>
</tr>
</tbody></table>
 
<p style=\"text-align: center;\"><span style=\"font-size: 15pt; text-align: center;\"><strong>Commande de Livraison / Bestellung Lieferung&nbsp;n&deg; {Commande ID :value}</strong></span></p>
 
<table style=\"width: 100%;\">
<tbody>
<tr>
<td style=\"width: 33%;\"><span style=\"font-size: 10pt;\">{InfoContrat_NePasRenommer:value}</span></td>
<td style=\"width: 33%;\"><span style=\"font-size: 10pt;\">{ClientAdresseIntervention_NePasRenommer:value}</span></td>
<td style=\"width: 33%;\"><span style=\"font-size: 10pt;\">{ClientContactIntervention_NePasRenommer:value}</span></td>
</tr>
</tbody>
</table>
<br>
<p><span style=\"font-size: 10pt;\"><strong>Donneur d'ordre / Auftraggeber:</strong></span><span style=\"font-size: 13.3333px;\">&nbsp; {DonneurDordreNom_NePasRenommer:value} / T&eacute;l&eacute;phone:&nbsp;</span><span style=\"font-size: 13.3333px;\">{DonneurDordreTel_NePasRenommer:value}</span><br>
 
<span style=\"font-size: 10pt;\"><strong>Jour de passage souhait&eacute; / Tageskarte erforderlich (1)</strong>: {Calendrier_NePasRenomer:value} {Heure_Passage_NePasRenomer:value}</span></p>
<table style=\"width: 100%;\">
<tbody>
<tr>
<td style=\"width: 33%;\"><span style=\"font-size: 10pt;\"><strong>Informations compl&eacute;mentaires / Zus&auml;tzliche Informationen:</strong></span></td>
<td><span style=\"font-size: 10pt;\">&nbsp;{Info_Comp_NePasRenomer:value}</span></td>
</tr>
</tbody>
</table>
<br>
<table style=\"background-color:#ffffff;border-collapse:collapse; width:100%;bordercolor=\"black\"\">
<tr>
<th style=\"width:40%;padding:5px;border:1px solid #9b9f8f; font-size:8pt; color:white; background-color:#404041;text-align:left;\">Désignation<br>Bezeichnung</th>
<th style=\"width:7%;padding:5px;border:1px solid #9b9f8f; font-size:8pt; color:white; background-color:#404041;\">Image</th>
<th style=\"width:13%;padding:5px;border:1px solid #9b9f8f; font-size:8pt; color:white; background-color:#404041;\">Capacité, Dimensions<br>Kapazität, Größe</th>
<th style=\"width:5%;padding:5px;border:1px solid #9b9f8f; font-size:8pt; color:white; background-color:#404041;\">Quantité<br>Menge</th>
<th style=\"width:15%;padding:5px;border:1px solid #9b9f8f; font-size:8pt; color:white; background-color:#404041;\">Pour quoi?<br>Welchen Abfall?</th>
<th style=\"width:20%;padding:5px;border:1px solid #9b9f8f; font-size:8pt; color:white; background-color:#404041;\">Infos</th>
</tr>
 ";
 
$ligneA = 1 ;
$ligneB = 1 ;
 
foreach($_POST['form'] as $component=>$value){
  if(is_array($value)) $value = implode(',',$value);
    if($value != '' && $component != 'formId'){
		if($component == "Confirmation_NePasRenommer"){
			continue;
		}else if($component == "Calendrier_NePasRenomer"){
			continue;
		}else if($component == "Heure_Passage_NePasRenomer"){
			continue;
		}else if($component == "DonneurDordreNom_NePasRenommer"){
			continue;
		}else if($component == "DonneurDordreTel_NePasRenommer"){
			continue;
		}else if($component == "Info_Comp_NePasRenomer"){
			continue;
		}else if($component == "SIC_Client"){
			continue;
		}else if (strlen(strstr($component,"Commande"))>0) {
			continue;
		}else if (strlen(strstr($component,"_Type"))>0) {
  			$modAdminEmailText .= '<td style="padding:5px;border:1px solid#9b9f8f;font-size:10pt;text-align:left;vertical-align:middle;"> {'.str_replace('</p>', '', $component).':caption} </td>';
			//$modAdminEmailText .= '<td style="padding:5px;border:1px solid#9b9f8f;font-size:10pt;text-align:center;vertical-align:middle;"> {'.$component.':value} </td>';
		}else if (strlen(strstr($component,"_Contenant"))>0) {
			$modAdminEmailText .= '<td style="padding:5px;border:1px solid#9b9f8f;font-size:10pt;text-align:center;vertical-align:middle;"> {'.(str_replace('</p>', '', $component)).':caption} </td>';
		}else if (strlen(strstr($component,"_Capacite"))>0) {
			$modAdminEmailText .= '<td style="padding:5px;border:1px solid#9b9f8f;font-size:10pt;text-align:center;vertical-align:middle;"> {'.$component.':caption}</td>';
		}else if (strlen(strstr($component,"_Quantite"))>0) {
			$modAdminEmailText .= '<td style="padding:5px;border:1px solid#9b9f8f;font-size:10pt;text-align:center;vertical-align:middle;"> {'.$component.':value} </td>';
		}else if (strlen(strstr($component,"_Com"))>0) {
			$modAdminEmailText .= '<td style="padding:5px;border:1px solid#9b9f8f;font-size:10pt;text-align:center;vertical-align:middle;"> {'.$component.':value} </td>';
			$modAdminEmailText .= '<td style="padding:5px;border:1px solid#9b9f8f;font-size:10pt;text-align:center;vertical-align:middle;"> {Art'.$ligneB.'_Infos_utiles:value}</td></tr>';
			$ligneB = $ligneB + $ligneA ;
		}
		else {
			$modAdminEmailText .= '<td style="padding:5px;border:1px solid#9b9f8f;font-size:10pt;text-align:center;vertical-align:middle;"> {'.$component.':caption}: {'.$component.':value} </td>';
		}
	}
}
 
 
 
 
 
 
$modAdminEmailText .= "</tr></table><br/><br/> {Warning_NePasRenommer:value}";				// Finalise la génération du squelette du mail et ajoute les warnings
$modAdminEmailText .= '<p style="text-align: center;"><span style="font-size: 14pt;"><strong><span style="color: #ff7238;">Merci pour votre demmande!</span></strong></span></p>
<p style="text-align: center;">Elle sera trait&eacute;e dans les meilleurs d&eacute;lais et nous restons a votre disposition en cas de questions.</p>
<p>&nbsp;</p>
<p style="text-align: center;"><span style="font-size: 14pt;"><strong><span style="color: #ff7238;">Vielen Dank f&uuml;r Ihre Anfrage!</span></strong></span></p>
<p style="text-align: center;">Es wird so bald wie m&ouml;glich und wir stehen zu Ihrer Verf&uuml;gung f&uuml;r Fragen behandelt.</p>
<p style="text-align: center;">&nbsp;</p>';
 
$userEmail['text'] = $modAdminEmailText;													// Remplace le contenu du mail par défaut
$userEmail['text'] = str_replace($placeholders, $values, $userEmail['text']);				// Ajour des saisies de l'utilisateur
$userEmail['text'] = str_replace('width="101" />', 'width="36" />', $userEmail['text']);	// redimensionement des images
$userEmail['text'] = str_replace('Contenant / Enthalten:<br>', '', $userEmail['text']); 	// supression de l'entête contenant dans image
$userEmail['text'] = str_replace('Infos utiles / Fakten <br>', '', $userEmail['text']); 	// supression de l'entête infos
$userEmail['text'] = str_replace('Capacité / Kapazität<br>', '', $userEmail['text']); 	// supression de l'entête infos
$userEmail['text'] = str_replace('<br>Dimensions / Maße <br>', '', $userEmail['text']); 	// supression de l'entête infos
$userEmail['text'] = str_replace('<br>0<br>', '<br><br>', $userEmail['text']); 	// supression de l'entête infos
 
 
 
 
 
// DEBUG
//print_r($_POST);	// debug donne les infos saisies par l'utilisateur
print_r($userEmail['text']);	// debug montre le contenu de l'email
 
print_r($ligneB);	// debug montre le nombre de lignes travaillées
 
$rows = $userEmail.getElementsByTagName("tr");
print_r($rows);	// debug montre le nombre de lignes travaillées
 
 
die();	// avorte la suite du traitement et de l'envoi
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!