. */ include("./include/include.php"); require_once(FILESYSTEMROOTPATH."jc/include/classes/DefaultLayout.php"); require_once(FILESYSTEMROOTPATH."jc/include/classes/AbstractForm3.php"); require_once(FILESYSTEMROOTPATH."include/list/ListPager.php"); require_once(FILESYSTEMROOTPATH."jc/include/model/NumberOfVotes.php"); $layout = new DefaultLayout("JC_MANAGE"); $layout->init(); if (isset($_GET['agora_id'])){ $agora_id = $_GET['agora_id']; }else{ //there should be always an agora id $agora_id = $_SESSION['JC_MODULE']['AgoraId']; } $layout->echoln('Back
'); if(isset($_POST["submit"])) { //if upload file if(isset($_FILES["file"])) { chmod($_FILES["file"]["tmp_name"], 0644); $filename = addslashes($_FILES["file"]["tmp_name"]); $ddao = $GLOBALS['ClassFactory']->getDelegatesDao(); $res = $ddao->import($filename, $agora_id, $_POST['prefix']); if ($res !== FALSE) { $result = "successfully"; $color = 'green'; }else { $result = "unsuccessfully"; $res = 0; $color = 'red'; } $layout->echoln("File {$_FILES['file']['name']} uploaded $result: $res rows were imported

"); unlink($filename); //deletes file } } $txt = 'Upload file with delegates
Extract the file from statutory system and upload without editing
 (Therefore, the file is comma-separated (";").
 The first line has the column titles in the following order:
 "ID", "Intranet username", "First name", "Family name", "Body code", "Participant type")
This file will overwrite existing data!
If the ID\'s in the file do not have the agora prefix (e.g. 123 instead of 209-0123),
provide the prefix below, else leave this field empty.
You can add the JC/Chair Team as delegates of "XCH" for testing.

'; $layout->echoln($txt); $HTML_FORM = '
ID Prefix e.g. 209 if participant ID\'s are like 209-0001
File
'; $layout->echoln($HTML_FORM); $layout->echoln('
'); $layout->echoln('Add one new delegate
'); $dService = $GLOBALS['ClassFactory']->getDelegatesService(); $data = $dService->loadAll($agora_id); $pager = new ListPager("Particpants"); $pager->addColumn(new TextColumn('bodyCode', 'Body')); $pager->addColumn(new TextColumn('participantId','participantId')); $pager->addColumn(new TextColumn('firstName','Name')); $pager->addColumn(new TextColumn('lastName','Surname')); $pager->addColumn(new TextColumn('uid','UID')); $pager->addColumn(new TextColumn('registered','Registered')); $pager->addColumn(new TextColumn('departed','Departed')); $pager->addColumn(new TextColumn('edit','Edit')); $layout->echoln($pager->display($data)); $layout->page_footer(); ?>