	
	<div id="IdcDivStatistic"  class="w-100 h-100 p-2 m-0 ximeo_bg-light" style="display: none !important">

		<iframe id="IdcStatisticEditorFrame" class="w-100 h-100" style="display: none;"></iframe>

		<div id="IdcStatisticMainFrame" class="d-flex flex-column w-100 h-100 m-0 p-0 rounded-top bg-white">
											
			<div class="row w-100 m-0 ps-0 pe-0 pt-0 pb-0 rounded-top">
		
				<ul class="nav nav-tabs rounded-top" id="myTab" role="tablist">
					<li class="nav-item" role="presentation">
						<button class="nav-link active" id="IdcStatisticGraphicTab" data-langkey="Graphics" data-bs-toggle="tab" data-bs-target="#IdcStatisticGraphicPanel" type="button" role="tab">
						</button>
					</li>
					<li class="nav-item" role="presentation">
						<button class="nav-link" id="IdcStatisticStudyTab" data-langkey="Study" data-bs-toggle="tab" data-bs-target="#IdcStatisticStudyPanel" type="button" role="tab">
						</button>
					</li>
					<li class="nav-item" role="presentation">
						<button class="nav-link" id="IdcStatisticSerieTab" data-langkey="Serie" data-bs-toggle="tab" data-bs-target="#IdcStatisticStudyPanel" type="button" role="tab">
						</button>
					</li>
					<li class="nav-item" role="presentation">
						<button class="nav-link" id="IdcStatisticJasperTab" data-langkey="Jasper reports" data-bs-toggle="tab" data-bs-target="#IdcStatisticJasperPanel" type="button" role="tab">
						</button>
					</li>
				</ul>
		
			</div>


			<div class="row flex-grow-1 m-0 ps-0 pe-0 pt-0 pb-0" style="min-height: 0px;">

				<div class="tab-content m-0 p-0 pt-2 bg-light" style="max-height: 100% !important;">
							
					<div class="tab-pane show active fade h-100 w-100 m-0 p-0" id="IdcStatisticGraphicPanel" role="tabpanel" aria-labelledby="IdcStatisticGraphicTab">		
					</div>

					<div class="tab-pane fade h-100 w-100 m-0 p-0" id="IdcStatisticStudyPanel" role="tabpanel" aria-labelledby="IdcStatisticStudyTab">		
						<div id="IdcStatisticStudySplitter1_2" class="splitter-v w-100 h-100 p-0 m-0" data-ratio="0.25">
			
							<div class="pan-left m-0 p-0 ps-3 pe-3 pb-2">

								<div class="row w-100 m-0 p-0">
									<label class="form-label fw-bold m-0 p-0 pb-1" data-langkey="Studies :"></label>
									<div id="IdcStatStudyStudiesContainer" class="m-0 p-0 mb-1"></div>
								</div>

								<div id="IdcStatSerieDiv" class="row w-100 m-0 p-0" style="display:none;">
									<label class="form-label fw-bold m-0 p-0 pb-1" data-langkey="Series :"></label>
									<div id="IdcStatStudySeriesContainer" class="m-0 p-0 mb-1"></div>
								</div>

								<div class="row w-100 m-0 p-0 pt-3">
									<div class="col-md-auto m-0 p-0 pe-3">
										<label class="form-label fw-bold m-0 p-0 pb-2" for="IdcStatStudyFrom" data-langkey="From :"></label>
										<input type="date" id="IdcStatStudyFrom" class="form-control form-control-sm m-0 p-0 ps-2 fs-6" autocomplete="off" size="8" placeholder="jj/mm/aaaa" />
									</div>
									<div class="col-md-auto m-0 p-0">
										<label class="form-label fw-bold m-0 p-0 pb-2" for="IdcStatStudyTo" data-langkey="Until :"></label>
										<input type="date" id="IdcStatStudyTo" class="form-control form-control-sm m-0 p-0 ps-2 fs-6" autocomplete="off" size="8" placeholder="jj/mm/aaaa">
									</div>
								</div>

								<div class="row w-100 m-0 p-0 pt-3">
									<label class="form-label fw-bold m-0 p-0 pb-1" data-langkey="Modalities :"></label>
									<div id="IdcStatStudyModalitiesContainer" class="m-0 p-0 mb-1"></div>
								</div>

								<div class="row w-100 m-0 p-0 pt-3 pb-4 border-bottom">
									<div class="col-md-auto m-0 p-0 pe-4">
										<label class="form-label fw-bold m-0 p-0 pb-1" data-langkey="I.M.C. :"></label>
										<div id="IdcStatStudyIMCContainer" class="m-0 p-0 mb-1"></div>
									</div>
								</div>

								<div class="row w-100 m-0 p-0 pt-3 pb-4 border-bottom">
									<div class="col-md-auto m-0 p-0">
										<label class="form-label fw-bold m-0 p-0 pb-1" data-langkey="Ages :"></label>
										<div id="IdcStatStudyAgeContainer" class="m-0 p-0 mb-1"></div>
									</div>
								</div>

								<div class="row w-100 m-0 p-0 pt-2">
  									<div class="d-flex flex-row-reverse flex-wrap w-100 m-0 p-0">
    
    									<div class="h-100 m-0 p-0 pt-2 pe-2">
      										<button class="ximeo_button ximeo_app-color" onclick="StatStudyExportModel();">
        										<img src="./SubFW/bmp/export_model-1.png" class="ximeo_img_button">
        										<span data-langkey="Export from a model..."></span>
      										</button>
    									</div>

    									<div class="h-100 m-0 p-0 pt-2 pe-2">
      										<button class="ximeo_button ximeo_app-color" onclick="StatPreviewCSV();">
        										<img src="./SubFW/bmp/export_csv-1.png" class="me-2" style="width: 22px; vertical-align: middle;">
        										<span data-langkey="Preview CSV"></span>
      										</button>
    									</div>

  									</div>
								</div>


							</div>

							<div class="separator_v">
							</div>

							<div class="pan-right m-0 p-0">
								<div class="d-flex flex-column w-100 h-100 m-0 p-0 ps-2 pe-2 pb-2">
									<div class="row w-100 m-0 p-0 pt-2 pb-2 ximeo_app-color text-white fw-bold rounded-top">
										<span data-langkey="Preview" data-id="-1"></span>
									</div>
									<div class="row flex-grow-1 m-0 p-0 border" style="min-height:0px;">
										<div id="IdcStatPreviewStudyDTContainer" class="w-100 h-100 m-0 p-0" style="min-height:0px; display: none;">
										</div>
										<div id="IdcStatPreviewSerieDTContainer" class="w-100 h-100 m-0 p-0" style="min-height:0px; display: none;">
										</div>
									</div>

									<div class="row w-100 m-0 p-0">
										<div class="d-flex flex-column w-100 h-100 m-0 p-0">
											<div class="d-flex flex-row-reverse w-100 h-100 m-0 p-0">
                  						
                  								<div class="col-md-auto h-100 m-0 p-0 pt-2 pe-2">
                									<button class="ximeo_button ximeo_app-color" onclick="StatDisplayCSV();">
                									<!-- <button class="ximeo_button" onclick="StatShowEditor();"> -->
                  										<img src="./SubFW/bmp/export_model-1.png" class="ximeo_img_button ximeo_app-color" >
                  										<span data-langkey="Export to CSV"></span>
                									</button>
              									</div>
              								</div>
										</div>
									</div>
								</div>
							</div>
						
						</div>
					</div>

					<div class="tab-pane fade h-100 w-100 m-0 p-0" id="IdcStatisticSeriePanel" role="tabpanel" aria-labelledby="IdcStatisticSerieTab">		
						<div id="IdcStatisticSerieSplitter1_2" class="splitter-v w-100 h-100 p-0" data-ratio="0.5" style="background-color: #F0F0F0;">
			
							<div class="pan-left ximeo_bg-light m-0 p-0">
								
							</div>

							<div class="separator_v">
							</div>

							<div class="pan-right ximeo_bg-light m-0 p-0">
							</div>
						
						</div>
					</div>



					<div class="tab-pane show active fade h-100 w-100 m-0 p-0" id="IdcStatisticJasperPanel" role="tabpanel" aria-labelledby="IdcStatisticJasperTab">	
						<div id="IdcStatisticJasperSplitter1_2" class="splitter-v w-100 h-100 p-0" data-ratio="0.25" style="background-color: #F0F0F0;">
			
							<div class="pan-left ximeo_bg-light m-0 p-0 bg-light">


								<div class="d-flex flex-column w-100 h-100 m-0 p-0 ps-2 pe-2 bg-light">

									<div class="row w-100 m-0 p-0">
										<div class="w-100 m-0 p-0 ps-1 pe-1 pt-2 d-flex align-items-end">
  											<div class="d-flex flex-column w-100 me-2">
    											<label class="form-label fw-bold" for="IdcStatJasperSelect">Rapport :</label>
    											<select id="IdcStatJasperSelect" class="form-select form-select-sm"></select>
  											</div>

  											<button id="refreshBtn" class="btn btn-sm ximeo_app-color" type="button">
    											<img src="SubFW/bmp/refresh.png" data-langkey_title="Refresh" class="imgclickable ximeo_bmp"
      														onclick="StatJasperRefreshReportsList()" />
  											</button>
										</div>
									</div>

									<div class="row flex-grow-1 m-0 p-0 pt-3 overflow-auto" style="min-height:0px;">
										<div id="IdcStatJasperParameters" class="m-0 p-0 pt-2 pb-2 ps-2 pe-2">
										</div>
									</div>

									<div class="row m-0 p-0 ps-2 pt-2 pb-2 pe-2 border-top">
										<div class="h-100 m-0 p-0 d-flex justify-content-end">
											<div class="form-check">
      											<input class="form-check-input" type="checkbox" value="" id="IdcStatJasperPDFCheck">
      											<label class="form-check-label" for="IdcStatJasperPDFCheck">
        											Affichage PDF
      											</label>
    										</div>
										</div>
									</div>

									<div class="row m-0 p-0 ps-2 pt-2 pb-2 pe-2 border-top">
										<div class="h-100 m-0 p-0 d-flex justify-content-end">
      										<button class="ximeo_button ximeo_app-color" onclick="StatJasperRender();">
        										<img src="./SubFW/bmp/export_model-1.png" class="ximeo_img_button">
        										<span data-langkey="Show report">Render</span>
      										</button>
    									</div>
    								</div>

    							</div>

							</div>

							<div class="separator_v">
							</div>

							<div class="pan-right ximeo_bg-light m-0 p-0">
								<div id ="IdcStatJasperRender" class="w-100 h-100 m-0 p-0 ps-2 pe-2 pb-2 bg-light d-flex overflow-auto">
								</div>
							</div>
						
						</div>	
					</div>






				</div>

			</div>


		</div>
		
	</div>






	<div id="IdcDlgStatStudyModelExport"  class="modal" tabindex="-1" style="z-index: 1080 !important;" data-ident="" data-onsavefunction="" data-bs-backdrop="static" role="dialog" aria-hidden="true">
		<div class="modal-dialog modal-dialog-centered modal-sm" role="document" style="resize: true;">
			<div class="modal-content">
										
				<div class="modal-header p-3 pb-3 pt-3 border-bottom bg-light">
					<h5 class="fw-bold mb-0" data-langkey="Export template available"></h5>
					<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
				</div>
										
				<div class="modal-body w-100 p-1">
					<ol class="list-group">
         				<?php
         					$conn = get_dbconnection();
       						if($conn)
       						{
       		  					$sql = "select stat_id,label from stats_template where removed = false and type = 'STUDY';";

       		  					if($query=pg_query($conn,$sql))
       		  					{
       		    					while($row = pg_fetch_row($query))
       		    					{ ?>
       									<li class="stattemplate" id="<?=$row[0]?>" onclick="downloadWithTemplate(this.id)"><?=htmlspecialchars($row[1])?></li>
       								<?php }
       							}
       						} ?>
      				</ol>
				</div>
						
				<div class="modal-footer">
						
					<div class="col-md-auto">
						<button class="ximeo_button" onclick="StatStudyExportModelValidate ();">
							<img src="./SubFW/bmp/validate_white.png" class="ximeo_img_button">
							<span >Validate</span>
						</button>
						<button class="ximeo_button ximeo_bg-dark-2" onclick="$('#IdcDlgStatStudyModelExport').modal('hide');">
							<img src="./SubFW/bmp/close_white.png" class="ximeo_img_button">
							<span data-langkey="Cancel">Cancel</span>
						</button>
					</div>
				</div>
			</div>
		</div>
	</div>