Exemple #1
0
div.ricoLG_cell {
  white-space:nowrap;
}
</style>
</head>
<body>

<?php 
//************************************************************************************************************
//  LiveGrid Plus-Edit Example
//************************************************************************************************************
//  Matt Brown
//************************************************************************************************************
if (OpenGridForm("", "orders")) {
    if ($oForm->action == "table") {
        DisplayTable();
    } else {
        DefineFields();
    }
} else {
    echo 'open failed';
}
CloseApp();
function DisplayTable()
{
    echo "<table id='explanation' border='0' cellpadding='0' cellspacing='5' style='clear:both'><tr valign='top'><td>";
    GridSettingsForm();
    echo "</td><td>This example demonstrates how database records can be updated via AJAX. ";
    echo "Try selecting add, edit, or delete from the pop-up menu. ";
    echo "If you select add, then click the '...' button next to customer, you will see the Rico tree control.";
    echo "The actual database updates have been disabled for security reasons and result in an error.";
Exemple #2
0
    if ($_REQUEST['query_string'] != '' | $s != '') {
        if (trim($_REQUEST['query_string']) == '') {
            $s = $_REQUEST['s'];
        } else {
            $s = $_REQUEST['query_string'];
        }
        if (strlen($s) > 0) {
            $content .= '<div class="container-fluid"><div class="row"><div class="col-md-4">';
            $content .= '<h3>Search result for ' . $s . '</h3>';
            $sql = "SELECT * FROM {$tbn} WHERE name LIKE '" . trim($s) . "%' ORDER BY due_back_date DESC";
            $result = mysqli_query($con, $sql) or die(mysqli_error() . "Error in " . $sql);
            $row_count = mysqli_num_rows($result);
            $field = array('name', 'due_back_date', 'job_location', 'repair_type', 'job_status');
            $total_pages = '';
            $table_name = 'jobs';
            $content .= DisplayTable($sql, $field, $table_name, $row_count);
            $content .= '</div>';
            if ($id != '') {
                $content .= '<div class="col-md-4">' . JobDetails() . '</div><div class="col-md-4">' . JobNote() . EditJob() . '</div>';
            }
            $content .= '</div></div>';
        }
    } else {
        $content .= '<h1 class="text-center">Search box empty</h1>';
    }
}
if ($cmd == '[NEW_USER]') {
    $content .= '<div class="container">
						<h1 class="text-center">New User</h1>
						<form method="post" name="new_user" class="form-horizontal" ><input type="hidden" name="ssc" value="new_user" class="form-control" >						
						<div class="form-group"><label for="first_name" >First Name</label><input type="text" name="first_name" id="first_name" class="form-control" ></div>	
Exemple #3
0
<?php 
session_start();
$idnum = $_SESSION["idnum"];
$conn = new mysqli($_SESSION["servername"], $_SESSION["Dusername"], $_SESSION["Dpassword"], $_SESSION["dbname"]);
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT Fname,Lname,IDKey from agents WHERE SupervisorID='{$idnum}' AND AccountType='1'";
$result = mysqli_query($conn, $sql);
while ($row = $result->fetch_assoc()) {
    $sid = $row["IDKey"];
    $fn = $row["Fname"];
    $ln = $row["Lname"];
    echo "{$fn} {$ln}'s current bookings";
    echo "<form action='changebooking.php' method='post'>";
    DisplayTable($sid);
    echo "<input type='submit' value='view'>";
    echo "</form>";
}
function DisplayTable($sid)
{
    $conn = new mysqli($_SESSION["servername"], $_SESSION["Dusername"], $_SESSION["Dpassword"], $_SESSION["dbname"]);
    if ($conn->connect_error) {
        die("Connection failed: " . $conn->connect_error);
    }
    $bsql = "SELECT * FROM bookings WHERE SalesmanID='{$sid}'";
    $bresult = mysqli_query($conn, $bsql);
    echo "<table border='6' style='width:100%' class='sortable'>";
    echo "<tr>";
    echo "<td>X</td>";
    echo "<td title='Phone Number'>Pnumber</td>";
Exemple #4
0
if ($cmd == '[SEARCH]') {
    if ($_REQUEST['query_string'] != '' | $s != '') {
        //Hold results of query until new query is enetered. This is so you can select different records
        if (trim($_REQUEST['query_string']) == '') {
            $s = $_REQUEST['s'];
        } else {
            $s = $_REQUEST['query_string'];
        }
        if (strlen($s) > 0) {
            $content .= '<div class="container-fluid"><div class="row"><div class="col-md-4">';
            $content .= '<h3>Search result for ' . $s . '</h3>';
            $sql = "SELECT * FROM mmb_bespoke_job WHERE name LIKE '" . trim($s) . "%' ORDER BY due_back_date DESC";
            $result = mysqli_query($con, $sql) or die(mysqli_error() . "Error in " . $sql);
            $row_count = mysqli_num_rows($result);
            $field = array('name', 'due_back_date', 'job_location', 'repair_type', 'job_status');
            $content .= DisplayTable($sql, $field, 'jobs', $row_count) . '</div>';
            //Display job details
            if ($id != '') {
                $content .= '<div class="col-md-4">' . JobDetails() . '</div><div class="col-md-4">' . JobNote() . EditJob() . '</div>';
            }
            $content .= '</div></div>';
        }
    } else {
        $content .= '<h1 class="text-center">Search box empty</h1>';
    }
}
//Create new user
if ($cmd == '[NEW_USER]') {
    $content .= '<div class="container">
						<h1 class="text-center">New User</h1>
						<form method="post" name="new_user" class="form-horizontal" ><input type="hidden" name="ssc" value="new_user" class="form-control" >						
Exemple #5
0
					<link rel="stylesheet" href="http://makermendsbespoke.co.uk/css/main.css">
				</head><body><h1 class="text-center" >Jobs on Hold</h1>';
$sql = "SELECT * FROM mmb_bespoke_job WHERE  job_status !='' AND job_status !='^Approval_Needed^' AND active=1 ORDER BY chase_job";
$field = array('name', 'repair_type', 'job_status', 'chase_job', 'due_back_date');
$row_count = mysqli_num_rows(mysqli_query($con, $sql));
$message .= DisplayTable($sql, $field, 'chase_jobs', $row_count);
$message .= '<h1 class="text-center" >Urgent Jobs</h1>';
$sql = "SELECT * FROM mmb_bespoke_job WHERE  urgent=1 AND active=1 ORDER BY due_back_date";
$field = array('name', 'repair_type', 'due_back_date');
$row_count = mysqli_num_rows(mysqli_query($con, $sql));
$message .= DisplayTable($sql, $field, 'chase_jobs', $row_count);
$message .= '<h1 class="text-center" >Next Parcel</h1>';
$sql = "SELECT * FROM mmb_bespoke_job WHERE due_back_date < DATE_ADD(CURDATE(), INTERVAL 7-DAYOFWEEK(CURDATE()) DAY) AND  active=1 AND job_location = 'Received_t' ORDER BY due_back_date";
$field = array('name', 'repair_type', 'due_back_date');
$row_count = mysqli_num_rows(mysqli_query($con, $sql));
$message .= DisplayTable($sql, $field, 'chase_jobs', $row_count);
$message .= '</body></html>';
$subject = 'Chase Jobs';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
if (mail($to, $subject, $message, $headers)) {
    print 'Mail sent!';
}
?>

<!doctype html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang=""> <!--<![endif]-->
    <head>