pending orders question

 

Hello, 

Please a little code suggestion on how to check if pending orders are placed and how many..

Thanks in advance!