Problem with execute my file permission

Here is my script.

      1 echo -n "Enter file name : "
      2 read file
      3 chmod 777 $file
      4 [ -w $file ] && W="write = yes" || W="Write = no"
      5 chmod 777 $file
      6 [ -x $file ] && X="Execute = yes" || X="Execute = No"
      7 chmod 777 $file
      8 [ -r $file ] && R="Read = yes" || R="Read = No"
      9 echo
     10 echo "$file permissions"
     11 echo "$W"
     12 echo "$R"
     13 echo "$X"

I want my script can do the following problem is display a listing of the user's directory and allow permission change. Prompt the user to change file permission (y/n). If yes, prompt the user for the file name. Display the file's permission. Ask the user to enter the add or remove the following permission: read the user, write user, execute user, read group, write group, execute group, read other, write other and execute other. After file permission have been changed, display the file's new permission.

I am really stuck all day and been trying to solve it all day long.

Anyone who read my post. Thank you so much and really appreciate for ehlping me.