demand Calculation in PHP side working