Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9268925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:58:50+00:00 2026-06-18T14:58:50+00:00

I have a following table display Task No. Person Company Project Task Date Tracked

  • 0

I have a following table display

Task No.    Person            Company           Project Task               Date Tracked Total Time  Comments
14.1    vaish, arpit          ABC-TecHolding    Relaunch Websitnalysis     2013-02-12   19:21:03    
14.2    vaish, arpit          Sugarion          New Opensource Server      2013-02-12   19:21:03    
14.6    vaish, arpit          Sugarion          New Opensource Server      2013-02-12   19:21:03    
5.26    Projectmanager, Paul  ABC-Tec Holding   Relaunch Website           2010-03-13   03:40:16    
5.27    Projectmanager, Paul  ABC-Tec Holding   Relaunch Website           2010-03-12   03:40:16    
5.27    Projectmanager, Paul  ABC-Tec Holding   Relaunch Website           2010-03-13   03:40:16    
8.2     Worker, Willi         Customers ACME    Hosting Data transfer      2010-03-13   00:21:18    
14.2    Worker, Willi         Sugarion          New Opensource Server      2013-02-06   00:21:18    fyhbvghjukjjkhhlhh uuiuijujj jookljh

This is my foreach loop

foreach($result123 as $key=>$task) {
            $time=$this->addtime($task['name'],$range['start'],$range['end']); //to calculate total time per user in time range

            $diff       = $task['estimated']+$task['tracked'];
            $diffSign   = $diff > 0 ? '-' : '+';

            $table->addRow(array(
                'number'    => $task['tasknumber'].' '.$task['id_project'] ,
                'person'=> $task['name'],
                'customer'      => $task['company'],
                'project'       => $task['project'],
                'task'      => $task['task'],
                'date'      => $task['date_tracked'],
                'tracked'   => $task['workload_tracked'],
                'Total_Time'        => $time,
                'comment'=>$task['comment']
            ));

        }

The column total time shows total of time tracked per person.
I want the total time should show only once per Person and not display again and again for each row.
Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T14:58:52+00:00Added an answer on June 18, 2026 at 2:58 pm

    That’s how I’d do it (Pseudocode) :

    • Set an array of “checked” people
    • Foreach record :
    • Is person in the “checked” array?
    • If yes, go on.
    • If no, display total AND add person to “checked” people.

    And in PHP : (if I got it right)

      $checked = array();
    
      foreach($result123 as $key=>&$task) {
            $time=$this->addtime($task['name'],$range['start'],$range['end']); //to calculate total time per user in time range
    
            $diff       = $task['estimated']+$task['tracked'];
            $diffSign   = $diff > 0 ? '-' : '+';
    
            if (in_array($task['name'],$checked) $time =0;
            else {
                  $checked[] = $task['name'];
            }
    
            $table->addRow(array(
                'number'    => $task['tasknumber'].' '.$task['id_project'] ,
                'person'=> $task['name'],
                'customer'      => $task['company'],
                'project'       => $task['project'],
                'task'      => $task['task'],
                'date'      => $task['date_tracked'],
                'tracked'   => $task['workload_tracked'],
                'Total_Time'        => $time,
                'comment'=>$task['comment']
            ));
    
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following table Id | Status | date ------------------- 1 | Onsite |2007
Imagine I have following table: NAME DATE OTHER_CONTANT 'A' '2012-06-05' 'baz' 'A' '2012-06-04' 'bar'
I have the following table and I am trying to display the sum of
I have the following css code .container { width:800px; background-color:yellow; margin:auto; display:table; } .cell
I have the following: CSS: .photo { overflow: hidden; display: table-cell; vertical-align: middle; text-align:
I have a following table. ID Name State Date 1 A1 First 1/10/2013 2
I have the following table ID Name Progress Date ------------------------------ 1 A1 First Stage
I have the following table Alarm (AlarmID INT, InstalledDate Date) Given that the alarm
I have the following table layout which I'm using to display image buttons in
I have the following database table below I want to display notification to the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.