} } //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')); $car->setUserIdAdded($_SESSION["userid"]); $error = $blCar->insertCar($car); } //insert car success if (is_numeric($error)) { $car->setId($error); $error = null; $error["success"] = "Car data saved!"; } } //get carbrands
<?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>"; }