Ejemplo n.º 1
0
<?php

header('Content-Type: text/html; charset=utf-8');
include_once "mfunctions.php";
if (isset($_GET['id'])) {
    $tab = $_GET['id'];
    gen_report($tab);
}
if (isset($_POST['st'])) {
    sentisingle($_POST['st']);
}
// close mysql connection
mysqli_close($mysqli);
?>
<br>
<h1>Thanks</h1>

<h2>how it works?</h2>
<p>Simply enter any english phrase and find out  (purely english)</p>
<form action="" method=post>
	<input name=st type=text placeholder="What a rubbish weather today?"><br>
	<input type="submit" value="find out polarity"></form>
Ejemplo n.º 2
0
function gen_report()
{
    $fun = new funciones();
    $msg = new messages();
    $response = new StdClass();
    /* Enviamos datos por Session */
    $_SESSION['report']['o'] = $_POST['o'];
    $_SESSION['report']['c'] = $_POST['c'];
    $_SESSION['report']['t'] = $_POST['t'];
    $_SESSION['report']['n'] = $_POST['o'] . "_" . date('YmdGis');
    $response->res = true;
    echo json_encode($response);
}
//validamos si es una petición ajax
if (isset($_POST['action']) && !empty($_POST['action'])) {
    $action = $_POST['action'];
    switch ($action) {
        case 'get_info_des':
            get_des();
            break;
        case 'update_delivery':
            upd_despacho();
            break;
        case 'send_report':
            gen_report();
            break;
        case 'insert_cons':
            add_consecutivo();
            break;
    }
}