Esempio n. 1
0
    header("Location: /page/notfound");
}
////////////////////////
//init car            //
////////////////////////
$carlinklist = null;
$errorlinks = null;
$carmovielist = null;
$errormovies = null;
$carpicturelist = null;
$errorpictures = null;
$carfilelist = null;
$errorfiles = null;
$presscontact = new PressContact(0, null, null, 0);
if (isset($_GET["foldername"])) {
    $car = $blCar->getCarByFolderName($_GET["foldername"]);
    if (!isset($_POST["carid"])) {
        $detailtype = $blDetailType->getDetailType($car->getDetailTypeId());
    }
    $pagelocation = "Edit Car > " . $car->getType();
} else {
    $car = new Car(0, 0, $site->getDefaultCarBrandId(), null, null, null, null, null, null, null, null, null, null, 0, 0, 0, 0, 0, 0, 0, 0, null, null);
    $detailtype = $blDetailType->getDetailType(1);
    $pagelocation = "Add Car";
}
////////////////////////
//Start post          //
////////////////////////
if (isset($_POST["carid"])) {
    ////////////////////////
    //car administration  //
Esempio n. 2
0
$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++;
        }
    }
    $car->setState('Online');
    $car->setFolderName(strtolower($foldername));
    $crudCar->updateCar($car);
    $max = $blSiteOrder->getMaxSiteOrderBySite($car->getSiteId()) + 1;
    $found = $blSiteOrder->getSiteOrderByCar($car->getId());
    if ($found == "False") {
        $siteorder = new SiteOrder(0, $max, $car->getSiteId(), $car->getId());
Esempio n. 3
0
         if ($carsdesign != null) {
             $cars = array_merge($carsdesign, $carsrest);
         } else {
             $cars = $carsrest;
         }
         if ($carsdesign == null) {
             $cars = $carsrest;
         }
         if ($carsrest == null) {
             $cars = $carsdesign;
         }
     }
     include_once getcwd() . "/sites/" . $site->getOriginalName() . "/index.php";
 } else {
     //car
     $car = $blCar->getCarByFolderName($foldername);
     if ($car == null) {
         echo "Unable to display the preview page for this car. A car with the name <strong>{$foldername}</strong> could not be found.<br />";
     } else {
         //car brand
         $carbrand = $blCarBrand->getCarBrand($car->getCarBrandId());
         //default picture
         $defaultpicture = $blCarPicture->getCarPicture($car->getDefaultPictureId());
         if ($defaultpicture == null) {
             if ($carbrand != null) {
                 $defaultpicture = $blCarPicture->getCarPicture($carbrand->getLogo());
             } else {
                 error_log(date("F j, Y, g:i a") . "-Default picture not found: " . $car->getId() . " - " . $car->getType() . "\n", 3, getcwd() . "/log/logfile.log");
                 $defaultpicture = new CarPicture(0, "", "", $car->getId(), 0);
             }
         }