if (!$logged_me_in_successfully234) return; echo ' '; if ($new != "2" && $new != "3") $taskarr = GrabTasktypes("subs"); echo "
"; function EchoTaskTypes($arr, $chooseSubtasks = false) { global $link, $companyID; foreach ($arr as $res1) { $tasktype_id = $res1->id; $taskname = $res1->name; $description = $res1->description; $main = $res1->main_task; $completeTime = intval($res1->time_to_complete_minutes); // $tasktype_id = $res1['id']; // $taskname = $res1['name']; // $description = $res1['description']; // $main = $res1['main_task']; // $completeTime = intval($res1['time_to_complete_minutes']); $global = ''; $styletab = ' style="margin-left: 40px"'; $nam = 'Задача '.$tasktype_id.$global.': '.$taskname.''; echo "
';
$query1 = mysqli_query($link, "select * from accounts where company=$companyID");
while ($res1 = mysqli_fetch_array($query1))
{
$staff_id = $res1['id'];
$staff_name = $res1['name'];
echo ''.$staff_name.':';
// $eff = EfficiencyReport($staff_id);
$tasks = GrabReadyTasksForAccount($staff_id, $tasktype_id);
// $data = $eff[$tasktype_id];
if (sizeof($tasks) == 0)
echo ' не выполнял';
else {
$data = round(GetAverageTime($tasks)/60.0, 0, PHP_ROUND_HALF_UP);
$minutes = 'минут';
switch (intval($data)) {
case 0:
$data = 'меньше минуты';
$minutes = '';
break;
case 1:
$minutes = 'минуту';
break;
case 2:
case 3:
case 4:
$minutes = 'минуты';
break;
}
echo " в среднем затрачивает $data $minutes ";
echo "";
}
echo "