Hi everyone,
First, I want to thank Grayhead for all his help earlier. He's much appreciated.
Ok, so Here's what my client wants to do.....
He would like the forms that have been filled out to be saved and then have them somehow show up on a separate page where only his sales agents would have access to them to review as needed.
I know I can setup a page that would only show up for them (as registered users), and I've figured how to create tables and save each form to the database, but now I'm stuck as to what's next.
Ideally, my client would like each form to be seperated into it's own folder, and then subsequent forms by the same person to be filed accordingly, but I think that might be pushing it.
Any Ideas???
Thanks,
JIF
First, I want to thank Grayhead for all his help earlier. He's much appreciated.
Ok, so Here's what my client wants to do.....
He would like the forms that have been filled out to be saved and then have them somehow show up on a separate page where only his sales agents would have access to them to review as needed.
I know I can setup a page that would only show up for them (as registered users), and I've figured how to create tables and save each form to the database, but now I'm stuck as to what's next.
Ideally, my client would like each form to be seperated into it's own folder, and then subsequent forms by the same person to be filed accordingly, but I think that might be pushing it.
Any Ideas???
Thanks,
JIF
Hi JIF,
This sounds like a ChronoConnectivity application to me. You could put a dropdown in the header to select all entries for a user (assuming that you have some reliable way to identify users).
Bob
PS Sounds as though the client hasn't quite got the idea that databases and folders are different.
This sounds like a ChronoConnectivity application to me. You could put a dropdown in the header to select all entries for a user (assuming that you have some reliable way to identify users).
Bob
PS Sounds as though the client hasn't quite got the idea that databases and folders are different.
Hi Bob,
I looked at some of the Chrono Connectivity info along with the 1st Tutorial for it, but got kinda lost.🙂 And yes, my client is seriously lacking in the whole computer area. I ended up having his emails forwarded to gmail where he could then move them into Google Docs as a document, where they could be organized. Now he's looking at some free service called DropBox. I don't know if it will be any better.
So, with Chrono Connectivity, I could have a page where it would pull up links to forms that have already been submitted? Am I getting that right? Is there any more documentation explaining that process?
Thanks!
I looked at some of the Chrono Connectivity info along with the 1st Tutorial for it, but got kinda lost.🙂 And yes, my client is seriously lacking in the whole computer area. I ended up having his emails forwarded to gmail where he could then move them into Google Docs as a document, where they could be organized. Now he's looking at some free service called DropBox. I don't know if it will be any better.
So, with Chrono Connectivity, I could have a page where it would pull up links to forms that have already been submitted? Am I getting that right? Is there any more documentation explaining that process?
Thanks!
Hi MrSchadow,
Not so much the forms that have been submitted but the data from those forms that has been saved in a database table (and this could include images or docs if necessary).
There's quite a good tutorial by Benblee in the ChronoConnectivity forum here. That's probably the best place to start.
There's a fairly simple ChronoConenctivity app of mine here that you can look at. Click 'View Details' for a more detailed view of any of the entries.
There's another much more complicated one here which is a Dutch 'contact site'. The whole system of advert (oproepen) and searches (zoeken) is a combination of ChronoConnectivity and ChronoForms. (NB I don't speak Dutch and take no responsibility for the site.)
Not sure if these help but they might give some ideas.
Bob
PS I use Dropbox which is a nice file sharing system but I haven't found anything in there that organises files for me :-(
Not so much the forms that have been submitted but the data from those forms that has been saved in a database table (and this could include images or docs if necessary).
There's quite a good tutorial by Benblee in the ChronoConnectivity forum here. That's probably the best place to start.
There's a fairly simple ChronoConenctivity app of mine here that you can look at. Click 'View Details' for a more detailed view of any of the entries.
There's another much more complicated one here which is a Dutch 'contact site'. The whole system of advert (oproepen) and searches (zoeken) is a combination of ChronoConnectivity and ChronoForms. (NB I don't speak Dutch and take no responsibility for the site.)
Not sure if these help but they might give some ideas.
Bob
PS I use Dropbox which is a nice file sharing system but I haven't found anything in there that organises files for me :-(
:arrow:
Hi Bob,
The view / records display on the ironbands.com website you showed here is great 🤔 and exactly what I need.
please show us the way to reach this functionality.
thanks!!!
Oren Wassersprung
...
There's a fairly simple ChronoConenctivity app of mine here that you can look at. Click 'View Details' for a more detailed view of any of the entries...
(
Hi Bob,
The view / records display on the ironbands.com website you showed here is great 🤔 and exactly what I need.
please show us the way to reach this functionality.
thanks!!!
Oren Wassersprung
Hi Oren,
Here we go.
First: here's the snippet from the ChronoConnectivity body box.
The [View Details] link also goes back to the same form but passes &task=extra&height=600&width=480&tmpl=component&cf_id={cf_id}.
[list]The &height=600 and width=480 are the sizing info for the smoothbox (called by class='smoothbox').
$tmpl=component asks for the page to display without the template. &task=extra is an instruction to ChronoForms to run Extra Code box 1 instead of the Form HTML!! [/list]
That's all in ChronoConnectivity. Now we need to go to the ChronoForm.
In the Extra Code 1 box is this code. It looks long but mostly it's getting data from the database; sorting out some date formatting; checking if there is an image and then displaying the results.
Notice that there are no form inputs in here. Although ChronoForms can display forms - it can also display *any* HTML.
Lastly, the [Edit Data] link goes back to the normal input form - but that &task=edit is used to get the data and show it instead of showing an empty form. They key part of the code is:
This gets some stored Table information; loads the saved data and matches the two up to give us a good data array with all the entries regardless of whether they have values.
Hope this helps
Bob
Here we go.
First: here's the snippet from the ChronoConnectivity body box.
<td class='band user-info'><a href="<?php echo JURI::base(); ?>index.php?option=com_chronocontact&chronoformname=band_db_t1&task=extra&height=600&width=480&tmpl=component&cf_id={cf_id}" title="<?php echo $hunt_title; ?>" class="smoothbox" id='{cf_id}' >[View Details]</a>
<div id="cccontent_{cf_id}_tip" style="display: none;">{cLsName} :: </div><br />
<?php
if ( $owner ) {
?>
<a href='index.php?option=com_chronocontact&chronoformname=band_db_t1&task=edit&cf_id={cf_id}'>[Edit Data]</a>
<?php
}
?>
</td>
Starting at the end there's an [Edit Data] link that is only shown to the entry owner and links back to a ChronoForms passing &task=edit&cf_id={cf_id} back to the form.The [View Details] link also goes back to the same form but passes &task=extra&height=600&width=480&tmpl=component&cf_id={cf_id}.
[list]
That's all in ChronoConnectivity. Now we need to go to the ChronoForm.
In the Extra Code 1 box is this code. It looks long but mostly it's getting data from the database; sorting out some date formatting; checking if there is an image and then displaying the results.
<?php
/* ensure that this file is called by another file */
defined('_JEXEC') or die('Restricted access');
$task = JRequest::getString('task', '', 'get');
$cf_id = JRequest::getString('cf_id', '', 'get');
if ( !$task || !$cf_id ) {
global $mainframe;
$mainframe->enqueuemessage("Sorry, the band record was not found");
return;
}
$style = "
.label {
color:#888;
text-align:right;
}
";
$path = JPATH_SITE.DS.'components'.DS.'com_chronocontact'.DS.'includes'.DS.'band_db_t1'.DS;
require_once($path.'load_arrays.php');
$db =& JFactory::getDBO();
$query = "
SELECT *
FROM `#__chronoforms_bands`
WHERE `cf_id` = $cf_id ;
";
$db->setQuery($query);
$band = $db->loadObject();
jimport('joomla.filesystem.file');
// reset dates to m/d/Y format
$band_data_mdy = formatDate($band->band_date);
$enc_date_mdy = formatDate($band->enc_date);
function formatDate($oldDate) {
$date = explode('-', $oldDate);
$date = $date[1].'/'.$date[2].'/'.$date[0];
return $date;
}
$photo = $band->hunt_photo;
$uri = JURI::base().'components/com_chronocontact/uploads/band_db_t1/';
$photo_path = JPATH_SITE.DS.'components'.DS.'com_chronocontact'.DS.'uploads'.DS.'band_db_t1'.DS;
if ( $photo ) {
$photo = JFile::stripExt($photo)."_med.".JFile::getExt($photo);
}
if ( $photo && JFile::exists($photo_path.$photo) ) {
$photo_uri = $uri.$photo;
} else {
$photo_uri = $uri.'no_photo_med.gif';
}
echo " <div id='view-details'>
<div id='banding-info'>
<h3>Banding Data</h3>
<dl>
<dt>Banding Date:</dt>
<dd>".$band_data_mdy."</dd>
<dt>Band Type:</dt>
<dd>".$band->band_type."</dd>
<dt>State/Province - Country:</dt>
<dd>".$band->band_state." - ".$band->band_country."</dd>
<dt>Band Organisation:</dt>
<dd>".$band->band_org."</dd>
<dt>Bander:</dt>
<dd>".$band->band_bander."</dd>
</dl>
</div>
<div id='encounter-info'>
<h3>Encounter Data</h3>
<dl>
<dt>Harvest Date:</dt>
<dd>".$enc_date_mdy."</dd>
<dt>Land Type:</dt>
<dd>".$band->enc_land."</dd>
<dt>State/Province - Country:</dt>
<dd>".$band->enc_state." - ".$band->enc_country."</dd>
<dt>Location Name:</dt>
<dd>".$band->enc_loc_name."</dd>
<dt>Location ID:</dt>
<dd>".$band->enc_loc_id."</dd>
<dt>Submitter Name:</dt>
<dd>".$band->user_name."</dd>
</dl>
</div>
<div id='detail-image'>
<img src='".$photo."' />
</div>
<div id='hunt-info'>
<h3>Hunt Information</h3>
<div>
<dl>
<dt>Species/Sex:</dt>
<dd>".$band->band_species." / ".$band->band_sex."</dd>
</dl>
</div>
<div>".$band->hunt_info."</div>
</div>
</div>";
*/
echo " <div id='view-details'>
<div id='left-info'>
<dl>
<dt>Submitter Username</dt>
<dd>".$band->user_name."</dd>
<dt>Species / Sex</dt>
<dd>".$band->band_species." / ".$band->band_sex."</dd>
</dl>
<h3>Banding Data</h3>
<dl>
<dt>Banding Date</dt>
<dd>".$band_data_mdy."</dd>
<dt>Band Type</dt>
<dd>".$band->band_type."</dd>
<dt>State / Province - Country</dt>
<dd>".$band->band_state." - ".$band->band_country."</dd>
<dt>County / Nearest City / Bearing</dt>
<dd>".$band->band_county." / ".$band->band_city." / ".$band->band_bearing." </dd>
<dt>Banding Organization</dt>
<dd>".$band->band_org."</dd>
<dt>Bander</dt>
<dd>".$band->band_bander."</dd>
</dl>
</div>
<div id='right-info'>
<dl>
<dt>Band Number</dt>
<dd>".$band->band_number."</dd>
<dt>Age of Bird</dt>
<dd>".$band->band_age."</dd>
</dl>
<h3>Encountered Data</h3>
<dl>
<dt>Harvest Date</dt>
<dd>".$enc_date_mdy."</dd>
<dt>Land Type</dt>
<dd>".$band->enc_land."</dd>
<dt>State / Province - Country</dt>
<dd>".$band->enc_state." - ".$band->enc_country."</dd>
<dt>County / Nearest City / Bearing</dd>
<dd>".$band->enc_county." / ".$band->enc_city." / ".$band->enc_bearing."</dd>
<dt>Location Name</dt>
<dd>".$band->enc_loc_name."</dd>
<dt>Location ID</dt>
<dd>".$band->enc_loc_id."</dd>
</dl>
</div>
<div id='detail-image'>
<img src='$photo_uri' />
</div>
<div id='hunt-info'>
<h3>Hunt / Band Data</h3>
<dl>
<dt>Band Condition</dt>
<dd>".$band->enc_band_cond."</dd>
<dt>Hunt Information</dt>
<dd>".$band->hunt_info."</dd>
</dl>
</div>
</div>";
$doc =& JFactory::getDocument();
$doc->addStyleDeclaration($style);
?>
Notice that there are no form inputs in here. Although ChronoForms can display forms - it can also display *any* HTML.
Lastly, the [Edit Data] link goes back to the normal input form - but that &task=edit is used to get the data and show it instead of showing an empty form. They key part of the code is:
<?php
. . .
$fdata =& JTable::getInstance("chronoforms_bands", "Table");
. . .
if ( $task && $cf_id ) {
$query = "
SELECT *
FROM `#__chronoforms_bands`
WHERE `cf_id` = $cf_id ;
";
$db->setQuery($query);
$result = $db->loadObject();
// check that record is found and current user has access
if ( $result &&
($user->id != 0 && $user->id == $result->cf_user_id)
|| in_array($user->gid, array('24', '25')) ) {
$fdata->bind($result);
}
. . .
This gets some stored Table information; loads the saved data and matches the two up to give us a good data array with all the entries regardless of whether they have values.
Hope this helps
Bob
This topic is locked and no more replies can be posted.