Why is Semantic-Ui Popup not Functioning? - php

I am working on a Laravel project. I included a SemanticUI popup but it doesn't work and I get a javascript error:
Popup: The target or popup you specified does not exist on the page
I used a view for the popup code called popup.blade.php and I included it in my Laravel index page.
Popup:
<div class="ui fluid popup bottom left transition hidden" style="top: 551.634px; left: 0.994324px; bottom: auto; right: auto; width: 614.659px;">
<div class="ui four column relaxed divided grid">
<div class="column">
<h4 class="ui header">Fabrics</h4>
<div class="ui link list">
<a class="item">Cashmere</a>
<a class="item">Linen</a>
<a class="item">Cotton</a>
<a class="item">Viscose</a>
</div>
</div>
</div>
JavaScript:
$(document).ready(function() {
$('.grid-cell').popup({
inline: true,
hoverable: true,
popup: '.special.popup',
position: 'bottom left',
delay: {
show: 300,
hide: 800
}
});
});
Index:
<div class="grid-calendar">
<div class="row calendar-week-header">
<div class="col-xs-1 grid-cell">
<div>
<div><span class="hd">Monday</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span class="hd">Tuesday</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span class="hd">Wednesday</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span class="hd">Thursday</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span class="hd">Friday</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span class="hd">Saturday</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span class="hd">Sunday</span></div>
</div>
</div>
</div>
<div class="row calendar-week">
<div class="col-xs-1 grid-cell">
<div>
<div><span></span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span></span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span></span></div>
</div>
</div>
<div class="col-xs-1 grid-cell " style="background-color: #dddada;">
<div>
<div><span>1</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>2</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>3</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>4</span></div>
</div>
</div>
</div>
<div class="row calendar-week">
<div class="col-xs-1 grid-cell">
<div>
<div><span>5</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>6</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>7</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>8</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>9</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>10</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>11</span></div>
</div>
</div>
</div>
<div class="row calendar-week">
<div class="col-xs-1 grid-cell">
<div>
<div><span>12</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>13</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>14</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>15</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>16</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>17</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>18</span></div>
</div>
</div>
</div>
<div class="row calendar-week">
<div class="col-xs-1 grid-cell">
<div>
<div><span>19</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>20</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>21</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>22</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>23</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>24</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>25</span></div>
</div>
</div>
</div>
<div class="row calendar-week">
<div class="col-xs-1 grid-cell">
<div>
<div><span>26</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>27</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>28</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>29</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>30</span></div>
</div>
</div>
<div class="col-xs-1 grid-cell">
<div>
<div><span>31</span></div>
</div>
</div><span></span></div>
</div>

Related

laravel 9 (how can i make this code better..more compact)

I have 3 lists from 3 different stages of a client. I want to list all the clients, but separated by the stages of those clients.
<div class="container">
<!-- Title and Top Buttons Start -->
<div class="page-title-container">
<div class="row">
<!-- Title Start -->
<div class="col-12 col-md-7">
<!-- #include('_layout.breadcrumb',['breadcrumbs'=>$breadcrumbs]) -->
</div>
<!-- Title End -->
</div>
</div>
<!-- Title and Top Buttons End -->
<!-- Content Start -->
<div>
<div class="row">
<!-- Buttons Start -->
<div class="col-xl-6 mb-5">
<section class="scroll-section" id="buttons">
<!-- Lista Prospecção -->
<div class="d-flex justify-content-between">
<h2 class="small-title">Prospecção</h2>
</div>
<div class="scroll-out">
<div class="scroll-by-count" data-count="5">
#foreach ($clientes->where('etapa', '1') as $cliente)
<div class="card mb-2">
<div class="row g-0 sh-14 sh-md-10">
<div class="col">
<div class="card-body pt-0 pb-0 h-700">
<div class="row g-0 h-100 align-content-center">
<div class="col-12 col-md-7 d-flex flex-column mb-2 mb-md-0">
<div>{{$cliente->nome}} </div>
<div class="text-small text-muted text-truncate">{{$cliente->contato}}</div>
<div class="text-small text-muted text-truncate">{{$cliente->mes}}/{{$cliente->ano}}</div>
</div>
</div>
</div>
</div>
</div>
</div>
#endforeach
</div>
</div>
<!-- Fim Lista Prospecção -->
<br />
<!-- Lista Necessidade do Cliente -->
<div class="d-flex justify-content-between">
<h2 class="small-title">Necessidade do Cliente</h2>
</div>
<div class="scroll-out">
<div class="scroll-by-count" data-count="5">
#foreach ($clientes->where('etapa', '2') as $cliente)
<div class="card mb-2">
<div class="row g-0 sh-14 sh-md-10">
<div class="col">
<div class="card-body pt-0 pb-0 h-700">
<div class="row g-0 h-100 align-content-center">
<div class="col-12 col-md-7 d-flex flex-column mb-2 mb-md-0">
<div>{{$cliente->nome}} </div>
<div class="text-small text-muted text-truncate">{{$cliente->contato}}</div>
<div class="text-small text-muted text-truncate">{{$cliente->mes}}/{{$cliente->ano}}</div>
</div>
</div>
</div>
</div>
</div>
</div>
#endforeach
</div>
</div>
<!-- Fim Lista Necessidade do Cliente -->
<br />
<!-- Lista Marcou Consulta -->
<div class="d-flex justify-content-between">
<h2 class="small-title">Marcou Consulta</h2>
</div>
<div class="scroll-out">
<div class="scroll-by-count" data-count="5">
#foreach ($clientes->where('etapa', '3') as $cliente)
<div class="card mb-2">
<div class="row g-0 sh-14 sh-md-10">
<!-- <div class="col-auto h-100">
<img src="/img/product/small/product-2.webp" alt="alternate text" class="card-img card-img-horizontal sw-11" />
</div> -->
<div class="col">
<div class="card-body pt-0 pb-0 h-700">
<div class="row g-0 h-100 align-content-center">
<div class="col-12 col-md-7 d-flex flex-column mb-2 mb-md-0">
<div>{{$cliente->nome}} </div>
<div class="text-small text-muted text-truncate">{{$cliente->contato}}</div>
<div class="text-small text-muted text-truncate">{{$cliente->mes}}/{{$cliente->ano}}</div>
</div>
</div>
</div>
</div>
</div>
</div>
#endforeach
</div>
</div>
<!-- Fim Lista Marcou Consulta -->
<br />
<!-- Lista Apresentou Proposta -->
<div class="d-flex justify-content-between">
<h2 class="small-title">Apresentou Proposta</h2>
</div>
<div class="scroll-out">
<div class="scroll-by-count" data-count="5">
#foreach ($clientes->where('etapa', '4') as $cliente)
<div class="card mb-2">
<div class="row g-0 sh-14 sh-md-10">
<!-- <div class="col-auto h-100">
<img src="/img/product/small/product-2.webp" alt="alternate text" class="card-img card-img-horizontal sw-11" />
</div> -->
<div class="col">
<div class="card-body pt-0 pb-0 h-700">
<div class="row g-0 h-100 align-content-center">
<div class="col-12 col-md-7 d-flex flex-column mb-2 mb-md-0">
<div>{{$cliente->nome}} </div>
<div class="text-small text-muted text-truncate">{{$cliente->contato}}</div>
<div class="text-small text-muted text-truncate">{{$cliente->mes}}/{{$cliente->ano}}</div>
</div>
</div>
</div>
</div>
</div>
</div>
#endforeach
</div>
</div>
<!-- Fim Lista Apresentou Proposta -->
<br />
</section>
</div>
<!-- Buttons End -->
</div>
</div>
<!-- Content End -->
</div>
The code is working.
#foreach ($clientes->where('etapa', '1') as $cliente)
#endforeach
This is the main loop.
I have to make a foreach inside this foreach?
Showing each "etapa" (stage) that my client is?
<div class="container">
<!-- Title and Top Buttons Start -->
<div class="page-title-container">
<div class="row">
<!-- Title Start -->
<div class="col-12 col-md-7">
<!-- #include('_layout.breadcrumb',['breadcrumbs'=>$breadcrumbs]) -->
</div>
<!-- Title End -->
</div>
</div>
<!-- Title and Top Buttons End -->
<!-- Content Start -->
<div>
<div class="row">
<!-- Buttons Start -->
<div class="col-xl-6 mb-5">
<section class="scroll-section" id="buttons">
<!-- Listas -->
#php
$etapa = [
'1' => 'Prospecção',
'2' => 'Necessidade do Cliente',
'3' => 'Marcou Consulta',
'4' => 'Apresentou Proposta',
'5' => 'Negócio Fechado',
'6' => 'Negócio Perdido',
'7' => 'Oportunidades Futuras'
];
#endphp
#foreach ($etapa as $keyetapa => $e)
<div class="d-flex justify-content-between">
<h2 class="small-title">{{ $e }}</h2>
</div>
<div class="scroll-out">
<div class="scroll-by-count" data-count="5">
#foreach ($clientes->where('etapa', $keyetapa) as $cliente)
<div class="card mb-2">
<div class="row g-0 sh-14 sh-md-10">
<div class="col">
<div class="card-body pt-0 pb-0 h-700">
<div class="row g-0 h-100 align-content-center">
<div class="col-12 col-md-7 d-flex flex-column mb-2 mb-md-0">
<div>{{$cliente->nome}} </div>
<div class="text-small text-muted text-truncate">{{$cliente->contato}}</div>
<div class="text-small text-muted text-truncate">{{$cliente->mes}}/{{$cliente->ano}}</div>
</div>
</div>
</div>
</div>
</div>
</div>
#endforeach
</div>
</div>
<br />
#endforeach
</section>
</div>
<!-- Buttons End -->
</div>
</div>
<!-- Content End -->
</div>

How to move div in row, it's going under the row now

Image of how it looks now : https://ibb.co/C2Gj1FL
I have to make a PDF file with a table made out of divs, I'm using bootstrap, but there is some php code in there also.
**Table made with divs**
<div class="split-table-div m-table first-table">
<div class="row m-header l-table">
<div class="top-p">
<p> <?= $property['project_name'] ?></p>
</div>
<div class="col-xs-1 col-sm-1 fs-12"><div class="p-1">Nr</div></div>
<div class="col-xs-1 col-sm-1 fs-12"><div class="p-1">Benämning</div></div>
<div class="col-xs-1 col-sm-1 fs-12"><div class="p-1">Underrättelse</div></div>
<div class="col-xs-1 col-sm-1 fs-12"><div class="p-1">Debet form</div></div>
<div class="col-xs-1 col-sm-1 fs-12"><div class="p-1">Upparbetat</div></div>
<div class="col-xs-1 col-sm-1 fs-12"><div class="p-1">Ej reglerat</div></div>
<div class="col-xs-1 col-sm-1 fs-12"><div class="p-1">Godkänt</div></div>
<div class="col-xs-1 col-sm-1 fs-12"><div class="p-1">Fakturerat</div></div>
<div class="col-xs-1 col-sm-1 fs-12"><div class="p-1">Riktkostnad +/-</div></div>
<div class="row">
<?php if (isset ($data['previous_json_data'])) :?>
<div class="fs-12 border-left col-sm-1"><div class="p-1">Prognos</div> <?= $data["created_at2"] ?></div>
<div class="fs-12 border-right col-sm-1"><div class="p-1">Prognos</div> <?= $data["created_at"] ?></div>
<?php else : ?>
<div class="fs-12 col-sm-1" ><div class="p-1">Prognos</div> <?= $data["created_at"] ?></div>
<?php endif; ?>
<div class="fs-12 col-sm-1"><div class="p-1">Status</div></div>
</div>
</div>
<div class="row m-body">
//Body div's
</div>
</div>
Image of how it looks now : https://ibb.co/C2Gj1FL

XPath Specific Expression WebDriver Error

I have a problem with WebDriver's XPath that, even though it's right, is returning an error expression.
The expression is:
(*//div[contains(#class, 'myb-SettledBetItem ') or contains(#class, 'myb-OpenBetItem_Collapsed') or contains(#class, 'myb-OpenBetItem ')]//(span[#class='myb-SettledBetParticipant_ParticipantSpan ' or #class='myb-OpenBetParticipant_ParticipantSpan']|div[#class='myb-SettledBetItem_SubHeaderText']))
The html is:
<div class="myb-BetItemsContainer_BetItemsContainer ">
<div class="myb-SettledBetItem ">
<div class="myb-SettledBetItemHeader ">
<div class="myb-SettledBetItemHeader_HeaderTextContainer ">
<div class="myb-SettledBetItemHeader_Title ">
<div class="myb-SettledBetItemHeader_Text ">R$0,50 Simples</div>
</div>
<div class="myb-SettledBetItem_SubHeaderText "></div>
</div>
<div class="myb-SettledBetItem_BetStateContainer ">
<div class="myb-SettledBetItem_BetStateLabel ">Retorno Obtido</div>
<div class="myb-SettledBetItem_BetReturnLabel ">R$1,19</div>
</div>
</div>
<div>
<div>
<div class="myb-SettledBetParticipant-FirstOfType myb-SettledBetParticipant myb-SettledBetParticipant_Won ">
<div class="myb-SettledBetParticipant_Header ">
<div class="myb-SettledBetParticipant_HeaderTitle ">
<div class="myb-SettledBetParticipant_HeaderText "><span class="myb-SettledBetParticipant_ParticipantSpan ">Hollyoak Hector (v Courts Ad Darcey) </span>
<div class="myb-HalfAndHalfPill myb-HalfAndHalfPill_Status-1 ">
<div class="myb-HalfAndHalfPill_TextStatus myb-HalfAndHalfPill_TextStatus-1 ">
<div class="myb-HalfAndHalfPill_TextStatusLHS myb-HalfAndHalfPill_TextStatusLHS-1 "></div>
<div class="myb-HalfAndHalfPill_TextStatusRHS myb-HalfAndHalfPill_TextStatusRHS-1 "></div>
</div>
</div>
</div>
</div>
<div class="myb-SettledBetParticipant_HeaderOdds ">2.37</div>
</div>
<div class="myb-SettledBetParticipant_MarketDescription ">Aposta Comparativa</div>
<div class="myb-SettledBetParticipant_FixtureDescription ">8.27 Central Park EVE (Corrida 8)</div>
</div>
</div>
<div class="myb-SettledBetItemFooter ">
<div class="myb-SettledBetItemFooter_BetInformation ">
<div class="myb-SettledBetItemFooter_StakeInformation ">
<div class="myb-SettledBetItemFooter_StakeLabel ">Aposta</div>
<div class="myb-SettledBetItemFooter_StakeTextWrapper "><span class="myb-SettledBetItemFooter_StakeTextCurrency myb-SettledBetItemFooter_StakeTextCurrency-formatted ">R$</span><span class="myb-SettledBetItemFooter_StakeText ">0,50</span></div>
</div>
<div class="myb-SettledBetItemFooter_ReturnInformation ">
<div class="myb-SettledBetItemFooter_ReturnLabel ">Retorno Total</div>
<div class="myb-SettledBetItemFooter_ReturnTextWrapper "><span class="myb-SettledBetItemFooter_ReturnTextCurrency myb-SettledBetItemFooter_ReturnTextCurrency-formatted ">R$</span><span class="myb-SettledBetItemFooter_ReturnText ">1,19</span></div>
</div>
</div>
</div>
</div>
</div>
<div class="myb-SettledBetItem ">
<div class="myb-SettledBetItemHeader ">
<div class="myb-SettledBetItemHeader_HeaderTextContainer ">
<div class="myb-SettledBetItemHeader_Title ">
<div class="myb-SettledBetItemHeader_Text ">R$0,50 Simples</div>
</div>
<div class="myb-SettledBetItem_SubHeaderText "></div>
</div>
<div class="myb-SettledBetItem_BetStateContainer ">
<div class="myb-SettledBetItem_BetStateLabel ">Retorno Obtido</div>
<div class="myb-SettledBetItem_BetReturnLabel ">R$0,77</div>
</div>
</div>
<div>
<div>
<div class="myb-SettledBetParticipant-FirstOfType myb-SettledBetParticipant myb-SettledBetParticipant_Won ">
<div class="myb-SettledBetParticipant_Header ">
<div class="myb-SettledBetParticipant_HeaderTitle ">
<div class="myb-SettledBetParticipant_HeaderText "><span class="myb-SettledBetParticipant_ParticipantSpan ">Trap 8 </span>
<div class="myb-HalfAndHalfPill myb-HalfAndHalfPill_Status-1 ">
<div class="myb-HalfAndHalfPill_TextStatus myb-HalfAndHalfPill_TextStatus-1 ">
<div class="myb-HalfAndHalfPill_TextStatusLHS myb-HalfAndHalfPill_TextStatusLHS-1 "></div>
<div class="myb-HalfAndHalfPill_TextStatusRHS myb-HalfAndHalfPill_TextStatusRHS-1 "></div>
</div>
</div>
</div>
</div>
<div class="myb-SettledBetParticipant_HeaderOdds ">1.53</div>
</div>
<div class="myb-SettledBetParticipant_MarketDescription ">Vencedor e V/C Ao-Vivo</div>
<div class="myb-SettledBetParticipant_FixtureDescription ">Race 15 Palm Beach</div>
</div>
</div>
<div class="myb-SettledBetItemFooter ">
<div class="myb-SettledBetItemFooter_BetInformation ">
<div class="myb-SettledBetItemFooter_StakeInformation ">
<div class="myb-SettledBetItemFooter_StakeLabel ">Aposta</div>
<div class="myb-SettledBetItemFooter_StakeTextWrapper "><span class="myb-SettledBetItemFooter_StakeTextCurrency myb-SettledBetItemFooter_StakeTextCurrency-formatted ">R$</span><span class="myb-SettledBetItemFooter_StakeText ">0,50</span></div>
</div>
<div class="myb-SettledBetItemFooter_ReturnInformation ">
<div class="myb-SettledBetItemFooter_ReturnLabel ">Retorno Total</div>
<div class="myb-SettledBetItemFooter_ReturnTextWrapper "><span class="myb-SettledBetItemFooter_ReturnTextCurrency myb-SettledBetItemFooter_ReturnTextCurrency-formatted ">R$</span><span class="myb-SettledBetItemFooter_ReturnText ">0,77</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
Expected outcome:
Hollyoak Hector (v Courts Ad Darcey)
Trap 8
And was tested on the site: http://xpather.com/
The error returned is:
Fatal error: Uncaught Facebook\WebDriver\Exception\InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression THIS_EXPRESSION because of the following error:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string THIS_EXPRESSION is not a valid XPath expression. .... in DIR/vendor/facebook/webdriver/lib/Exception/WebDriverException.php on line 152
What is happening? Why doesn't it work in WebDriver's Xpath and it works on this site?
Is this the best way to handle this data?
Your XPath expression only works in XPath-2.0 or above.
To make it work in XPath-1.0, you have to split what you have tried to do with the brackets:
//div[contains(#class, 'myb-SettledBetItem ') or contains(#class, 'myb-OpenBetItem_Collapsed') or contains(#class, 'myb-OpenBetItem ')]//span[#class='myb-SettledBetParticipant_ParticipantSpan ' or #class='myb-OpenBetParticipant_ParticipantSpan'] | //div[contains(#class, 'myb-SettledBetItem ') or contains(#class, 'myb-OpenBetItem_Collapsed') or contains(#class, 'myb-OpenBetItem ')]/div[#class='myb-SettledBetItem_SubHeaderText']
So duplicate the first part of the expression and apply the union afterwards on both expressions.

Can't open Bootstrap modal in codeigniter

I can't open my modal in CodeIgniter.
I did a view for the modal and then I loaded in the controller. But when I click on the button, it doesn't show anything. No response. head have the Jquery and Bootstrap imports in the correct order.
Here i show you my code:
cdashboard.php:
//header
$this->load->view('UI/vheader');
//sidebar
$this->load->view('UI/vsidebar',$data);
//modals
$data['modaltarea'] = $this->load->view('tareas/vmodalnewtarea',NULL,TRUE);
//data in dashboard
$this->load->view('vdashboard',$data);
//footer
$this->load->view('UI/vfooter');
vmodalnewtarea.php:
<div id="newTareaModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="newTarea" aria-hidden="true">
<div class="modal-dialog" >
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Tarea nueva</h5>
</div>
<div class="modal-body">
<div class="container-fluid">
<!--Importar plantilla-->
<div class="row">
<div class="col-md-12">
<h3>Importar plantilla</h3>
</div>
<div class="row">
<!--Proyecto-->
<div class="col-md-4">
</div>
<!--Fase-->
<div class="col-md-4">
</div>
<!--Tarea-->
<div class="col-md-4">
</div>
</div>
</div>
<!--Nueva Fase-->
<div class="row">
<div class="col-md-12">
<h3>Nueva Tarea</h3>
</div>
<div class="row">
<div class="col-md-4">
<div class="row">
<input type="text" placeholder="Nombre" required />
</div>
<div class="row">
<!--<table id="tableHitos" class="table table-bordered table-strip" >
<thead>
<th>
Hitos
</th>
</thead>
<tbody>
</tbody>
</table>-->
<a type="button" class="btn"><i class="fa fa-plus"></i></a>
</div>
</div>
<div class="col-md-8">
<textarea id="txtaTarea" rows="5" placeholder="Descripcion" required>
</textarea>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<p>
aaaaaa
</p>
</div>
</div>
</div>
</div>
And the view where I call the modal, on other view (vrowfase.php):
<div class="row fase">
<div class="col-lg-12">
<div class="col-lg-2 text-center">
<div class="callout callout-warning">
<h4><?= $fase->nombre?></h4>
<div class="progress progress-xxs">
<div class="progress-bar" role="progressbar" style="width: 50%">
</div>
</div>
</div>
</div>
<div class="projectBar col-lg-10">
<div class="row Bar">
<?= $tareas; ?>
<button type="button" class="btn btn-app text-center" data-toogle="modal" data-target="#newTareaModal">
<i class="fa fa-plus"></i>
Nueva Tarea
</button>
</div>
</div>
</div>
</div>
thanks for the help!
your modal id is
newTareaModal
and your data-target in button is
TareaModal
was a error writing.
on vrowfase.php I had "data-toogle" and is "data-toggle"
thank you anyway!

php loop with complex html blocks

I have set of html block that are moved using jquery i need to make the correct loop of $posts array inside that i spent days trying to make it correct but it's not working for me.
The expected output should be
like this
Here is the my code
<?php if(!empty($posts)): ?>
<?php $count = 1; $countposts = count($posts); ?>
<?php for ($x = 0; $x <= $countposts; $x++): ?>
<?php if($x == 0): ?>
<div class="col-xs-12 col-sm-6 height-auto">
<?php else: ?>
<div class="col-sm-6 height-auto">
<?php endif; ?>
<?php foreach($posts as $post): ?>
<div class="col-sm-12 boxed no-padding-left">
<div class="col-sm-3 no-padding-left artical-thumb">
</div>
<div class="col-sm-9 padding-bottom-10">
<h4 class="text-right text-primary">post title</h4>
<h6 class="text-right">author name</h6>
<p class="text-right">
description text
</p>
more
</div>
</div>
<?php endforeach; ?>
</div>
<?php endfor; ?>
<?php $count++; endif; ?>
This is HTML output that i need
<div class="col-xs-12 col-sm-6 height-auto">
<div class="col-sm-12 boxed no-padding-left">
<div class="col-sm-3 no-padding-left artical-thumb">
</div>
<div class="col-sm-9 padding-bottom-10">
<h4 class="text-right text-primary">post title</h4>
<h6 class="text-right">author name</h6>
<p class="text-right">
description text
</p>
more
</div>
</div>
<div class="col-sm-12 boxed no-padding-left">
<div class="col-sm-3 no-padding-left artical-thumb">
</div>
<div class="col-sm-9 padding-bottom-10">
<h4 class="text-right text-primary">post title</h4>
<h6 class="text-right">author name</h6>
<p class="text-right">
description text
</p>
more
</div>
</div>
</div>
<div class="col-sm-6 height-auto">
<div class="col-sm-12 boxed no-padding-left">
<div class="col-sm-3 no-padding-left artical-thumb">
</div>
<div class="col-sm-9 padding-bottom-10">
<h4 class="text-right text-primary">post title</h4>
<h6 class="text-right">author name</h6>
<p class="text-right">
description text
</p>
more
</div>
</div>
<div class="col-sm-12 boxed no-padding-left">
<div class="col-sm-3 no-padding-left artical-thumb">
</div>
<div class="col-sm-9 padding-bottom-10">
<h4 class="text-right text-primary">post title</h4>
<h6 class="text-right">author name</h6>
<p class="text-right">
description text
</p>
more
</div>
</div>
</div>
<div class="col-sm-6 height-auto">
<div class="col-sm-12 boxed no-padding-left">
<div class="col-sm-3 no-padding-left artical-thumb">
</div>
<div class="col-sm-9 padding-bottom-10">
<h4 class="text-right text-primary">post title</h4>
<h6 class="text-right">author name</h6>
<p class="text-right">
description text
</p>
more
</div>
</div>
<div class="col-sm-12 boxed no-padding-left">
<div class="col-sm-3 no-padding-left artical-thumb">
</div>
<div class="col-sm-9 padding-bottom-10">
<h4 class="text-right text-primary">post title</h4>
<h6 class="text-right">author name</h6>
<p class="text-right">
description text
</p>
more
</div>
</div>
</div>
<div class="col-sm-6 height-auto">
<div class="col-sm-12 boxed no-padding-left">
<div class="col-sm-3 no-padding-left artical-thumb">
</div>
<div class="col-sm-9 padding-bottom-10">
<h4 class="text-right text-primary">post title</h4>
<h6 class="text-right">author name</h6>
<p class="text-right">
description text
</p>
more
</div>
</div>
<div class="col-sm-12 boxed no-padding-left">
<div class="col-sm-3 no-padding-left artical-thumb">
</div>
<div class="col-sm-9 padding-bottom-10">
<h4 class="text-right text-primary">post title</h4>
<h6 class="text-right">author name</h6>
<p class="text-right">
description text
</p>
more
</div>
</div>
</div>
Notice here that the main blocks the first one looks like that
<div class="col-xs-12 col-sm-6 height-auto">
But the others are
<div class="col-sm-6 height-auto">
Also inside each main block there are only 2 posts
You can simply achieve this by starting the loop inside this <div class="col-sm-6 height-auto"> (the one that acts as a slide) then close and open it with a check for each 2 posts, for example it should look like this:
<div class="col-xs-12 col-sm-6 height-auto">
<?php $counter = 0; foreach($posts as $post) : $counter++; ?>
<div class="col-sm-12 boxed no-padding-left">
<div class="col-sm-3 no-padding-left artical-thumb"></div>
<div class="col-sm-9 padding-bottom-10">
<h4 class="text-right text-primary">post title</h4>
<h6 class="text-right">author name</h6>
<p class="text-right">
description text
</p>
more
</div>
</div>
<?php if($counter == 2) : $counter = 0; ?>
</div><div class="col-sm-6 height-auto">
<?php endif; ?>
<?php endforeach; ?>
</div>
Hope I helped.
This is exactly what you want, im using a counter to determine the first post and so on:
<?php
$Posts = [
[
'title' => 'title',
'author' => 'author',
'desc' => 'desc',
'link' => 'link',
],
[
'title' => 'title',
'author' => 'author',
'desc' => 'desc',
'link' => 'link',
],
];
$Count = 0;
?>
<?php foreach( $Posts as $Post ) { ?>
<?php if ($Count == 0) {?>
<div class="col-xs-12 col-sm-6 height-auto">
<div class="col-sm-12 boxed no-padding-left">
<div class="col-sm-3 no-padding-left artical-thumb">
</div>
<div class="col-sm-9 padding-bottom-10">
<h4 class="text-right text-primary">
post title
</h4>
<h6 class="text-right">
author name
</h6>
<p class="text-right">
description text
</p>
<a href="#">
more
</a>
</div>
</div>
<div class="col-sm-12 boxed no-padding-left">
<div class="col-sm-3 no-padding-left artical-thumb">
</div>
<div class="col-sm-9 padding-bottom-10">
<h4 class="text-right text-primary">
post title
</h4>
<h6 class="text-right">
author name
</h6>
<p class="text-right">
description text
</p>
<a href="#">
more
</a>
</div>
</div>
</div>
<?php } else { ?>
<div class="col-sm-6 height-auto">
<div class="col-sm-12 boxed no-padding-left">
<div class="col-sm-3 no-padding-left artical-thumb">
</div>
<div class="col-sm-9 padding-bottom-10">
<h4 class="text-right text-primary">
post title
</h4>
<h6 class="text-right">
author name
</h6>
<p class="text-right">
description text
</p>
<a href="#">
more
</a>
</div>
</div>
<div class="col-sm-12 boxed no-padding-left">
<div class="col-sm-3 no-padding-left artical-thumb">
</div>
<div class="col-sm-9 padding-bottom-10">
<h4 class="text-right text-primary">
post title
</h4>
<h6 class="text-right">
author name
</h6>
<p class="text-right">
description text
</p>
<a href="#">
more
</a>
</div>
</div>
</div>
<?php } ?>
<?php $Count++; ?>
<?php } ?>

Categories