[Solved] Can I do this with ChronoConnectivity ?

codeslayer 19 Nov, 2008
Hi !

I am new to joomla and Chronoform / ChronoConnectivity.
I am creating a simple timesheet application for my persoanl use.
After spending days, reading tutorials and searching forum, I have successfully made a form that send the results to email and database. The form "CFT2" is then linked to "Forms" in my joomla Menu. Using ChronoConnectivity, I made connection "cf_results" and linked it to my joomla menu "Results".

So far so good.

Now, I would like to know if the following tasks are possible to achieve:-

1, Display only first column of result (Entry_Date) on each row. With options Edit and Delete the row option.
2, Complete result should displayed upon clicking the “Entry_Date” (clickable) should also have Edit and Delete options.

Please help me achieving these tasks. lightbulb

I am attaching here my form backup and also chronosonnectitvity connection codes.

Body

<hr>
<table border="0" width="100%" id="table1" cellspacing="3" cellpadding="2">
	<tr>
		<td bgcolor="#99CCFF"><b>Entry Date</b></td>
		<td bgcolor="#99CCFF"><b>City</b></td>
		<td bgcolor="#99CCFF"><b>Customer</b></td>
		<td bgcolor="#99CCFF"><b>Cash Management Consultant</b></td>
		<td bgcolor="#99CCFF"><b>Segment</b></td>
	</tr>
	<tr>
		<td>{Entry_Date}</td>
		<td>{City}</td>
		<td>{Customer}</td>
		<td>{Cash_Management_Consultant}</td>
		<td>{Segment}
</td>
	</tr>
	<tr>
		<td bgcolor="#99CCFF"><b>Product</b></td>
		<td bgcolor="#99CCFF"><b>Booking Location</b></td>
		<td bgcolor="#99CCFF"><b>Probability of Success</b></td>
		<td bgcolor="#99CCFF"><b>Pipeline Entry Date</b></td>
		<td bgcolor="#99CCFF"><b>Latest Customer Follow-up Date</b></td>
	</tr>
	<tr>
		<td>{Product}</td>
		<td>{Booking_Location}</td>
		<td>{Prob_of_Success}</td>
		<td>{Pipeline_Entry_Date}</td>
		<td>{Latest_Customer_FD}</td>
	</tr>
	<tr>
		<td bgcolor="#99CCFF"><b>Expected / Actual Close Date</b></td>
		<td bgcolor="#99CCFF"><b>Expected Deal Revenue</b></td>
		<td bgcolor="#99CCFF"><b>Revenue_2007</b></td>
		<td bgcolor="#99CCFF"><b>Current_Status</b></td>
		<td bgcolor="#99CCFF"><b>Deal_Description</b></td>
	</tr>
	<tr>
		<td>{Ex_Act_Close_Date}</td>
		<td>{Expected_Deal_Revenue}</td>
		<td>{Revenue_2007}</td>
		<td>{Current_Status}</td>
		<td>{Deal_Description}</td>
	</tr>
	<tr>
		<td bgcolor="#99CCFF"><b>Remarks</b></td>
		<td bgcolor="#99CCFF"><b>Customer Name & Contact Details</b></td>
	</tr>
	<tr>
		<td>{Remarks}</td>
		<td>{Cust_Name_Contact_Details}</td>
	</tr>
</table>
<br>
<hr>


Footer

<br>
<strong>
The End of results.
</strong>
Max_admin 19 Nov, 2008
Hi,

you will make a new connection and call it for example "fulldetails", now at your body code above convert this: {Entry_Date} to :
<a href="link to new connection + &entry={primary_key_name}">{Entry_Date}</a>


at your new connection set the WHERE tag to have this :

WHERE primary_key_name = "<?php echo JRequest::getVar('entry') ; ?>"


design a new body for your new connection!

you can add the edit/delete links any where by adding {edit_record} or {delete_record}

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
codeslayer 20 Nov, 2008
Thanks for the code Max,

My results are working exactly just as i want. 😀
However, {edit_record} and {delete_record} are not working.
I have pasted {edit_record} and {delete_record} an the end of Body layout. No button or option to edit or delete is showing after the results.

any ideas ?

One more thing,
Is it possible to have the interface just as its being displayed at the admin backend. i.e "Show Data" in Chrono Connectivity - Connections Manager

regards
CS
batmon 20 Nov, 2008
There are two more fields towards the end, "edit link code" and "delete link code". You need to type in something link "edit" and "delete" so it will show up in your frontend page.
Max_admin 20 Nov, 2008
Hi codeslayer, the first part's answer is just as batmon said, the 2nd part is your HTML layout task, we can't do this except with special HTML/CSS!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
codeslayer 21 Nov, 2008
Hi,

I have tried this option too.
but still no Edit/Delete/New option is displaying any where on the results page.

just in case if needed to know, I am using chronoconnectivity version 1.2.

anymore suggestions, Please

Regards

CS
Max_admin 21 Nov, 2008
show me your general tab full screenshot!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
codeslayer 21 Nov, 2008
Thanks for your reply Max.

The screenshot is attached herewith, please check.

The complete codes is as follows:

Name:
cf_results


TableName(s):
jos_chronoforms_CTF2


WHERE SQL:
Blank - No Code here


Header:
This my data extraction example.
{pagination}
<hr>

<?php
$i = 0;
?>


Body:
<table style="text-align: left; width: 100%;" border="0"
cellpadding="0" cellspacing="0">
  <tbody>
    <tr<?php if ($i % 2) echo ' style="background-color: #EBEBEB;"';?>>
      <td><a href="index.php?option=com_chronoconnectivity&connectionname=fulldetails+&entry={cf_id}">{Entry_Date}</a></td>
	  <td>{Customer}</td>
	  <td>{City}</td>
          <td>{edit_record}</td>
    </tr>
  </tbody>
</table>
<?php $i++ ?>


Footer:
<hr>
<br>
<strong>
The End of results.
</strong>
<br>
{pagination}

<?php $i++ ?>


Body Loop:
Inside Body Loop


Order fields:
Blank - No code here


Header/Title:
Blank - No code here


POST Variables:
Blank - No code here


GET Variables:
Blank - No code here


Frontend Filtering:
Blank - No code here


Enable Mambots:
Blank - No code here


Delete Link Code:
Delete


Edit Link Code:
Edit


New Link Code:
New Record


I hope this would help.😀
Max_admin 21 Nov, 2008
Hi, did you set the permissions in the front permissions tab ? there must be proper permissions set and it should be tested with those!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
codeslayer 22 Nov, 2008
Hi !

Thanks for your life saving help, MAX. 😀

Everything is working great, just as a I wanted.

I did not had any permissions set, I thought being logged in with super administrators account, it would let me execute any code.
Setting exclusive rights solved my problem.

Thanks for the great joomla component with a great support. 😀

Regards

CS
morfargekko 23 Mar, 2009
Hi, sorry to hijack this thread, I found it useful and it works just great but now I wounder how to make a selection from the table and just post a list of the selected and maybe sorted result.

Regards
Mats
GreyHead 23 Mar, 2009
Hi Mats,

There is a recent worked example of using ChronoConenctivity in the Forums here.

Bob
morfargekko 23 Mar, 2009
Hi Bob, wow You are fast.

I have looked at that and I can't get it to work as it should.

There are a lot of errors and I an not able to fix the problem.
Maybe You can give me an example based on the code listed in this example to get me on the right track.

Mats
GreyHead 23 Mar, 2009
Hi Mats,

We are talking about this tutorial? I don't think that there are many mistakes in there - but I haven't checked in detail.

Bob
morfargekko 23 Mar, 2009
Hi Bob, no it's not but that is not what I want to do.

I have the form set up and working just fine and I have used CC to display a list of all that registered via the form but I would lihe to make selections depending on what was answered in a series of checkboxes.

Mats
morfargekko 24 Mar, 2009
Hi, I am stuck Bob.
Can You please tell me what is wrong with the following code:
<?php
$db =& JFactory::getDBO();

// Define query in the reg table...
$jobQuery = "
SELECT text_2, text_3, text_9, Upsala_GK
FROM jos_chronoforms_reg;";
WHERE Upsala_GK = ".$db->quote($Upsala_GK).";";
$db->setQuery( $jobQuery );

// ... and execute the query
$result =& $db->loadObject();

// Pull out the 3 values needed from the reg table.
$text_2 = $row->text_2;
$text_3 = $row->text_3;
$text_9 = $row->text_9;

?>

<table style="text-align: left; width: 100%; " border="0"
cellpadding="0" cellspacing="0">
<tbody>
<tr<?php if ($i % 2) echo ' style="background-color: #EBEBEB;"';?>>
<td style="font-weight: bold; width: 35%;">{recordtime}</a></td>
<td style="font-weight: bold; width: 15%;">{text_2}</td>
<td style="font-weight: bold; width: 20%;">{text_3}</td>
<td style="font-weight: bold; width: 30%;">{text_9}</td>
</tr>
</tbody>
</table>
<?php $i++ ?>

I get the following error(s):
Parse error: syntax error, unexpected T_STRING in /home/hemmagol/domains/uppsalabasketgolftour.se/public_html/components/com_chronoconnectivity/chronoconnectivity.html.php(176) : eval()'d code on line 8

Parse error: syntax error, unexpected T_STRING in /home/hemmagol/domains/uppsalabasketgolftour.se/public_html/components/com_chronoconnectivity/chronoconnectivity.html.php(176) : eval()'d code on line 8

Parse error: syntax error, unexpected T_STRING in /home/hemmagol/domains/uppsalabasketgolftour.se/public_html/components/com_chronoconnectivity/chronoconnectivity.html.php(176) : eval()'d code on line 8

Parse error: syntax error, unexpected T_STRING in /home/hemmagol/domains/uppsalabasketgolftour.se/public_html/components/com_chronoconnectivity/chronoconnectivity.html.php(176) : eval()'d code on line 8

Regards
Mats
nml375 24 Mar, 2009
The error is in this part:
$jobQuery = "
SELECT text_2, text_3, text_9, Upsala_GK
FROM jos_chronoforms_reg;";
WHERE Upsala_GK = ".$db->quote($Upsala_GK).";";

You close the string, and add the command terminator (;) on line 7, but try to continue it on line 8.
That part of the code should read like this instead:
$jobQuery = "
SELECT text_2, text_3, text_9, Upsala_GK
FROM jos_chronoforms_reg
WHERE Upsala_GK = ".$db->quote($Upsala_GK).";";


Caution: Complex code below.
One option would be to use sprintf to format the query, as this provides a neat way of separating the "template query" from the field/table names and conditional string. Some understanding in the mechanics of sprintf would be necessary however.
$jobQuery = sprintf('SELECT %2$s, %3$s, %4$s, %5$s FROM %1$s WHERE %5$s = %6$s;',
  $db->nameQuote('jos_chronoforms_reg'),
  $db->nameQuote('text_2'),
  $db->nameQuote('text_3'),
  $db->nameQuote('text_9'),
  $db->nameQuote('Upsala_GK'),
  $db->Quote($Upsala_GK));

The above code do need some commenting, as it's function may not be completely obvious.
It makes use of the string formatting command sprintf, and the feature known as "variable swapping". Basically, %1$s means "take the first additional argument (1$) and insert it as a string (%s) here". Each argument is then the properly quoted equivalence of each field/table name and conditional string.
morfargekko 24 Mar, 2009
Thanks nml375, I will try that code tomorrow.

Mats
This topic is locked and no more replies can be posted.