Hi again,
This is probably a stupid question, but anyway:
I have these buttons inside a CButtonColumn like this:
array
(
'class'=>'CButtonColumn',
'template'=>'{present}{absent}',
'buttons'=>array
(
'present' => array
(
'label'=>'Set Present',
'click'=>'js:function (e) { e.setAanwezig (); alert("aanwezig!"); }',
),
'absent' => array
(
'label'=>'Set Absent',
'click'=>'function(){setAfwezig();}',
),
),
)
And I have 2 functions defined in the page model like this:
public function setAanwezig() {
$link = mysql_connect('localhost', 'root', '');
mysql_select_db('pssd');
$sql = "UPDATE `tblaanwezigheid` SET `aanwezig` = '1' WHERE `id-aanwezigheden` = '3'";
$query = mysql_query($sql);
}
public function setAfwezig() {
$link = mysql_connect('localhost', 'root', '');
mysql_select_db('pssd');
$sql = "UPDATE `tblaanwezigheid` SET `aanwezig` = '0' WHERE `id-aanwezigheden` = '3'";
$query = mysql_query($sql);
}
But when I click either of these buttons, nothing happens…
So my question is, how do I call the function when I click the buttons?
Thanks in advance.