perl comment #!/usr/bin/perl -w perl blank perl comment # ajaxCheckbox.pl - a script to test Ajax functionality perl blank perl code use strict; perl code use CGI qw/:standard/; perl code use CGI::Ajax; perl code use DBI; perl blank perl comment # --- database authenication perl code my $dbh = do 'db.inc'; perl blank perl code my $query = q{ SELECT project.project_id, project.name, project.phase, prio.prio, perl code HEX((255 - prio.prio)) AS hex, begun, tags perl code FROM project JOIN prio perl code ON (project.project_id = prio.project_id) perl code WHERE completed < 1 perl code ORDER BY prio.prio DESC LIMIT 3}; perl blank perl code my $sth = $dbh->prepare($query); perl code $sth->execute(); perl code my $result = $dbh->selectall_arrayref($sth); perl blank perl code my $cgi = new CGI; perl code my $pjx = new CGI::Ajax( 'toStruck' => \&perl_func ); perl code print $pjx->build_html( $cgi, \&Show_HTML); perl blank perl code sub Show_HTML { perl blank perl code use CGI qw/:standard/; perl blank perl code my $html = < perl code perl code perl code This is the lastest source version perl code perl code perl code perl code

Carrot Queue

Priority List  |   perl code Add a listing  |  

Project listing

perl code HEAD perl blank perl code foreach my $row (@$result) { perl code $html .= ""; perl code $html .= "
" . @$row[1] . "

"; perl code } perl blank perl comment # you can append stuff to the HTML this way perl code $html .= ""; perl blank perl code return $html; perl code } perl blank perl code sub perl_func { perl code my $input=shift; perl blank perl comment # if onClick the change the style perl code if ($input eq "ON") { perl code $input=""; perl code } else { perl code $input =""; perl code } perl code }