Hide button based on PHP result

You can use get_post_status(ID) to check to see if the post is published. You’ll need to pull the post ID (through WP Query/loop/etc)

if (get_post_status( $ID ) == "publish"){
    #Show Published Button
} else {
    #Show Not Published Button
} 

Get Post Status in the Codex