How about this?

Code:

#!/bin/sh

for subdir in *
do
        if [ -d "$subdir" ]
        then
                tar cvfz  "$subdir".tar.gz "$subdir"/*
                #rm -r "$subdir"
        fi
done


(commented out the rm -r - only uncomment when you are sure everything works the way you want!)