Computation of Basic and Diluted Net Income Per Share (Detail) - USD ($) $ / shares in Units, shares in Thousands, $ in Thousands |
3 Months Ended | 9 Months Ended | ||||
|---|---|---|---|---|---|---|
Apr. 30, 2017 |
Apr. 30, 2016 |
Apr. 30, 2017 |
Apr. 30, 2016 |
|||
| Earnings Per Share [Abstract] | ||||||
| Net (loss) income | $ (59,664) | $ 4,970 | $ (49,618) | $ 3,361 | ||
| Weighted average number of common shares outstanding-basic | 12,486 | 12,392 | 12,457 | 12,412 | ||
| Effect of dilutive securities: | ||||||
| Stock options and restricted stock units | 161 | 211 | ||||
| Weighted average number of common shares outstanding-diluted | 12,486 | 12,553 | 12,457 | 12,623 | ||
| Basic net (loss) income per share | $ (4.78) | $ 0.40 | $ (3.98) | $ 0.27 | ||
| Diluted net (loss) income per share | $ (4.78) | $ 0.40 | $ (3.98) | $ 0.27 | ||
| Anti-dilutive shares related to outstanding stock options and unvested restricted stock | [1] | 242 | 87 | 228 | 5 | |
| ||||||