Richper wrote:
There is a sample with all the coding but I can't remember which it is. The proceduire is something like the following;
- Go into your backend
- Open Breezingforms/manageforms
- Go to Create form with Classic Mode
- Name your form and establish width according to the amount of columns you have and save.
- Create a title (text/html) going to the top button "New" and selecting "Text"
- Next create a query list going to the top button "New" and selecting "Query List"
- Give the query list a title and name
- leave the CSS class'es as are for now, later I can give you a CSS that will highlight the appearance of your table.
- Fill in the other fields according to your need.
- In that same view find the "Query" tab at the top, and put in a code similar to the following, obviously according to your own data, your own joins, etc.:
$rows = ff_select(
"select ".
"c.id as id, ".
"c.userid as userid, ".
"u.name as user, ".
"c.titoferta as titoferta, ".
"c.tipocuenta as tipocuenta, ".
"c.razonsoc as razonsoc, ".
"c.rut as rut, ".
"c.contacto as contacto, ".
"c.fonofijo1 as fonofijo1, ".
"c.email1 as email1, ".
"c.ciudad as ciudad, ".
"c.hoydate as hoydate, ".
"c.cierre as cierre, ".
"c.areaserv as areaserv, ".
"c.tiposerv as tiposerv, ".
"c.otros as otros, ".
"q.perfil as perfil, ".
"c.descr as descr ".
"from #__ofertas as c ".
"left join #__users as u on c.userid = u.id ".
"left join #__regcompr as q on c.userid = q.userid ".
"order by areaserv, hoydate, ciudad"
);
- Open the next Tab that is "Columns".
- Define the title of the column (visible on your table). Register the Data/name ( the field in your database that should bring out the data you want to show).
- In the "Value" fiels put: <?php return $value; ?>
- Save the Query List
- If I remember well you should create at least two more fields, hidden fields:
- Delete ID name: deleteid save with no data, values or anything.
- User ID name: userid copy this in the value field: <?php return JFactory::getUser()->get('id',0) ?> and save
- I remember the sample had two buttons "Reset" and "Modify" but as I didn't need them I created them but left them unpublished:
- Reset name: revoke
Image URL: {mossite}/administrator/images/delete.png
Mouseover Image URL: {mossite}/administrator/images/delete_f2.png
Caption: <font size="2"><strong>Borrar Registros</strong></font> (or your own caption)
revoke: Script / Custom / Click
function ff_revoke_action(element, action)
{
// check if user is logged in
var userid = ff_getElementByName('userid').value;
if (userid == 0) {
alert('Usted no ha ingresado al sitio.');
return;
} // if
// search if userid is in the list
var listid = ff_getIdByName('trabajos');
var qrows = ff_queryRows[listid];
var cnt = qrows.length;
var i;
var rowid = 0;
for (i = 0; i < cnt; i++)
if (qrows[i][1] == userid) {
rowid = qrows[i][0];
break;
} // if
if (rowid == 0) {
alert('Usted no está registrado.');
return;
} // if
if (!confirm('¿Realmente quiere cancelar su registro?')) return;
ff_getElementByName('deleteid').value = rowid;
ff_submitForm();
} // ff_revoke_action
- Modify name: update
Image URL: {mossite}/administrator/images/edit.png
Mouseover Image URL: {mossite}/administrator/images/edit_f2.png
Caption: <font size="2"><strong>Modificar Datos</strong></font>
update Script /custom / click
function ff_update_action(element, action)
{
ff_redirectParent(
'<?php return ff_makeFormUrl("ofertas"); ?>'
);
} // ff_update_action
Obviously you have to change the names of fields, tables, etc. (sorry the spanish)
And, if I remember well, thats about it. If you have data in your database table, and you have put in the coding correctly you should see in the right side of your form creator the table and the data.
if I have missed something out I'll try to help you finish it. In any case go through the breezingforms samples, I'm sure I got this out of there.
Hi Richper,
Thanks,, i am thinking that i might be using the cck instead. what do you think? here is the form,
test.ocstation.com/index.php?option=com_...=edit&Itemid=220
and for the out put. .
test.ocstation.com/index.php?option=com_...;id=3&Itemid=221
but i don't how to format the output.