function get_program_status($program_id) { $allstat = return_arr_status(); $arr_status = array(); foreach ($allstat as $each) { $arr_status[$each] = 0; } $this->db->where('program_id', $program_id); $this->db->select('initiative.*, program.segment'); $this->db->join('program', 'initiative.program_id = program.id'); $query = $this->db->get('initiative'); $inits = $query->result(); foreach ($inits as $init) { $status = $this->minitiative->get_initiative_status_only($init); if (!$status) { if ($init->status) { $status = $init->status; } else { $status = "Not Started Yet"; } } $arr_status[$status] = $arr_status[$status] + 1; } return $arr_status; }
function get_one_segment_status($segment) { $status = return_arr_status(); $arr = $this->get_segment_status($status, $segment); return $arr; }
?> </div> <div style="float:left; max-width:490px"><a href="<?php echo base_url(); ?> initiative/list_program_initiative/<?php echo $prog['prog']->id; ?> "><?php echo $prog['prog']->title; ?> </a></div> <div style="clear:both"></div> </td> <?php $allstat = return_arr_status(); $total = 0; foreach ($allstat as $stat) { $color = ""; if ($prog['status'][$stat]) { $color = color_status($stat); } echo "<td style='background-color:" . $color . "'><center>" . $prog['status'][$stat] . "</center></td>"; $total = $total + $prog['status'][$stat]; } ?> <td><center><?php echo $total; ?> </center></td> <td colspan=2 style="width:100px">
<canvas style="float:left;" id="myChart2" width="200" height="200"></canvas> </div> <div style="float:left"> <?php $bisnis = array('Wholesale', 'SME', 'Mikro', 'Individuals'); ?> <table class="table"> <tr><th style="width:100px"></th> <th><span class="circle circle-notyet circle-lg text-left"></span></th> <th><span class="circle circle-inprog circle-lg text-left"></span></th> <th><span class="circle circle-atrisk circle-lg text-left"></span></th> <th><span class="circle circle-delay circle-lg text-left"></span></th> <th><span class="circle circle-completed circle-lg text-left"></span></th> </tr> <?php $stss = return_arr_status(); $arrtotbis = array(); foreach ($stss as $stat) { $arrtotbis[$stat] = 0; } foreach ($bisnis as $each) { echo "<tr><td><a href='" . base_url() . "program/list_programs/" . $each . "'>" . $each . "</a></td>"; foreach ($stss as $stat) { echo "<td>" . $segment_status[$each]['stat'][$stat] . "</td>"; $arrtotbis[$stat] = $arrtotbis[$stat] + $segment_status[$each]['stat'][$stat]; } echo "</tr>"; } //Total echo "<tr><th>Total</th>"; foreach ($stss as $stat) {