?
Current Path : /home1/savoy/public_html/savoyglobal.net/rms/application/views/accounting/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/public_html/savoyglobal.net/rms/application/views/accounting/list_cost_center.php |
<?php /* * To change this template, choose Tools | Templates * and open the template in the editor. */ echo $sel; ?> <option value="">--Select--</option> <?php $cost_center_parent=$this->mastermodel->get_data('cost_center','0','cost_center_parent','cost_center_id'); if (count($cost_center_parent)) { $sub_t='temp'; foreach ($cost_center_parent as $parent) { if($parent['cost_center_parent']!=$sub_t) { echo '<optgroup label="'.$parent['cost_center_code'].'"></optgroup> '; } $cost_center=$this->mastermodel->get_data('cost_center',$parent['cost_center_id'],'cost_center_parent','cost_center_parent'); foreach ($cost_center as $value) { $log_in_type=$_SESSION['login_type']; $cost_master_login=$this->mastermodel->get_single_field_value('master','login_type_id','master_id ',$value['cost_master_id']); if($log_in_type==$cost_master_login) { echo '<option value="cost_center~'.$value['cost_center_id'].'~COST CENTER~'.$value["cost_center_name"].'"';if($sel==$value['cost_center_id']) echo 'selected';echo ' style="background-color: #ccc;">'.$value["cost_center_code"].$value["cost_center_name"].'</option>'; $cost_center_sub=$this->mastermodel->get_data('cost_center',$value['cost_center_id'],'cost_center_parent','cost_center_parent'); foreach ($cost_center_sub as $sub) { echo '<option value="cost_center~'.$sub['cost_center_id'].'~COST CENTER~'.$sub["cost_center_name"].'" ';if($sel==$sub['cost_center_id']) echo 'selected';echo '>'.$sub["cost_center_name"].'</option>'; } } } if($parent['cost_center_parent']!=$sub_t) { echo " "; } $sub_t=$parent['cost_center_parent']; } } ?>