Beispiel #1
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!";
    }
}
Beispiel #2
0
include_once getcwd() . "/include/config.php";
include_once "classes/BLSite.php";
include_once "classes/BLCar.php";
include_once "classes/BLCarBrand.php";
include_once "classes/BLCarPicture.php";
include_once "classes/BLCarFile.php";
include_once "classes/BLCarLink.php";
include_once "classes/BLDetailType.php";
include_once "classes/BLPressContact.php";
include_once "classes/BLCarMovie.php";
include_once "classes/BLMovieType.php";
$blSite = new BLSite();
$blCar = new BLCar();
$blCarBrand = new BLCarBrand();
$blCarPicture = new BLCarPicture();
$blCarFile = new BLCarFile();
$blCarLink = new BLCarLink();
$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
Beispiel #3
0
<?php

include_once getcwd() . "/classes/BLCarFile.php";
include_once getcwd() . "/classes/BLBlobs.php";
$blCarFile = new BLCarFile();
$blBlobs = new BLBlobs();
if (isset($_POST['filenr'])) {
    $nr = $_POST["filenr"];
    $i = 0;
    for ($i = 1; $i < $nr; $i++) {
        //file uploaden + naar tabel wegschrijven
        if (trim($_POST["filetext" . $i]) != "") {
            if (!empty($_FILES['file' . $i])) {
                $file = $_POST["carid"] . "_" . strtolower(str_replace(" ", "_", $_FILES['file' . $i]['name']));
                $target_path = getcwd() . "/files/";
                //upload
                $target_path = $target_path . $file;
                chmod($target_path, 0777);
                if (move_uploaded_file($_FILES['file' . $i]['tmp_name'], $target_path)) {
                    $errorfiles .= '<span style="color:green">The file ' . $file . ' has been uploaded.<br />';
                    //Insert blob in table
                    $blobId = $blBlobs->uploadBlobs($target_path . $file);
                    $carfile = new CarFile(0, str_replace("." . findexts($file), "", $file), findexts($file), $_POST["filetext" . $i], $_POST["carid"], $blobId);
                    $blCarFile->insertCarFile($carfile);
                } else {
                    $errorfiles .= "There was an error uploading the file, please try again! (" . $file . ")<br />";
                }
            }
        } else {
            $errorfiles .= "Text is a required field! (" . $_FILES['file' . $i]['name'] . ")<br />";
        }
Beispiel #4
0
<?php

include_once getcwd() . "/classes/BLCarFile.php";
include_once getcwd() . "/classes/BLBlobs.php";
$blCarFile = new BLCarFile();
$blBlobs = new BLBlobs();
if (isset($_GET["id"])) {
    $id = $_GET["id"];
    $carfile = $blCarFile->getCarFile($id);
    $blCarFile->deleteCarFile($id);
    $blBlobs->deleteBlobs($carfile->getBlobId());
    unlink(getcwd() . "/files/" . $carfile->getName() . "." . $carfile->getType());
}
Beispiel #5
0
include_once getcwd() . "/include/config.php";
include_once "classes/BLSite.php";
include_once "classes/BLCar.php";
include_once "classes/BLCarBrand.php";
include_once "classes/BLCarPicture.php";
include_once "classes/BLCarFile.php";
include_once "classes/BLCarLink.php";
include_once "classes/BLDetailType.php";
include_once "classes/BLPressContact.php";
include_once "classes/BLCarMovie.php";
include_once "classes/BLMovieType.php";
$blSite = new BLSite();
$blCar = new BLCar();
$blCarBrand = new BLCarBrand();
$blCarPicture = new BLCarPicture();
$blCarFile = new BLCarFile();
$blCarLink = new BLCarLink();
$blDetailType = new BLDetailType();
$blPressContact = new BLPressContact();
$blCarMovie = new BLCarMovie();
$blMovieType = new BLMovieType();
if (!isset($_GET["site"])) {
    header("Location: " . SUBFOLDER . "/page/notfound");
} else {
    $sitep = $_GET["site"];
}
$foldername = "";
if (isset($_GET["folder"])) {
    $foldername = $_GET["folder"];
}
//get site
Beispiel #6
0
<?php

include_once getcwd() . "/classes/BLCarPicture.php";
include_once getcwd() . "/classes/BLCarFile.php";
include_once getcwd() . "/classes/BLBlobs.php";
$blCarPicture = new BLCarPicture();
$blCarFile = new BLCarFile();
$blBlobs = new BLBlobs();
$files = $blCarFile->getCarFiles();
$pictures = $blCarPicture->getCarPictures();
echo '<h1>Files</h1>';
foreach ($files as $file) {
    if ($file->getBlobId() == null) {
        //Import file
        try {
            echo "Start: " . $file->getName() . "<br />";
            $path = getcwd() . "/files/" . $file->getName() . "." . $file->getType();
            $blobId = $blBlobs->uploadBlobs($path);
            $file->setBlobId($blobId);
            $blCarFile->updateCarFile($file);
            echo "End: " . $file->getName() . " uploaded!<br /><hr />";
        } catch (Exception $ex) {
            echo $ex;
        }
    }
}
echo '<h1>Pictures</h1>';
foreach ($pictures as $picture) {
    if ($picture->getBlobId() == null) {
        //Import picture
        try {
Beispiel #7
0
<?php

include_once getcwd() . "/classes/BLCarPicture.php";
include_once getcwd() . "/classes/BLCarFile.php";
include_once getcwd() . "/classes/BLBlobs.php";
$blCarPicture = new BLCarPicture();
$blCarFile = new BLCarFile();
$blBlobs = new BLBlobs();
$files = $blCarFile->getCarFiles();
$pictures = $blCarPicture->getCarPictures();
echo '<h1>Files</h1>';
foreach ($files as $file) {
    if ($file->getBlobId() != null) {
        //Import file
        try {
            $path = getcwd() . "/files/" . $file->getName() . "." . $file->getType();
            if (!file_exists($path)) {
                echo "Start: " . $file->getName() . "<br />";
                //Synchronize
                $blBlobs->downloadBlobs($file->getBlobId(), $path);
                echo "End: " . $file->getName() . " synchronized!<br /><hr />";
            }
        } catch (Exception $ex) {
            echo $ex;
        }
    }
}
echo '<h1>Pictures</h1>';
foreach ($pictures as $picture) {
    if ($picture->getBlobId() != null) {
        //Import picture