Location: PHPKode > scripts > phpWords > phpWordsHebrew/list.php
<?php
require( "functions.php" );
require( "config.php" );

/*
    Authenticate routine
    first if block
    if $action=="setcookie" this page was called from login forms
    $userid and $passwd are checked against values in config.php file
    if credentials match, set cookies on user's browser and set
    the authorized flag to true.
    Else doLogin()

    second if block
    if authorized above then drop though
    else if cookies were already set on user's browser drop through
    else doLogin()
*/

//if ( $action == "setcookie" ) {
//    if ( ($userid == $auth_user) && ($passwd == $auth_passwd ) ) {
//        setcookie("cookie_user",$userid);  //set cookies on user browser
//        setcookie("cookie_passwd",$passwd);
//        $authorized = 1;
//    }
//    else {
//        $titleMsg = "Authentication Failed - Try Again";
//        doLogin($titleMsg); // authentication failed show login again
//        exit();
//    }
//}

//if ( $authorized ) {
//    //echo "authorized<br>";
//    //break; illegal to use it here comment just for clarity
//}
//elseif ( (isset($cookie_user)) && (isset($cookie_passwd)) ) {
//    //echo "auth cookies previously set<br>";
//    //break;
//}
//else {
//    $titleMsg = "Authenticate";
//    doLogin($titleMsg);
//}


/* Script Name:    contact.php3
Version chaged to 2.1.1 10-11-00
Script Purpose:  Contact Database

Files:    index.html -frameset description
          contact.desc - table create file
          contact.php3 - main program displays in right-side window
          leftframe.php3 - controls in left-side window
          functions.php3  - contacts was starting to get too big
          logout.php     - unset cookies and redisplay login frame
          config.php3     - change variables for local conditions here



Modified: Barry Logan (hide@address.com)
         4-16-01  change README to recommend
                  that config.php3 be moved out of DocRoot tree
                  edit top of contact.php3 to reflect absolute
                  path where config.php3 has been placed


         10-11-00 Thanks to Bernd Casimir (hide@address.com)
                  corrected some typos, added required
                  global variables to some functions, changed
                  mysql_connect to mysql_pconnect.

          10-1-00 comments about authentication added
                  cleaned up authentication/cookie routine
                  added logout routine (clears cookies)
                  tested with PHP4, Apache 1.3.12

          7-14-2000 fixed missing title field in contact.desc
          4-16-2000 substantially rewritten - added frames,
          added alpha buttons in left frame for record output in right frame,
          added search function for last name or company name searches,
          added more contact info columns to Mysql table,
          added password authentication via cookies.
          Comments now limited to one comment attached to contact table.
          See contact.desc for table description.

          01-25-2000 cleaned up some syntax errors for function
          definitions and control statements. Name in DB create
          script did not match script names.

         Original Script Author:  Michael J. Miller Jr. (hide@address.com)
         See: http://www.webtechniqes.com/archives/1998/01/note
         Script Purpose: Simple Contact Database Script Version: 1.1
*/


?>
<HTML>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=Windows-1255">
<title>List Words</title>
</head>

<BODY bgcolor="#ffffff">
<?


$new_wid = 0;

/* Now to define functions. */
/* The main screen.  Printed when $state is empty. */

function jet_sql_espape_string( $string ) {
    $temp = str_replace( "'", "''", $string );
    $temp = str_replace( "|", "'" . chr(124) . "'", $temp );

    return $temp;
}

Function Main_Menu () {
global $vanity_msg;
?>

<H1><CENTER><? echo $vanity_msg; ?></CENTER></H1>
<p><center><i>Words can be searched by entering<br>
a search term in the query box<br>
or click on a letter to display<br>
Words beginning with that letter<br>
or click on the add button to add a Word
</i></center></p>

<?
}


Function List_Contacts( $searchtype, $level, $un )
{
    global $vanity_msg, $hostname, $dbname, $tablename, $user, $password;

//    echo "\$searchtype = $searchtype<br>";
//    echo "\$level = $level<br>";

//    mysql_pconnect( $hostname, $user, $password );
    mysql_connect($hostname, $user, $password) OR DIE ("Unable to connect to database! Please try again later.");
    mysql_select_db($dbname);
	mysql_set_charset('utf8');

    if ( $searchtype == "level" ) {
        if ( is_numeric( $level ) ) {
            $sql = "SELECT * FROM $tablename WHERE wid > 0 AND level = $level ORDER BY level, BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
        }
        else {
            $sql = "SELECT * FROM $tablename WHERE wid > 0 ORDER BY level, BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
        }
    }
    elseif ( $searchtype == "weight" ) {
        if ( is_numeric( $level ) ) {
            $sql = "SELECT * FROM $tablename WHERE wid > 0 AND level = $level ORDER BY weight DESC, BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
        }
        else {
            $sql = "SELECT * FROM $tablename WHERE wid > 0 ORDER BY weight DESC, BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
        }
    }
    elseif ( $searchtype == "root" ) {
        if ( is_numeric( $level ) ) {
            $sql = "SELECT * FROM $tablename WHERE wid > 0 AND level = $level ORDER BY BINARY(root), BINARY(word), BINARY(written), transliteration, wid";
        }
        else {
            $sql = "SELECT * FROM $tablename WHERE wid > 0 ORDER BY BINARY(root), BINARY(word), BINARY(written), transliteration, wid";
        }
    }
    elseif ( $searchtype == "word" ) {
        if ( is_numeric( $level ) ) {
            $sql = "SELECT * FROM $tablename WHERE wid > 0 AND level = $level ORDER BY BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
        }
        else {
            $sql = "SELECT * FROM $tablename WHERE wid > 0 ORDER BY BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
        }
    }
    else {
        if ( is_numeric( $level ) ) {
            $sql = "SELECT * FROM $tablename WHERE wid > 0 AND level = $level ORDER BY BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
        }
        else {
            $sql = "SELECT * FROM $tablename WHERE wid > 0 ORDER BY BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
        }
    }

    $title_msg = "List Words";

//    $result1 = mysql_db_query($dbname, $sql1);
//    $result = mysql_db_query( $dbname, $sql );
    $result = mysql_query($sql);
    $numrecs = mysql_numrows( $result );
    $recs = $numrecs;
?>

<table border="0" align="left" cellpadding="3" cellspacing="0" width="100%" cellspacing="0">
    <!-- row 1 -->
    <tr bgcolor="#ffffff">
        <td colspan="2">
            <center><font size="+1">
            <b><? echo $title_msg; ?></b>
            </font></center>
        </td>
    </tr>
    <!-- row 2 -->
    <tr bgcolor="#ffffff">
        <td colspan="2">
<?
    echo "<font size=\"-2\">";
    echo "<p>SQL: $sql</p>";
    echo "</font>";
    if ( !($numrecs) ) {
        echo "<center><p><b>No Matches Found</b></p></center>";
    }
?>
        </td>
    </tr>

<?
    if ( $numrecs < 1 ) {
        exit();
        return;
    }

    if ( $numrecs > 10000 ) {
        $recs = 10000;
    }
    else {
        $recs = $numrecs;
    }

?>
    <!-- row 3 -->
    <tr bgcolor="#ffffff">
        <td colspan="2">
            <font size="-1">
            <p><? echo $numrecs; ?> Record(s) Found, <? echo $recs; ?> Record(s) Displayed</p>
            </font>
        </td>
    </tr>
<?
    if ( $un == "guest" ) {
        echo( "Listing not allowed!" );

        exit();
        return;
    }
?>
    <!-- row 4 -->
    <tr>
        <td width="100%" bgcolor="#9999cc" colspan="2">&nbsp;</td>
    </tr>
<?

    $counter = 0;
    while ( $counter < $recs ) {
        $row = mysql_fetch_array($result);
?>
    <tr>
        <td bgcolor="#c8d8f8" colspan="2">
            <p><font size="-1">
            <b>Word ID:</b>&nbsp;<?echo $row['wid']; ?><br>
            <b>Transliteration:</b>&nbsp;<?echo $row['transliteration']; ?>&nbsp;&nbsp;&nbsp;&nbsp;
            <b>Root:</b>&nbsp;<font size="+1"><?echo ConvertToWindows1255( $row['root'], $row['encoding'] ); ?></font>&nbsp;&nbsp;&nbsp;&nbsp;
            <b>Written:</b>&nbsp;<font size="+1"><?echo ConvertToWindows1255( $row['written'], $row['encoding'] ); ?></font>&nbsp;&nbsp;&nbsp;&nbsp;
            <b>Word:</b>&nbsp;<font size="+1"><?echo ConvertToWindows1255( $row['word'], $row['encoding'] ); ?></font><br>
            <b>Meaning:</b>&nbsp;<?echo $row['meaning']; ?>&nbsp;&nbsp;&nbsp;&nbsp;
            <b>More Meanings:</b>&nbsp;<?echo $row['meaning2']; ?><br>
            <b>Language:</b>&nbsp;<?echo $row['language']; ?>&nbsp;&nbsp;
            <b>Part:</b>&nbsp;<?echo $row['part']; ?>&nbsp;&nbsp;
            <b>Gender:</b>&nbsp;<?echo $row['gender']; ?>&nbsp;&nbsp;
            <b>Number:</b>&nbsp;<?echo $row['number']; ?><br>
            <b>Weight:</b>&nbsp;
<?
    if ( $row['weight'] != "" ) {
?>
            <? echo $row['weight']; ?>
<?
    }
?>
            &nbsp;&nbsp;
            <b>Level:</b>&nbsp;
<?
    if ( $row['level'] != "" ) {
?>
            <? echo $row['level']; ?>
<?
    }
?>
            </font></p>
        </td>
    </tr>
    <tr>
        <td width="100%" bgcolor="#9999cc" colspan="2">&nbsp;</td>
    </tr>

<?
        $counter++;
    }
?>
</table>
<?
    exit();
}


Function Export_Contacts( $searchtype, $level, $un )
{
    global $vanity_msg, $hostname, $dbname, $tablename, $user, $password;

//    echo "\$letter= $letter<br>";
//    echo "\$word= $word<br>";

//    mysql_pconnect( $hostname, $user, $password );
    mysql_connect($hostname, $user, $password) OR DIE ("Unable to connect to database! Please try again later.");
    mysql_select_db($dbname);
	mysql_set_charset('utf8');

    if ( $searchtype == "level" ) {
        if ( is_numeric( $level ) ) {
            $sql = "SELECT * FROM $tablename WHERE wid > 0 AND level = $level ORDER BY level, BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
        }
        else {
            $sql = "SELECT * FROM $tablename WHERE wid > 0 ORDER BY level, BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
        }
    }
    elseif ( $searchtype == "weight" ) {
        if ( is_numeric( $level ) ) {
            $sql = "SELECT * FROM $tablename WHERE wid > 0 AND level = $level ORDER BY weight DESC, BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
        }
        else {
            $sql = "SELECT * FROM $tablename WHERE wid > 0 ORDER BY weight DESC, BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
        }
    }
    elseif ( $searchtype == "root" ) {
        if ( is_numeric( $level ) ) {
            $sql = "SELECT * FROM $tablename WHERE wid > 0 AND level = $level ORDER BY BINARY(root), BINARY(word), BINARY(written), transliteration, wid";
        }
        else {
            $sql = "SELECT * FROM $tablename WHERE wid > 0 ORDER BY BINARY(root), BINARY(word), BINARY(written), transliteration, wid";
        }
    }
    elseif ( $searchtype == "word" ) {
        if ( is_numeric( $level ) ) {
            $sql = "SELECT * FROM $tablename WHERE wid > 0 AND level = $level ORDER BY BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
        }
        else {
            $sql = "SELECT * FROM $tablename WHERE wid > 0 ORDER BY BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
        }
    }
    else {
        if ( is_numeric( $level ) ) {
            $sql = "SELECT * FROM $tablename WHERE wid > 0 AND level = $level ORDER BY BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
        }
        else {
            $sql = "SELECT * FROM $tablename WHERE wid > 0 ORDER BY BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
        }
    }

    $title_msg = "Export Words";

//    $result1 = mysql_db_query($dbname, $sql1);
//    $result = mysql_db_query( $dbname, $sql );
    $result = mysql_query($sql);
    $numrecs = mysql_numrows( $result );
    $recs = $numrecs;
?>

<table border="0" align="left" cellpadding="3" cellspacing="0" width="100%" cellspacing="0">
    <!-- row 1 -->
    <tr bgcolor="#ffffff">
        <td>
            <center><font size="+1">
            <b><? echo $title_msg; ?></b>
            </font></center>
        </td>
    </tr>
    <!-- row 2 -->
    <tr bgcolor="#ffffff">
        <td>
<?
    echo "<font size=\"-2\">";
    echo "<p>SQL: $sql</p>";
    echo "</font>";
    if ( !($numrecs) ) {
        echo "<center><p><b>No Matches Found</b></p></center>";
    }
?>
        </td>
    </tr>

<?
    if ( $numrecs < 1 ) {
        exit();
        return;
    }

    if ( $numrecs > 10000 ) {
        $recs = 10000;
    }
    else {
        $recs = $numrecs;
    }

?>
    <!-- row 3 -->
    <tr bgcolor="#ffffff">
        <td>
            <font size="-1">
            <p><? echo $numrecs; ?> Records Found, <? echo $recs; ?> Records Displayed</p>
            </font>
        </td>
    </tr>
<?
    if ( $un == "guest" ) {
        echo( "Exporting not allowed!" );

        exit();
        return;
    }
?>
    <!-- row 4 -->
    <tr>
        <td width="100%" bgcolor="#9999cc" colspan="2">&nbsp;</td>
    </tr>
    <tr>
        <td width="100%">
<?
    if ( 1 ) {
?>
"wid","transliteration","word","written","root","meaning","meaning2","language","part","gender","number","weight","level","encoding","exp"<br>
<?
        $counter = 0;
        while ( $counter < $recs ) {
            $row = mysql_fetch_array($result);
?>
<?echo $row['wid']; ?>,"<?echo $row['transliteration']; ?>","<?echo ConvertToWindows1255( $row['word'], $row['encoding'] ); ?>","<?echo ConvertToWindows1255( $row['written'], $row['encoding'] ); ?>","<?echo ConvertToWindows1255( $row['root'], $row['encoding'] ); ?>","<?echo $row['meaning']; ?>","<?echo $row['meaning2']; ?>","<?echo $row['language']; ?>","<?echo $row['part']; ?>","<?echo $row['gender']; ?>","<?echo $row['number']; ?>","<? echo $row['weight']; ?>","<? echo $row['level']; ?>","Windows-1255","<? echo $row['exp']; ?>"<br>
<?
            $counter++;
        }
    }
    else {
        $counter = 0;
        while ( $counter < $recs ) {
            $row = mysql_fetch_array($result);
?>
INSERT INTO hebrew ( wid, transliteration, word, written, root, meaning, meaning2, language, part, gender, [number], weight, [level], [encoding], exp ) VALUES (
<?echo $row['wid']; ?>,"<?echo jet_sql_espape_string( $row['transliteration'] ); ?>","<?echo ConvertToWindows1255( $row['word'], $row['encoding'] ); ?>","<?echo ConvertToWindows1255( $row['written'], $row['encoding'] ); ?>","<?echo ConvertToWindows1255( $row['root'], $row['encoding'] ); ?>","<?echo jet_sql_espape_string( $row['meaning'] ); ?>","<?echo jet_sql_espape_string( $row['meaning2'] ); ?>","<?echo $row['language']; ?>","<?echo $row['part']; ?>","<?echo $row['gender']; ?>","<?echo $row['number']; ?>","<? echo $row['weight']; ?>","<? echo $row['level']; ?>","Windows-1255","<? echo jet_sql_espape_string( $row['exp'] ); ?>"
 );<br>
<?
            $counter++;
        }
    }
?>
        </td>
    </tr>
</table>
<?
    exit();
}


Function List_Contacts_Alpha( $letter, $word, $wid, $searchtype )
{
    global $vanity_msg, $hostname, $dbname, $tablename, $user, $password;

//    echo "\$letter = $letter<br>";
//    echo "\$word = $word<br>";
//    echo "\$wid = $wid<br>";
//    echo "\$searchtype = $searchtype<br>";

//    mysql_pconnect( $hostname, $user, $password );
    mysql_connect($hostname, $user, $password) OR DIE ("Unable to connect to database in function List_Contacts_Alpha.");
    mysql_select_db($dbname);
	mysql_set_charset('utf8');

    // called from update or add
    if ( $letter == 'wid' ) {
        if ( $word != "" ) {
            $sql = "SELECT * FROM $tablename WHERE wid =$wid AND word LIKE BINARY '$word%' ORDER BY BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
        }
        else {
            $sql = "SELECT * FROM $tablename WHERE wid =$wid ORDER BY BINARY(word), BINARY(written), transliteration, wid";
        }
    }
    // is query on meaning or part?
    elseif ( $searchtype == "meaning" ) {
        if ( $word != "" ) {
            $sql = "SELECT * FROM $tablename WHERE (meaning LIKE '%$letter%' OR meaning2 LIKE '%$letter%') AND word LIKE BINARY '$word%' ORDER BY BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
        }
        else {
            $sql = "SELECT * FROM $tablename WHERE (meaning LIKE '%$letter%' OR meaning2 LIKE '%$letter%') ORDER BY BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
        }
        $title_msg = $vanity_msg;
    }
    elseif ( $searchtype == "part" ) {
        if ( $letter != "" AND $word != "" ) {
            $sql = "SELECT * FROM $tablename WHERE part LIKE '$letter%' AND word LIKE BINARY '$word%' ORDER BY BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
            $title_msg = $vanity_msg;
        }
        elseif ( $transliteration != "" ) {
            $sql = "SELECT * FROM $tablename WHERE part LIKE '$letter%' AND transliteration LIKE BINARY '%$transliteration%' ORDER BY BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
            $title_msg = $vanity_msg;
        }
        else {
            $sql = "SELECT * FROM $tablename WHERE part LIKE '$letter%' ORDER BY BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
            $title_msg = $vanity_msg;
        }
    }
    elseif ( $searchtype == "transliteration" ) {
        if ( $letter != "" AND $word != "" ) {
            $sql = "SELECT * FROM $tablename WHERE transliteration LIKE BINARY '%$letter%' AND word LIKE BINARY '$word%' ORDER BY BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
            $title_msg = $vanity_msg;
        }
        elseif ( $word != "" ) {
            $sql = "SELECT * FROM $tablename WHERE word LIKE BINARY '$word%' ORDER BY BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
            $title_msg = $vanity_msg;
        }
        else {
            $sql = "SELECT * FROM $tablename WHERE transliteration LIKE BINARY '%$letter%' ORDER BY BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
            $title_msg = $vanity_msg;
        }
    }
    else {
        if ( $letter != "" AND $word != "" ) {
            $sql = "SELECT * FROM $tablename WHERE transliteration LIKE BINARY '$letter%' AND word LIKE BINARY '$word%' ORDER BY BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
            $title_msg = $vanity_msg;
        }
        elseif ( $word != "" ) {
            $sql = "SELECT * FROM $tablename WHERE word LIKE BINARY '$word%' ORDER BY BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
            $title_msg = $vanity_msg;
        }
        else {
            $sql = "SELECT * FROM $tablename WHERE word LIKE BINARY '$letter%' OR written LIKE BINARY '$letter%' OR root LIKE BINARY '$letter%' ORDER BY BINARY(word), BINARY(written), BINARY(root), transliteration, wid";
            $title_msg = $vanity_msg;
        }
    }

//    $result1 = mysql_db_query($dbname, $sql1);
    $result = mysql_db_query( $dbname, $sql );
    $numrecs = mysql_numrows( $result );
    $recs = $numrecs;
?>

<p>
<table border="0" cellpadding="3" cellspacing="0" width="100%" cellspacing="0">
    <!-- row 1 -->
    <tr bgcolor="#ffffff">
        <td colspan="3">
            <center><font size="+1">
            <b><? echo $title_msg; ?></b>
            </font></center>
        </td>
    </tr>
    <!-- row 2 -->
    <tr bgcolor="#ffffff">
        <td colspan="3">
<?
    echo "<font size=\"-2\">";
    echo "<p>SQL: $sql</p>";
    echo "</font>";
    if ( !($numrecs) ) {
        echo "<center><p><b>No Matches Found</b></p></center>";
    }
?>
        </td>
    </tr>

<?
    if ( $numrecs < 1 ) {
//        exit();
        return;
    }

    if ( $numrecs > 1000 ) {
        $recs = 1000;
    }
    else {
        $recs = $numrecs;
    }

    // suppress records found msg when displaying add or update record
    if ( !( ( $searchtype == "update" ) || ( $searchtype == "add" ) ) ) {
?>
    <!-- row 3 -->
    <tr bgcolor="#ffffff">
        <td colspan="3">
            <font size="-1">
            <p><? echo $numrecs; ?> Record(s) Found, <? echo $recs; ?> Record(s) Displayed</p>
            </font>
        </td>
    </tr>
<?
    }

    $counter = 0;
    while ( $counter < $recs ) {
        $row = mysql_fetch_array($result)
?>
    <tr>
        <td bgcolor="#c8d8f8" colspan="3">
            <p><font size="-1">
            <b>Word ID:</b>&nbsp;<?echo $row['wid']; ?><br>
            <b>Transliteration:</b>&nbsp;<?echo $row['transliteration']; ?>&nbsp;&nbsp;&nbsp;&nbsp;
            <b>Root:</b>&nbsp;<font size="+1"><?echo ConvertToWindows1255( $row['root'], $row['encoding'] ); ?></font>&nbsp;&nbsp;&nbsp;&nbsp;
            <b>Written:</b>&nbsp;<font size="+1"><?echo ConvertToWindows1255( $row['written'], $row['encoding'] ); ?></font>&nbsp;&nbsp;&nbsp;&nbsp;
            <b>Word:</b>&nbsp;<font size="+1"><?echo ConvertToWindows1255( $row['word'], $row['encoding'] ); ?></font><br>
            <b>Meaning:</b>&nbsp;<?echo $row['meaning']; ?>&nbsp;&nbsp;&nbsp;&nbsp;
            <b>More Meanings:</b>&nbsp;<?echo $row['meaning2']; ?><br>
            <b>Language:</b>&nbsp;<?echo $row['language']; ?>&nbsp;&nbsp;
            <b>Part:</b>&nbsp;<?echo $row['part']; ?>&nbsp;&nbsp;
            <b>Gender:</b>&nbsp;<?echo $row['gender']; ?>&nbsp;&nbsp;
            <b>Number:</b>&nbsp;<?echo $row['number']; ?><br>
            <b>Weight:</b>&nbsp;
<?
    if ( $row['weight'] != "" ) {
?>
            <? echo $row['weight']; ?>
<?
    }
?>
            &nbsp;&nbsp;
            <b>Level:</b>&nbsp;
<?
    if ( $row['level'] != "" ) {
?>
            <? echo $row['level']; ?>
<?
    }
?>
            <br>
            <b>Explanation:</b>&nbsp;<br>
<?
    if ( $row['exp'] != "" ) {
?>
            <? echo $row['exp']; ?>
<?
    }
?>
            <br>
            <b>Last Updated:</b>&nbsp;<?echo $row['datelast']; ?>&nbsp;&nbsp;
            <b>By Username:</b>&nbsp;<?echo $row['username']; ?>
            </font></p>
        </td>
    </tr>

<?
        $counter++;
    }
?>
</table>
</p>

<?
//exit();
}



/* The main loop.  Call functions based on the value of $state, which gets set via a hidden INPUT TYPE. */

// from leftframe - state contain search term

$state = $_REQUEST["state"];
$wid = $_REQUEST["wid"];
$transliteration = $_REQUEST["transliteration"];
$word = $_REQUEST["word"];
//$written = $_POST["written"];
//$gender = $_POST["gender"];
//$number = $_POST["number"];
//$meaning = $_POST["meaning"];
//$meaning2 = $_POST["meaning2"];
//$tlanguage = $_POST["tlanguage"];
//$part = $_POST["part"];
//$root = $_POST["root"];
//$weight = $_POST["weight"];
$level = $_REQUEST["level"];
//$image = $_POST["image"];
//$exp = $_POST["exp"];
$searchtype = $_REQUEST["searchtype"];
$username = $_SERVER['REMOTE_USER'];

//echo "\$level = $level<br>";
//echo "\$state = $state<br>";
//echo "\$word = $word<br>";
//echo "\$wid = $wid<br>";
//echo "\$searchtype = $searchtype<br>";

if ( ( strncasecmp( $state, "export", 6 ) == 0 ) && $level != "" ) {
    Export_Contacts( $searchtype, $level, $username );
}
elseif ( $level != "" ) {
    List_Contacts( $searchtype, $level, $username );
}
else {
    $state = "wid";
    List_Contacts_Alpha( $state, $word, $wid, $searchtype );
}
?>

</BODY>
</HTML>
Return current item: phpWords