Thank's to Bob's help I got a ChronoForm that will retrieve information from the database and put in on an email using "mailto":
This is how I have it now: A simple ChronoForm with a "submit" button and a text box, in the textbox I enter a search value (DPS#) and under the section called "On Submit code - after sending email" I have the code shown below which on submit will give me a "click here" option that creates the email using "mailto" with the information I have in my database.
In the other hand the above mentioned email should only be sent to some records in my table that comply with certain criteria, in that matter, I also have a list created with ChronoConnectivity of the records that "comply" with the mentioned criteria.
What I would like to do is to have a page with the list of records that comply with the condition and either next to each record or below the list, have the code that I pasted above that creates the email. Is that possible with CC? if it is, can you assist me with it?
This is how I have it now: A simple ChronoForm with a "submit" button and a text box, in the textbox I enter a search value (DPS#) and under the section called "On Submit code - after sending email" I have the code shown below which on submit will give me a "click here" option that creates the email using "mailto" with the information I have in my database.
<?php
$db =& JFactory::getDBO();
$query = "SELECT a.*,b.* FROM `#__tracker` a, `#__agents` b WHERE a.Agentname=b.name and a.DPS =".$db->quote(JRequest::getString('dps', '', 'post'));
$db->setQuery($query);
$data = $db->loadObject();
$dps = $data->DPS;
$OTRactions = $data->OTRactions;
$Agentname = $data->Agentname;
$KickbackReason = $data->KickbackReason;
$DPStype = $data->DPStype;
$Agentname = $data->Agentname;
$manager_email = $data->manager_email;
$agent_mail = $data->agent_mail;
$poc_email = $data->poc_email;
$body = "Automated $OTRactions DPS $dps due to the following reason: $KickbackReason";
$subject = "DPS KICKBACK: $DPStype $dps issued by $Agentname";
$mailto = "mailto: $agent_mail?cc=$manager_email; $poc_email&subject=$subject&body=$body";
echo "<a href='$mailto' >Click here</a>";
?>
In the other hand the above mentioned email should only be sent to some records in my table that comply with certain criteria, in that matter, I also have a list created with ChronoConnectivity of the records that "comply" with the mentioned criteria.
What I would like to do is to have a page with the list of records that comply with the condition and either next to each record or below the list, have the code that I pasted above that creates the email. Is that possible with CC? if it is, can you assist me with it?
Hi,
you may add the code above to the HTML area of a chronoform and add a link to the form at the footer section of CC
Cheers
Max
you may add the code above to the HTML area of a chronoform and add a link to the form at the footer section of CC
Cheers
Max
Hello Max, I was able to make it work just the way I wanted it ... embedded in the list... I include the code here for future users that may want the same:
Where:
Header:
Body:
Footer:
Thank you for your great assistance.. π
Where:
<?php
$user = JFactory::getUser()
?>
WHERE
OTRactions = "kickback"
Header:
<font face="Century Gothic" size="4" color="#000080"><b>Talisma Tracker for Resolution<br>
<u>Send Kickbacks</u></b><br>
<br>
<br>
</font>
<table style="text-align: left; width: 100%; font-family: Calibri; font-size: 10pt; color: #000000" border="0" cellpadding="2" cellspacing="0">
<tr>
<td style="font-weight: bold; width: 8%;border-right-style:solid; border-right-width:1px; border-bottom-style:solid; border-bottom-width:1px">DPS#</td>
<td style="font-weight: bold; width: 14%;border-right-style:solid; border-right-width:1px; border-bottom-style:solid; border-bottom-width:1px">Date / Time</td>
<td style="font-weight: bold; width: 10%;border-left-style:solid; border-left-width:1px; border-right-style:solid; border-right-width:1px; border-bottom-style:solid; border-bottom-width:1px">Case#</td>
<td style="font-weight: bold; width: 11%; border-left-style:solid; border-left-width:1px; border-right-style:solid; border-right-width:1px; border-bottom-style:solid; border-bottom-width:1px">Tag / Order</td>
<td style="font-weight: bold; width: 10%;border-left-style:solid; border-left-width:1px; border-right-style:solid; border-right-width:1px; border-bottom-style:solid; border-bottom-width:1px">Session ID</td>
<td style="font-weight: bold; width: 15%;border-left-style:solid; border-left-width:1px; border-right-style:solid; border-right-width:1px; border-bottom-style:solid; border-bottom-width:1px">Dispatcher</td>
<td style="font-weight: bold; width: 16%;border-left-style:solid; border-left-width:1px; border-bottom-style:solid; border-bottom-width:1px">Agent Name</td>
</tr>
Body:
<tr<?php if ($i % 2) echo ' style="background-color: #EBEBEB;"';?>>
<td style="width: 8%;border-right-style:solid; border-right-width:1px; border-top-style:solid; border-top-width:1px">
<?php
$db =& JFactory::getDBO();
$query = "SELECT a.*,b.* FROM #__tracker a, #__agents b WHERE a.Agentname=b.name and a.DPS = '".$row->DPS."'";
$db->setQuery($query);
$data = $db->loadObject();
$dps = $data->DPS;
$OTRactions = $data->OTRactions;
$Agentname = $data->Agentname;
$KickbackReason = $data->KickbackReason;
$Comments = $data->Comments;
$DPStype = $data->DPStype;
$Agentname = $data->Agentname;
$manager_email = $data->manager_email;
$agent_mail = $data->agent_mail;
$poc_email = $data->poc_email;
$body = "Automated $OTRactions DPS $dps due to the following reason: %0D%0D$KickbackReason%0D%0D$Comments";
$subject = "KICKBACK: $DPStype $dps issued by $Agentname";
$mailto = "mailto: $agent_mail?cc=$manager_email; $poc_email&subject=$subject&body=$body";
echo "<a href='$mailto' title='$KickbackReason'>{DPS}</a>";
?>
</td>
<td style="width: 14%;border-right-style:solid; border-right-width:1px; border-top-style:solid; border-top-width:1px">{time_date}</td>
<td style="width: 10%;border-left-style:solid; border-left-width:1px; border-right-style:solid; border-right-width:1px; border-top-style:solid; border-top-width:1px">{Case}</td>
<td style="width: 11%;border-left-style:solid; border-left-width:1px; border-right-style:solid; border-right-width:1px; border-top-style:solid; border-top-width:1px">{TagOrder}</td>
<td style="width: 10%;border-left-style:solid; border-left-width:1px; border-right-style:solid; border-right-width:1px; border-top-style:solid; border-top-width:1px">{SessionID}</td>
<td style="width: 15%;border-left-style:solid; border-left-width:1px; border-right-style:solid; border-right-width:1px; border-top-style:solid; border-top-width:1px">{Dispatcher}</td>
<td style="width: 16%;border-left-style:solid; border-left-width:1px; border-top-style:solid; border-top-width:1px">{Agentname}</td>
<?php $i++ ?>
</tr>
Footer:
</table>
<?php $i++ ?>
<br>
<br>
<script type="text/javascript">
window.addEvent('domready', function() {
var limit_select = $('limit').options;
if ( !limit_select ) return;
for ( var i = 0; i < limit_select.length; i++ ) {
if ( limit_select[i].value == 0 ) {
limit_select[i].value = 250;
limit_select[i].innerHTML = '250';
}
}
});
</script>
<div align="left">{pagination}</div>
<br />
Thank you for your great assistance.. π
great, thank you for posting it!π
Regards
Max
Regards
Max
Good day guys is me againπ now I am having another issue with the ChronoConnectivity table posted in this thread if my data specifically on a field called "kickbackreason" contains this symbol ' (single quote) in words like didn't, don't, won't etc... it will only show the data before that single quote... can you assist me fixing this?
basically is how can I make this instruction to bring all the information including the info after the quote:
basically is how can I make this instruction to bring all the information including the info after the quote:
$KickbackReason = $data->KickbackReason;
Nevermind guys I was able to do it using htmlentities() find more info here: http://php.net/htmlentities
This topic is locked and no more replies can be posted.