Browse Source

User input enabled.

master 0.0.1
Rogier Neeleman 9 years ago
parent
commit
21e6709dec
  1. 17
      application/controllers/Beoordelen.php
  2. 13
      application/controllers/Dashboard.php
  3. 1
      application/models/Beoordelen_model.php
  4. 7
      application/views/dashboard_user.php
  5. 21
      application/views/header.php
  6. 4
      application/views/login.php
  7. 17
      application/views/user_lijsten.php
  8. 20
      application/views/user_ronde.php
  9. 24
      application/views/user_score.php
  10. 37
      application/views/user_subgroep.php

17
application/controllers/Beoordelen.php

@ -13,6 +13,7 @@ class Beoordelen extends CI_Controller
if(! $this->session->userdata('validated')){ if(! $this->session->userdata('validated')){
redirect(base_url('/login')); redirect(base_url('/login'));
} }
$data['page'] = 'beoordelen';
} }
public function index() public function index()
@ -22,7 +23,7 @@ class Beoordelen extends CI_Controller
public function lijst() public function lijst()
{ {
$data['title'] = 'JOS'; $data['page'] = 'beoordelen';
// Get data // Get data
$this->load->model('Beoordelen_model'); $this->load->model('Beoordelen_model');
@ -35,7 +36,7 @@ class Beoordelen extends CI_Controller
} }
// Header // Header
$this->load->view('header'); $this->load->view('header', $data);
// login page // login page
$this->load->view('user_lijsten', $data); $this->load->view('user_lijsten', $data);
@ -46,6 +47,8 @@ class Beoordelen extends CI_Controller
public function ronde() public function ronde()
{ {
$data['page'] = 'beoordelen';
// Check input // Check input
$lijstid = $this->security->xss_clean($this->input->post('lijstid')); $lijstid = $this->security->xss_clean($this->input->post('lijstid'));
if ($lijstid OR $this->session->userdata('lijstid')) { if ($lijstid OR $this->session->userdata('lijstid')) {
@ -73,7 +76,7 @@ class Beoordelen extends CI_Controller
// Make page // Make page
// Header // Header
$this->load->view('header'); $this->load->view('header', $data);
// login page // login page
$this->load->view('user_ronde', $data); $this->load->view('user_ronde', $data);
@ -85,6 +88,8 @@ class Beoordelen extends CI_Controller
public function subgroep() public function subgroep()
{ {
$data['page'] = 'beoordelen';
// Check input // Check input
$ronde = $this->security->xss_clean($this->input->post('ronde')); $ronde = $this->security->xss_clean($this->input->post('ronde'));
if ($ronde OR $this->session->userdata('ronde')) { if ($ronde OR $this->session->userdata('ronde')) {
@ -111,7 +116,7 @@ class Beoordelen extends CI_Controller
} }
// Header // Header
$this->load->view('header'); $this->load->view('header', $data);
// login page // login page
$this->load->view('user_subgroep', $data); $this->load->view('user_subgroep', $data);
@ -122,6 +127,8 @@ class Beoordelen extends CI_Controller
public function score() public function score()
{ {
$data['page'] = 'beoordelen';
// Check input // Check input
$subgroepid = $this->security->xss_clean($this->input->post('subgroepid')); $subgroepid = $this->security->xss_clean($this->input->post('subgroepid'));
if (!$subgroepid) { if (!$subgroepid) {
@ -135,7 +142,7 @@ class Beoordelen extends CI_Controller
$data['vragen'] = $this->Beoordelen_model->get_vragen(); $data['vragen'] = $this->Beoordelen_model->get_vragen();
// Header // Header
$this->load->view('header'); $this->load->view('header', $data);
// login page // login page
$this->load->view('user_score', $data); $this->load->view('user_score', $data);

13
application/controllers/Dashboard.php

@ -26,15 +26,24 @@ class Dashboard extends CI_Controller
public function admin() public function admin()
{ {
$data['page'] = 'home';
// Header
$this->load->view('header', $data);
// login page
//$this->load->view('dashboard_user', $data);
// Footer
$this->load->view('footer');
} }
public function user() public function user()
{ {
$data['title'] = 'JOS'; $data['page'] = 'home';
// Header // Header
$this->load->view('header'); $this->load->view('header', $data);
// login page // login page
$this->load->view('dashboard_user', $data); $this->load->view('dashboard_user', $data);

1
application/models/Beoordelen_model.php

@ -96,6 +96,7 @@ class Beoordelen_model extends CI_Model
'vraagid' => $item['vraagid'], 'vraagid' => $item['vraagid'],
'ronde' => $ronde, 'ronde' => $ronde,
'subgroepid' => $subgroepid, 'subgroepid' => $subgroepid,
'timestamp' => date("Y-m-d H:i:s"),
'score' => $item['score'], 'score' => $item['score'],
'userid' => $this->session->id, 'userid' => $this->session->id,
); );

7
application/views/dashboard_user.php

@ -1,6 +1,5 @@
<div class="container"> <div class="container">
<h1>Invoeren scorelijsten</h1> <hr>
<p> Welkom bij het score systeem. Maak een keuze.
<a href='<?php echo base_url();?>beoordelen/'><button type="button" class="btn btn-success btn-lg">Beoordelen</button></a>
</p>
</div> </div>

21
application/views/header.php

@ -18,3 +18,24 @@
<![endif]--> <![endif]-->
</head> </head>
<body> <body>
<?php if($this->session->userdata('validated')) { ?>
<div class="container">
<div class="header clearfix">
<nav>
<ul class="nav nav-pills pull-right">
<li role="presentation" <?php if ($page == 'home') {?> class="active" <?php } ?> ><a href="<?php echo base_url('/');?>">Home</a></li>
<li role="presentation" <?php if ($page == 'beoordelen') {?> class="active" <?php } ?> ><a href="<?php echo base_url('beoordelen/');?>">Beoordelen</a></li>
<?php if ($this->session->admin == '1' OR $this->session->superadmin == '1') { ?>
<li role="presentation" <?php if ($page == 'configuratie') {?> class="active" <?php } ?> ><a href="<?php echo base_url('admin/config/');?>">Configuratie</a></li>
<?php }; ?>
<li role="presentation" <?php if ($page == 'info') {?> class="active" <?php } ?> ><a href="<?php echo base_url('info/');?>">Informatie</a></li>
<?php if ($this->session->superadmin == '1') { ?>
<li role="presentation" <?php if ($page == 'info') {?> class="active" <?php } ?> ><a href="<?php echo base_url('admin/regio/');?>">Regio </a></li>
<?php }; ?>
<li role="presentation"><a href="<?php echo base_url('logout/');?>">Logout</a></li>
</ul>
</nav>
</div>
</div>
<?php } ?>

4
application/views/login.php

@ -1,6 +1,6 @@
<div class='container-fluid'> <div class='container-fluid'>
<div class='row'> <div class='row'>
<div class="col-xs-12 col-md-6 col-md-offset-3"> <div class="ol-md-6 col-md-offset-3 .hidden-sm">
<img class="img-responsive" src="<?php echo base_url('images/login1.jpg'); ?>"> <img class="img-responsive" src="<?php echo base_url('images/login1.jpg'); ?>">
</div> </div>
</div> </div>
@ -13,6 +13,8 @@
// Viewing error's // Viewing error's
if (isset($errormsg)) { ?> if (isset($errormsg)) { ?>
<div class="alert alert-danger" role="alert"> <div class="alert alert-danger" role="alert">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
<span class="sr-only">Error:</span>
<?php echo $errormsg; ?> <?php echo $errormsg; ?>
</div> </div>
<?php } ?> <?php } ?>

17
application/views/user_lijsten.php

@ -1,16 +1,25 @@
<div class="container"> <div class="container">
<h1>De volgende lijsten zijn beschikbaar:</h1> <hr>
<div class='text-center'>
<div class="btn-group" role="group" aria-label="...">
<a href="<?php echo base_url('beoordelen/lijst'); ?>" role="button" class="btn btn-warning">Beoordeling</span></a>
<button type="button" class="btn btn-default">Ronde</button>
<button type="button" class="btn btn-default">Ploeg</button>
<button type="button" class="btn btn-default">Score</button>
</div>
</div>
<?php echo form_open(base_url().'beoordelen/ronde'); ?> <?php echo form_open(base_url().'beoordelen/ronde'); ?>
<p>
<div class="row"> <div class="row">
<div class="col-xs-2 col-sm-2 col-sm-offset-4"> <div class="text-center">
<?php echo form_dropdown('lijstid', $lijsten); ?> <?php echo form_dropdown('lijstid', $lijsten); ?>
</div> </div>
</div> </div>
</p>
<p> <p>
<div class="row"> <div class="row">
<div class="col-xs-2 col-sm-2 col-xs-offset-4 col-sm-offset-5"> <div class="text-center">
<button type="submit" class="btn btn-primary btn-lg">Kies</button> <button type="submit" class="btn btn-primary btn-lg">Kies</button>
</div> </div>
</div> </div>

20
application/views/user_ronde.php

@ -1,20 +1,28 @@
<div class="container"> <div class="container">
<h1>Kies de ronde</h1> <hr>
<div class='text-center'>
<div class="btn-group" role="group" aria-label="...">
<a href="<?php echo base_url('beoordelen/lijst'); ?>" role="button" class="btn btn-success">Beoordeling</span></a>
<a href="<?php echo base_url('beoordelen/ronde'); ?>" role="button" class="btn btn-warning">Ronde</button></a>
<button type="button" class="btn btn-default">Ploeg</button>
<button type="button" class="btn btn-default">Score</button>
</div>
</div>
<?php // $attributes = array('class' => 'form-horizontal', 'role' => 'form');?>
<?php echo form_open(base_url().'beoordelen/subgroep')."\n"; ?> <?php echo form_open(base_url().'beoordelen/subgroep')."\n"; ?>
<p>
<div class="row"> <div class="row">
<div class="col-xs-2 col-sm-2 col-xs-offset-3 col-sm-offset-4"> <div class="text-center">
<label>Ronde</label> <label>Ronde</label>
</div>
<div class="col-xs-2 col-sm-2">
<?php echo form_dropdown('ronde', $ronde); ?> <?php echo form_dropdown('ronde', $ronde); ?>
</div> </div>
</div> </div>
</p>
<p> <p>
<div class="row"> <div class="row">
<div class="col-xs-2 col-sm-2 col-xs-offset-4 col-sm-offset-5"> <div class="text-center">
<a href="<?php echo base_url('beoordelen/lijst'); ?>" type="submit" class="btn btn-primary btn-lg">Vorige</button></a>
<button type="submit" class="btn btn-primary btn-lg">Volgende</button> <button type="submit" class="btn btn-primary btn-lg">Volgende</button>
</div> </div>
</div> </div>

24
application/views/user_score.php

@ -1,12 +1,19 @@
<div class="container"> <div class="container">
<hr>
<div class='text-center'>
<div class="btn-group" role="group" aria-label="...">
<a href="<?php echo base_url('beoordelen/lijst'); ?>" role="button" class="btn btn-success">Beoordeling</span></a>
<a href="<?php echo base_url('beoordelen/ronde'); ?>" role="button" class="btn btn-success">Ronde</button></a>
<a href="<?php echo base_url('beoordelen/subgroep'); ?>" role="button" class="btn btn-success">Ploeg</button></a>
<button type="button" class="btn btn-warning">Score</button>
</div>
</div>
<div class="starter-template">
<h1>Geef de score aan</h1>
<?php echo form_open(base_url().'beoordelen/score_save'); ?> <?php echo form_open(base_url().'beoordelen/score_save'); ?>
<?php echo form_hidden('subgroepid', $subgroepid); ?> <?php echo form_hidden('subgroepid', $subgroepid); ?>
<p>
<?php <?php
foreach ($vragen as $vraag) foreach ($vragen as $vraag)
{ ?> { ?>
@ -26,16 +33,17 @@
</div> </div>
</div> </div>
<?php } ?> <?php } ?>
</p>
<p> <p>
<div class="row"> <div class="row">
<div class="col-xs-2 col-sm-2 col-xs-offset-4 col-sm-offset-5"> <div class="text-center">
<button type="submit" class="btn btn-success btn-lg">Opslaan</button> <a href="<?php echo base_url('beoordelen/subgroep'); ?>" type="submit" class="btn btn-primary btn-lg">Vorige</button></a>
<button type="submit" class="btn btn-danger btn-lg">Opslaan</button>
</div> </div>
</div> </div>
<?php echo form_close(); ?> </p>
<?php echo form_close(); ?>
</div> </div>
</div>

37
application/views/user_subgroep.php

@ -1,39 +1,60 @@
<div class="container"> <div class="container">
<hr>
<div class="starter-template"> <div class='text-center'>
<h1>Kies de ploeg</h1> <div class="btn-group" role="group" aria-label="...">
<a href="<?php echo base_url('beoordelen/lijst'); ?>" role="button" class="btn btn-success">Beoordeling</span></a>
<a href="<?php echo base_url('beoordelen/ronde'); ?>" role="button" class="btn btn-success">Ronde</button></a>
<?php if (count($subgroepen) == 0) { ?>
<a href="<?php echo base_url('beoordelen/subgroep'); ?>" role="button" class="btn btn-success">Ploeg</button></a>
<button type="button" class="btn btn-success">Score</button>
<?php } else { ?>
<a href="<?php echo base_url('beoordelen/subgroep'); ?>" role="button" class="btn btn-warning">Ploeg</button></a>
<button type="button" class="btn btn-default">Score</button>
<?php } ?>
</div>
</div>
<?php if (count($subgroepen) != 0) { ?> <?php if (count($subgroepen) != 0) { ?>
<?php echo form_open(base_url().'beoordelen/score'); ?> <?php echo form_open(base_url().'beoordelen/score'); ?>
<p>
<div class="row"> <div class="row">
<div class="col-xs-2 col-sm-2 col-sm-offset-5 col-xs-offset-2"> <div class="text-center">
<?php echo form_dropdown('subgroepid', $subgroepen); ?> <?php echo form_dropdown('subgroepid', $subgroepen); ?>
</div> </div>
</div> </div>
</p>
<p> <p>
<div class="row"> <div class="row">
<div class="col-xs-2 col-sm-2 col-xs-offset-4 col-sm-offset-5"> <div class="text-center">
<a href="<?php echo base_url('beoordelen/ronde'); ?>" type="submit" class="btn btn-primary btn-lg">Vorige</button></a>
<button type="submit" class="btn btn-primary btn-lg">Volgende</button> <button type="submit" class="btn btn-primary btn-lg">Volgende</button>
</div> </div>
</div> </div>
</p>
<?php echo form_close(); ?> <?php echo form_close(); ?>
<?php } else { ?> <?php } else { ?>
<p>
<div class="row"> <div class="row">
<div class="col-xs-10 col-sm-4 col-xs-offset-1 col-sm-offset-4"> <div class="text-center">
Er zijn geen groepen meer te beoordelen. Er zijn geen groepen meer te beoordelen.
</div> </div>
</div> </div>
</p>
<p>
<div class="row"> <div class="row">
<div class="col-xs-2 col-sm-2 col-xs-offset-4 col-sm-offset-5"> <div class="text-center">
<button type="button" class="btn btn-success btn-lg" disabled="disabled"> <button type="button" class="btn btn-success btn-lg" disabled="disabled">
<span class="glyphicon glyphicon-ok"></span> <span class="glyphicon glyphicon-ok"></span>
</button> </button>
</div> </div>
</div> </div>
</p>
<?php } ?> <?php } ?>
</div> </div>
</div>
Loading…
Cancel
Save