Exemple #1
0
<?php 
include_once getcwd() . "/classes/BLCar.php";
include_once getcwd() . "/classes/BLCarPicture.php";
$blCar = new BLCar();
$blCarPicture = new BLCarPicture();
$car = $blCar->getCar($_GET["id"]);
//get pictures
$carpicturelist = $blCarPicture->getCarPicturesByCar($_GET["id"]);
$picturecolumns = "<table><tr><th>Picture</th><th>Name</th><th>Type</th><th colspan=\"2\">Move up/down</th><th>Default picture</th><th>Delete</th></tr>";
$rows = 1;
$max = count($carpicturelist);
if ($carpicturelist == null) {
    echo $picturecolumns . "<td colspan=\"3\">No images.</td></tr></table>";
} else {
    foreach ($carpicturelist as $carpicture) {
        $upcolumn = "<a href=\"javascript:moveUp(" . $carpicture->getId() . ")\"><img src=\"" . SUBFOLDER . "/css/images/icons/up-icon.png\" alt=\"Up\" /></a>";
        $downcolumn = "<a href=\"javascript:moveDown(" . $carpicture->getId() . ")\"><img src=\"" . SUBFOLDER . "/css/images/icons/down-icon.png\" alt=\"Down\" /></a>";
        if ($max == 1) {
            $downcolumn = "";
            $upcolumn = "";
        } elseif ($rows == 1) {
            $upcolumn = "";
        } elseif ($rows == $max) {
            $downcolumn = "";
        }
        $checked = "";
        if ($car->getDefaultPictureId() == $carpicture->getId()) {
            $checked = 'checked="checked"';
        }
        $picturecolumns .= "<tr id=\"picturecolumn" . $carpicture->getId() . "\">";
Exemple #2
0
    $carmovielist = $blCarMovie->getIPhoneCarMoviesByCar($_GET["id"]);
} else {
    $carmovielist = $blCarMovie->getLRCarMoviesByCar($_GET["id"]);
}
$moviecolumns = "";
$nr = 1;
if ($carmovielist == null) {
    echo "No movies.";
} else {
    foreach ($carmovielist as $carmovie) {
        $moviecolumns .= "Text: ";
        $moviecolumns .= "&nbsp;<input id=\"movietext" . $carmovie->getId() . "\" type=\"text\" value=\"" . $carmovie->getText() . "\" size=\"30\"/>";
        $moviecolumns .= "&nbsp;Link:&nbsp;&nbsp;";
        $color = "";
        if (!isValidURL($carmovie->getUrl())) {
            $car = $blCar->getCar($carmovie->getCarId());
            $carbrand = $blCarBrand->getCarBrand($car->getCarBrandId());
            if ($car->getMovieFolder() != "") {
                $filelocation = $carbrand->getMovieFolder() . $car->getMovieFolder() . "/" . $carmovie->getUrl();
            } else {
                $filelocation = $carbrand->getMovieFolder() . $carmovie->getUrl();
            }
            if (!file_exists(getcwd() . $filelocation)) {
                $color = "background-color:#B9352F;color:#fff";
            }
        }
        $moviecolumns .= "<input id=\"movielink" . $carmovie->getId() . "\" type=\"text\" value=\"" . $carmovie->getUrl() . "\" style=\"{$color}\" size=\"30\"/>";
        //youtube links do not have a browse button
        if ($typeid != 3) {
            $moviecolumns .= "&nbsp;-&nbsp;<a href=\"javascript:browseMovie(" . $typeid . "," . $carmovie->getId() . ")\" class=\"link\" >Browse</a>";
        }
Exemple #3
0
<?php

include_once getcwd() . "/classes/BLCar.php";
include_once getcwd() . "/classes/BLSiteOrder.php";
include_once getcwd() . "/classes/BLSite.php";
$blCar = new BLCar();
$crudCar = new CRUDCar();
$blSiteOrder = new BLSiteOrder();
$blSite = new BLSite();
if (isset($_GET["id"])) {
    $id = $_GET["id"];
    $car = $blCar->getCar($id);
    $site = $blSite->getSite($car->getSiteId());
    if ($car->getState() == "Design") {
        $car->setDateApproved(date('d/m/Y'));
        $car->setUserIdApproved($_SESSION["userid"]);
    }
    if ($site->getDefaultCarId() == null || $site->getDefaultCarId() == 0) {
        $site->setDefaultCarId($car->getId());
        $blSite->updateSite($site);
    }
    $foldername = clean_string(utf8_decode(str_replace(' ', '_', $car->getType())));
    $carfind = $blCar->getCarByFolderName($foldername);
    if ($carfind != null) {
        $nr = 1;
        while ($carfind != null) {
            $foldername = clean_string(utf8_decode(str_replace(' ', '_', $car->getType()))) . "(" . $nr . ")";
            $carfind = $blCar->getCarByFolderName($foldername);
            $nr++;
        }
    }
Exemple #4
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);
}
Exemple #5
0
 } else {
     $presscontact->setName($_POST["presscontactname"]);
     $presscontact->setHTMLContent(utf8_encode($_POST["presscontacthtml"]));
     $presscontact->setCarBrandId($_POST["carbrand"]);
     $presscontactinsert = $blPressContact->insertPressContact($presscontact);
     if (is_numeric($presscontactinsert)) {
         $car->setPressContactId($presscontactinsert);
         $errorpresscontact["success"] = "Press contact saved!";
     } else {
         $car->setPressContactId(0);
         $errorpresscontact = $presscontactinsert;
     }
 }
 //check if car is set
 if ($car->getId() != 0) {
     $carprev = $blCar->getCar($_POST["carid"]);
     $car->setFolderName($carprev->getFolderName());
     $car->setDateAdded($carprev->getDateAdded());
     $car->setDateApproved($carprev->getDateApproved());
     $car->setUserIdAdded($carprev->getUserIdAdded());
     $car->setUserIdApproved($carprev->getUserIdApproved());
     $car->setLRClicks($carprev->getLRClicks());
     $car->setHRClicks($carprev->getHRClicks());
     $car->setViews($carprev->getViews());
     $car->setState($carprev->getState());
     $car->setDefaultPictureId($carprev->getDefaultPictureId());
     $error = $blCar->updateCar($car);
 } else {
     $car->setState('Design');
     $car->setFolderName(uniqid());
     $car->setDateAdded(date('d/m/Y'));
    header("Location: " . SUBFOLDER . "/page/notfound");
} elseif ($site->getDefaultCarId() == null || $site->getDefaultCarId() == 0) {
    echo '
	<h2>Error</h2>
	<div>
		<div>The site has no default car set to display on the index page.
		</div>
	</div>';
} else {
    $prefix = "";
    $html = true;
    ////////////////
    //index page////
    ////////////////
    //default car
    $defaultcar = $blCar->getCar($site->getDefaultCarId());
    //default car brand
    $defaultcarbrand = $blCarBrand->getCarBrand($defaultcar->getCarBrandId());
    //movies
    if (!isValidURL($defaultcar->getPreviewLink())) {
        $defaultcarpreviewlink = MOVIEFOLDERROOT . $car->getMovieFolder() . "/" . $defaultcar->getPreviewLink();
    } else {
        $url = getYoutubeEmbedLink($defaultcar->getPreviewLink());
        $defaultcarpreviewlink = $url;
    }
    //default car ytlink
    $carmovielistyt = $blCarMovie->getYoutubeCarMoviesByCar($defaultcar->getId());
    if ($carmovielistyt != null) {
        $url = getYoutubeEmbedLink($carmovielistyt[0]->getUrl());
        $defaultcarytlink = $url;
    }
<?php

include_once getcwd() . "/classes/BLCar.php";
include_once getcwd() . "/classes/BLCarPicture.php";
$blCar = new BLCar();
$blCarPicture = new BLCarPicture();
if (isset($_GET["id"])) {
    $id = $_GET["id"];
    $carpic = $blCarPicture->getCarPicture($id);
    $car = $blCar->getCar($carpic->getCarId());
    $car->setDefaultPictureId($id);
    $blCar->updateCar($car);
    echo "<font color=\"green\">Default picture changed!</font>";
}
Exemple #8
0
$upload_name = "Filedata";
//image uploaden + naar tabel wegschrijven
if (!empty($_FILES[$upload_name])) {
    if (findexts($_FILES[$upload_name]['name']) == "jpg" || findexts($_FILES[$upload_name]['name']) == "jpeg" || findexts($_FILES[$upload_name]['imagename']) == "gif" || findexts($_FILES[$upload_name]['name']) == "png") {
        $file = $_POST["CARID"] . "_" . strtolower(str_replace(" ", "_", $_FILES[$upload_name]['name']));
        $path = getcwd() . "/pictures/";
        //large
        $errorim = upload($_FILES[$upload_name]['tmp_name'], $path, $file, 1600, 1600);
        chmod($path . $file, 0777);
        //class
        if ($errorim[0] == true) {
            //Insert blob in table
            $blobId = $blBlobs->uploadBlobs($path . $file);
            $carpicture = new CarPicture(0, str_replace("." . findexts($file), "", $file), findexts($file), $_POST["CARID"], $blobId);
            $carpicture->setId($blCarPicture->insertCarPicture($carpicture));
            $car = $blCar->getCar($_POST["CARID"]);
            //default
            if ($car->getDefaultPictureId() == null) {
                $car->setDefaultPictureId($carpicture->getId());
                $blCar->updateCar($car);
            }
            //pictureorder
            $max = $blPictureOrder->getMaxPictureOrderByCar($car->getId()) + 1;
            $pictureorder = new PictureOrder(0, $max, $car->getId(), $carpicture->getId());
            $blPictureOrder->insertPictureOrder($pictureorder);
            //success
            //HandleError('<span style="color:green">' . $file . ' saved!</span><br />');
            $carpicturelist[] = $carpicture;
        } else {
            HandleError('Error: ' . $errorim[2] . ' (' . $file . ')');
        }