You have this website , which generates a table of reserved and available tables, with no need to login:
Oninspection,youcanseethestyleofthediv(ex:class="day closed"
):
Butinthesourcecodeitsaysthis:
<divid="reserve" class="container main">
<div class="col-md-12 white">
<h2>Faça sua Reserva</h2>
<hr class="softly">
<p class="info-top">Reserve mesa(s) para até <strong>4 pessoas por R$ 12</strong> ou até <strong>6 pessoas por R$ 18</strong> e garanta <strong>50% de desconto nas refeições de toda a mesa</strong>.</p>
<div id="restaurant-calendar" class="calendar">
<script id="restaurant-calendar-tpl" type="text/ractive">
{{#if loading}}
<div class="loader small">
<div class="loading-spinner"></div>
</div>
<style>
@-webkit-keyframes rotate-forever {
0% { -webkit-transform: rotate(0deg); -moz-transform: rotate(0deg); -ms-transform: rotate(0deg); -o-transform: rotate(0deg); transform: rotate(0deg); }
100% { -webkit-transform: rotate(360deg); -moz-transform: rotate(360deg); -ms-transform: rotate(360deg); -o-transform: rotate(360deg); transform: rotate(360deg); }
}
@-moz-keyframes rotate-forever {
0% { -webkit-transform: rotate(0deg); -moz-transform: rotate(0deg); -ms-transform: rotate(0deg); -o-transform: rotate(0deg); transform: rotate(0deg); }
100% { -webkit-transform: rotate(360deg); -moz-transform: rotate(360deg); -ms-transform: rotate(360deg); -o-transform: rotate(360deg); transform: rotate(360deg); }
}
@keyframes rotate-forever {
0% { -webkit-transform: rotate(0deg); -moz-transform: rotate(0deg); -ms-transform: rotate(0deg); -o-transform: rotate(0deg); transform: rotate(0deg); }
100% { -webkit-transform: rotate(360deg); -moz-transform: rotate(360deg); -ms-transform: rotate(360deg); -o-transform: rotate(360deg); transform: rotate(360deg); }
}
.loading-spinner {
-webkit-animation-duration: 0.75s;
-moz-animation-duration: 0.75s;
animation-duration: 0.75s;
-webkit-animation-iteration-count: infinite;
-moz-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-animation-name: rotate-forever;
-moz-animation-name: rotate-forever;
animation-name: rotate-forever;
-webkit-animation-timing-function: linear;
-moz-animation-timing-function: linear;
animation-timing-function: linear;
height: 30px;
width: 30px;
border: 4px solid #d5dae2;
border-right-color: transparent;
border-radius: 50%;
display: inline-block;
opacity: 0.8;
}
.loader.small {
padding:30px 0;
position: relative;
text-align: center;
}
</style> {{else}}
{{#if error}}
<div class="alert alert-info">{{ error }}</div>
{{else}}
<div id="restaurantCalendar" class="calendar">
<div class="line head clearfix">
<div class="day">{{ calendar.breakfast[0].day_week_name }}</div>
<div class="day">{{ calendar.breakfast[1].day_week_name }}</div>
<div class="day">{{ calendar.breakfast[2].day_week_name }}</div>
<div class="day">{{ calendar.breakfast[3].day_week_name }}</div>
<div class="day">{{ calendar.breakfast[4].day_week_name }}</div>
<div class="day">{{ calendar.breakfast[5].day_week_name }}</div>
<div class="day">{{ calendar.breakfast[6].day_week_name }}</div>
</div>
<div class="line subhead clearfix">
<div class="day">{{ calendar.breakfast[0].qtd_tables+' '+(calendar.breakfast[0].qtd_tables > 1 ? 'Mesas' : 'Mesa') }}</div>
<div class="day">{{ calendar.breakfast[1].qtd_tables+' '+(calendar.breakfast[1].qtd_tables > 1 ? 'Mesas' : 'Mesa') }}</div>
<div class="day">{{ calendar.breakfast[2].qtd_tables+' '+(calendar.breakfast[2].qtd_tables > 1 ? 'Mesas' : 'Mesa') }}</div>
<div class="day">{{ calendar.breakfast[3].qtd_tables+' '+(calendar.breakfast[3].qtd_tables > 1 ? 'Mesas' : 'Mesa') }}</div>
<div class="day">{{ calendar.breakfast[4].qtd_tables+' '+(calendar.breakfast[4].qtd_tables > 1 ? 'Mesas' : 'Mesa') }}</div>
<div class="day">{{ calendar.breakfast[5].qtd_tables+' '+(calendar.breakfast[5].qtd_tables > 1 ? 'Mesas' : 'Mesa') }}</div>
<div class="day">{{ calendar.breakfast[6].qtd_tables+' '+(calendar.breakfast[6].qtd_tables > 1 ? 'Mesas' : 'Mesa') }}</div>
</div>
{{#if filters.meal.indexOf("breakfast") > -1 || filters.meal.length == 0}}
<div class="line breakfast clearfix">
{{#each calendar.breakfast}}
<a href="javascript:void(0)">
<div class="day {{ status }}">
<div>
{{ convertDay(date) }} {{ month_name }}
<div>
{{#if status != "closed"}}
{{ hour }}
{{/if}}
</div>
{{ convertStatus(status, qtd_available) }}
</div>
<div class="popup_hidden">
<div class="title">
{{#if status == "available"}}
Reserve a primeira mesa e tenha 50% de desconto!
{{elseif status == "soldout"}}
Oops! Já foi reservado!
{{else}}
Primeira Mesa não operará neste dia.
{{/if}}
</div>
<div class="content text-center">
{{#if status == "available"}}
<a target="_blank" href="/restaurante/{{ slug }}" class="btn">Conheça o Restaurante</a>
<i style="display:block;font-style:normal">ou</i>
<a href="/restaurante/{{ slug }}/reservar/{{ convertWeekDay(date) }}/cafe-da-manha" class="btn">Reserve Agora</a>
{{else}}
<div class="text">
Mas você ainda pode reservar!
<br>Ligue para <a href="tel:{{ phone }}" class="phone">{{ phone }}</a>
{{#if website.length > 1}}, ou {{/if}}
</div>
{{#if website.length > 1}}
<a href="http://{{ website }}" target="_blank" class="btn website">Entre no Site</a>
{{/if}}
{{/if}}
</div>
</div>
</div>
</a>
{{/each}}
</div>
{{/if}}
{{#if filters.meal.indexOf("lunch") > -1 || filters.meal.length == 0}}
<div class="line lunch clearfix">
{{#each calendar.lunch}}
<a href="javascript:void(0)">
<div class="day {{ status }}">
<div>{{ convertDay(date) }} {{ month_name }}<div>{{#if status != "closed"}}{{ hour }}{{/if}}</div>{{ convertStatus(status, qtd_available) }}</div>
<div class="popup_hidden">
<div class="title">
{{#if status == "available"}}
Reserve a primeira mesa e tenha 50% de desconto!
{{elseif status == "soldout"}}
Oops! Já foi reservado!
{{else}}
Primeira Mesa não operará neste dia.
{{/if}}
</div>
<div class="content text-center">
{{#if status == "available"}}
<a target="_blank" href="/restaurante/{{ slug }}" class="btn">Conheça o Restaurante</a>
<i style="display:block;font-style:normal">ou</i>
<a href="/restaurante/{{ slug }}/reservar/{{ convertWeekDay(date) }}/almoco" class="btn">Reserve Agora</a>
{{else}}
<div class="text">
Mas você ainda pode reservar!
<br>Ligue para <a href="tel:{{ phone }}" class="phone">{{ phone }}</a>
{{#if website.length > 1}}, ou {{/if}}
</div>
{{#if website.length > 1}}
<a href="http://{{ website }}" target="_blank" class="btn website">Entre no Site</a>
{{/if}}
{{/if}}
</div>
</div>
</div>
</a>
{{/each}}
</div>
{{/if}}
{{#if filters.meal.indexOf("dinner") > -1 || filters.meal.length == 0}}
<div class="line dinner clearfix">
{{#each calendar.dinner}}
<a href="javascript:void(0)">
<div class="day {{ status }}">
<div>{{ convertDay(date) }} {{ month_name }}<div>{{#if status != "closed"}}{{ hour }}{{/if}}</div>{{ convertStatus(status, qtd_available) }}</div>
<div class="popup_hidden">
<div class="title">
{{#if status == "available"}}
Reserve a primeira mesa e tenha 50% de desconto!
{{elseif status == "soldout"}}
Oops! Já foi reservado!
{{else}}
Primeira Mesa não operará neste dia.
{{/if}}
</div>
<div class="content text-center">
{{#if status == "available"}}
<a target="_blank" href="/restaurante/{{ slug }}" class="btn">Conheça o Restaurante</a>
<i style="display:block;font-style:normal">ou</i>
<a href="/restaurante/{{ slug }}/reservar/{{ convertWeekDay(date) }}/jantar" class="btn">Reserve Agora</a>
{{else}}
<div class="text">
Mas você ainda pode reservar!
<br>Ligue para <a href="tel:{{ phone }}" class="phone">{{ phone }}</a>
{{#if website.length > 1}}, ou {{/if}}
</div>
{{#if website.length > 1}}
<a href="http://{{ website }}" target="_blank" class="btn website">Entre no Site</a>
{{/if}}
{{/if}}
</div>
</div>
</div>
</a>
{{/each}}
</div>
{{/if}}
</div>
<div class="swipe visible-xs visible-sm">← deslize o calendário →</div> {{/if}}
{{/if}}
</script>
</div>
</div>
</div>
What I wanted was to use file_get_contents
with preg_match_all
to search when I had class="day available
, but I believe that it does not return the result because of JS
, so I can not search.
Is this really the problem?
What other way can I make this query in the content of the page, using php
?