Forums

Binary conditional

turbio 28 Oct, 2014
Hi all!

I have a chronoconnectivity list with two columns:



“estado” with several possibilities, “pendiente” “asignado ”“completado” and other with a binary option “facturado”.

How I can make the “facturado” option is activated only if the state is equal to “completado”?

Thanks.

Pablo.
Max_admin 30 Oct, 2014
Hi Pablo,

You can use the "PHP Functions" box to show the activated status by changing the value before its displayed, BUT this doesn't affect the database value under the table field "facturado".

In the PHP functions:
Model.facturado:return ($row["Model"]["estado"] == "completado") ? 1 : 0);


Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
turbio 30 Oct, 2014
Thanks for help.

I don’t need change any value, only I want that “facturado” button is blocked or disappear in case that column “estado” <> “Completado”.

In binary box: model.facturar

In HTML box: model.estado:array(0 => "Pendiente", 1 => "Completado")

Regards,

Pablo.
Max_admin 30 Oct, 2014
So, did you get it working ? you can do it using the "HTML box"
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
turbio 31 Oct, 2014
No, I don’t see any change

Model.facturado:return ($row["Model"]["estado"] == "completado") ? 1 : 0);

The value in table of “estado” (Completado) = 1, then I write:

Model.facturado:return ($row["Model"]["estado"] == 1) ? 1 : 0);

But I see no change.. It’s possible that this line in HTML box is in conflict?

model.estado:array(0 => "Pendiente", 1 => "Completado")

Thanks,

Pablo.
Max_admin 31 Oct, 2014
All that this line:
Model.facturado:return ($row["Model"]["estado"] == "completado") ? 1 : 0);

Does is that it sets the "facturado" value to either 1 OR 0, then you can use it in any box, this doesn't change the "estado" value!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger