0

I have an array as such:

Array([0]=>1001 [1]=>1002 [2]=>1003 [3]=>1004)
Array([0]=>2001 [1]=>2002 [2]=>2003)

I am trying to display the array in a table like below:

Location user
Office 4
Canteen 3

The user column is supposed to display the total count in the array. I am able to do that, however I am trying to display the array values when the number is clicked. Please help me solve this issue.

User_model.php

function get_user_count($location){
 $this->db->select('user_id');
 $this->db->from('time_location');
 $this->db->where('location', $location);
 $this->db->where('ack', 1);
 $query = $this->db->count_all_results();

controller.php

$status = $this->User_model->get_user_count($location);
if($status){
 $object_id = array_column($status, 'user_id');
 $this->table->add_row($location, $object_id);
} else{
 $object_id = 0;
 $this->table->add_row($location, $object_id);
}

So far I am able to do this to display the total user count in the location. How to make the count value as a link/button where if clicked, it will display the user_id array?

asked Jul 12, 2023 at 3:36

1 Answer 1

0

this is the Magento community .

Your code seems to be written in another PHP framework.

I think you are using the CI or Laravel framework, ask your question to the CI/Laravel or https://stackoverflow.com/ community.

answered Jul 12, 2023 at 5:36

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.