mardi 30 avril 2019

if and elseif issue in codeigniter

I am trying to calculate the incentive for the people with designation as Assistant Managers and Senior Executives. So, I need to give 1% of the total amount to the Senior Executives and 1.5% to the managers. So, while writing the if, elseif conditions for the same in codeigniter view. Only the if condition is working and elseif conditiion is not working. Since, I am new to codeigniter, please help me out with this.

                                if(isset($target_revenue[0]['target']))
                                {
                                    $amount=$get_rev/$target_revenue[0]['target']*100;
                                    {
                                    if($amount>100 && $designation ="Assistant Manager")  
                                    {

                                        $get_rev1=($get_rev-$target_revenue[0]['target'])*0.015;
                                        }

                                        else if($amount>100 && $designation ="Senior Executive") 
                                    {

                                        $get_rev1=($get_rev-$target_revenue[0]['target'])*0.01;
                                        }

                                    }
                            }

Aucun commentaire:

Enregistrer un commentaire