예제 #1
0
        if (!($imageCount == 0 && $iconCount == 0)) {
            $error = true;
            $classPicErrorText = "Filename already exists";
        } else {
            $classPicErrorText = "PASS";
        }
    }
    if (!$error) {
        move_uploaded_file($_FILES["file"]["tmp_name"], "../Images/" . $image);
        //move_uploaded_file($_FILES["file"]["tmp_name"], "../Images/" . $icon);
        $imageObj = new SimpleImage();
        $imageObj->load("../Images/" . $image);
        $imageObj->resizeToWidth(134);
        $imageObj->save("../Images/" . $icon);
        echo "DBAccess::insertPicture(" . $photoName . ", " . $photoDescription . ", " . $photoDate . ", " . $icon . ", " . $image . ", " . $classID . ", " . $userIDD . ", " . $eventID . ", TRUE);";
        $result = DBAccess::insertPicture($photoName, $photoDescription, $photoDate, $icon, $image, $classID, $userIDD, $eventID, TRUE);
        $value = $result[0]['Error'];
        if ($value > 0) {
            header("Location: ../gallery.php");
        } else {
            $feedBack = "An error occured" . $value;
        }
    } else {
        $feedBack = "Invalid input detected ";
    }
}
//Get list of users
$userResult = DBAccess::getAllUsers();
$rows = count($userResult, 0);
$optionUser = "";
$optionUser .= "<option value=\"0\">NO USER</option>";