Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

229
Views
Indexe cada ranura superpuesta y el mismo número no puede superponerse en php

Estoy usando jq.schedule( https://github.com/ateliee/jquery.schedule/ ) para mostrar un horario que cambia todos los días. Hoy "indexamos" cada intervalo de tiempo azul con un número del 1 al 7 dependiendo de cuántos intervalos de tiempo se superponen manualmente en el papel. El número de índice le dice al cajero en qué registro debe estar.

Por ejemplo, en la mañana entre las 7 y las 9 de la mañana, solo hay 2 cajeros. Entonces, el número de índice más alto puede ser 2. Y entre 16 y 17 hay 5 ranuras superpuestas, por lo que el número más alto puede ser 5.

Todos los intervalos de tiempo están en una matriz. Intenté hacer un bucle foreach y encontrar cuáles se superponen, pero no obtengo los números correctos.

Y para que el cajero se mueva y tenga rotación, la misma persona no debe ser el mismo número más de dos horas seguidas.

Púrpura significa descanso, por lo que no debería haber ningún índice en ellos.

Esto es lo que he probado:

 foreach ($timeslot as $thisevent) { $kassanralla = 1; foreach ($timeslot as $thatevent) { if ($thisevent['Timestart'] > $thatevent['Timestart']) { $thisevent_from = $thisevent['Timestart']; $thisevent_ends = $thisevent['Timestop']; $thatevent_from = $thatevent['Timestart']; $thatevent_ends = $thatevent['Timestop']; if ($thatevent_ends > $thisevent_from AND $thisevent_ends > $thatevent_from) { $kassanralla++; } } if ($kassanralla === 0) { } } echo' $("#schedule").timeSchedule("addSchedule", "'.$thisevent['Row'].'", { start: "'.$thisevent['Timestart'].'", end: "'.$thisevent['Timestop'].'", text:"'.$kassanralla.'", data:{ "class": "'.$divclass.'" } });';

imagen del horario:
Haga clic aquí para ver la imagen del horario

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!