Gift certs are not supposed to earn miles. But when purchased in the restaurant, it's not possible for idine to distinguish what was bought.
For some reason, I get the feeling that they'd have an easier time enforcing the T&C with an on-line purchase, since the db would contain info as to what was bought. Furthermore, the online CC might be processed by a third party, and thus never show up on your CC account as a purchase from the restaurant.