public function index()
 {
     $this->auth->check_access("team");
     $this->template->title(APP_NAME, "team List");
     $data['notif'] = flashdata("notif");
     $data['result'] = $this->model_team->find_all();
     $data['result_enginer'] = $this->model_team->get_where('user', array('user_group' => 'enginer'));
     $this->renderAdmin("admin/team/team_list", $data);
 }
 public function index($offset = 0)
 {
     $this->auth->login_scurity();
     $this->template->title(APP_NAME, "Notification List");
     $limit = isset($_GET['limit']) ? $_GET['limit'] : 10;
     $q = isset($_GET['q']) ? $_GET['q'] : '';
     $level = $this->auth->level_name_by_idlevel(user_admin('level'));
     $user_reff = NULL;
     $user_reff_id = NULL;
     if (in_array($level, array('pm_vendor_manager', 'tt_vendor_manager', 'tt_vendor_helpdesk'))) {
         $user_reff = 'vendor';
         $user_reff_id = user_admin('idvendor');
     }
     $config['base_url'] = "admin/notification/index/";
     $config['total_rows'] = $this->model_notification->count_all($user_reff, $user_reff_id);
     $config['per_page'] = $limit;
     $config['uri_segment'] = 4;
     $data['pagination'] = $this->pagination($config);
     $data['notif'] = flashdata("notif");
     $data['result'] = $this->model_notification->get_notification($offset, $limit, $user_reff, $user_reff_id);
     $data['total_rows'] = $config['total_rows'];
     $data['notif'] = flashdata("notif");
     $data['user_reff'] = $user_reff;
     $data['user_reff_id'] = $user_reff_id;
     $this->renderAdmin("admin/notification/notification_list", $data);
 }
Example #3
0
 public function index($offset = 0)
 {
     $this->auth->check_access("pm");
     $data['notif'] = flashdata("notif");
     $data['result'] = $this->model_pm->get_pm();
     $this->renderAdmin("admin/pm/pm_list", $data);
 }
Example #4
0
 public function delete($id)
 {
     $this->user->soft_delete($id);
     save_log('Excluiu usuário id: ' . $id);
     flashdata('Usuário excluído com Sucesso!');
     redirect('app/users');
 }
Example #5
0
 public function delete($id)
 {
     $this->group->delete($id);
     $this->group_menu->delete(['group_id' => $id]);
     flashdata('Grupo excluído com sucesso!');
     save_Log('Excluiu grupo id: ' . $id);
     redirect('app/groups');
 }
Example #6
0
 public function plan()
 {
     $this->auth->check_access("pm_plan");
     $this->form_validation->set_rules("periode", "Previous Period", "required");
     $this->form_validation->set_rules("new_periode", "New Period", "required");
     if ($this->form_validation->run()) {
         $periode = $this->input->post('periode');
         $vendor = $this->input->post('vendor');
         $result_periode = $this->model_pm->get_single('pm_period', 'idpm_period', $periode);
         $result_task_site = $this->get_not_pm($periode, $vendor);
         $all_task_site = array();
         $not_check = array();
         //print_pre($result_task_site); exit;
         foreach ($result_task_site as $site) {
             $all_task_site[] = $site->idpm;
         }
         $site_check = $this->input->post('site');
         if (!$site_check) {
             $site_check = array();
         }
         foreach ($all_task_site as $site_id) {
             if (!in_array($site_id, $site_check)) {
                 $not_check[] = $site_id;
             }
         }
         //print_pre($not_check); exit();
         $result_pm = $this->model_pm->get_site_periode_nocheck($periode, $vendor, $not_check);
         //print_pre($result_pm); exit();
         foreach ($result_pm as $pm) {
             $data = array();
             $data['pm_parent'] = $pm->idpm;
             $data['pm_vendor'] = $pm->pm_vendor;
             $data['pm_plan_name'] = $pm->pm_plan_name;
             $data['user_iduser'] = $pm->user_iduser;
             $data['pm_period_idpm_period'] = $this->input->post('new_periode');
             $data['pm_description'] = $pm->pm_description;
             $data['om_create_date'] = date("Y-M-d H:i:s");
             $data['om_create_by'] = user_admin('iduser');
             $data['om_deletion_flag'] = '0';
             $idpm = $this->model_pm->store($data);
             //
             $result_info = $this->model_pm->get_info($pm->pmp_idsite);
             $data = array("pm_idpm" => $idpm, "pmp_idsite" => $pm->pmp_idsite, "pmp_vendor" => $pm->pmp_vendor, "vendor_user_idvendor_user_pic" => '', "pmp_idsite" => $pm->pmp_idsite, "pmp_status" => "Missing PIC Assignment", "pmp_remark" => "", "pmp_task_type" => $pm->pmp_task_type, "pmp_priority" => $pm->pmp_priority, "pmp_blocked_access" => $pm->pmp_blocked_access, "om_created_date" => date("Y-m-d H:i:s"), "om_update_date" => date("Y-m-d H:i:s"), "om_created_by" => user_admin('iduser'), "om_deletion_flag" => '0', "flag_last_checked" => $pm->flag_last_checked);
             $idpm_plan_detil = $this->model_pm->insert('pm_plan_detail', $data);
             $data = array("pmh_remark" => "", "pmh_status" => "Missing PIC Assignment", "pmh_by" => user_admin("iduser"), "pmh_date" => date('Y-m-d H:i:s'), "PM_PLAN_DETIL_idpm_plan" => $idpm_plan_detil);
             $this->model_pm->insert('pm_history', $data);
         }
         set_flashdata("notif", alert("PM Plan sucess, selanjutnya Meluncur test ke Task list "));
     }
     $data = array();
     $data['notif'] = flashdata("notif");
     $data['result_periode'] = $this->model_periode->get_periode(0, 100, NULL);
     $data['result_vendor'] = $this->model_pm->get_all_data('OMSubcontractor');
     $this->renderAdmin("admin/pm/pm_plan", $data);
 }
 /**
  * Imports the .csv-file and outputs a download.
  * @param file $filename
  */
 private function import_csv($filename)
 {
     $row = 0;
     $out = fopen('php://output', 'w');
     ob_start();
     fputcsv($out, array('proefpersoon', 'leeftijd in maanden', 'leeftijd in maanden en dagen (m;d)', 'percentielscore begrip', 'taalleeftijd begrip', 'percentielscore productie', 'taalleeftijd productie', 'percentielscore woordvormen', 'taalleeftijd woordvormen', 'percentielscore zinnen', 'taalleeftijd zinnen'), ';');
     $separator = $this->input->post('separator');
     if (($handle = fopen($filename, 'r')) !== FALSE) {
         while (($data = fgetcsv($handle, 1000, $separator)) !== FALSE) {
             $row++;
             if ($row != 1 && $data !== array(NULL)) {
                 if (count($data) == 8) {
                     // TODO: remove duplicate code below (refer to functions age_in_months)
                     $diff = date_diff(new DateTime($data[1]), new DateTime($data[2]));
                     $ageinmonths = intval($diff->format('%r') . ($diff->format('%m') + 12 * $diff->format('%y')));
                     $ageinmonthsdays = $diff->format('%r') . ($diff->format('%m') + 12 * $diff->format('%y')) . ';' . $diff->format('%d');
                     $ncdi_check = array('ip_address' => $this->input->ip_address(), 'p_number' => $data[0], 'ageinmonths' => $ageinmonths, 'ageinmonthsdays' => $ageinmonthsdays, 'gender' => $data[3] === 'M' ? Gender::Male : Gender::Female, 'b_score' => intval($data[4]), 'p_score' => intval($data[5]), 'w_score' => intval($data[6]), 'z_score' => intval($data[7]));
                 } else {
                     flashdata(sprintf('Verkeerd aantal kolommen op rij %d, check het bestand. (heb je het goede scheidingsteken aangevinkt?)', $row), FALSE);
                     redirect('ncdi_calculator');
                 }
                 // TODO: deal with constants here
                 $test = $this->testModel->get_test_by_code('ncdi_wz');
                 $testcat_codes = array('b', 'p', 'w', 'z');
                 $row = array($ncdi_check['p_number'], $ncdi_check['ageinmonths'], $ncdi_check['ageinmonthsdays']);
                 foreach ($testcat_codes as $testcat_code) {
                     $testcat = $this->testCatModel->get_testcat_by_code($test, $testcat_code);
                     $raw_score = $ncdi_check[$testcat_code . '_score'];
                     if ($raw_score) {
                         $perc = $this->percentileModel->find_percentile($testcat->id, $ncdi_check['gender'], $ncdi_check['ageinmonths'], $raw_score);
                         $age = $this->percentileModel->find_50percentile_age($testcat->id, $ncdi_check['gender'], $raw_score);
                         array_push($row, $perc);
                         array_push($row, $age);
                     } else {
                         array_push($row, '-');
                         array_push($row, '-');
                     }
                 }
                 fputcsv($out, $row, ';');
                 //$this->NCDICheckModel->add_ncdi_check($ncdi_check);
             }
         }
         fclose($handle);
     }
     $csv = ob_get_contents();
     ob_end_clean();
     fclose($out);
     return $csv;
 }
 public function index($offset = 0)
 {
     $this->auth->check_access("meta_list");
     $this->template->title(APP_NAME, "Meta List");
     $this->load->library('pagination');
     $limit = isset($_GET['limit']) ? $_GET['limit'] : 10;
     $q = isset($_GET['q']) ? $_GET['q'] : '';
     $config['base_url'] = "admin/meta/index/";
     $config['total_rows'] = $this->model_meta->count_all($q);
     $config['per_page'] = $limit;
     $config['uri_segment'] = 4;
     $data['pagination'] = $this->pagination($config);
     $data['notif'] = flashdata("notif");
     $data['result'] = $this->model_meta->get_meta($offset, $limit, $q);
     $this->renderAdmin("admin/meta/meta_list", $data);
 }
 public function index($offset = 0)
 {
     $this->auth->check_access("site");
     $this->template->title(APP_NAME, "site List");
     $limit = isset($_GET['limit']) ? $_GET['limit'] : 10;
     $q = isset($_GET['q']) ? $_GET['q'] : '';
     $config['base_url'] = "admin/site/index/";
     $config['total_rows'] = $this->model_site->count_all($q);
     $config['per_page'] = $limit;
     $config['uri_segment'] = 4;
     $data['pagination'] = $this->pagination($config);
     $data['notif'] = flashdata("notif");
     $data['result'] = $this->model_site->get_site($offset, $limit, $q);
     $data['total_rows'] = $config['total_rows'];
     $data['notif'] = flashdata("notif");
     $this->renderAdmin("admin/site/site_general", $data);
 }
Example #10
0
 public function index($offset = 0)
 {
     $this->auth->check_access("tt_access");
     $this->load->library('pagination');
     $limit = isset($_GET['limit']) ? $_GET['limit'] : 10;
     $q = isset($_GET['q']) ? $this->input->get('q', TRUE) : '';
     $data_filter = array();
     if (isset($_GET['siteid']) and !empty($_GET['siteid'])) {
         $data_filter['protelindo_site_id'] = $this->input->get('siteid', TRUE);
     }
     if (isset($_GET['region']) and !empty($_GET['region'])) {
         $data_filter['Region'] = $this->input->get('region', TRUE);
     }
     if (isset($_GET['status']) and !empty($_GET['status'])) {
         $data_filter['sla_event_status'] = $this->input->get('status', TRUE);
     }
     if (isset($_GET['desc']) and !empty($_GET['desc'])) {
         $data_filter['tt_status_description'] = $this->input->get('desc', TRUE);
     }
     if (isset($_GET['status_description']) and !empty($_GET['status_description'])) {
         $data_filter['tt_status_description'] = $this->input->get('status_description', TRUE);
     }
     if (isset($_GET['ttno']) and !empty($_GET['ttno'])) {
         $data_filter['tt_no'] = $this->input->get('ttno', TRUE);
     }
     //default tt open
     $data_filter['tt_open'] = $this->input->get('tt_open', TRUE);
     $config['base_url'] = "admin/tt/index/";
     $config['total_rows'] = $this->model_tt->count_all($data_filter);
     $config['per_page'] = $limit;
     $config['uri_segment'] = 4;
     $data['pagination'] = $this->pagination($config);
     $data['notif'] = flashdata("notif");
     $data['result'] = $this->model_tt->get_tt($offset, $limit, $data_filter);
     $data['result_region'] = $this->model_tt->get_all_data('Region');
     $data['result_vendor'] = $this->model_tt->get_vendor();
     $data['result_status'] = $this->model_tt->get_status();
     $data['result_status_description'] = $this->model_tt->get_status_description();
     $data['total_rows'] = $config['total_rows'];
     $this->renderAdmin("admin/tt/tt_list", $data);
 }
Example #11
0
 /** Deletes the specified closing. */
 public function delete($closing_id)
 {
     $this->closingModel->delete_closing($closing_id);
     flashdata(lang('closing_deleted'));
     redirect($this->agent->referrer(), 'refresh');
 }
 public function update($id = NULL)
 {
     $this->auth->check_access("vendor_user_update");
     $this->template->title(APP_NAME, "vendor user Update");
     $this->form_validation->set_rules("username", "vendor_username", "required");
     $this->form_validation->set_rules("fullname", "full name", "required");
     $this->form_validation->set_rules("phone", "phone", "required");
     $this->form_validation->set_rules("email", "email", "required|valid_email");
     if ($this->form_validation->run()) {
         $config['upload_path'] = './asset/vendor-user-image/';
         $config['allowed_types'] = 'gif|jpg|png';
         $config['max_size'] = '9999999';
         $config['max_width'] = '9999999';
         $config['max_height'] = '9999999';
         $this->load->library('upload', $config);
         if ($_FILES and $_FILES['avatar']['name']) {
             if (!$this->upload->do_upload("avatar")) {
                 $error = $this->upload->display_errors();
                 set_flashdata("notif", alert($error, "danger"));
                 redirect("admin/vendor_user");
             } else {
                 $data_upload = $this->upload->data();
                 $data['avatar'] = $data_upload['file_name'];
             }
         }
         $data['username'] = $this->input->post("username");
         $data['fullname'] = $this->input->post("fullname");
         $data['idvendor'] = user_admin('idvendor');
         $data['email'] = $this->input->post("email");
         $data['phone'] = $this->input->post("phone");
         $data['om_update_date'] = date("Y-m-d H:i:s");
         $data['om_update_by'] = user_admin('iduser');
         $data['om_deletion_flag'] = 0;
         $data['access_pm'] = $this->input->post("access_pm");
         $data['access_tt'] = $this->input->post("access_tt");
         $data['imei_number'] = $this->input->post("imei_number");
         $this->model_vendor_user->change($id, $data);
         $this->model_vendor_user_region->delete_region_byid_vendor($id);
         //insert multiple user region
         $data_region = array();
         $region_id = $this->input->post('region_id');
         if (is_array($region_id)) {
             foreach ($region_id as $region) {
                 $data_region = array('vendor_user_idvendor_user' => $id, 'idregion' => $region);
                 $this->model_vendor_user_region->store($data_region);
             }
         }
         set_flashdata("notif", alert("Berhasil mengupdate data vendor user"));
         redirect("admin/vendor_user");
     }
     $data['notif'] = flashdata("notif");
     $data["result_vendor"] = $this->model_vendor_user->get_all_data('OMSubcontractor');
     $data["vendor_user_level"] = $this->config->item("level");
     $data['row'] = $this->model_vendor_user->find($id);
     $data["result_region"] = $this->model_vendor_user->get_all_data('Region');
     $data["result_region_selected"] = $this->model_vendor_user_region->get_region_byid_vendor($id);
     $this->renderAdmin("admin/vendor_user/vendor_user_update", $data);
 }
function get_jnotif()
{
    return flashdata('jnotif');
}
Example #14
0
 /** Deletes the specified percentile, and returns to previous page */
 public function delete($percentile_id)
 {
     $this->percentileModel->delete_percentile($percentile_id);
     flashdata(lang('percentile_deleted'));
     redirect('percentile', 'refresh');
 }
Example #15
0
 /** Deletes the specified language, and returns to previous page */
 public function delete($language_id)
 {
     $this->languageModel->delete_language($language_id);
     flashdata(lang('language_deleted'), TRUE, 'language_message');
     redirect($this->agent->referrer(), 'refresh');
 }
Example #16
0
<?php

/**
 * Created by JetBrains PhpStorm.
 * User: Unleashed
 * Date: 11/23/13
 * Time: 10:11 AM
 */
$no = 1;
flashdata();
?>

<!-- START BREADCRUMB -->
<ul class="breadcrumb">
    <li><a href="#">Home</a></li>
    <li><a href="<?php 
echo base_url('type_analisis');
?>
">Type Analisis</a></li>
    <li class="active"><?php 
echo $type_analisis->nama;
?>
</li>
</ul>
<!-- END BREADCRUMB -->

<!-- PAGE TITLE -->
<div class="page-title">
    <h2><i class="fa fa-flask"></i> Tipe Analisis <?php 
echo $type_analisis->nama;
?>
Example #17
0
 /**
  * Signs the contract.
  */
 public function sign_submit()
 {
     // Set current time as signature time
     $user = array('needssignature' => FALSE, 'signed' => input_datetime());
     $this->userModel->update_user(current_user_id(), $user);
     // Redirect to welcome page
     flashdata(lang('signed'));
     redirect('welcome');
 }
 /** Deactivates the specified participant */
 public function deactivate($participant_id)
 {
     $this->participantModel->deactivate($participant_id, DeactivateReason::Manual);
     $p = $this->participantModel->get_participant_by_id($participant_id);
     // Inform all admins of this deactivation
     $url = $this->config->site_url() . 'participant/get/' . $participant_id;
     $users = $this->userModel->get_all_admins();
     foreach ($users as $user) {
         reset_language(user_language($user));
         $this->email->clear();
         $this->email->from(FROM_EMAIL, FROM_EMAIL_NAME);
         $this->email->to(in_development() ? TO_EMAIL_OVERRIDE : $user->email);
         $this->email->subject(lang('dereg_pp_subject'));
         $message = sprintf(lang('mail_heading'), $user->username);
         $message .= br(2);
         $message .= sprintf(lang('deac_pp_body'), name($p), $p->phone, current_username(), $url, $url);
         $message .= br(2);
         $message .= lang('mail_ending');
         $message .= br(2);
         $message .= lang('mail_disclaimer');
         $this->email->message($message);
         $this->email->send();
     }
     flashdata(sprintf(lang('p_deactivated'), name($p)));
     redirect($this->agent->referrer(), 'refresh');
 }
Example #19
0
 /** Deletes the given leader */
 public function delete($leader_id)
 {
     $this->leaderModel->delete_leader($leader_id);
     flashdata(lang('deleted_leader'));
     redirect($this->agent->referrer(), 'refresh');
 }
 /** Deletes the specified testtemplate, and returns to previous page */
 public function delete($testtemplate_id)
 {
     $this->testTemplateModel->delete_testtemplate($testtemplate_id);
     flashdata(lang('testtemplate_deleted'));
     redirect($this->agent->referrer(), 'refresh');
 }
Example #21
0
 /**
  * Downloads all dyslexia scores as a .csv-file.
  */
 public function download()
 {
     if (current_role() !== UserRole::Admin) {
         flashdata(lang('not_authorized'));
         redirect('/dyslexia/', 'refresh');
     }
     $csv = dyslexia_to_csv($this->dyslexiaModel->get_all_dyslexias());
     // Generate filename
     $filename = 'dyslexia_' . mdate("%Y%m%d_%H%i", time()) . '.csv';
     // Download the file
     force_download($filename, $csv);
 }
Example #22
0
 public function assign_multiple_site()
 {
     $this->auth->check_access("pm_assign_multiple_site");
     $data['notif'] = flashdata("notif");
     $data['result'] = $this->load_task_site_more(0, 5, true);
     $this->renderAdmin("admin/task/task_assign_multiple_site", $data);
 }
Example #23
0
 /** Unarchives the given experiment */
 public function unarchive($experiment_id)
 {
     $this->experimentModel->archive($experiment_id, 0);
     flashdata(lang('unarchived_exp'));
     redirect($this->agent->referrer(), 'refresh');
 }
Example #24
0
<?php

get_header("king");
?>

    <div class="w-section body-section">
        <div class="w-container">
            <div class="cart-sec">
                <div class="w-row">
                    <?php 
$msg = flashdata('message');
?>
                    <?php 
if ($msg) {
    ?>
                        <div class="auth-msg"><?php 
    echo $msg;
    ?>
</div>
                    <?php 
}
?>
                    <div class="w-col w-col-6">
                        <div class="panel-regis">
                            <div class="txt-head-panel">REGISTER</div>

                            <div class="w-form">

                                <form action="<?php 
echo site_url();
?>
Example #25
0
 public function qc_transfer($offset = 0)
 {
     $this->auth->is_allowed('qc_transfer');
     $this->template->title(APP_NAME, "User QC List");
     $limit = isset($_GET['limit']) ? $_GET['limit'] : 10;
     $q = isset($_GET['q']) ? $this->input->get('q', TRUE) : '';
     $config['base_url'] = "admin/tt/index/";
     $config['total_rows'] = $this->model_user->count_all_user_qc($q);
     $config['per_page'] = $limit;
     $config['uri_segment'] = 4;
     $data['pagination'] = $this->pagination($config);
     $data['notif'] = flashdata("notif");
     $data['result'] = $this->model_user->get_user_qc($offset, $limit, $q);
     $data['total_rows'] = $config['total_rows'];
     $this->renderAdmin("admin/user/user_qc_transfer", $data);
 }
 /** Submits the username and password and redirects based on validation. */
 public function welcome_submit()
 {
     if (!$this->session->userdata('selfservice')) {
         flashdata(lang('selfservice_incorrect_url'), FALSE);
         redirect('selfservice');
     }
     // If register button is clicked, go to registration
     if ($this->input->post('register')) {
         redirect(current_language() == L::Dutch ? 'aanmelden' : 'signup', 'refresh');
     } else {
         if (!$this->validate_participant()) {
             // If not succeeded, show form again with error messages
             $this->welcome();
         } else {
             // If succeeded, update the participants
             $participant = $this->post_participant();
             $participants = $this->participantModel->get_participants_by_email(current_email());
             foreach ($participants as $p) {
                 $activate = $this->input->post('active_' . $p->id);
                 if ($p->activated && !$activate) {
                     $this->participantModel->deactivate($p->id, DeactivateReason::SelfService);
                 } else {
                     if (!$p->activated && $activate) {
                         $this->participantModel->activate($p->id);
                     }
                 }
                 $participant['otherbabylabs'] = $this->input->post('other_' . $p->id);
                 $this->participantModel->update_participant($p->id, $participant);
             }
             // Display success
             flashdata(lang('selfservice_edit_success'));
             redirect('selfservice/welcome', 'refresh');
         }
     }
 }
Example #27
0
 /** Deletes the given relation */
 public function delete($relation_id)
 {
     $this->relationModel->delete_relation($relation_id);
     flashdata(lang('relation_deleted'));
     redirect($this->agent->referrer(), 'refresh');
 }
 /** Deletes the specified impediment. */
 public function delete($availability_id)
 {
     $av = $this->availabilityModel->get_availability_by_id($availability_id);
     if ($av->user_id == $this->session->userdata('user_id')) {
         $this->availabilityModel->delete_availability($availability_id);
         flashdata(lang('availability_deleted'), TRUE, 'availability_message');
     } else {
         flashdata(lang('no_permission'));
     }
     redirect($this->agent->referrer(), 'refresh');
 }
 /** Submits the rescheduling of a participation */
 public function completed_submit($participation_id)
 {
     $participant = $this->participationModel->get_participant_by_participation($participation_id);
     $experiment = $this->participationModel->get_experiment_by_participation($participation_id);
     $this->form_validation->set_rules('part_number', lang('part_number'), 'trim|required');
     $this->form_validation->set_rules('interrupted', lang('interrupted'), 'required');
     $this->form_validation->set_rules('excluded', lang('excluded'), 'required');
     $this->form_validation->set_rules('excluded_reason', lang('excluded_reason'), $this->input->post('excluded') ? 'callback_not_default' : 'trim');
     $this->form_validation->set_rules('comment', lang('comment'), 'trim|required');
     $this->form_validation->set_rules('pp_comment', lang('pp_comment'), 'trim');
     $this->form_validation->set_rules('tech_comment', lang('tech_comment'), 'trim');
     // Run validation
     if (!$this->form_validation->run()) {
         // If not succeeded, return to previous page
         $pp_comment = $this->input->post('pp_comment');
         $tech_comment = $this->input->post('tech_comment');
         $this->completed($participation_id, $pp_comment, $tech_comment);
     } else {
         // If succeeded, insert data into database
         $r = $this->input->post('excluded_reason');
         $participation = array('part_number' => $this->input->post('part_number'), 'interrupted' => $this->input->post('interrupted'), 'excluded' => $this->input->post('excluded'), 'excluded_reason' => $r == '-1' ? NULL : $r, 'comment' => $this->input->post('comment'));
         $this->participationModel->completed($participation_id, $participation);
         // Add (possible) comment
         $comment = $this->post_comment($participant->id);
         if ($comment) {
             $this->commentModel->add_comment($comment);
         }
         // Mail (possible) technical comment
         $tech_comment = $this->input->post('tech_comment');
         if ($tech_comment) {
             $this->participationModel->add_tech_message($participation_id, $tech_comment);
             $this->send_technical_email($participation_id, $tech_comment);
         }
         // Deactivate participant (possibly)
         if ($this->input->post('cancelled_complete') === '1') {
             $this->participantModel->deactivate($participant->id, DeactivateReason::AfterExp);
         }
         flashdata(sprintf(lang('part_completed'), name($participant), $experiment->name));
         redirect('/participation/experiment/' . $experiment->id, 'refresh');
     }
 }
Example #30
0
 /** Cancel: cancels the participation to the experiment */
 public function cancel($call_id)
 {
     $this->check_integrity($call_id);
     $participation = $this->callModel->get_participation_by_call($call_id);
     $participant = $this->participationModel->get_participant_by_participation($participation->id);
     $experiment = $this->participationModel->get_experiment_by_participation($participation->id);
     // Add (possible) comment
     $comment = $this->post_comment($participant->id);
     if ($comment) {
         $this->commentModel->add_comment($comment);
     }
     // End the call
     $this->callModel->end_call($call_id, CallStatus::Cancelled);
     $this->participationModel->cancel($participation->id, TRUE);
     $this->participationModel->release_lock($participation->id);
     // Deactivate the participant
     if ($this->input->post('never_again')) {
         $this->participantModel->deactivate($participant->id, DeactivateReason::DuringCall);
         flashdata(sprintf(lang('part_cancelled_complete'), name($participant), $experiment->name, name($participant)));
     } else {
         flashdata(sprintf(lang('part_cancelled'), name($participant), $experiment->name));
     }
     redirect('/participant/find/' . $experiment->id, 'refresh');
 }