public static function updateSettingsAlternative($client_id,$active_to,$tiers_str,$new_monthly_price,$changed_fee,$add_users,$add_projects,$add_storage,$active_from='') { //3) write to pending client settings $pcss = PendingClientServiceSettings::model()->findByPk($client_id); if (!$pcss) { $pcss = new PendingClientServiceSettings(); $pcss->Client_ID = $client_id; } $pcss->Service_Level_ID = $tiers_str; $pcss->Additional_Users = $add_users ; $pcss->Additional_Projects = $add_projects; $pcss->Additional_Storage = $add_storage; $pcss->Pending_Active_From = $active_from ? date('Y-m-d',strtotime($active_from)) : '0000-00-00'; $pcss->Pending_Active_To = date('Y-m-d',strtotime($active_to)); $pcss->Fee = round($new_monthly_price,2); $pcss->Fee_To_Upgrade = round($changed_fee,2); $pcss->Approved =0; $pcss->save(); return $pcss; }