}
 if ($num == '') {
     $errmsg .= "Number should be selected <br />";
 }
 if ($month == '') {
     $errmsg .= "Month should be selected <br />";
 }
 if ($year_of_edition == '') {
     $errmsg .= "Year of Edition should be selected <br />";
 }
 if ($issn == '') {
     $errmsg .= " ISSN Field should be entered. <br />";
 }
 if (EJHSFormValidator::checkIfFileIsUploaded($_FILES)) {
     ## Check the file is JPEG OR GIF > If Nto Set errmsg
     if (!EJHSFormValidator::validateJPEG($_FILES)) {
         $errmsg .= "Selected File As Cover Page Should Be Of Type: JPEG Or GIF";
     } else {
         $fileIsUploaded = TRUE;
     }
 }
 if ($errmsg == '') {
     $new_upload_dir = "Volume-" . $vol . "-Num" . $num;
     ## Journal Location Not Changed, and New Journal Information Does Not Exist
     if (EJHSJournal::checkIfUploadLocationIsChanged($updateID, $new_upload_dir) && !EJHSJournal::checkIfJournalExists($vol, $num)) {
         $create_dir = "Volume-" . $vol . "-Num" . $num;
         $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
Beispiel #2
0
 if (EJHSJournal::checkIfExistsByVolNum($year_of_edition, $vol, $num)) {
     $errmsg .= "This journal already exists in the DATABASE <br />";
 }
 ##CHECK UPLOAD DIRECTORY EXISTS ALREADY
 if (file_exists("Volume-" . $vol . "-Num" . $num)) {
     $upload_dir = "Volume-" . $vol . "-Num" . $num;
 } else {
     $create_dir = "Volume-" . $vol . "-Num" . $num;
     mkdir($create_dir);
     $upload_dir = $create_dir;
 }
 ## 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'];
 $date = date('d-m-Y');
 if ($errmsg == "") {
     $result = EJHSJournal::insert($year_of_edition, $month, $vol, $num, $issn, $eissn, $upload_dir, $fileName);
     if ($result) {
         EJHSJournal::upload($_FILES, $upload_dir);
         $_SESSION['notice1'] = "Journal Upload Was Successful ";
         header('location: journal_edit.php');
     } else {
         $errmsg .= "Journal Add Was Not Successful Due To Error On Database: " . mysql_error();
     }
 } else {