function getLeaveType()
{
    include "query_functions.php";
    $gnpc = new query_functions();
    $gnpc->getLeaveType();
    $row = $gnpc->fetch();
    if (!$row) {
        echo "{";
        echo jsonn("result", 0) . ",";
        echo jsons("message", "no leave type found");
        echo "}";
        return;
    }
    echo "{";
    echo '"gnpc_dms":';
    $det = array();
    do {
        array_push($det, $row);
        $row = $gnpc->fetch();
    } while ($row);
    print_r(json_encode($det));
    echo "}";
}
Example #2
0
function addItem()
{
    //$id=get_datan("fileId");
    $filename = get_data("fName");
    $description = get_data("description");
    $file_type = get_data("fileType");
    $fullname = get_data("fullname");
    $email = get_data("email");
    $date = get_datan("date");
    $contact = get_datan("contact");
    $conn = mysql_connect(DBHOST, DBUSER, DBPW);
    if (!$conn) {
        die('Could not connect: ' . mysql_error());
    }
    $db = mysql_select_db(DBNAME, $conn) or die(mysql_error());
    if ($db) {
        $query = "INSERT INTO data_saver_files(name, type, description, full_name, email, contact, date_added) VALUES('{$filename}','{$file_type}','{$description}','{$fullname}','{$email}',{$contact}, now())";
        $result = mysql_query($query);
        echo mysql_error();
        //$info = mysql_fetch_assoc($result);
    }
    if (!$result) {
        echo "{";
        echo jsonn("result", 0) . ",";
        echo jsons("message", "add was not successful");
        echo "}";
        return;
    }
    echo "{";
    echo jsonn("result", 1) . ",";
    echo jsons("message", "add was successful");
    echo "}";
}
Example #3
0
function get_two_days()
{
    include "devotional.php";
    //$title=get_two_days("title");
    $did = get_datan("did");
    $var = new Devotional();
    $var->twodays_devotion();
    $row = $var->fetch();
    if (!$row) {
        echo "{";
        echo jsonn("result", 0) . ",";
        echo jsons("message", "devotion unavailable");
        echo "}";
        return;
    }
    echo "{";
    echo jsonn("result", 1) . ",";
    echo '"devotion":{';
    echo jsons("title", $row['title']) . ",";
    echo jsons("date", $row['date']) . ",";
    echo jsons("verse", $row['verse']) . ",";
    echo jsons("bible_reading", $row['bible_reading']) . ",";
    echo jsons("devotional_reading", $row['devotional_reading']) . ",";
    echo jsons("prayer", $row['prayer']);
    echo "}";
    echo "}";
}