<?php if (cfr('EMPLOYEE')) { if (isset($_GET['username'])) { $username = $_GET['username']; if (isset($_POST['addjob'])) { $date = $_POST['jobdate']; $worker_id = $_POST['worker']; $jobtype_id = $_POST['jobtype']; $job_notes = $_POST['notes']; stg_add_new_job($username, $date, $worker_id, $jobtype_id, $job_notes); rcms_redirect("?module=jobs&username="******"?module=jobs&username=" . $username); } stg_show_jobs($username); show_window('', web_UserControls($username)); } } else { show_error(__('Access denied')); } ?>
if (isset($_POST['changetask'])) { if (wf_CheckPost(array('editenddate', 'editemployeedone'))) { if (zb_checkDate($_POST['editenddate'])) { //editing task sub $editid = vf($_POST['changetask']); simple_update_field('taskman', 'enddate', $_POST['editenddate'], "WHERE `id`='" . $editid . "'"); simple_update_field('taskman', 'employeedone', $_POST['editemployeedone'], "WHERE `id`='" . $editid . "'"); simple_update_field('taskman', 'donenote', $_POST['editdonenote'], "WHERE `id`='" . $editid . "'"); simple_update_field('taskman', 'status', '1', "WHERE `id`='" . $editid . "'"); //flushing darkvoid after changing task $darkVoid = new DarkVoid(); $darkVoid->flushCache(); log_register('TASKMAN DONE [' . $editid . ']'); //generate job for some user if (wf_CheckPost(array('generatejob', 'generatelogin', 'generatejobid'))) { stg_add_new_job($_POST['generatelogin'], curdatetime(), $_POST['editemployeedone'], $_POST['generatejobid'], 'TASKID:[' . $_POST['changetask'] . ']'); log_register("TASKMAN GENJOB (" . $_POST['generatelogin'] . ') VIA [' . $_POST['changetask'] . ']'); } } else { show_error(__('Wrong date format')); } } else { show_error(__('All fields marked with an asterisk are mandatory')); } } //setting task undone if (isset($_GET['setundone'])) { $undid = vf($_GET['setundone'], 3); simple_update_field('taskman', 'status', '0', "WHERE `id`='" . $undid . "'"); simple_update_field('taskman', 'enddate', 'NULL', "WHERE `id`='" . $undid . "'"); log_register("TASKMAN UNDONE [" . $undid . ']');