<!doctype html>
	
<html lang="de">
<head>

    <?php include "include/includeJSandCSS.php" ?>

	<script type="text/javascript">
    	//<!--
    		var userIsLoggedIn = false;
    	//-->
	</script>
	<script type="text/javascript">
    	//<!--
    		var keepAliveInterval = 300
    	//-->
	</script>

</head>

<body>

<header class="hidden-print">
	<?php include "templates/headerLogout.php" ?>
</header>

<?php 	
	$ini_array = parse_ini_file("config.ini", true);
	$baseURL = $ini_array['base']['URL'];
	// Initialize the session
	session_start();
	
	if($_POST['newPublication'] == 'Reset') $_POST = array(); 
	
	// Check if the user is already logged in, if yes then redirect him to welcome page
	if(! isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] === false){
		header("location: " .$baseURL ."/redirecttologin.php");
	} 

	$firstname = $_SESSION['firstname']; 
	$lastname  = $_SESSION['lastname']; 
?>

<div id="VEROData" class="container-fluid">
    <div class="col-12">
	<div id="BibliographicData" class="pb-3 shadow p-3 bg-box rounded">
	    <h4>Bibliografische Grunddaten</h4>
	    <?php include "templates/title.tpl" ?>
	    <?php include "templates/author.tpl" ?>
	    <?php include "templates/publicationyear.tpl" ?>
	    <?php // include "templates/language.tpl" ?>
	    <?php include "templates/abstract.tpl" ?>
	</div>	
    </div>

    <div class="pt-5"></div>
    <!-- Accordion Sections -->
 
   <!-- Identifikatoren -->
    <div class="accordion">
        <div id="IdentificatorData" class="accordion-item pb-3 shadow p-3 mb-5 bg-box rounded">
            <h2 class="accordion-header" id="headingIdentificator">
                <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
                    <h4>Identifikatoren</h4>
                </button>
            </h2>
            <div id="collapseThree" class="accordion-collapse collapse" aria-labelledby="headingThree" data-bs-parent="#VEROData">
                <div class="accordion-body">
                    <?php include "templates/identificator.tpl" ?>
		    <div class="d-grid gap-2 pe-5 d-md-flex justify-content-md-end"></div>
                </div>
            </div>
        </div>
    </div>
    <!-- Ende Identifikatoren -->
	
    <!-- Dokumenttypen und Zusatzdaten -->
    <div class="accordion">
	<div id="TypeData" class="accordion-item pb-3 shadow p-3 mb-5 bg-box rounded">
       	    <h2 class="accordion-header" id="headingType">
              	<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
               	    <h4>Dokumenttyp und weitere Daten</h4> 
                </button>
            </h2>
            <div id="collapseTwo" class="accordion-collapse collapse" aria-labelledby="headingTwo" data-bs-parent="#VEROData">
               	<div class="accordion-body">
               	    <?php include "templates/checkType.php" ?>
			<div class="d-grid gap-2 pe-5 d-md-flex justify-content-md-end"></div>
                </div>
            </div>
	</div>
    </div>
    <!-- Ende Dokumenttypen und Zusatzdaten -->
		
    <!-- Schlagworte -->
    <div class="accordion">
	<!-- Schlagworte -->
	<div id="SubjectData" class="accordion-item pb-3 shadow p-3 mb-5 bg-box rounded">
            <h2 class="accordion-header" id="headingSubject">
            	<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseFour" aria-expanded="false" aria-controls="collapseFour">
                    <h4>Freie Schlagworte</h4>
                </button>
            </h2>
            <div id="collapseFour" class="accordion-collapse collapse" aria-labelledby="headingFour" data-bs-parent="#VEROData">
            	<div class="accordion-body">
                    <?php include "templates/subject.tpl" ?>
		    <div class="d-grid gap-2 pe-5 d-md-flex justify-content-md-end"></div>
                </div>
            </div>
        </div>
    </div>
    <!-- Ende Schlagworte -->

    <!-- Vertragssektion -->	
    <div class="accordion">
	<div id="contractData" class="accordion-item pb-3 shadow p-3 mb-5 bg-box rounded">
            <h2 class="accordion-header">
               	<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapsemultiPublish" aria-expanded="false" aria-controls="collapsemultiPublish">
               	    <h4>Vertragssektion</h4>
                </button>
            </h2>
            <div id="collapsemultiPublish" class="accordion-collapse collapse" aria-labelledby="headingmultiPublish" data-bs-parent="#VEROData">
               	<div class="accordion-body">
                    <?php include "templates/multiPublish.php" ?>
			<div class="d-grid gap-2 pe-5 d-md-flex justify-content-md-end"></div>
                </div>
            </div>
   	</div>
    </div>
    <!-- Ende Vertragssektion -->


    <!-- Uploadsektion  -->
    <div class="accordion">
        <div id="uploadData" class="accordion-item pb-3 shadow p-3 mb-5 bg-box rounded opacity-50">
            <h2 class="accordion-header">
                <button class="accordion-button collapsed text-muted" type="button" disabled data-bs-toggle="collapse" data-bs-target="#collapseUpload" aria-expanded="false" aria-controls="collapseUpload">
                    <h4>Dateiupload <span style="font-size:20px;" class="text-muted"> - erst nach dem Ausfüllen der Vertragssektion verfügbar</span></h4>
                </button>
            </h2>
            <div id="collapseUpload" class="accordion-collapse collapse" aria-labelledby="headingUpload" data-bs-parent="#VEROData">
                <div class="accordion-body">
                    <?php include "templates/uploadForm.php" ?>
                        <div class="d-grid gap-2 pe-5 d-md-flex justify-content-md-end"></div>
                </div>
            </div>
        </div>
    </div>
    <!-- Ende Uploadsektion -->


    <!-- Zusammenfassung -->
    <div id="divSummaryButton" class="d-grid pe-5 d-md-flex justify-content-md-end">
        <button id="summaryButton" type="submit" class="btn btn-success" onclick="showErrors()">Überprüfung der Eingaben</button> 
    </div>
    
    <!-- Ende Zusammenfassung -->

    <!-- DIV für Mailausgabe am Ende -->
    <div id="MAILData" class="container-fluid" style="display:none;">
        <div id="finalMailContent" class="col-12">
            <!-- Inhalt wird hier geladen -->
        </div>
    </div>


    <?php include "templates/footer.php" ?>

</div>   <!-- Ende VEROData -->

<!-- Modal für Zusammenfassung -->
<div class="modal fade" id="arrayModal">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
           <div class="modal-body" id="modalBody">
            <!-- Inhalt wird hier geladen -->
            </div>
        </div>
    </div>
</div>

<script src="js/script.js"></script>
<script src="js/checkPIDs.js"></script>


</body>
</html>
