Annotation of loncom/metadata_database/lonsql.pm, revision 1.3

1.1       harris41    1: # The LearningOnline Network with CAPA
                      2: # Metadata Database Handler
                      3: #
                      4: # 02/20/2001 Scott Harrison
                      5: 
                      6: package Apache::lonsql;
                      7: 
                      8: use strict;
1.2       harris41    9: use Opcode;
                     10: use Apache::lonnet;
                     11: use Apache::Constants qw(:common :http);
1.1       harris41   12: 
1.3     ! harris41   13: use CGI;
1.2       harris41   14: 
                     15: # ================================================================ Main handler
                     16: #
                     17: # Interactive call to screen
                     18: #
                     19: #
                     20: 
                     21: sub handler {
                     22:     my $r=shift;
1.3     ! harris41   23: 
        !            24:     if ($r->header_only) {
        !            25:       $r->content_type('text/html');
        !            26:       $r->send_http_header;
        !            27:       return OK;
        !            28:     }
        !            29: 
        !            30: # ------------------------------------------------------------------- Open page
        !            31: 
        !            32:     my $query=new CGI;
        !            33: 
        !            34:     my $searchquery;
        !            35:     my $searchresults;
        !            36: 
        !            37:     if ($query->{'SUBMIT'}) {
        !            38: 	$searchquery="trying to search...";
        !            39:     }
        !            40: 
        !            41:     $r->content_type('text/html');
        !            42:     $r->header_out('Cache-control','no-cache');
        !            43:     $r->header_out('Pragma','no-cache');
        !            44:     $r->send_http_header;
1.2       harris41   45:     my $output=<<END;
                     46: 
1.3     ! harris41   47: <P>
        !            48: <H1>MySQL search engine</H1>
        !            49: <FORM METHOD="GET" ACTION="/adm/sqltest">
        !            50: <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>
        !            51: <TR><TD><STRONG>title</STRONG></TD>
        !            52: <TD><INPUT TYPE="TEXT" NAME="title"></TD>
        !            53: <TR><TD><STRONG>author</STRONG></TD>
        !            54: <TD><INPUT TYPE="TEXT" NAME="author"></TD>
        !            55: <TR><TD><STRONG>subject</STRONG></TD>
        !            56: <TD><INPUT TYPE="TEXT" NAME="subject"></TD>
        !            57: <TR><TD><STRONG>notes</STRONG></TD>
        !            58: <TD><INPUT TYPE="TEXT" NAME="notes"></TD>
        !            59: <TR><TD><STRONG>abstract</STRONG></TD>
        !            60: <TD><INPUT TYPE="TEXT" NAME="abstract"></TD>
        !            61: <TR><TD><STRONG>mime</STRONG></TD>
        !            62: <TD><INPUT TYPE="TEXT" NAME="mime"></TD>
        !            63: <TR><TD><STRONG>language</STRONG></TD>
        !            64: <TD><INPUT TYPE="TEXT" NAME="language"></TD>
        !            65: <TR><TD><STRONG>creationdate</STRONG></TD>
        !            66: <TD><INPUT TYPE="TEXT" NAME="creationdate"></TD>
        !            67: <TR><TD><STRONG>lastrevisiondate</STRONG></TD>
        !            68: <TD><INPUT TYPE="TEXT" NAME="lastrevisiondate"></TD>
        !            69: <TR><TD><STRONG>owner</STRONG></TD>
        !            70: <TD><INPUT TYPE="TEXT" NAME="owner"></TD>
        !            71: <TR><TD><STRONG>copyright</STRONG></TD>
        !            72: <TD><INPUT TYPE="TEXT" NAME="copyright"></TD>
        !            73: </TR>
        !            74: </TABLE>
        !            75: <SELECT NAME="logic">
        !            76: <OPTION SELECTED>and</OPTION>
        !            77: <OPTION>or</OPTION>
        !            78: </SELECT>
        !            79: <INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="SEARCH MySQL DATABASE">
        !            80: </P>
        !            81: <P>
        !            82: $searchquery
        !            83: </P>
        !            84: <P>
        !            85: $searchresults
        !            86: </P>
1.2       harris41   87: END
                     88:     $r->print($output);
                     89:     return OK;
                     90: }
1.1       harris41   91: 
                     92: 
                     93: 
                     94: 1;

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>