$old_upload_dir = EJHSJournal::getUploadDir($updateID);
            ##OLD UPLOAD DIR
            EJHSJournal::recursiveCopy($old_upload_dir . '/', $new_upload_dir . '/');
            EJHSJournal::deleteFiles($old_upload_dir);
            ## DELETE OLD DIR WITH CONTENTS
            $upload_dir = $new_upload_dir;
        }
        ## RENAME and UPLOAD
        if ($fileIsUploaded) {
            $fullFileName = explode(".", $_FILES["cover"]["name"]);
            $ext = $fullFileName[1];
            $fileName = "Volume-" . $vol . "-Num-" . $num . "-cover-page" . "." . $ext;
            EJHSJournal::renameAndUpload($_FILES, $new_upload_dir, $fileName);
        }
        ## DEALL With Table Updates
        if (EJHSJournal::update($year_of_edition, $month, $vol, $num, $issn, $eissn, $new_upload_dir, $fileName, $updateID) && EJHSJournalArticle::updateArticleUploadDir($updateID, $new_upload_dir)) {
            $_SESSION['notice1'] = "Journal Update Was Successful.";
            header('location: journal_edit.php');
        } else {
            echo mysql_error() . "It Seems Like There Are Errors";
        }
    }
}
if (!isset($_GET['updateID'])) {
    $_SESSION['error'] = "Unable To Start Update: UpdateID Error.";
    header('location: journal_edit.php');
} else {
    $updateID = $_GET['updateID'];
    $result = EJHSJournal::queryOneById($updateID);
    $row = mysql_fetch_array($result, MYSQL_ASSOC);
    $year_of_edition = $row['year'];
Beispiel #2
0
    $upload_dir = $oneResultRow['upload_dir'];
    $existingCover = $oneResultRow['coverpage_location'];
    $volume = $oneResultRow['volume'];
    $num = $oneResultRow['num'];
    $year = $oneResultRow['year'];
    ## VALIDATE UPLOADED FILE FOR JPED
    if (!EJHSFormValidator::validateJPEG($_FILES)) {
        $errmsg .= "Error With Attached File: Please Make Sure It Is JPEG or GIF Image File Format. <br /> ";
    } else {
        if (EJHSFormValidator::checkIfFileExists($upload_dir, $_FILES)) {
            $errmsg .= "File Already Exists <br /> ";
        }
    }
    $fileName = $_FILES['cover']['name'];
    if ($errmsg == "") {
        $result = EJHSJournal::update(NULL, NULL, NULL, NULL, NULL, NULL, NULL, $updateID, $fileName);
        if ($result) {
            EJHSJournal::upload($_FILES, $upload_dir);
            unlink($upload_dir . '/' . $existingCover);
            $_SESSION['notice1'] = "Coverpage Upload Was Successful ";
            header('location: journal_detail.php?detailID=' . $updateID);
            exit;
        } else {
            $errmsg .= "Journal Add Was Not Successful Due To Error On Database: " . mysql_error();
        }
    } else {
        $errmsg .= "Journal Add Was Not Successful ";
    }
}
?>