<commit_before><?php
/*******************************************************************************
 *
 *  filename    : GroupReports.php
 *  last change : 2003-09-03
 *  description : Detailed reports on group members
 *
 *  http://www.infocentral.org/
 *  Copyright 2003 <NAME>, <NAME>
 *
 *  InfoCentral is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 ******************************************************************************/

// Include the function library
require "Include/Config.php";
require "Include/Functions.php";

// Get all the groups
$sSQL = "SELECT * FROM group_grp ORDER BY grp_Name";
$rsGroups = RunQuery($sSQL);

// Set the page title and include HTML header
$sPageTitle = gettext("Group reports");
require "Include/Header.php";

?>

<script type="text/javascript">
var IFrameObj; // our IFrame object

function UpdateRoles()
{
	var group_ID = document.getElementById('GroupID').value;
	if (!document.createElement) {return true};
	var IFrameDoc;
	var URL = 'RPCdummy.php?mode=GroupRolesSelect&data=' + group_ID;
	if (!IFrameObj && document.createElement) {
		var tempIFrame=document.createElement('iframe');
		tempIFrame.setAttribute('id','RSIFrame');
		tempIFrame.style.border='0px';
		tempIFrame.style.width='0px';
		tempIFrame.style.height='0px';
		IFrameObj = document.body.appendChild(tempIFrame);

		if (document.frames) {
			// For IE5 Mac
			IFrameObj = document.frames['RSIFrame'];
		}
	}

	if (navigator.userAgent.indexOf('Gecko') !=-1
		&& !IFrameObj.contentDocument) {
		// For NS6
		setTimeout('AddToCart()',10);
		return false;
	}

	if (IFrameObj.contentDocument) {
		// For NS6
		IFrameDoc = IFrameObj.contentDocument;
	} else if (IFrameObj.contentWindow) {
		// For IE5.5 and IE6
		IFrameDoc = IFrameObj.contentWindow.document;
	} else if (IFrameObj.document) {
		// For IE5
		IFrameDoc = IFrameObj.document;
	} else {
		return true;
	}

	IFrameDoc.location.replace(URL);
	return false;
}

function updateGroupRoles(generated_html)
{
	if (generated_html == "invalid") {
		document.getElementById('GroupRole').innerHTML = <?php echo '\'<p class="LargeError">' . gettext("Invalid Group or No Roles Available!") . '<p>\';'; ?>
	} else {
		document.getElementById('GroupRole').innerHTML = generated_html;
	}
}
</script>

<?php if (!isset($_POST["GroupID"])) { ?>

<p align="center"><?php echo gettext("Select the group you would like to report:"); ?></p>
<form method="POST" action="GroupReports.php">
<table align="center">
	<tr>
		<td class="LabelColumn"><?php echo gettext("Select Group:"); ?></td>
		<td class="TextColumn">
			<?php
			// Create the group select drop-down
			echo "<select id=\"GroupID\" name=\"GroupID\" onChange=\"UpdateRoles();\"><option value=\"0\">". gettext('None') . "</option>";
			while ($aRow = mysql_fetch_array($rsGroups)) {
				extract($aRow);
				echo "<option value=\"" . $grp_ID . "\">" . $grp_Name . "</option>";
			}
			echo "</select>";
			?>
		</td>
	</tr>
	<tr>
		<td class="LabelColumn"><?php echo gettext("Select Role:"); ?></td>
		<td class="TextColumn"><span id="GroupRole"><?php echo gettext("No Group Selected"); ?></span></td>
	</tr>
	<tr>
		<td class="LabelColumn"><?php echo gettext("Only cart persons?:"); ?></td>
		<td class="TextColumn"><input type="checkbox" Name="OnlyCart" value="1"></td>
	</tr>
	<tr>
		<td class="LabelColumn"><?php echo gettext("Report Model:"); ?></td>
		<td class="TextColumn">
			<input type="radio" Name="ReportModel" value="1" checked><?php echo gettext("Report for group and role selected"); ?><br>
			<input type="radio" Name="ReportModel" value="2"><?php echo gettext("Report for any role in group selected"); ?><br>
<?php //			<input type="radio" Name="ReportModel" value="3"><?php echo gettext("Report any group and role"); ?>
		</td>
	</tr>
</table>
<p align="center">
<BR>
<input type="submit" class="icButton" name="Submit" <?php echo 'value="' . gettext("Next") . '"'; ?>>
<input type="button" class="icButton" name="Cancel" <?php echo 'value="' . gettext("Cancel") . '"'; ?> onclick="javascript:document.location='Menu.php';">
</p>
</form>

<?php } else {

$iGroupID = FilterInput($_POST['GroupID'],'int');

?>

<form method="POST" action="Reports/GroupReport.php">
<input type="hidden" Name="GroupID" value="<?php echo $iGroupID;?>">
<input type="hidden" Name="GroupRole" value="<?php echo $_POST['GroupRole'];?>">
<input type="hidden" Name="OnlyCart" value="<?php echo $_POST['OnlyCart'];?>">
<input type="hidden" Name="ReportModel" value="<?php echo $_POST['ReportModel'];?>">

<?php

$sSQL = "SELECT prop_Field, prop_Name FROM groupprop_master WHERE grp_ID = " . $iGroupID . " ORDER BY prop_ID";
$rsPropFields = RunQuery($sSQL);
<commit_msg>Minor change: Cancel button redirects to Report menu rather than to main menu.<commit_after><?php
/*******************************************************************************
 *
 *  filename    : GroupReports.php
 *  last change : 2003-09-03
 *  description : Detailed reports on group members
 *
 *  http://www.infocentral.org/
 *  Copyright 2003 <NAME>, <NAME>
 *
 *  InfoCentral is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 ******************************************************************************/

// Include the function library
require "Include/Config.php";
require "Include/Functions.php";

// Get all the groups
$sSQL = "SELECT * FROM group_grp ORDER BY grp_Name";
$rsGroups = RunQuery($sSQL);

// Set the page title and include HTML header
$sPageTitle = gettext("Group reports");
require "Include/Header.php";

?>

<script type="text/javascript">
var IFrameObj; // our IFrame object

function UpdateRoles()
{
	var group_ID = document.getElementById('GroupID').value;
	if (!document.createElement) {return true};
	var IFrameDoc;
	var URL = 'RPCdummy.php?mode=GroupRolesSelect&data=' + group_ID;
	if (!IFrameObj && document.createElement) {
		var tempIFrame=document.createElement('iframe');
		tempIFrame.setAttribute('id','RSIFrame');
		tempIFrame.style.border='0px';
		tempIFrame.style.width='0px';
		tempIFrame.style.height='0px';
		IFrameObj = document.body.appendChild(tempIFrame);

		if (document.frames) {
			// For IE5 Mac
			IFrameObj = document.frames['RSIFrame'];
		}
	}

	if (navigator.userAgent.indexOf('Gecko') !=-1
		&& !IFrameObj.contentDocument) {
		// For NS6
		setTimeout('AddToCart()',10);
		return false;
	}

	if (IFrameObj.contentDocument) {
		// For NS6
		IFrameDoc = IFrameObj.contentDocument;
	} else if (IFrameObj.contentWindow) {
		// For IE5.5 and IE6
		IFrameDoc = IFrameObj.contentWindow.document;
	} else if (IFrameObj.document) {
		// For IE5
		IFrameDoc = IFrameObj.document;
	} else {
		return true;
	}

	IFrameDoc.location.replace(URL);
	return false;
}

function updateGroupRoles(generated_html)
{
	if (generated_html == "invalid") {
		document.getElementById('GroupRole').innerHTML = <?php echo '\'<p class="LargeError">' . gettext("Invalid Group or No Roles Available!") . '<p>\';'; ?>
	} else {
		document.getElementById('GroupRole').innerHTML = generated_html;
	}
}
</script>

<?php if (!isset($_POST["GroupID"])) { ?>

<p align="center"><?php echo gettext("Select the group you would like to report:"); ?></p>
<form method="POST" action="GroupReports.php">
<table align="center">
	<tr>
		<td class="LabelColumn"><?php echo gettext("Select Group:"); ?></td>
		<td class="TextColumn">
			<?php
			// Create the group select drop-down
			echo "<select id=\"GroupID\" name=\"GroupID\" onChange=\"UpdateRoles();\"><option value=\"0\">". gettext('None') . "</option>";
			while ($aRow = mysql_fetch_array($rsGroups)) {
				extract($aRow);
				echo "<option value=\"" . $grp_ID . "\">" . $grp_Name . "</option>";
			}
			echo "</select>";
			?>
		</td>
	</tr>
	<tr>
		<td class="LabelColumn"><?php echo gettext("Select Role:"); ?></td>
		<td class="TextColumn"><span id="GroupRole"><?php echo gettext("No Group Selected"); ?></span></td>
	</tr>
	<tr>
		<td class="LabelColumn"><?php echo gettext("Only cart persons?:"); ?></td>
		<td class="TextColumn"><input type="checkbox" Name="OnlyCart" value="1"></td>
	</tr>
	<tr>
		<td class="LabelColumn"><?php echo gettext("Report Model:"); ?></td>
		<td class="TextColumn">
			<input type="radio" Name="ReportModel" value="1" checked><?php echo gettext("Report for group and role selected"); ?><br>
			<input type="radio" Name="ReportModel" value="2"><?php echo gettext("Report for any role in group selected"); ?><br>
<?php //			<input type="radio" Name="ReportModel" value="3"><?php echo gettext("Report any group and role"); ?>
		</td>
	</tr>
</table>
<p align="center">
<BR>
<input type="submit" class="icButton" name="Submit" <?php echo 'value="' . gettext("Next") . '"'; ?>>
<input type="button" class="icButton" name="Cancel" <?php echo 'value="' . gettext("Cancel") . '"'; ?> onclick="javascript:document.location='ReportList.php';">
</p>
</form>

<?php } else {

$iGroupID = FilterInput($_POST['GroupID'],'int');

?>

<form method="POST" action="Reports/GroupReport.php">
<input type="hidden" Name="GroupID" value="<?php echo $iGroupID;?>">
<input type="hidden" Name="GroupRole" value="<?php echo $_POST['GroupRole'];?>">
<input type="hidden" Name="OnlyCart" value="<?php echo $_POST['OnlyCart'];?>">
<input type="hidden" Name="ReportModel" value="<?php echo $_POST['ReportModel'];?>">

<?php

$sSQL = "SELECT prop_Field, prop_Name FROM groupprop_master WHERE grp_ID = " . $iGroupID . " ORDER BY prop_ID";
$rsPropFields = RunQuery($sSQL);

{'fraction_non_alphanumeric': 0.21302619508714707, 'fraction_numerical': 0.0063194373662215884, 'mean_word_length': 5.064276885043263, 'pattern_counts': {'":': 0, '<': 167, '<?xml version=': 0, '>': 163, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4197990', 'n_tokens_mistral': 3282, 'n_tokens_neox': 3145, 'n_words': 798}