123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- <?
- if (!$logged_me_in_successfully234)
- return;
- //удалить запись из базы
- //send task confirm type
- //send object type?
- //send accept date
- //echo "cid ".$companyID;
- $taskarr = GrabTasktypes();
- if ($new == "3")
- {
- DeleteTask($task_id);
- echo "<span style='color:red'><b>Задача $task_id удалена!</b></span>";
- }
- else if ($new == '2')
- {
- if (!isset($task_id) || $task_id=='')
- {
- echo "Все задачи выданы в работу!";
- }
- else
- echo "Задача ".$task_id." выдана в работу!";
- $accsused = TasksAssign($task_id,true);
- echo "Задачи назначены ".sizeof($accsused)." сотрудникам: ";
- }
- if ($new == '6')//revoke
- {
- Account::ClearTasksFromAccount($task_id);
- }
- if ($new == '7')//confirm
- {
- TaskConfirm($num, $id, $tid, $confirm_data);
- }
- if ($new == '8')//confirm
- {
- TaskReopen($tid);
- }
- if ($new == '9')//confirm
- {
- DeletePic($path);
- }
- if ($new == '5')
- {
- // echo 'new task type '.$newtasktype;
- $tasktypesarr = array( GrabTasktype($newtasktype) );
- CreateTasks($tasktypesarr);
- }
- if ($new == '4')
- {
- echo 'Создать новую задачу';
- echo "<form method='post' action='?act=tasks&new=5'>";
- echo "<select name='newtasktype'>";
- foreach ($taskarr as $tasktype)
- {
- if ($tasktype['main_task'] == '1') {
- $ttype = $tasktype['id'];
- $ttname = $tasktype['name'];
- echo "<option value = '".$ttype."'>[" . $ttype . "] " . $ttname . "</option>";
- }
- }
- echo "</select>";
- echo "<input type='submit' value='Создать!'><br>";
- echo "</form>";
- }
- else
- {
- echo "<form method='post' action='?act=tasks&new=4'>";
- echo "<input type='submit' value='Создать новую задачу'><br>";
- echo "</form>";
- }
- echo "<form id='form1' name='form1' method='post'>";
- echo "<h3>Выполненные задачи компании $companyname:</h3>";
- // echo "taskarr ".sizeof($taskarr);
- if (sizeof($taskarr)> 0) {
- $keys = array_keys ($taskarr);
- $arrIds = implode(',',$keys);
- //echo '$arrIds '.$arrIds;
- echo " <input type='button' onclick='FindStaff(\"\")' value='Все в работу!'><br>";
- $array_parent = array();
- $str = "select * from tasks where status=5 and parent_id=0 and type in (".$arrIds.")";
- // echo "str $str <br>";
- $query = mysqli_query($link, $str);
- {
- while ($res1 = mysqli_fetch_array($query)) {
- $array_parent[$res1['id']] = $res1;
- }
- }
- // echo sizeof($array_parent);
- $array_children = array();
- foreach ($array_parent as $parent_id => $res) {
- $children = array();
- // echo $parent_id.' '.$res['name'].'||';
- $query = mysqli_query($link, "select * from tasks where parent_id=" . $parent_id);
- while ($res1 = mysqli_fetch_array($query)) {
- array_push($children, $res1);
- }
- $array_children[$parent_id] = $children;
- //echo sizeof($array_children[$array_parent]);
- }
- $_SESSION['array_children'] = $array_children;
- foreach ($array_children as $parent_id => $children) {
- echo '<br>';
- echo "<div style='border: solid; border-width: .5px; border-color: #9cb2c4; border-radius: 15px; margin:5px; padding: 5px'>";
- EchoTask($array_parent[$parent_id], $taskarr, true);
- if (sizeof($children) > 0) {
- echo '<br><b>Показать подзадачи и исполнителей:</b> <input type="checkbox" onclick="ShowSubtasks(' . $parent_id . ')" name="subtask' . $parent_id . '"/><br>';
- echo '<div id="subtasks_block' . $parent_id . '" style="display: none; margin-left: 40px;">';
- foreach ($children as $res1) {
- echo "<div style='border-top: solid; border-width: .5px; padding: 0px; margin-top:40px;border-color: #D1D1D1'>";
- EchoTask($res1, $taskarr);
- echo '</div>';
- }
- echo '</div>';
- }
- echo '</div>';
- }
- }
- echo "</form>";
- echo '<p><a href = XLSList.php>Скачать XLS отчет</a></p><br>';
- ?>
|