<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>


<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <style type="text/css">
			   <!--
             body, div, td, span, li, input {
        	font-family: Arial, Helvetica;
                font-size: 15px;
             }
             th {
                font-size: 15px;
             }
            .center, .pageTitle, .form {
		position: relative;
		margin: 0 auto;
		text-align: left;
                font-size: 18px;
            }
            .pageTitle {
		font-size: 18px;
		font-weight: bold;
            }
            .form {
		border:2px solid black;
            }

            .form2 {
		border:2px solid black;
                width: 500px;
            }

            .tableHeader2 {
                background-color: #333;
                font-size: 20px;
                color: white;
                height: 40px;
            }
            .tableFooter2 {
                background-color: #333;
                font-size: 17px;
                height: 35px;
            }

            .tableHeader {
                background-color: white;
                color: black;
                font-size: 16px;
                height: 20px;
            }
            .tableFooter {
                background-color: white;
                color: black;
                font-size: 16px;
                height: 20px;
            }
            .tableRowOdd {
		background-color: #FFFFFF;
            }
            .tableRowEven {
		background-color: #EEF0F0;
            }
            a {
                text-decoration: none;
                color: #337799;
                font-weight: bolder;
            }
            a:hover {
                text-decoration:underline;
                color: #FF5555;
                font-weight: bolder;
            }
            td {
                text-align: left;
            }
            .error{
                color : #FF0000;
                font-weight: bolder;
            }
            .errorStackTrace {
                color : #000000;
            }
            .formUserError {
                color : #FF0000;
                font-weight: bolder;
            }
            .name1{
                width: 150px;
            }
            .name2{
                width: 100px;
            }
            .name3{
                width: 60px;
            }
             .sor{
                    margin-top: 68px;
                    margin-left: 1040px;
                    color: black;
                    width: 156px;
                    height: 50px;
                }
            body{
                    position:relative;
                    margin: 0;
                    padding: 0;
                    height: auto;
                    height: 100%;
                    min-height:100%;
                    width: auto;
                    width: 100%;
                    min-width:100%;
                }
                .header{
                    position:relative;
                    height: 180px;
                    background-image:url("fej2.jpg");
                    background-repeat: repeat-x;
                }
                .menu{
                    position:relative;
                    width: 289px;
                    float:left;
                    background-image:url("menu.jpg");
                    background-repeat: repeat-y;
                    height: 700px;
                }
                .content{
                    position:relative;
                    float:left;
                    width: 900px;
                    float:left;
                    height: 700px;
                }
                /*------------------------------------------------------------ */
                .menupanels{
                    list-style-type: none;
                    margin-left: 25px;
                    padding: 0;
                    width: 210px; /* width of menu */

                }

                .menupanels li{
                    border-bottom: 1px solid white; /* white border beneath each menu item */
                }
                .menupanels li a{
                    background: #333 url("paneltop.gif") no-repeat left top; /*color of menu by default*/
                    display: block;
                    color: white;
                    width: auto;
                    padding: 5px 0; /* Vertical (top/bottom) padding for each menu link */
                    text-indent: 25px;
                    text-decoration: none;
                    border-bottom: 1px solid black; /*bottom border of menu link. Should be equal or darker to link's bgcolor*/

                }
                .menupanels li a:visited, .menupanels li a:active{
                    color: white;
                }
                .menupanels li a:hover{
                    background-color: black; /*color of menu onMouseover*/
                    color: white;
                    border-bottom: 1px solid black; /*bottom border of menu link during hover. Should be equal or darker to link's hover's bgcolor*/
                }
            </style>
            <title>Meghírdetett tárgyak</title>
        </head>
        <body>
            <div class="header">
               <div class="sor">
                    <center>
                        <h:outputText value="#{Menu.user.name}"/><br>
                        <h:outputText value="ADMINISZTRÁTOR" rendered="#{Menu.user.userRole == 'ADMIN'}"/>
                        <h:outputText value="HALLGATÓ" rendered="#{Menu.user.userRole == 'STUDENT'}"/>
                        <h:outputText value="OKTATÓ" rendered="#{Menu.user.userRole == 'TEACHER'}"/>
                    </center>
                </div>
            </div>
            <div class="menu">
                <img src="logo.jpg" alt="logo"/>
                <ul class="menupanels">
                    <li><a href="faces/listsemester.jsp">Aktuális Félév</a></li>
                    <li><a href="faces/listsubject.jsp">Tárgyak hírdetése</a></li>
                    <li><a href="faces/listcurrentsubject.jsp">Meghírdetett tárgyak</a></li>
                    <li><a href="faces/listthesis.jsp">Diplomamunka</a></li>
                    <li><a href="faces/login.jsp">Kijelentkezés</a></li>
                </ul>

            </div>
            <div class="content">
                <img src="cim_egyi.jpg" alt="cim" style="margin-top: 0px; padding-top: 0px; margin-left: 134px;"/>
                <h:form>
                <center> <br>
                    <br><br>
                    <h:panelGrid columns="1" styleClass="form2" headerClass="tableHeader2" footerClass="tableFooter2" cellspacing="false">
                        <f:facet name="header" >
                            <h:outputText value="#{CreateSubject.currentSubject.subjectId.name}" />
                        </f:facet>
                    <f:facet name="footer" >
                        <h:panelGroup>
                            <h:commandButton  action="#{CreateSubject.backAction}" value="Vissza" immediate="true"/>
                            <h:commandButton  action="#{CreateSubject.saveAction}" value="Mentés"/>

                        </h:panelGroup>
                    </f:facet><br>
                    <h:outputText style="margin-left: 80px" value="Előadások:" />
                    <h:dataTable style="margin-left: 80px" cellspacing="false" value="#{CreateSubject.listLessonL}" var="lesson" binding="#{CreateSubject.tableComponentL}" rendered="#{CreateSubject.listSize1!=0}"
                                    styleClass="form" headerClass="tableHeader"  columnClasses="name1,name2, name3">

                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Oktató" />
                                </f:facet>
                            <h:outputText value="#{lesson.teacherId.name}" />
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Max létszám" />
                                </f:facet>
                                <h:outputText value="#{lesson.limit}" />
                            </h:column>

                            
                            <h:column>
                                <f:facet name="header">
                                     <h:outputText value="" />
                                </f:facet>
                                <h:commandLink action="#{CreateSubject.updateLectureAction}" value="Módosít"/>
                            </h:column>

                            </h:dataTable>

                    <h:commandButton style="margin-left: 80px" action="#{CreateSubject.addLectureAction}" value="Hozzáad" />
                        <br><br>
                    <h:outputText style="margin-left: 80px" value="Gyakorlatok:" />
                           <h:dataTable  style="margin-left: 80px" cellspacing="false" value="#{CreateSubject.listLessonP}" var="lesson" binding="#{CreateSubject.tableComponentP}" rendered="#{CreateSubject.listSize2!=0}"
                                    styleClass="form" headerClass="tableHeader"  columnClasses="name1,name2, name3">

                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Oktató" />
                                </f:facet>
                            <h:outputText value="#{lesson.teacherId.name}" />
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Max létszám" />
                                </f:facet>
                                <h:outputText value="#{lesson.limit}" />
                            </h:column>

                            
                            <h:column>
                                <f:facet name="header"/>
                                <h:commandLink action="#{CreateSubject.updateLectureAction}" value="Módosít"/>
                            </h:column>

                           
                        </h:dataTable>
                        <h:commandButton style="margin-left: 80px" action="#{CreateSubject.addPracticeAction}" value="Hozzáad" />
                           <br>
                </h:panelGrid>
               </center>
            </h:form>
            </div>
        </body>
    </html>
</f:view>
