<commit_before><?php

require_once('config.php');
global $config;

require_once('page_template_dash_head.php');
require_once('page_template_dash_sidebar.php');

$election_id = $_GET['id'];
$election_name = get_election_name($election_id);

?>

<div class="content-wrapper">
	<section class="content-header">
		<h1 id="election_name" data-type="text" data-url="/endpoints/process_election_modify.php" data-pk="<?php echo $election_id; ?>">
			<?php echo $election_name; ?>
		</h1>
		<ol class="breadcrumb">
			<li><i class="fa fa-th-list"></i> Elections</li>
			<li><?php echo $election_name; ?></li>
			<li class="active">Dashboard</li>
		</ol>
	</section>
	<script>$(document).ready(function() { $('#election_name').editable({ params: function(params) { params.csrf = "<?php echo session_csrf_add(); ?>"; return params; }});});</script>
	<section class="content">
		<div class="row">
			<div class="col-lg-8 col-xs-12">
				<!-- Questions -->
				<div class="box box-primary">
					<div class="box-header with-border">
						<h3 class="box-title">Ballot Questions</h3>
					</div>
					<div class="box-body">
						<div class="nav-tabs-custom">
							<ul class="nav nav-tabs">
								<?php $questions = get_questions_for_election($election_id); 
								foreach($questions as $question) { ?>
								<li><a href="#tab_<?php echo $question['order']; ?>" data-toggle="tab" aria-expanded="false"><?php $data = json_decode($question['data'], true); echo $data['name']; ?><?php if($data['required']) { echo "*"; } ?></a></li>
								<?php } ?>
								<li class="pull-right"><a href="#" class="text-muted"><i class="fa fa-plus-circle"></i></a></li>
							</ul>
							<div class="tab-content">
								<?php foreach($questions as $question) { 
								$questiondata = json_decode($question['data'], true); ?>
								<div class="tab-pane" id="tab_<?php echo $question['order']; ?>">
									<?php render_question($questiondata); ?>
								</div>
								<?php } ?>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="col-lg-4 col-md-6 col-xs-12">
				<!-- Committee -->
				<div class="box box-primary">
					<div class="box-header with-border">
						<h3 class="box-title">Election Administrators</h3>
			
						<div class="box-tools">
							<ul class="pagination pagination-sm no-margin pull-right">
								<li><a href="#" data-toggle="modal" data-target="#addElectionAdmin"><i class="fa fa-plus-circle"></i></a></li>
							</ul>
						</div>
					</div>
					<div class="box-body">
						<table class="table">
							<tr id="admin-<?php echo $admin['user']; ?>">
								<th>Email</th>
								<th style="width: 40px">Action</th>
							</tr>
							<?php foreach($admins as $admin) { 
							$email = get_user_email($admin['user']); ?>
							<tr>
								<td><?php echo $email; ?></td>
								<td id="delete-admin-<?php echo $admin['user']; ?>">
									<form name="deleteadminbox" id="deleteadminbox" action="endpoints/process_delete_election_admin.php" method="post">
										<?php csrf_render_html(); ?>
										<input type="hidden" name="election_id_deleteadmin" value="<?php echo $election_id; ?>" />
										<input type="hidden" name="admin_id_deleteadmin" value="<?php echo $admin['user']; ?>" />
										<button type="submit" class="btn btn-block btn-danger btn-xs"><i class="fa fa-minus-square"></i></button>
									</form>
								</td>
							</tr>
							<?php } ?>
						</table>
					</div>
				</div>
				<!-- Voters --><commit_msg>Re-add get_election_admins<commit_after><?php

require_once('config.php');
global $config;

require_once('page_template_dash_head.php');
require_once('page_template_dash_sidebar.php');

$election_id = $_GET['id'];
$election_name = get_election_name($election_id);

?>

<div class="content-wrapper">
	<section class="content-header">
		<h1 id="election_name" data-type="text" data-url="/endpoints/process_election_modify.php" data-pk="<?php echo $election_id; ?>">
			<?php echo $election_name; ?>
		</h1>
		<ol class="breadcrumb">
			<li><i class="fa fa-th-list"></i> Elections</li>
			<li><?php echo $election_name; ?></li>
			<li class="active">Dashboard</li>
		</ol>
	</section>
	<script>$(document).ready(function() { $('#election_name').editable({ params: function(params) { params.csrf = "<?php echo session_csrf_add(); ?>"; return params; }});});</script>
	<section class="content">
		<div class="row">
			<div class="col-lg-8 col-xs-12">
				<!-- Questions -->
				<div class="box box-primary">
					<div class="box-header with-border">
						<h3 class="box-title">Ballot Questions</h3>
					</div>
					<div class="box-body">
						<div class="nav-tabs-custom">
							<ul class="nav nav-tabs">
								<?php $questions = get_questions_for_election($election_id); 
								foreach($questions as $question) { ?>
								<li><a href="#tab_<?php echo $question['order']; ?>" data-toggle="tab" aria-expanded="false"><?php $data = json_decode($question['data'], true); echo $data['name']; ?><?php if($data['required']) { echo "*"; } ?></a></li>
								<?php } ?>
								<li class="pull-right"><a href="#" class="text-muted"><i class="fa fa-plus-circle"></i></a></li>
							</ul>
							<div class="tab-content">
								<?php foreach($questions as $question) { 
								$questiondata = json_decode($question['data'], true); ?>
								<div class="tab-pane" id="tab_<?php echo $question['order']; ?>">
									<?php render_question($questiondata); ?>
								</div>
								<?php } ?>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="col-lg-4 col-md-6 col-xs-12">
				<!-- Committee -->
				<div class="box box-primary">
					<div class="box-header with-border">
						<h3 class="box-title">Election Administrators</h3>
			
						<div class="box-tools">
							<ul class="pagination pagination-sm no-margin pull-right">
								<li><a href="#" data-toggle="modal" data-target="#addElectionAdmin"><i class="fa fa-plus-circle"></i></a></li>
							</ul>
						</div>
					</div>
					<div class="box-body">
						<table class="table">
							<tr id="admin-<?php echo $admin['user']; ?>">
								<th>Email</th>
								<th style="width: 40px">Action</th>
							</tr>
							<?php 
							$admins = get_election_admins($election_id);
							foreach($admins as $admin) { 
							$email = get_user_email($admin['user']); ?>
							<tr>
								<td><?php echo $email; ?></td>
								<td id="delete-admin-<?php echo $admin['user']; ?>">
									<form name="deleteadminbox" id="deleteadminbox" action="endpoints/process_delete_election_admin.php" method="post">
										<?php csrf_render_html(); ?>
										<input type="hidden" name="election_id_deleteadmin" value="<?php echo $election_id; ?>" />
										<input type="hidden" name="admin_id_deleteadmin" value="<?php echo $admin['user']; ?>" />
										<button type="submit" class="btn btn-block btn-danger btn-xs"><i class="fa fa-minus-square"></i></button>
									</form>
								</td>
							</tr>
							<?php } ?>
						</table>
					</div>
				</div>
				<!-- Voters -->
{'fraction_non_alphanumeric': 0.21524727221198808, 'fraction_numerical': 0.0042510982003684285, 'mean_word_length': 3.1887240356083084, 'pattern_counts': {'":': 0, '<': 229, '<?xml version=': 0, '>': 229, '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': '663820', 'n_tokens_mistral': 3090, 'n_tokens_neox': 2348, 'n_words': 443}