Based on your gist, I just see php code. This forum isn't intended to support PHP code (nor can PhoneGap execute PHP code).
Also, please read the welcome text for this group -- there's not enough information to be of assistance in this post, and the welcome text describes what information we need in order to be helpful.