Пример #1
0
$blDetailType = new BLDetailType();
$blPressContact = new BLPressContact();
$blCarMovie = new BLCarMovie();
$blMovieType = new BLMovieType();
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
if (!isset($_POST["site"])) {
    exit;
} else {
    $sitep = $_POST["site"];
}
//get site
$site = $blSite->getSiteByName($sitep);
//get car
$car = $blCar->getCar($_POST["carid"]);
//file
$file = $blCarFile->getCarFile($_POST["carfileid"]);
if (!is_dir(getcwd() . '/html/' . $site->getName() . '/' . $car->getFolderName() . '/files')) {
    mkdir(getcwd() . '/html/' . $site->getName() . '/' . $car->getFolderName() . '/files', 0777, true);
    chmod(getcwd() . '/html/' . $site->getName() . '/' . $car->getFolderName() . '/files', 0777);
}
//check if file exists
if (!file_exists(getcwd() . "/files/" . $file->getName() . "." . $file->getType())) {
    error_log(date("F j, Y, g:i a") . "-File not found: /files/" . $file->getName() . "." . $file->getType() . "\n", 3, getcwd() . "/log/logfile.log");
}
if (!file_exists(getcwd() . "/html/" . $site->getName() . "/" . $car->getFolderName() . "/files/" . $file->getName() . "." . $file->getType())) {
    copy(getcwd() . "/files/" . $file->getName() . "." . $file->getType(), getcwd() . "/html/" . $site->getName() . "/" . $car->getFolderName() . "/files/" . $file->getName() . "." . $file->getType());
    chmod(getcwd() . "/html/" . $site->getName() . "/" . $car->getFolderName() . "/files/" . $file->getName() . "." . $file->getType(), 0777);
}
Пример #2
0
<?php

include_once getcwd() . "/classes/BLCarFile.php";
$blCarFile = new BLCarFile();
if (isset($_GET["id"]) && isset($_POST["text"])) {
    $id = $_GET["id"];
    $text = $_POST["text"];
    $carfile = $blCarFile->getCarFile($id);
    if (trim($text) != "") {
        $carfile->setText($text);
        $blCarFile->updateCarFile($carfile);
    } else {
        echo "Text is a required field!";
    }
}