<head>
<style type="text/css">
button {
 	margin-left: 2px;
 	margin-right: 2px;
}

#messageView {
    z-index: 1110!important; /* must set here to let date picker display on top */
}

#jobDetailView {
    z-index: 1110!important; /* must set here to let date picker display on top */
}

#jobAssignAttachmentView {
    z-index: 1110!important; /* must set here to let date picker display on top */
}

#AgentStatus {
    z-index: 1110!important; /* must set here to let date picker display on top */
}

.modal-header {
	background-color: #3c8dbc;
	color: white;
}

#calendar-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

</style>

</head>
<!-- Add Project Modal HTML -->

<div id="addJobQuotationView" class="modal fade" style="overflow: auto;overflow-y: scroll;" tabindex="-1" data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog" style="width: 80%;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">Job Quotation</h4>
            </div>
            <div class="modal-body">
	            <div id="modalAddJobQuotationHeaderViewContent">
	        	</div>
            </div>
            <div class="modal-footer">
            	<div id="modalAddJobQuotationHeaderViewButtonContent">
			   </div>
            </div>
        </div>
    </div>
</div>


<!-- message Modal HTML -->
<div id="messageView" class="modal fade" style="overflow: auto;overflow-y: scroll;">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header" id="modalMessageHeaderContent">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="modalMessageViewTitle" >Message</h4>
            </div>
            
            <div class="modal-body">
	            <div id="modalMessageViewContent">
	        	</div>
            </div>
            
            <div class="modal-footer">
            	<div id="modalMessageButtonContent">
            		<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
			   </div>
            </div>
        </div>
    </div>
</div>
<!-- save template pop up Modal HTML -->
<div id="SaveQuotationTemplateConfirmationView" class="modal fade" style="overflow: auto;overflow-y: scroll;">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="modalSaveQuotationTemplateConfirmationTitle">Save Quotation Template</h4>
            </div>
            
            <div class="modal-body">
                <div class="row">
                    <div id="modalSaveQuotationTemplateConfirmationContent" >
                            <div class="col-md-6">
                                <input  type="text" class="form-control" id="quotationTemplateName" placeholder="Template Name ">
                            </div>
                    </div>
                </div>
	            
            </div>
            
            <div class="modal-footer">
            	<div id="modalSaveQuotationTemplateConfirmationButton">
			   </div>
            </div>
        </div>
    </div>
</div>

<!-- Load template pop up Modal HTML -->
<div id="LoadQuotationTemplateConfirmationView" class="modal fade" style="overflow: auto;overflow-y: scroll;">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="modalLoadQuotationTemplateConfirmationTitle">Load Quotation Template</h4>
            </div>
            
            <div class="modal-body">
                <div class="row">
                    <div id="modalLoadQuotationTemplateConfirmationContent" >
                            <div class="col-md-6">
                                <select class="form-control" id="QuotationTemplateLoad"></select>
                            </div>
                    </div>
                </div>
	            
            </div>
            
            <div class="modal-footer">
            	<div id="modalLoadQuotationTemplateConfirmationButton">
			   </div>
            </div>
        </div>
    </div>
</div>

<!-- Submit pop up Modal HTML -->
<div id="deleteJobQuotationConfirmationView" class="modal fade" style="overflow: auto;overflow-y: scroll;">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="modalDeleteJobQuotationConfirmationTitle">Confirm Job Plan Deletion</h4>
            </div>
            
            <div class="modal-body">
	            <div id="modalDeleteJobQuotationConfirmationContent">
	            
	        	</div>
            </div>
            
            <div class="modal-footer">
            	<div id="modalDeleteJobQuotationConfirmationButton">
			   </div>
            </div>
        </div>
    </div>
</div>

<!-- confirmation message Modal HTML -->
<div id="confirmationMessageView" class="modal fade" style="overflow: auto;overflow-y: scroll;">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header" id="modalConfirmationMessageHeaderContent">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="modalConfirmationMessageViewTitle" >Message</h4>
            </div>
            
            <div class="modal-body">
	            <div id="modalConfirmationMessageViewContent">
	        	</div>
            </div>
            <div class="modal-footer">
            	<div id="modalcCnfirmationMessageButtonContent">
            		<button type="button" class="btn btn-default" data-dismiss="modal">Yes</button>
			   </div>
            </div>
        </div>
    </div>
</div>


<div class="modal fade" id="activityLoadingModal" tabindex="-1" data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title" id="modalLoadingTitle">Processing...</h4>
            </div>
            <div class="modal-body">
                <div class="progress progress-striped active">
                    <div class="progress-bar" role="progressbar" aria-valuenow="70" aria-valuemin="0" aria-valuemax="100" style="width:100%">
                        <span class="sr-only">70% Complete</span>
                      </div>
                </div>
            </div>
        </div>
    </div>
</div>


<input type="hidden" id="isManagerFilter" value="<?php echo isset($isManagerFilter) ? ($isManagerFilter ? 'true' : 'false' ) : 'false';?>" >

<div class="col-md-12" <?php echo isset($isManagerFilter) && $isManagerFilter ? "style='display:none'" : ''; ?>>
    <div class="filter-unit">
        <select style="height: 30px;" id="filterJobTypeQuotation" >
            <?php echo $this->getJobTypeFilter(); ?>
        </select>
    </div>
    <div class="filter-unit">
        <input  style="height: 30px;"  type="text" placeholder="Job Title" id="filterTitleJobQuotation">
    </div>
    <div class="filter-unit" style="display:none;">
        <input  style="height: 30px;"  type="text" placeholder="Customer Code" id="filterCustCodeJobQuotation">
    </div>
    <div class="filter-unit">
        <input  style="height: 30px;"  type="text" placeholder="Customer Name" id="filterCustomerJobQuotation">
    </div>
    <div class="filter-unit">
        <select style="height: 30px;" id="filterJobQuotationStatus" >
            <?php echo $this->getJobStatusFilter(); ?>
        </select>
    </div>
    <div class="filter-unit">
        <a href="#" onclick="return filterJobQuotation();" class="btn btn-primary btn-sm"><span class="fa fa-plus"></span> Filter</a>
    </div>

    
	<?php if(!isset($isManagerFilter) || $isManagerFilter == false) { ?>
    <div class="claim-btn">
        <table>
            <tr>
                <td>
                    <div>
                        <a onclick="return showAddJobQuotation();" role="button" class="btn btn-primary btn-sm" data-toggle="modal"><span class="glyphicon glyphicon-plus"></span> Add</a>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <?php } ?>

	<div class="filter-unit"> 
		<!-- <a href="#" onclick="return filterTaskSchedule();" class="btn btn-primary btn-sm"><span class="fa fa-plus"></span> Filter</a> -->
	</div>
	<?php if(!isset($isManagerFilter) || $isManagerFilter == false) { ?>
	<div class="claim-btn">
		<table>
			<tr>
				<td style="text-align:right;display:none">
				</td>
			</tr>
		</table>
	</div>
	<?php } ?>
</div>

<div class="col-md-12" id="errorShow"></div>

<div class="col-md-12" style="margin-top: 20px">
	<div class="box" id="testData">
		<table class="table" style="width: 100%; max-width: 100%; margin-bottom: 20px;" id="job-quotation-table">
		</table>
	</div>
</div>


<script>
$(document).ready(function () {
	filterJobQuotation();
});
</script>

<script>
$(document).ready(function () {
    var claimDayLast = 30;
    if(!isNaN($('#txtClaimDayLast').val()))
        claimDayLast = parseInt($('#txtClaimDayLast').val());
    var date = new Date();
    var firstDay = new Date();
    var lastDay = new Date();
    var todayDate = new Date();
    var startDate = new Date(new Date().setDate(todayDate.getDate()-claimDayLast));

    firstDay.setFullYear(date.getFullYear(), date.getMonth(), 1);
    lastDay.setFullYear(date.getFullYear(), date.getMonth() + 1, 0);
});
</script>
<script>

      document.addEventListener('DOMContentLoaded', function() {
        var calendarEl = document.getElementById('calendar');

        var calendar = new FullCalendar.Calendar(calendarEl, {
          plugins: [ 'dayGridMonth' ]
        });

        calendar.render();
      });

    </script>