<commit_before><?php
/**											new_report.php
 *
 *
 * Allows the editing or creation of both report wrapper definitions
 * and report definitions (depending on wether a responsibility course
 * is selected).
 *
 *
 */

$action='new_report_action.php';
$choice='new_report.php';
$toyear=get_curriculumyear();
$extrabuttons=array();

if($r>-1){$rcrid=$respons[$r]['course_id'];}
else{$rcrid='';}

$reptypes=array('profile','subject','wrapper');

two_buttonmenu($extrabuttons);
?>
  <form id="formtoprocess" name="formtoprocess" method="post" action="<?php print $host;?>">

	  <input type="text" style="display:none;" id="Id_db" name="id" value="" />
	  <input type="hidden" name="cancel" value="<?php print '';?>" />
	  <input type="hidden" name="current" value="<?php print $action;?>" />
	  <input type="hidden" name="choice" value="<?php print $current;?>" />
  </form>

  <div class="content">
	<div class="center">
<?php
	if($rcrid!=''){
		$tablecaption=get_string('subjectreports');
		}
	else{
		$tablecaption=get_string('subjectreportbinders',$book);
		}
?>
	  <h3><?php print $tablecaption;?></h3>
<?php
	foreach($reptypes as $reptype){
		if($rcrid!=''){
		    $d_report=mysql_query("SELECT id FROM report WHERE type='$reptype' AND
								course_id='$rcrid' AND year='$toyear' ORDER BY date DESC, title");
			$extrabuttons['newsubjectreport']=array('name'=>'current','value'=>'new_report_action.php');
			}
		else{
		    $d_report=mysql_query("SELECT id FROM report WHERE type='$reptype' AND
								course_id='wrapper' AND year='$toyear' ORDER BY date DESC, title");
			$extrabuttons['newreportbinder']=array('name'=>'current','value'=>'new_report_action.php');
			}
		if(mysql_num_rows($d_report)>0){
?>
	  <table class="listmenu" name="listmenu">
		<caption><?php print_string($reptype);?></caption>
		<thead>
		  <tr>
			<th></th>
			<th><?php print get_string('date');?></th>
			<?php if($rcrid!=''){ print '<th>'.get_string('stage').'</th>';}?>
			<th><?php print_string('title');?></th>
		  </tr>
		</thead>
<?php
	while($report=mysql_fetch_array($d_report,MYSQL_ASSOC)){<commit_msg>fix for manage subject reports buttons<commit_after><?php
/**											new_report.php
 *
 *
 * Allows the editing or creation of both report wrapper definitions
 * and report definitions (depending on wether a responsibility course
 * is selected).
 *
 *
 */

$action='new_report_action.php';
$choice='new_report.php';
$toyear=get_curriculumyear();
$extrabuttons=array();

if($r>-1){$rcrid=$respons[$r]['course_id'];}
else{$rcrid='';}

$reptypes=array('profile','subject','wrapper');
if($rcrid!=''){
	$extrabuttons['newsubjectreport']=array('name'=>'current','value'=>'new_report_action.php');
	}
else{
	$extrabuttons['newreportbinder']=array('name'=>'current','value'=>'new_report_action.php');
	}

two_buttonmenu($extrabuttons);
?>
  <form id="formtoprocess" name="formtoprocess" method="post" action="<?php print $host;?>">

	  <input type="text" style="display:none;" id="Id_db" name="id" value="" />
	  <input type="hidden" name="cancel" value="<?php print '';?>" />
	  <input type="hidden" name="current" value="<?php print $action;?>" />
	  <input type="hidden" name="choice" value="<?php print $current;?>" />
  </form>

  <div class="content">
	<div class="center">
<?php
	if($rcrid!=''){
		$tablecaption=get_string('subjectreports');
		}
	else{
		$tablecaption=get_string('subjectreportbinders',$book);
		}
?>
	  <h3><?php print $tablecaption;?></h3>
<?php
	foreach($reptypes as $reptype){
		if($rcrid!=''){
		    $d_report=mysql_query("SELECT id FROM report WHERE type='$reptype' AND
								course_id='$rcrid' AND year='$toyear' ORDER BY date DESC, title");
			}
		else{
		    $d_report=mysql_query("SELECT id FROM report WHERE type='$reptype' AND
								course_id='wrapper' AND year='$toyear' ORDER BY date DESC, title");
			}
		if(mysql_num_rows($d_report)>0){
?>
	  <table class="listmenu" name="listmenu">
		<caption><?php print_string($reptype);?></caption>
		<thead>
		  <tr>
			<th></th>
			<th><?php print get_string('date');?></th>
			<?php if($rcrid!=''){ print '<th>'.get_string('stage').'</th>';}?>
			<th><?php print_string('title');?></th>
		  </tr>
		</thead>
<?php
	while($report=mysql_fetch_array($d_report,MYSQL_ASSOC)){
{'fraction_non_alphanumeric': 0.2155111633372503, 'fraction_numerical': 0.0018801410105757932, 'mean_word_length': 5.7555555555555555, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 0, '>': 89, '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': '1520451', 'n_tokens_mistral': 1626, 'n_tokens_neox': 1517, 'n_words': 274}