Exemple #1
0
function show_client_list_all()
{
    $query = "SELECT ID,FName,MName,LName FROM clients ORDER BY LName,FName,MName";
    $result = try_query($query);
    show_client_list_result($result);
}
<?php

// File: edit-client-result.php
// Copyright (C) 2012 WoodDuck Computer Consulting
include "./header.php";
get_globals();
my_connect();
echo "<H3>Edit Client</H3>\n";
// Fetch client ID from the FORM POST data
$ID = $_POST['ID'];
decho("Editing client ID '{$ID}' ... <BR>");
// Do a SELECT query to get the old client data
$query = "SELECT ID,FName,MName,LName from clients WHERE ID = '{$ID}'";
$result = try_query($query);
// Display it as an editable form, including the INPUT boxes
echo "<FORM ACTION=\"./save-client.php\" METHOD=post>\n";
if (show_client_edit_form($result)) {
    // Display the form buttons only if the return value was TRUE
    echo "<P>" . "<INPUT TYPE=submit VALUE=\"  SAVE edited client data  \"><P>\n" . "<INPUT TYPE=reset VALUE=\"  Reset to original client data  \"><P>\n";
} else {
    echo "<P>Sorry, no results match Client ID '{$ID}'.<P>\n";
}
echo "</FORM>\n";
my_disconnect();
?>

<P>
<A HREF="./edit-client.php"><BUTTON TYPE=button> Edit another client </BUTTON></A><P>
<A HREF="./main.php"><BUTTON TYPE=button> Return to main page </BUTTON></A><P>
<A HREF="./logout.php"><BUTTON TYPE=button> Logout </BUTTON></A>
Exemple #3
0
        $valid_me->validate('completed', $_POST['install_user_pass'], $validation_no_pass);
        //$valid_me->validate('completed',$_POST['install_user_repeat'],$validation_no_pass2);
        $valid_me->validate('email', $got_admin_email, $validation_invalid_mail);
        $valid_me->validate('length', $_POST['install_user_pass'], $validation_length_pass, MIN_USER_CHARS, MAX_USER_CHARS);
        $valid_me->validate('password', $_POST['install_user_pass'], $validation_alpha_pass);
        //$valid_me->validate('pass_match','',$validation_match_pass,'','',$_POST['install_user_pass'],$_POST['install_user_repeat']);
        if ($valid_me->return_val) {
            /**
             * Call the file that creates the tables and fill it with the data we got previously
             */
            define('TRY_INSTALL', true);
            include_once ROOT_DIR . '/install/database.php';
            /**
             * Try to execute each query individually
             */
            try_query($install_queries);
            /**
             * Continue based on the value returned from the above function
             */
            if (!empty($error_str)) {
                $query_state = 'err';
            } else {
                $query_state = 'ok';
            }
        }
    }
    ?>
			
			<?php 
    if (isset($valid_me)) {
        /** If the form was submited with errors, show them here */
Exemple #4
0
function show_client_list_all()
{
    $query = "SELECT SID,sname,school FROM Students ORDER BY sname";
    $result = try_query($query);
    show_client_list_result($result);
}