Your question is about two different things:
- The usage of particle で and particle に to express place vs. action.
- The usage of particle は to highlight a matter in the sentence.
Understanding particle で vs. particle に
When you want to express where a certain action is taking place, you use particle で. Consider the following examples:
1a) My mom bought an apple in the supermarket. => お母{かあ}さんはスーパーでりんごを買{か}いました。
2a) I am studying Japanese in Naganuma School. => ナガヌマ学校で[日]{に}[本]{ほん}語{ご}を勉{べん}強{きょう}しています。
3a) I had a fight with that guy in a restaurant. => あの人{ひと}とレストランで喧{けん}嘩{か}をした。
4a) Where can I buy an apple? => どこでりんごを買{か}ったらいいですか。
I am using particle で, here, because I want to describe the place where an action took place.
Consider now these sentences:
1b) There is a kid there. => あそこに子{こ}どもがいます。
2b) Place that bag over here please. => そのカバンをここに置{お}いて下{くだ}さい。
3b) I am in a restaurant now. => 今{いま}、レストランにいます。
4b) Where are you? => どこにいるんですか。 or どこにいる?
5b) Ms Shimura is in her office now. => 志{し}村{むら}さんは自{じ}分{ぶん}の事{じ}務{む}所{しょ}にいます。
6b) There is a bag in that room. => あの部{へ}屋{や}にカバンがあります。
7b) Pay attention to the boxes on the table please. => テーブルにある箱{はこ}に気{き}をつけて下{くだ}さい。
In this case I used particle に because, although I am specifying a place where something is happening, I am actually describing a place where things are. Where things do exist.
Consider the sentences 1a and 1b. Sentence 1a is actually telling you: Ok my friend, my mom bought an apple. Where does this action took place? => In the supermarket!. Sentence 1b, on the other hand, is telling you: Ok my friend, there is a kid. Where? => There is a kid over there!. The latter is not telling you when an action is taking place. The kid is existing in a certain place, I am not telling you what he is doing, just telling you where is existence is located. The same goes for all my examples.
A particular example is sentence 2b. Here There is a man that is telling you to put the bag in a certain place. Of course you need to specify a place where to put it, but particle で is to be avoided. Here you are not describing where the action of dropping the bag is being performed (probably in a room). In sentence 2b, verb 置{お}く necessarily needs a place which implies a movement of something.
This should explain you when using particle で and when using particle に.
Understanding particle は
This particle is terrible for beginners because it is so versatile and flexible that you will end up finding it in every damn place.
Probably they tell you, in the first lessons, that particle は is used to mark the subject of the sentence. It is true, but too specific. Actually particle は has two important usages:
It is used to mark the argument of the sentence. Pay attention, the argument of the sentence is not necessarily the subject.
It is used to underline something and put emphasis on it.
Since it is better proceeding by examples, here we go.
As subject marker
In the following sentences, the particle marks the subject of the sentence:
Where is mom? => 母{かあ}ちゃんはどこにいる?
I am here! => 僕{ぼく}はここにいる。
I am watching a movie with my brother. => 僕{ぼく}はお兄{にい}さんと映{えい}画{が}を見{み}ています。
Ishikawa-san went out to buy some fruit. => 石{いし}川{かわ}さんはスーパーへ果{くだ}物{もの}を買{か}いに行{い}きました。
To mark the argument
In the following conversation, the particle does not mark the subject, but the argument.
Aさん: Soon it is Christmas! => そろそろクリスマスになるよ!
Bさん: Yes! About the present for your brother, what will you buy?
=> そうね!ああ、お兄{にい}さんのギフトはどうする?
Conclusions
Particle は can also be used next to other particles in order to act as some sort of remarker. Consider the following sentences:
The kid is in that place (saying with anxiety) => あそこには[子]{こ}どもがいるよ!
The entrance ceremony will take place in the school gym, students will gather there! => 学{がっ}校{こう}のジムで入{にゅう}学{がく}式{しき}があるから、あそこでは学{がく}生{せい}が集{あつ}まる!
Both sentences use particle に and particle で as I told you, and also use particle は to remark something. Just like your examples!