Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $i = 0;
- $j = 0;
- $p = 0;
- $dep = '';
- $pdep = '';
- $aux = count($servidores);
- foreach ($servidores as $value => $servidor) {
- $servidor->ferias = $ferias[$value]->ferias;
- if($value == 0){
- $pdep = $servidor->cd_departamento;
- $dep = $servidor->cd_departamento;
- $serv[$p][$j] = $servidor;
- $j++;
- }else{
- if($dep == $servidor->cd_departamento){
- if ($j < 9) {
- $serv[$p][$j] = $servidor;
- $j++;
- } else {
- $p++;
- $j = 0;
- $serv[$p][$j] = $servidor;
- }
- }else{
- $dep = $servidor->cd_departamento;
- $p++;
- $j = 0;
- $serv[$p][$j] = $servidor;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement