Ejemplo n.º 1
0
<?php
// Эти две строки моделируют работу сервера с кешированием
header("Cache-control: public");
header("Cache-control: max-age=1800");
?>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="styles.css">
<?php
require_once '../autoload.php';
require_once 'connectionData.php';

$params = array($host, $user, $password, $database);
$investor = new investorClass($params);

try {
    echo($investor->showInvestor());
} catch (Exception $e) {
    echo $e->getMessage();
}

?>
Ejemplo n.º 2
0
<?php
require_once 'connectionData.php';
require_once '../autoload.php';
$params = array($host, $user, $password, $database);
$investor = new investorClass($params);
$id = $investor->sanitizeString($_GET['id']);
$logotype = $investor->showLogotype($id);
switch ($logotype){
    case false:
        die();
    default:
        header('Content-type: image/*');
        echo $logotype;
}
Ejemplo n.º 3
0
<?php
require_once 'connectionData.php';
require_once '../autoload.php';
$params = array($host, $user, $password, $database);
$investor = new investorClass($params);
$referAfterError = "<meta charset='utf-8'><br><br><a href='investors.php'><button>Перейти на страницу заполнения формы</button></a><br>";
if ($_POST['name'] == '' || $_POST['country'] == '') {
    echo "Вы ввели недостаточно данных<br>";
    echo $referAfterError;
    exit(-1);
}

$name = $investor->sanitizeString($_POST['name']);
$country = $investor->sanitizeString($_POST['country']);

$logotype = $investor->processingImage($_FILES['logotype']);
if (is_array($logotype)) {
    switch ($logotype[0]) {
        case 1:
            echo $logotype[1];
            echo $referAfterError;
            die();
        case 2:
            echo $logotype[1];
            echo $referAfterError;
            die();
        //Так как картинка не явлется обязательной ошибку отсутствия картинки отключаем
//            case 3:
//                echo "<meta charset='utf-8'>";
//                echo $logotype[1];
    }
Ejemplo n.º 4
0
<?php
    require_once 'connectionData.php';
    require_once '../autoload.php';
    $params = array($host, $user, $password, $database);
    $investor = new investorClass($params);
    $referAfterError = "<meta charset='utf-8'><br><br><a href='investors.php'><button>Перейти на страницу заполнения формы</button></a><br>";

    if(!isset($_POST['delete'])){
            echo $referAfterError;
            exit(-1);
    }

    $deleteId = $investor->sanitizeString($_POST['delete']);
    $delete = $investor->deleteInvestor($deleteId);
    switch ($delete) {
        case true:
            header('Location: showInvestors.php');
            break;
        case false:
            echo('Ошибка удаления данных:<br>');
            echo $referAfterError;
            die();
    }
<meta charset="UTF-8">
<link rel="stylesheet" href="styles.css">
<?php
/**
 * Created by PhpStorm.
 * User: Михаил
 * Date: 17.07.2016
 * Time: 19:04
 */
    require_once 'connectionData.php';
    require_once '../autoload.php';;
    $params = array($host, $user, $password, $database);
    $investor = new investorClass($params);
try {
    echo($investor->showInvestorsForVisitors());
} catch (Exception $e) {
    echo $e->getMessage();
}
?>