I have CRMERY plugin installed and have made many forms using rsforms.
I would like to display the form data entered by client only.
These datatables will load on 3 pages that have different url id's based on the page that is loading.
page 1 example i need the deal "id"
index.php?option=com_crmery&view=deals&layout=deal&id=7&Itemid=290
Page 2 example I need the person "id"
index.php?option=com_crmery&view=people&layout=person&id=43
Page 3 example I need the company "id"
index.php?option=com_crmery&view=companies&layout=company&id=29
How can I get a MYSQL only statement to have the "ID" as my variable for all pages to start my datatables select statement.
I have been able to do this in rsform to populate a dropdown for each form to select the client from the company group of contacts. (code at bottom)
Thank you in advance for any help in the right direction with the URL ID capture SQL statement.
Shane
//<code>
$url = RSFormProHelper::getURL();
$url= str_replace('
app.plan-your-federal-retirement.com/index.php?option=com_crmery&view=deals&layout=deal&id=','',$url);
$items = array();
// Prepare the database connection
$db = JFactory::getDbo();
// Keep this if you'd like a "Please select" option, otherwise comment or remove it
$items[] = "|Please Select[c]";
// Run the SQL query and store it in $results
$sql="SELECT CONCAT(first_name,' ' ,last_name) AS name
FROM `pyfr_crmery_people` WHERE company_id = (SELECT company_id FROM pyfr_crmery_deals WHERE id='$url')";
$db->setQuery($sql);
$results = $db->loadObjectList();
foreach ($results as $result) {
$value = $result->name;
$label = $result->name;
$items[] = $value.'|'.$label;
}
$items = implode("\n", $items);
return $items;
//</code>