Hi!
I am trying to run the code bellow in the Admin OnSaveJSCode field. If I assign values to the variables it does work fine, so I am sure the problem is within the javascript part.
<?php
$localdb =& JFactory::getDBO();
$usuario = $row->cf_user_id;
$status = $row->Status_Pre_Reserva;
$statusF = <script type="text/javascript"> echo document.getElementById("select_34").value; </script>;
If (($status == "Concluída") and ($statusF == "Concluída")){
$localquery = "UPDATE `#__comprofiler` SET `cb_pontos` = `cb_pontos`+50 WHERE `user_id` = ".$usuario.";";
$localdb->setQuery($localquery);
$localdb->query();
}
?>
Could you guys give me some light?
Thanks!
I am trying to run the code bellow in the Admin OnSaveJSCode field. If I assign values to the variables it does work fine, so I am sure the problem is within the javascript part.
<?php
$localdb =& JFactory::getDBO();
$usuario = $row->cf_user_id;
$status = $row->Status_Pre_Reserva;
$statusF = <script type="text/javascript"> echo document.getElementById("select_34").value; </script>;
If (($status == "Concluída") and ($statusF == "Concluída")){
$localquery = "UPDATE `#__comprofiler` SET `cb_pontos` = `cb_pontos`+50 WHERE `user_id` = ".$usuario.";";
$localdb->setQuery($localquery);
$localdb->query();
}
?>
Could you guys give me some light?
Thanks!