<commit_before><?php
/**
 * SAHARA Web Interface
 *
 * User interface to Sahara Remote Laboratory system.
 *
 * @license See LICENSE in the top level directory for complete license terms.
 *
 * Copyright (c) 2010, University of Technology, Sydney
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *  * Redistributions of source code must retain the above copyright notice,
 *    this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *  * Neither the name of the University of Technology, Sydney nor the names
 *    of its contributors may be used to endorse or promote products derived from
 *    this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * @author <NAME> (tmachet)
 * @date 9th March 2011
 *
 */
$this->headLink()->appendStylesheet($this->baseUrl('/css/session.css'));
$this->headLink()->appendStylesheet($this->baseUrl('/css/reports.css'));
$this->headLink()->appendStylesheet($this->baseUrl('/css/jquery.ui.selectmenu.css'));
$this->headScript()->appendFile($this->baseUrl('/js/jquery.ui.selectmenu.js'));
$this->headScript()->appendFile($this->baseUrl('/js/reports.js'));


?>

<?php if($this->persona == "ADMIN" || $this->persona == "ACADEMIC"): ?>

<div class="contentheader">
	<h2>Reports</h2>
</div>


<form id="accessform"  action="/reports/accessreport/">
<div class="reportscontainer ui-corner-all overlayelementhide">
	<div class="sessionpanelheader">
		<p><span class="ui-icon ui-icon-suitcase sessionpanelheadericon"></span> Access Reports:</p>
	</div>
	<div class="reportdescription">
		<p>This report supplies access details per rig, rig type, class or user over a specified period.
		The session details such as queue duration and session duration are reported per user for the selection. </p>
	</div>
	<div class="groupdropdown">
		<label for="accessgroup">Select type for report: <br></label>
		<select id="accessgroup" name="accessgroup" class="ui-corner-bottom validate[required]">
			<option value="">Select a type</option>
			<?php if ($this->persona == "ADMIN") echo "<option value=\"RIG\" >Rig Name</option>" ?>
			<?php if ($this->persona == "ADMIN") echo "<option value=\"RIG_TYPE\">Rig Type</option>" ?>
			<option value="USER_CLASS">User Class</option>
			<option value="USER">User</option>
		</select>
	</div>
	<div class="values">
		<label for="accessvalue">Select value: </label>
		<input id="accessvalue" type="text" name="accessvalue" class="valueinput ui-state-default ui-corner-all ui-selectmenu-status validate[required]">
		<div id="accessvaluelist"  class="valuelist ui-corner-bottom" >
			<ul>
			</ul>
		</div>
	</div>
	<div id="accessdatepicker" class="ui-corner-all">
		<label for="accessfrom">Date from:</label>
		<input type="text" id="accessfrom" name="accessfrom" />
		<label for="accessto">to:</label>
		<input type="text" id="accessto" name="accessto" />
	</div>
	<div>
		<button type="submit" id="accesssubmit" class="actiondialogbutton plaina ui-corner-all"  >
	    <img src="<?=$this->baseUrl('images/1rightarrow.png')?>" alt="Submit"><br/>
		Get Report
	    </button>
	</div>
	<div style="clear: both" ></div>
</div>
</form>


<form id="sessionform" action="/reports/sessionreport/">
<div class="reportscontainer ui-corner-all overlayelementhide">
	<div class="sessionpanelheader">
		<p><span class="ui-icon ui-icon-suitcase sessionpanelheadericon"></span> Session Reports:</p>
	</div>
	<div class="reportdescription">
		<p>Usage statistics per rig, rig type, class or user over a specified period.
		This includes details on average, median, maximum and minimum usage for the selection.</p>
	</div>
	<div class="groupdropdown">
		<label for="sessiongroup">Select type for report: <br></label>
		<select id="sessiongroup" name="sessiongroup" >
			<option value="">Select a type</option>
			<?php if($this->persona == "ADMIN") echo "<option value=RIG>Rig Name</option>" ?>
			<?php if($this->persona == "ADMIN") echo "<option value=RIG_TYPE>Rig Type</option>" ?>
			<option value=USER_CLASS>User Class</option>
			<option value=USER>User</option>
		</select>
	</div>
	<div class="values">
		<label for="sessionvalue">Select Value: </label>
		<input id="sessionvalue" type="text" name="sessionvalue" class="valueinput ui-state-default ui-corner-all ui-selectmenu-status validate[required]">
		<div id="sessionvaluelist" class="valuelist ui-corner-bottom">
			<ul>
			</ul>
		</div>
	</div>
	<div id="reportdatepicker" class="ui-corner-all">
		<label for="reportfrom">Date from</label>
		<input type="text" id="reportfrom" name="reportfrom" />
		<label for="reportto">to</label>
		<input type="text" id="reportto" name="reportto" />
	</div>
	<div>
		<button type="submit" id="sessionsubmit" class="actiondialogbutton plaina ui-corner-all" >
		<img src="<?=$this->baseUrl('images/1rightarrow.png')?>" alt="Submit"/><br/>
		Get Report
	    </button>
	</div>

	<div style="clear: both" ></div>
</div>
</form>



<script type="text/javascript">

$(function() {
	$('select').selectmenu({width:150});

	$("#sessionvaluelist").hide();
	$("#accessvaluelist").hide();

	$("#accessfrom, #accessto, #reportfrom, #reportto" ).datepicker({
		dateFormat: "dd-mm-yy",
		defaultDate: "+1d",
		changeMonth: true,
		changeYear: true,
		currentText: 'Now',
		numberOfMonths: 1,
		onSelect: function( selectedDate ) {
			var option = this.id == "accessfrom" || "reportfrom" ? "minDate" : "maxDate",
				instance = $( this ).data( "datepicker" ),
				date = $.datepicker.parseDate(
					instance.settings.dateFormat ||
					$.datepicker._defaults.dateFormat,
					selectedDate, instance.settings );
			if (this.id == "accessfrom")
				 $("#accessto").datepicker( "option", option, date );
			if (this.id == "reportfrom")
				 $("#reportto").datepicker( "option", option, date );
			$("#accessvaluelist").hide();
			$("#sessionvaluelist").hide();
		}
	});

	$("#sessionvalue").keyup(
			function(){
				var nameval = $(this).val();
				var namelength = nameval.length;
				var type = "session";
				var group = $("#sessiongroup").val();

				if( namelength > 0 & namelength%3 == 0 )
				{
					getValue(type, group, nameval,5);
				}
			}
	);

	$("#accessvalue").keyup(
			function(){
				var nameval = $(this).val();
				var namelength = nameval.length;
				var type = "access";
				var group = $("#accessgroup").val();
				selectmenu
				if( namelength > 0 & namelength%3 == 0 )
				{
					getValue(type, group, nameval,5);
				}
			}
	);

	$("#sessionvalue, #accessvalue").focusin(function() {<commit_msg>Disable autocomplete.<commit_after><?php
/**
 * SAHARA Web Interface
 *
 * User interface to Sahara Remote Laboratory system.
 *
 * @license See LICENSE in the top level directory for complete license terms.
 *
 * Copyright (c) 2010, University of Technology, Sydney
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *  * Redistributions of source code must retain the above copyright notice,
 *    this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *  * Neither the name of the University of Technology, Sydney nor the names
 *    of its contributors may be used to endorse or promote products derived from
 *    this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * @author <NAME> (tmachet)
 * @date 9th March 2011
 *
 */
$this->headLink()->appendStylesheet($this->baseUrl('/css/session.css'));
$this->headLink()->appendStylesheet($this->baseUrl('/css/reports.css'));
$this->headLink()->appendStylesheet($this->baseUrl('/css/jquery.ui.selectmenu.css'));
$this->headScript()->appendFile($this->baseUrl('/js/jquery.ui.selectmenu.js'));
$this->headScript()->appendFile($this->baseUrl('/js/reports.js'));


?>

<?php if($this->persona == "ADMIN" || $this->persona == "ACADEMIC"): ?>

<div class="contentheader">
	<h2>Reports</h2>
</div>


<form id="accessform"  action="/reports/accessreport/" autocomplete="off" >
<div class="reportscontainer ui-corner-all overlayelementhide">
	<div class="sessionpanelheader">
		<p><span class="ui-icon ui-icon-suitcase sessionpanelheadericon"></span> Access Reports:</p>
	</div>
	<div class="reportdescription">
		<p>This report supplies access details per rig, rig type, class or user over a specified period.
		The session details such as queue duration and session duration are reported per user for the selection. </p>
	</div>
	<div class="groupdropdown">
		<label for="accessgroup">Select type for report: <br></label>
		<select id="accessgroup" name="accessgroup" class="ui-corner-bottom validate[required]">
			<option value="">Select a type</option>
			<?php if ($this->persona == "ADMIN") echo "<option value=\"RIG\" >Rig Name</option>" ?>
			<?php if ($this->persona == "ADMIN") echo "<option value=\"RIG_TYPE\">Rig Type</option>" ?>
			<option value="USER_CLASS">User Class</option>
			<option value="USER">User</option>
		</select>
	</div>
	<div class="values">
		<label for="accessvalue">Select value: </label>
		<input id="accessvalue" type="text" autocomplete="off" name="accessvalue" class="valueinput ui-state-default ui-corner-all ui-selectmenu-status validate[required]">
		<div id="accessvaluelist"  class="valuelist ui-corner-bottom" >
			<ul>
			</ul>
		</div>
	</div>
	<div id="accessdatepicker" class="ui-corner-all">
		<label for="accessfrom">Date from:</label>
		<input type="text" id="accessfrom" name="accessfrom" />
		<label for="accessto">to:</label>
		<input type="text" id="accessto" name="accessto" />
	</div>
	<div>
		<button type="submit" id="accesssubmit" class="actiondialogbutton plaina ui-corner-all"  >
	    <img src="<?=$this->baseUrl('images/1rightarrow.png')?>" alt="Submit"><br/>
		Get Report
	    </button>
	</div>
	<div style="clear: both" ></div>
</div>
</form>


<form id="sessionform" action="/reports/sessionreport/" autocomplete="off" >
<div class="reportscontainer ui-corner-all overlayelementhide">
	<div class="sessionpanelheader">
		<p><span class="ui-icon ui-icon-suitcase sessionpanelheadericon"></span> Session Reports:</p>
	</div>
	<div class="reportdescription">
		<p>Usage statistics per rig, rig type, class or user over a specified period.
		This includes details on average, median, maximum and minimum usage for the selection.</p>
	</div>
	<div class="groupdropdown">
		<label for="sessiongroup">Select type for report: <br></label>
		<select id="sessiongroup" name="sessiongroup" >
			<option value="">Select a type</option>
			<?php if($this->persona == "ADMIN") echo "<option value=RIG>Rig Name</option>" ?>
			<?php if($this->persona == "ADMIN") echo "<option value=RIG_TYPE>Rig Type</option>" ?>
			<option value=USER_CLASS>User Class</option>
			<option value=USER>User</option>
		</select>
	</div>
	<div class="values">
		<label for="sessionvalue">Select Value: </label>
		<input id="sessionvalue" type="text" name="sessionvalue" autocomplete="off" class="valueinput ui-state-default ui-corner-all ui-selectmenu-status validate[required]">
		<div id="sessionvaluelist" class="valuelist ui-corner-bottom">
			<ul>
			</ul>
		</div>
	</div>
	<div id="reportdatepicker" class="ui-corner-all">
		<label for="reportfrom">Date from</label>
		<input type="text" id="reportfrom" name="reportfrom" />
		<label for="reportto">to</label>
		<input type="text" id="reportto" name="reportto" />
	</div>
	<div>
		<button type="submit" id="sessionsubmit" class="actiondialogbutton plaina ui-corner-all" >
		<img src="<?=$this->baseUrl('images/1rightarrow.png')?>" alt="Submit"/><br/>
		Get Report
	    </button>
	</div>

	<div style="clear: both" ></div>
</div>
</form>



<script type="text/javascript">

$(function() {
	$('select').selectmenu({width:150});

	$("#sessionvaluelist").hide();
	$("#accessvaluelist").hide();

	$("#accessfrom, #accessto, #reportfrom, #reportto" ).datepicker({
		dateFormat: "dd-mm-yy",
		defaultDate: "+1d",
		changeMonth: true,
		changeYear: true,
		currentText: 'Now',
		numberOfMonths: 1,
		onSelect: function( selectedDate ) {
			var option = this.id == "accessfrom" || "reportfrom" ? "minDate" : "maxDate",
				instance = $( this ).data( "datepicker" ),
				date = $.datepicker.parseDate(
					instance.settings.dateFormat ||
					$.datepicker._defaults.dateFormat,
					selectedDate, instance.settings );
			if (this.id == "accessfrom")
				 $("#accessto").datepicker( "option", option, date );
			if (this.id == "reportfrom")
				 $("#reportto").datepicker( "option", option, date );
			$("#accessvaluelist").hide();
			$("#sessionvaluelist").hide();
		}
	});

	$("#sessionvalue").keyup(
			function(){
				var nameval = $(this).val();
				var namelength = nameval.length;
				var type = "session";
				var group = $("#sessiongroup").val();

				if( namelength > 0 & namelength%3 == 0 )
				{
					getValue(type, group, nameval,5);
				}
			}
	);

	$("#accessvalue").keyup(
			function(){
				var nameval = $(this).val();
				var namelength = nameval.length;
				var type = "access";
				var group = $("#accessgroup").val();

				if( namelength > 0 & namelength%3 == 0 )
				{
					getValue(type, group, nameval,5);
				}
			}
	);

	$("#sessionvalue, #accessvalue").focusin(function() {
{'fraction_non_alphanumeric': 0.1616221174004193, 'fraction_numerical': 0.0034067085953878406, 'mean_word_length': 4.622467771639043, 'pattern_counts': {'":': 0, '<': 255, '<?xml version=': 0, '>': 305, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '665503', 'n_tokens_mistral': 5150, 'n_tokens_neox': 4614, 'n_words': 1344}