<?php

//=========================================================
error_reporting(E_ALL);
ini_set('display_errors', '1');
require_once 'server/config.php';
require_once 'server/db_pdo.php';
$db = openDatabaseConnection();
//=========================================================
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>בישול טוב</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>

<?php 
require_once 'views/header.php';
?>


<div class="mid">

<?php 
$data = ev_query("\nSELECT cd.courseid, p.picture place_pic, c.class_level, p.description place_desc, c.avg_class_size, c.age_range, c.course, cd.price, c.cover, p.address, c.description, cd.start_date, cd.price, cd.sessions, p.place, p.location, p.id placeid\nfrom courses_tags ct \njoin courses c on ct.courseid=c.id \njoin courses_dates cd on cd.courseid = c.id  \njoin places p on cd.placeid = p.id  \nwhere c.id=" . $_REQUEST['cid'] . " limit 1");
foreach ($data as $row) {
Beispiel #2
0
<?php

require_once 'inc/constants.php';
require_once 'inc/functions.php';
$films = array();
$numberOfPages = 0;
$pdo = openDatabaseConnection();
$query = isset($_GET['q']) ? trim($_GET['q']) : '';
$offset = isset($_GET['page']) ? (intval($_GET['page']) - 1) * RESULTS_PER_PAGE : 0;
$stmt = $pdo->prepare("SELECT fil_affiche, fil_id, fil_titre, fil_description FROM film WHERE fil_titre LIKE :query OR fil_acteurs LIKE :query OR fil_description LIKE :query OR fil_synopsis LIKE :query ORDER BY fil_id DESC LIMIT :resultsPerPage OFFSET :offset");
$stmt->bindValue(':query', "%{$query}%");
$stmt->bindValue(':resultsPerPage', RESULTS_PER_PAGE, PDO::PARAM_INT);
$stmt->bindValue(':offset', $offset, PDO::PARAM_INT);
if ($stmt->execute()) {
    $films = $stmt->fetchAll(PDO::FETCH_ASSOC);
}
$stmt = $pdo->prepare('SELECT COUNT(*) FROM film WHERE fil_titre LIKE :query OR fil_acteurs LIKE :query OR fil_description LIKE :query OR fil_synopsis LIKE :query');
$stmt->bindValue(':query', "%{$query}%");
if ($stmt->execute()) {
    $numberOfPages = ceil(intval($stmt->fetchColumn()) / RESULTS_PER_PAGE);
}
$title = 'GCFL - Film list';
require_once 'inc/header.php';
?>
<main>
			<ul class="films"><?php 
foreach ($films as $film) {
    ?>
<li>
						<object data="<?php 
    echo $film['fil_affiche'];
Beispiel #3
0
function getRowAsArray($query)
{
    openDatabaseConnection();
    //$query = "SELECT * FROM ".$tablename." WHERE id=".$id;
    $result = mysql_query($query) or die("Invalid query: " . mysql_error());
    // turn the result into an array
    return mysql_fetch_array($result, MYSQL_ASSOC);
    // free the result resources
    mysql_free_result($result);
}
Beispiel #4
0
function doInsertSmtp($username, $password, $host, $port, $security)
{
    # Open Database Connection.
    $conDatabase = openDatabaseConnection();
    # Get the data from database.
    $query = "insert into smtpmail(host,port,security,username,password)" . " value('" . $host . "'," . $port . ",'" . $security . "','" . $username . "','" . $password . "')";
    mysqli_query($conDatabase, $query);
    # Close database connection.
    closeDatabaseConnection($conDatabase);
}
Beispiel #5
0
<?php

// ini_set('display_errors',true);
// ini_set('display_startup_errors',true);
// ini_set('date.timezone','America/New_York');
// error_reporting (E_ALL|E_STRICT);
require 'Homebase_Routes.php';
// Requests from the same server don't have a HTTP_ORIGIN header
if (!array_key_exists('HTTP_ORIGIN', $_SERVER)) {
    $_SERVER['HTTP_ORIGIN'] = $_SERVER['SERVER_NAME'];
}
try {
    $GLOBALS['oracle_connection'] = openDatabaseConnection();
    $API = new HomebaseApi($_REQUEST['request'], $_SERVER['HTTP_ORIGIN']);
    echo $API->processAPI();
    $conn = $GLOBALS['oracle_connection'];
    oci_close($GLOBALS['oracle_connection']);
} catch (Exception $e) {
    echo json_encode(array('error' => $e->getMessage()));
}