I have built an xlsx and csv file reader with php using phpspreadsheet as reader but when reading files that are password protected it is not possible. Searching the documentation it says that " phpspreadsheet can read spreadsheets that are protected. You don't need to know the password or do anything special to read a protected file. " Reading. Does anyone know anything regarding this?
Javier Alejandro's questions
I'm making a photo gallery with a bootstrap 4 carousel but the image looks like this on the left side of it:
I have tried to give it a margin-left but the image is not responsive so I have removed it, here I leave the html code
<h3 class="card-title text-center" style="margin-top: 10px;">AGUAS OCULTAS</h3>
<div class="container">
<div class="row justify-content-center">
<div id="carouselExampleIndicators" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-indicators">
<button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="0" class="active"
aria-current="true" aria-label="Slide 1"></button>
<button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="1"
aria-label="Slide 2"></button>
<button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="2"
aria-label="Slide 3"></button>
<button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="3"
aria-label="Slide 3"></button>
<button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="4"
aria-label="Slide 3"></button>
<button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="5"
aria-label="Slide 3"></button>
<button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="6"
aria-label="Slide 3"></button>
<button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="7"
aria-label="Slide 3"></button>
<button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="8"
aria-label="Slide 3"></button>
<button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="9"
aria-label="Slide 3"></button>
</div>
<div class="carousel-inner">
<div class="carousel-item active">
<img src="img/aguas10.jpg" alt="" id="aguas10" onclick="imagen('aguas10')" class="img-fluid">
</div>
<div class="carousel-item">
<img src="img/aguastodas.png" alt="Análisis territorial.
Unión de diferencias" id="aguas2" onclick="imagen('aguas2')">
</div>
<div class="carousel-item">
<img src="img/aguaspa.png" alt="Parte alta. Presencia de
Niebla." id="aguas3" onclick="imagen('aguas3')">
</div>
<div class="carousel-item">
<img src="img/aguascc.png" alt="Cuatro Corredores.
Quebradas." id="aguas4" onclick="imagen('aguas4')">
</div>
<div class="carousel-item">
<img src="img/aguasze.png" alt="Zona de Encuentro.
Transición" id="aguas5" onclick="imagen('aguas5')">
</div>
<div class="carousel-item">
<img src="img/aguasda.png" alt="Domesticación del Agua. Agua al
mar" id="aguas6" onclick="imagen('aguas6')">
</div>
<div class="carousel-item ">
<img src="img/agua7.jpg" alt="Análisis territorial. Estrategias
por estrato" id="aguas7" onclick="imagen('aguas7')">
</div>
<div class="carousel-item ">
<img src="img/agua8.jpg" alt="Fotomontaje" id="aguas8" onclick="imagen('aguas8')">
</div>
<div class="carousel-item ">
<img src="img/agua9.jpg" alt="Fotomontaje" id="aguas9" onclick="imagen('aguas9')">
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleIndicators"
data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Atrás</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleIndicators"
data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Siguiente</span>
</button>
</div>
</div>
</div>
I hope you can help me.
I want to go through an array that comes to me from the view and insert it into the database, but it only enters the last array.
This is the array I send (I send it as json and convert it to array in controller)
Controller where to get the array:
$producto= new producto();
$productos=json_decode($request->productos);
// NO ME RECORRE EL ARRAY, SÓLO ME MUESTRA EL ÚLTIMO INGRESADO
/* foreach ($productos as $p) {
$array=[
'codigo'=>$p->codigo,
'cantidad'=>$p->cantidad,
'descripcion'=>$p->descripcion,
'valor'=>$p->valor,
'total'=>($p->valor * $p->cantidad),
'fecha'=> $p->fecha,
];
} */
//SI DEJO PRODUCTOS[$I] ME AGREGA EL ÚLTIMO ARRAY, SI DEJO PRODUCTOS[$J]
ME AGREGA EL PRIMER ARRAY
$j=0;
for($i=0;$i<count($productos);$i++){
$producto->codigo=$productos[$i]->codigo;
$producto->cantidad=$productos[$i]->cantidad;
$producto->descripcion=$productos[$i]->descripcion;
$producto->valor=$productos[$i]->valor;
$producto->total=($productos[$i]->cantidad * $productos[$i]->valor);
$producto->fecha=$productos[$i]->fecha;
$producto->save();
$j++;
}
I have tried several methods that I have searched here on the page but I have not reached a solution. I hope you can help me.
I'm making a form with Laravel 8 that at the end downloads a pdf and shows me a message but I can't make it show me both. Either it downloads the pdf and doesn't show anything or it only shows the msg and doesn't download the pdf. These are my controllers
Function that generates the pdf
protected function pdf($data){
$pdf = \PDF::loadView('orden/ordenPDF', $data);
return $pdf->download('archivo.pdf');
}
And here I call him and try to return him with a message
$pdf=$this->pdf($data);
$mensaje='La orden de compra se ha generado con éxito, se ha descargado un archivo PDF. Si desea
visualizar nuevamente la orden generada diríjase a la opción "Orden de compra -> Órdenes de
compra."';
return $pdf;
return back()->with('success',$mensaje)
if i just use return $pdf
it i download the pdf without message. If I only use return back()->with('success',$mensaje)
it, it returns only the message that it is.
I tried with return $pdf->with('success',$mensaje);
but it throws the following error: BadMethodCallException Method Illuminate\Http\Response::with does not exist.