示例#1
0
                         $editResult = array('upload' => "Couldn't move image with name '" . $image['name'] . "' to permanent storage. Please try again.");
                     }
                 } else {
                     $editResult = array('upload' => "'Image with name '" . $image['name'] . "' is larger than 2MB. Please try again.");
                     break;
                 }
             }
         }
     }
 }
 if (isset($_POST['txtFeatures'])) {
     if (!empty($_POST['txtFeatures'])) {
         $featureIds = array();
         foreach ($_POST['txtFeatures'] as $feature) {
             if (!empty($feature) && $feature != '') {
                 $result = $featureCon->insertFeature($feature);
                 $featureId = $result['featureId'];
                 if ($result['stmt']->errorInfo()[2] == null) {
                     $featureIds[] = $featureId;
                 } else {
                     $editResult = $result['stmt']->errorInfo()[2];
                 }
             }
         }
         $foCon->deleteFeatureForOffer($offerId);
     }
 }
 if (isset($_POST['features'])) {
     if (!isset($featureIds)) {
         $featureIds = array();
     }
示例#2
0
 * Created by PhpStorm.
 * User: roessler
 * Date: 16/09/15
 * Time: 1:22 PM
 */
/**
 * Backend page for administrators and Staff of Cyril's Classic Cars to add and view features
 */
require_once dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'config/config.php';
if (isset($_SESSION['authenticated'])) {
    if ($_SESSION['authenticated'] == true) {
        $addResult = null;
        $featureCon = new FeatureController();
        if (isset($_POST['hdnAction'])) {
            if ($_POST['hdnAction'] == 'insert') {
                $result = $featureCon->insertFeature($_POST['txtFeatureName']);
                if ($result['stmt']->errorInfo()[2] == null) {
                    $addResult = true;
                } else {
                    $addResult = $result['stmt']->errorInfo()[2];
                }
            }
        }
        ?>
        <!DOCTYPE html>
        <html lang="en">
        <head>
            <meta charset="utf-8">
            <meta http-equiv="X-UA-Compatible" content="IE=edge">
            <meta name="viewport" content="width=device-width, initial-scale=1">
            <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->