View forms data on site

parent 7a013e01
......@@ -48,6 +48,8 @@ return [
['/teacher-form/submit-success',['guest'], ['get','post']],
['/teacher-form/mm',['guest'], ['get']],
['/admin', ['admin'], ['get']],
['/admin/university-form/display', ['admin'], ['get']],
['/admin/teacher-form/display', ['admin'], ['get']],
],
],
],
......
......@@ -16,11 +16,17 @@
<tbody>
<tr>
<td>Καταχωρημένες αιτήσεις εθελοντών - Εκπαιδευτικοί</td>
<td><a class="btn btn-primary btn-sm" href="{{ path_for('export.csv', {type: 'volunteer_teachers'}) }}"><i class="fa fa-download"></i> Αρχείο .csv</a></td>
<td class="text-right">
<a class="btn btn-primary btn-sm" href="{{ path_for('export.csv', {type: 'volunteer_teachers'}) }}"><i class="fa fa-download"></i> Αρχείο .csv</a>
<a class="btn btn-default btn-sm" href="{{ path_for('admin.volunteer.teacher') }}"><span class="fa fa-list"></span> Προβολή</a>
</td>
</tr>
<tr>
<td>Καταχωρημένες αιτήσεις εθελοντών - Ιδρύματα</td>
<td><a class="btn btn-primary btn-sm" href="{{ path_for('export.csv', {type: 'volunteer_institutions'}) }}"><span class="fa fa-download"></span> Αρχείο .csv</a></td>
<td class="text-right">
<a class="btn btn-primary btn-sm" href="{{ path_for('export.csv', {type: 'volunteer_institutions'}) }}"><span class="fa fa-download"></span> Αρχείο .csv</a>
<a class="btn btn-default btn-sm" href="{{ path_for('admin.volunteer.univ') }}"><span class="fa fa-list"></span> Προβολή</a>
</td>
</tr>
</tbody>
</table>
......
......@@ -7,6 +7,7 @@ use Slim\App;
use Slim\Container;
use Slim\Http\Request;
use Slim\Http\Response;
use GrEduLabs\UniversityForm\Service\UniversityFormService;
/**
* gredu_labs.
......@@ -153,6 +154,7 @@ return function (App $app) {
'Όνομα',
'Επώνυμο',
'Ειδικότητα',
'Ειδικότητα (λεκτικό)',
'Αριθμός Μητρώου',
'Τηλέφωνο',
'Email',
......@@ -242,43 +244,32 @@ return function (App $app) {
$c['csv_export_volunteer_teachers'] = function ($c) {
return function () {
$sql = 'SELECT `id`, '
. '`name`, '
. '`surname`, '
. '`eidikothta`, '
. '`arithmitroou`, '
. '`telef`, '
. '`email`, '
. '`school`, '
. '`schooltelef`, '
. '`comments`, '
. '`projecttitle`, '
. '`projecturl`, '
. '`projectdescription` '
. ' FROM `volunteerteachers` '
$sql = 'SELECT `volunteerteachers`.`id`, '
. '`volunteerteachers`.`name`, '
. '`volunteerteachers`.`surname`, '
. '`volunteerteachers`.`eidikothta`, '
. '`branch`.`name` AS `eidikothta_name`, '
. '`volunteerteachers`.`arithmitroou`, '
. '`volunteerteachers`.`telef`, '
. '`volunteerteachers`.`email`, '
. '`volunteerteachers`.`school`, '
. '`volunteerteachers`.`schooltelef`, '
. '`volunteerteachers`.`comments`, '
. '`volunteerteachers`.`projecttitle`, '
. '`volunteerteachers`.`projecturl`, '
. '`volunteerteachers`.`projectdescription` '
. ' FROM `volunteerteachers` JOIN `branch` ON (`volunteerteachers`.`eidikothta` = `branch`.`id`) '
// . ' FROM `volunteerteachers` '
. ' ORDER BY id ';
$volunteer_teachers = R::getAll($sql);
$volunteer_teachers = array_map(function ($row) {
if (($projects = preg_split('/###@@@###/msUu', $row['projectdescription'])) !== false) {
$projects_parts = array_map(function ($r) {
return preg_split('/_@@@_/msUu', $r);
}, $projects);
$projects_cnt = 0;
foreach ($projects_parts as $part) {
if (count($part) > $projects_cnt) {
$projects_cnt = count($part);
}
}
$recons = array_fill(0, $projects_cnt, '');
for ($i = 0; $i < $projects_cnt; $i++) {
$recons[$i] .= $projects_parts[0][$i] . "\r\n"
. (isset($projects_parts[1][$i]) ? $projects_parts[1][$i] : '') . "\r\n"
. (isset($projects_parts[2][$i]) ? $projects_parts[2][$i] : '');
$row['project' . $i] = $recons[$i];
$row['projectdescription'] = UniversityFormService::recomposeProjects($row['projectdescription'], false);
if (($projects = preg_split('/' . UniversityFormService::PLAIN_TEXT_SEPARATOR . '/msUu', $row['projectdescription'])) !== false) {
foreach ($projects as $i => $proj) {
$row["project{$i}"] = $proj;
}
$row['projectdescription'] = implode("\r\n--------------\r\n", $recons);
}
return $row;
}, $volunteer_teachers);
......@@ -309,24 +300,11 @@ return function (App $app) {
$volunteer_institutions = R::getAll($sql);
$volunteer_institutions = array_map(function ($row) {
if (($projects = preg_split('/###@@@###/msUu', $row['projectdescription'])) !== false) {
$projects_parts = array_map(function ($r) {
return preg_split('/_@@@_/msUu', $r);
}, $projects);
$projects_cnt = 0;
foreach ($projects_parts as $part) {
if (count($part) > $projects_cnt) {
$projects_cnt = count($part);
}
}
$recons = array_fill(0, $projects_cnt, '');
for ($i = 0; $i < $projects_cnt; $i++) {
$recons[$i] .= $projects_parts[0][$i] . "\r\n"
. (isset($projects_parts[1][$i]) ? $projects_parts[1][$i] : '') . "\r\n"
. (isset($projects_parts[2][$i]) ? $projects_parts[2][$i] : '');
$row['project' . $i] = $recons[$i];
$row['projectdescription'] = UniversityFormService::recomposeProjects($row['projectdescription'], false);
if (($projects = preg_split('/' . UniversityFormService::PLAIN_TEXT_SEPARATOR . '/msUu', $row['projectdescription'])) !== false) {
foreach ($projects as $i => $proj) {
$row["project{$i}"] = $proj;
}
$row['projectdescription'] = implode("\r\n--------------\r\n", $recons);
}
return $row;
}, $volunteer_institutions);
......
......@@ -12,10 +12,9 @@ use Slim\Http\Response;
* @copyright Copyright (c) 2008-2015 Greek Free/Open Source Software Society (https://gfoss.ellak.gr/)
* @license GNU GPLv3 http://www.gnu.org/licenses/gpl-3.0-standalone.html
*/
return function (App $app) {
$container = $app->getContainer();
$events = $container['events'];
$events = $container['events'];
$events('on', 'app.autoload', function ($autoloader) {
$autoloader->addPsr4('GrEduLabs\\TeacherForm\\', __DIR__ . '/src/');
......@@ -33,17 +32,22 @@ return function (App $app) {
$container[GrEduLabs\TeacherForm\Action\TeacherForm::class] = function ($c) {
return new GrEduLabs\TeacherForm\Action\TeacherForm(
$c->get('view'),
$c->get(GrEduLabs\TeacherForm\Service\TeacherFormServiceInterface::class),
$c->get(GrEduLabs\TeacherForm\InputFilter\TeacherForm::class),
$c->get('router')->pathFor('teacher_form.submit_success'),
$c);
$c->get('view'), $c->get(GrEduLabs\TeacherForm\Service\TeacherFormServiceInterface::class), $c->get(GrEduLabs\TeacherForm\InputFilter\TeacherForm::class), $c->get('router')->pathFor('teacher_form.submit_success'), $c);
};
$container[GrEduLabs\TeacherForm\Action\SubmitSuccess::class] = function ($c) {
return new GrEduLabs\TeacherForm\Action\SubmitSuccess(
$c->get('view'),
$c->get('router')->pathFor('teacher_form')
$c->get('view'), $c->get('router')->pathFor('teacher_form')
);
};
$container[GrEduLabs\TeacherForm\Service\TeacherFormServiceInterface::class] = function ($c) {
return new GrEduLabs\TeacherForm\Service\TeacherFormService();
};
$container[GrEduLabs\TeacherForm\Action\Display::class] = function ($c) {
return new GrEduLabs\TeacherForm\Action\Display(
$c->get('view'), $c->get(GrEduLabs\TeacherForm\Service\TeacherFormServiceInterface::class)
);
};
});
......@@ -64,12 +68,12 @@ return function (App $app) {
$school_name = $req->getQueryParam('term');
$httpClient = new GuzzleHttp\Client([
'base_uri' => $container['settings']['sch_mm']['public_api_url']
]);
'base_uri' => $container['settings']['sch_mm']['public_api_url']
]);
$config = $httpClient->getConfig();
$baseUri = $config['base_uri'];
$url = $baseUri . "?name=" . $school_name;
$config = $httpClient->getConfig();
$baseUri = $config['base_uri'];
$url = $baseUri . "?name=" . $school_name;
$response = $httpClient->request('GET', $url);
$responseData = json_decode($response->getBody()->getContents(), true);
......@@ -78,7 +82,7 @@ return function (App $app) {
}
$cnt = count($responseData['data']);
$school_arr = [];
for ($i=0; $i<$cnt; $i++) {
for ($i = 0; $i < $cnt; $i++) {
$school_arr[$i]['mm_id'] = $responseData['data'][$i]['mm_id'];
$school_arr[$i]['value'] = $responseData['data'][$i]['name'];
$school_arr[$i]['tel'] = $responseData['data'][$i]['phone_number'];
......@@ -86,5 +90,8 @@ return function (App $app) {
return $res->withJson($school_arr);
})->setName('teacher_form.mm');
$app->get('/admin/teacher-form/display', GrEduLabs\TeacherForm\Action\Display::class)
->setName('admin.volunteer.teacher');
});
};
ALTER TABLE `volunteerteachers` MODIFY `eidikothta` int(11) UNSIGNED;
ALTER TABLE `volunteerteachers` ADD CONSTRAINT `fk_branch_id` FOREIGN KEY (`eidikothta`) REFERENCES `branch`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
<?php
/**
* gredu_labs.
*
* @link https://github.com/eellak/gredu_labs for the canonical source repository
*
* @copyright Copyright (c) 2008-2015 Greek Free/Open Source Software Society (https://gfoss.ellak.gr/)
* @license GNU GPLv3 http://www.gnu.org/licenses/gpl-3.0-standalone.html
*/
namespace GrEduLabs\TeacherForm\Action;
use GrEduLabs\TeacherForm\Service\TeacherFormServiceInterface;
use Slim\Http\Request;
use Slim\Http\Response;
use Slim\Views\Twig;
class Display
{
/**
* @var Twig
*/
protected $view;
/**
* @var FormServiceInterface
*/
protected $formService;
public function __construct(Twig $view, TeacherFormServiceInterface $formService)
{
$this->view = $view;
$this->formService = $formService;
}
public function __invoke(Request $req, Response $res)
{
$forms = $this->formService->findAll();
return $this->view->render($res, 'teacher_form/display.twig', [
'forms' => $forms
]);
}
}
......@@ -8,24 +8,28 @@
* @license GNU GPLv3 http://www.gnu.org/licenses/gpl-3.0-standalone.html
*/
namespace GrEduLabs\TeacherForm\Service;
use RedBeanPHP\OODBBean;
use RedBeanPHP\R;
use GrEduLabs\UniversityForm\Service\UniversityFormService;
class TeacherFormService implements TeacherFormServiceInterface
{
public function submit(array $data)
{
$appForm = R::dispense('volunteerteachers');
$appForm = R::dispense('volunteerteachers');
// $appForm->id = $data['id'];
$appForm->name = $data['name'];
$appForm->surname = $data['surname'];
$appForm->eidikothta = $data['eidikothta'];
$appForm->arithmitroou = $data['arithmitroou'];
$appForm->email = $data['email'];
$appForm->telef = trim($data['telef']);
$appForm->school = $data['school'];
$appForm->schooltelef = trim($data['schooltelef']);
$appForm->projectdescription = $data['projectdescription'];
$appForm->comments = $data['comments'];
$appForm->name = $data['name'];
$appForm->surname = $data['surname'];
$appForm->eidikothta = $data['eidikothta'];
$appForm->arithmitroou = $data['arithmitroou'];
$appForm->email = $data['email'];
$appForm->telef = trim($data['telef']);
$appForm->school = $data['school'];
$appForm->schooltelef = trim($data['schooltelef']);
$appForm->projectdescription = $data['projectdescription'];
$appForm->comments = $data['comments'];
R::store($appForm);
return $appForm;
}
......@@ -36,4 +40,35 @@ class TeacherFormService implements TeacherFormServiceInterface
return $branch->export();
}, R::findAll('branch', 'ORDER BY name ASC'));
}
/**
*
* @param OODBBean $bean the form bean
* @return array
*/
private function exportApplicationForm(OODBBean $bean)
{
$form = $bean->export();
$form['projectdescription'] = UniversityFormService::recomposeProjects($form['projectdescription']);
return $form;
}
/**
* Get all the university volunteer submissions
*
* @return array The exported bean info from retrieved data
*/
public function findAll()
{
$forms = R::getAll('SELECT `volunteerteachers`.*, `branch`.`name` AS `eidikothta_name` '
. 'FROM `volunteerteachers` JOIN `branch` ON (`volunteerteachers`.`eidikothta` = `branch`.`id`) '
. 'ORDER BY `id` DESC');
$beanForms = R::convertToBeans('volunteerteachers', $forms);
return array_map(function ($form) {
return $this->exportApplicationForm($form);
}, $beanForms);
}
}
......@@ -7,11 +7,17 @@
* @copyright Copyright (c) 2008-2015 Greek Free/Open Source Software Society (https://gfoss.ellak.gr/)
* @license GNU GPLv3 http://www.gnu.org/licenses/gpl-3.0-standalone.html
*/
namespace GrEduLabs\TeacherForm\Service;
interface TeacherFormServiceInterface
{
public function submit(array $data);
public function getBranches();
/**
* Gets all forms and return an array of data
*/
public function findAll();
}
{% extends "layout.twig" %}
{% block content %}
<div id="approved_applications">
<h1>Ιδρύματα <small>Αιτήσεις εκπαιδευτικών</small></h1>
<p>Ακολουθεί λίστα των αιτήσεων που κατατέθηκαν από εκπαιδευτικούς.</p>
{% if forms %}
<div class="table-responsive">
<caption>Συνολικά <span class="label label-success">{{ forms | length }} αιτήσεις</span>
<span class="pull-right">
<a class="btn btn-primary btn-sm" href="{{ path_for('export.csv', {type: 'volunteer_teachers'}) }}"><span class="fa fa-download"></span> Αρχείο .csv</a>
</span>
</caption>
<table class="table table-condensed table-hover">
<thead>
<tr>
<th class="text-center">ID</th>
<th>Ονοματεπώνυμο<br/>
<span class="text-muted">Αριθμός μητρώου, Ειδικότητα</span></th>
<th>Σχολείο <span class="text-muted">Τηλέφωνο</span></th>
<th>Τηλέφωνο</th>
<th>Email</th>
</tr>
</thead>
<tbody>
{% for form in forms %}
<tr>
<td class="text-center col-xs-1"><span class="text-muted">{{ form.id }}</span></td>
<td class="col-xs-4">{{ form.name }} {{ form.surname }}<br/>
<span class="text-muted">{{ form.arithmitroou }}, {{ form.eidikothta_name }}</span></td>
<td class="col-xs-4">{{ form.school }} <span class="text-muted">{{ form.schooltelef }}</span></td>
<td class="col-xs-1">{{ form.telef }}</td>
<td class="col-xs-2">{{ form.email }}</td>
</tr>
<tr>
<td></td>
<td colspan="4"><span class="text-muted">ΣΧΟΛΙΑ:</span> {{ form.comments }}<br/>
<span class="text-muted">ΕΡΓΑ:</span> {{ form.projectdescription|raw }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="alert alert-info" role="alert">Δεν υπάρχουν καταχωρημένα στοιχεία</div>
{% endif %}
</div>
{% endblock %}
......@@ -13,16 +13,15 @@ use Slim\Http\Response;
* @copyright Copyright (c) 2008-2015 Greek Free/Open Source Software Society (https://gfoss.ellak.gr/)
* @license GNU GPLv3 http://www.gnu.org/licenses/gpl-3.0-standalone.html
*/
return function (App $app) {
$container = $app->getContainer();
$events = $container['events'];
$events = $container['events'];
$events('on', 'app.autoload', function ($autoloader) {
$events('on', 'app.autoload', function ($autoloader) {
$autoloader->addPsr4('GrEduLabs\\UniversityForm\\', __DIR__ . '/src/');
});
$events('on', 'app.services', function ($container) {
$events('on', 'app.services', function ($container) {
$container[GrEduLabs\UniversityForm\Service\UniversityFormServiceInterface::class] = function ($c) {
return new GrEduLabs\UniversityForm\Service\UniversityFormService();
......@@ -36,40 +35,40 @@ $events('on', 'app.services', function ($container) {
return new GrEduLabs\UniversityForm\InputFilter\UniversityForm1();
};
$container[GrEduLabs\UniversityForm\Action\UniversityForm::class] = function ($c) {
return new GrEduLabs\UniversityForm\Action\UniversityForm(
$c->get('view'),
$c->get(GrEduLabs\UniversityForm\Service\UniversityFormServiceInterface::class),
$c->get(GrEduLabs\UniversityForm\InputFilter\UniversityForm::class),
$c->get(GrEduLabs\UniversityForm\InputFilter\UniversityForm1::class),
$c->get('router')->pathFor('university_form.submit_success'),
$c);
$container[GrEduLabs\UniversityForm\Action\UniversityForm::class] = function ($c) {
return new GrEduLabs\UniversityForm\Action\UniversityForm(
$c->get('view'), $c->get(GrEduLabs\UniversityForm\Service\UniversityFormServiceInterface::class), $c->get(GrEduLabs\UniversityForm\InputFilter\UniversityForm::class), $c->get(GrEduLabs\UniversityForm\InputFilter\UniversityForm1::class), $c->get('router')->pathFor('university_form.submit_success'), $c);
};
$container[GrEduLabs\UniversityForm\Action\SubmitSuccess::class] = function ($c) {
return new GrEduLabs\UniversityForm\Action\SubmitSuccess(
$c->get('view'),
$c->get('router')->pathFor('university_form')
$c->get('view'), $c->get('router')->pathFor('university_form')
);
};
});
$container[GrEduLabs\UniversityForm\Service\UniversityFormServiceInterface::class] = function ($c) {
return new GrEduLabs\UniversityForm\Service\UniversityFormService();
};
$container[GrEduLabs\UniversityForm\Action\Display::class] = function ($c) {
return new GrEduLabs\UniversityForm\Action\Display(
$c->get('view'), $c->get(GrEduLabs\UniversityForm\Service\UniversityFormServiceInterface::class)
);
};
});
$events('on', 'app.bootstrap', function ($app, $container) {
$events('on', 'app.bootstrap', function ($app, $container) {
$container['view']->getEnvironment()->getLoader()->prependPath(__DIR__ . '/templates');
$app->group('/university-form', function () {
$app->group('/university-form', function () {
$this->map(['get', 'post'], '', GrEduLabs\UniversityForm\Action\UniversityForm::class)
->add(GrEduLabs\Application\Middleware\AddCsrfToView::class)
->add('csrf')
->setName('university_form');
$this->get('/submit-success', GrEduLabs\UniversityForm\Action\SubmitSuccess::class)
->setName('university_form.submit_success');
});
});
$app->get('/admin/university-form/display', GrEduLabs\UniversityForm\Action\Display::class)
->setName('admin.volunteer.univ');
});
};
\ No newline at end of file
};
<?php
/**
* gredu_labs.
*
* @link https://github.com/eellak/gredu_labs for the canonical source repository
*
* @copyright Copyright (c) 2008-2015 Greek Free/Open Source Software Society (https://gfoss.ellak.gr/)
* @license GNU GPLv3 http://www.gnu.org/licenses/gpl-3.0-standalone.html
*/
namespace GrEduLabs\UniversityForm\Action;
use GrEduLabs\UniversityForm\Service\UniversityFormServiceInterface;
use Slim\Http\Request;
use Slim\Http\Response;
use Slim\Views\Twig;
class Display
{
/**
* @var Twig
*/
protected $view;
/**
* @var FormServiceInterface
*/
protected $formService;
public function __construct(Twig $view, UniversityFormServiceInterface $formService)
{
$this->view = $view;
$this->formService = $formService;
}
public function __invoke(Request $req, Response $res)
{
$forms = $this->formService->findAll();
return $this->view->render($res, 'university_form/display.twig', [
'forms' => $forms
]);
}
}
......@@ -7,7 +7,6 @@
* @copyright Copyright (c) 2008-2015 Greek Free/Open Source Software Society (https://gfoss.ellak.gr/)
* @license GNU GPLv3 http://www.gnu.org/licenses/gpl-3.0-standalone.html
*/
namespace GrEduLabs\UniversityForm\Service;
use RedBeanPHP\OODBBean;
......@@ -15,28 +14,93 @@ use RedBeanPHP\R;
class UniversityFormService implements UniversityFormServiceInterface
{
const PLAIN_TEXT_SEPARATOR = ' ---------------NEXT_PROJECT--------------- ';
public function submit(array $data)
{
$appForm = R::dispense('univ');
$appForm->id = $data['id'];
$appForm->idrima = $data['idrima'];
$appForm->sxolh = $data['sxolh'];
$appForm->tmhma = $data['tmhma'];
$appForm->ereunitiko = $data['ereunitiko'];
$appForm->institute = $data['institute'];
$appForm->other = $data['other'];
$appForm->erga = $data['erga'];
$appForm->person = $data['person'];
$appForm->telef = trim($data['telef']);
$appForm->email = $data['email'];
$appForm->projectdescription = $data['projectdescription'];
$appForm->comments = $data['comments'];
$appForm = R::dispense('univ');
$appForm->id = $data['id'];
$appForm->idrima = $data['idrima'];
$appForm->sxolh = $data['sxolh'];
$appForm->tmhma = $data['tmhma'];
$appForm->ereunitiko = $data['ereunitiko'];
$appForm->institute = $data['institute'];
$appForm->other = $data['other'];
$appForm->erga = $data['erga'];
$appForm->person = $data['person'];
$appForm->telef = trim($data['telef']);
$appForm->email = $data['email'];
$appForm->projectdescription = $data['projectdescription'];
$appForm->comments = $data['comments'];
R::store($appForm);
R::store($appForm);
return $appForm;
}
public static function recomposeProjects($data, $html = true)
{
$recons = [];
if (($projects = preg_split('/###@@@###/msUu', $data)) !== false) {
$projects_parts = array_map(function ($r) {
return preg_split('/_@@@_/msUu', $r);
}, $projects);
$projects_cnt = 0;
foreach ($projects_parts as $part) {
if (count($part) > $projects_cnt) {
$projects_cnt = count($part);
}
}
$recons = array_fill(0, $projects_cnt, '');
for ($i = 0; $i < $projects_cnt; $i++) {
$recons[$i] .= $projects_parts[0][$i] . "\r\n"
. (isset($projects_parts[1][$i]) ? $projects_parts[1][$i] : '') . "\r\n"
. (isset($projects_parts[2][$i]) ? $projects_parts[2][$i] : '');
}
$recons = array_filter($recons, function ($v) {
return trim($v) != '';
});
}
if (count($recons) > 0) {
if ($html === true) {
$data = '<ol><li>' . implode("</li>\n<li>", $recons) . '</li></ol>';
} else {
$data = implode(self::PLAIN_TEXT_SEPARATOR, $recons);
}
} else {
$data = '-';
}
return $data;
}
/**
*
* @param OODBBean $bean the form bean
* @return array
*/
private function exportApplicationForm(OODBBean $bean)
{
$form = $bean->export();
$form['projectdescription'] = UniversityFormService::recomposeProjects($form['projectdescription']);
return $form;
}
/**
* Get all the university volunteer submissions
*
* @return array The exported bean info from retrieved data
*/
public function findAll()
{
$forms = R::getAll('SELECT univ.* '
. 'FROM univ '
. 'ORDER BY id DESC');
$beanForms = R::convertToBeans('univ', $forms);
return array_map(function ($form) {
return $this->exportApplicationForm($form);
}, $beanForms);
}
}
......@@ -13,4 +13,9 @@ namespace GrEduLabs\UniversityForm\Service;
interface UniversityFormServiceInterface
{
public function submit(array $data);
/**
* Gets all forms and return an array of data
*/
public function findAll();
}
{% extends "layout.twig" %}
{% block content %}
<div id="approved_applications">
<h1>Ιδρύματα <small>Αιτήσεις εθελοντών</small></h1>
<p>Ακολουθεί λίστα των αιτήσεων που κατατέθηκαν από ακαδημαϊκό και ερευνητικό προσωπικό από Πανεπιστήμια και Ερευνητικά Κέντρα.</p>
{% if forms %}
<div class="table-responsive">
<caption>Συνολικά <span class="label label-success">{{ forms | length }} αιτήσεις</span>
<span class="pull-right">
<a class="btn btn-primary btn-sm" href="{{ path_for('export.csv', {type: 'volunteer_institutions'}) }}"><span class="fa fa-download"></span> Αρχείο .csv</a>
</span>
</caption>
<table class="table table-condensed table-hover">
<thead>
<tr>
<th class="text-center">ID</th>
<th>Ίδρυμα / Ερευνητικό Κέντρο
<span class="text-muted">Σχολή / Ινστιτούτο</span><br/>
Τμήμα / Αλλο<br/>
Εργαστήριο</th>
<th>Υπεύθυνος Επικοινωνίας</th>
<th>Τηλέφωνο</th>
<th>Email</th>
</tr>
</thead>
<tbody>
{% for form in forms %}
<tr>
<td class="text-center col-xs-1"><span class="text-muted">{{ form.id }}</span></td>
<td class="col-xs-5">{{ form.idrima }}{{ form.ereunitiko }}
<span class="text-muted">{{ form.sxolh }}{{ form.institute }}</span><br/>
{{ form.tmhma }}{{ form.other }}<br/>
{{ form.erga }}</td>
<td class="col-xs-3">{{ form.person }}</td>
<td class="col-xs-1">{{ form.telef }}</td>
<td class="col-xs-2">{{ form.email }}</td>
</tr>
<tr>