I have two arrays that contain the value.
$list_partners_edr =
Array
(
[0] => AIDA
[1] => AMAN
[2] => CDS
[3] => CISForm
[4] => ICJ Makassar
[5] => ICJR
[6] => IJRS
[7] => Kemitraan
[8] => LBH APIK
[9] => LBH Makassar
[10] => LBHM
[11] => LeIP
[12] => Peace Gen
[13] => PEKKA
[14] => PUSHAM UII
[15] => Rumah KitaB
[16] => SAPDA
[17] => SIGAB
[18] => Solo Bersimfoni
[19] => TAF
[20] => TII
[21] => WAHID F
[22] => YPP
)
note: this $list_partners_edr data can be retrieved from the field of [acronym] => AIDA from $partners_edr_data
It's actually less practical, I'm using 2 different arrays even though the partner information is already in the $partners_edr_data array. The script should be able to do it. Any suggestions?
and
$partners_edr_data =
array(184)
(
[0] => Array
(
[id] => 81
[acronym] => AIDA
[start_date] => 2022-05-20
[end_date] => 2024-12-31
[edr_code] => 1272
[edr_status] =>
)
[1] => Array
(
[id] => 81
[acronym] => AIDA
[start_date] => 2022-05-20
[end_date] => 2024-12-31
[edr_code] => 1273
[edr_status] =>
)
[2] => Array
(
[id] => 81
[acronym] => AIDA
[start_date] => 2022-05-20
[end_date] => 2024-12-31
[edr_code] => 1274
[edr_status] =>
)
[3] => Array
(
[id] => 81
[acronym] => AIDA
[start_date] => 2022-05-20
[end_date] => 2024-12-31
[edr_code] => 1275
[edr_status] =>
)
[4] => Array
(
[id] => 81
[acronym] => AIDA
[start_date] => 2022-05-20
[end_date] => 2024-12-31
[edr_code] => 1276
[edr_status] =>
)
[5] => Array
(
[id] => 81
[acronym] => AIDA
[start_date] => 2022-05-20
[end_date] => 2024-12-31
[edr_code] => 1277
[edr_status] =>
)
[6] => Array
(
[id] => 81
[acronym] => AIDA
[start_date] => 2022-05-20
[end_date] => 2024-12-31
[edr_code] => 1278
[edr_status] =>
)
[7] => Array
(
[id] => 93
[acronym] => AMAN
[start_date] => 2022-06-20
[end_date] => 2024-12-31
[edr_code] => 1710
[edr_status] => ACHIEVED
)
[8] => Array
(
[id] => 93
[acronym] => AMAN
[start_date] => 2022-06-20
[end_date] => 2024-12-31
[edr_code] => 1711
[edr_status] => ONGOING
)
[9] => Array
(
[id] => 93
[acronym] => AMAN
[start_date] => 2022-06-20
[end_date] => 2024-12-31
[edr_code] => 1712
[edr_status] => ONGOING
)
[10] => Array
(
[id] => 93
[acronym] => AMAN
[start_date] => 2022-06-20
[end_date] => 2024-12-31
[edr_code] => 1713
[edr_status] => ACHIEVED
)
[11] => Array
(
[id] => 93
[acronym] => AMAN
[start_date] => 2022-06-20
[end_date] => 2024-12-31
[edr_code] => 1714
[edr_status] => ONGOING
)
[12] => Array
(
[id] => 93
[acronym] => AMAN
[start_date] => 2022-06-20
[end_date] => 2024-12-31
[edr_code] => 1715
[edr_status] => ONGOING
)
[13] => Array
(
[id] => 93
[acronym] => AMAN
[start_date] => 2022-06-20
[end_date] => 2024-12-31
[edr_code] => 1716
[edr_status] => ONGOING
)
[14] => Array
(
[id] => 93
[acronym] => AMAN
[start_date] => 2022-06-20
[end_date] => 2024-12-31
[edr_code] => 1717
[edr_status] => NOTACHIEVED
)
[15] => Array
(
[id] => 93
[acronym] => AMAN
[start_date] => 2022-06-20
[end_date] => 2024-12-31
[edr_code] => 1718
[edr_status] => ACHIEVED
)
....
[183] => Array
(
[id] => 87
[acronym] => YPP
[start_date] => 2022-06-01
[end_date] => 2024-12-31
[edr_code] => 1466
[edr_status] =>
)
The expected result/goal is 3 groups of categories and 23 (representation of partners) values inside like below:
$_ach = [0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1] (JSON encoded)
$_ong = [7,5,8,6,9,10,15,2,4,9,8,6,2,9,10,4,12,4,12,13,8,8,8] (JSON encoded)
$_nach = [0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] (JSON encoded)
Those values above will be fed to highchart column as below:
Have been crawling around within StackOverflow and others without no clue how to achieve those results. Any advice, a shorter way, or any thoughts? Thanks in advance.