Hi chic @ s I have a question about how to show a data that does not exist in the database ... I explain I have an arrangement in which I keep the students' attendance which is separated by id, date, entry and exit $ fecha2 is a validation to filter by a predetermined date ...
$co= true;
$co1= 0;
$co2= 0;
while ($co=true) {
if ($c2[$co1][0]==null) {
$co= false;
break;
}
if ($co2 == 2) {
$arreglo2[$co2][0] = $arreglo1[$co1][0]; //id
$arreglo2[$co2][2] = $arreglo1[$co1][2]; //fecha
$arreglo2[$co2][3] = $arreglo1[$co1][3]; //entrada
$arreglo2[$co2][4] = $arreglo1[$co1][4]; //salida
}
else {
//aqui hace el filtrado por fecha y la cual funciona bien... el problema es que si un alumno tiene alguna falta osea no tiene un registro del día.. esto afecta el orden de la vista... ya que todo se recorre hacia arriba...
if ($fecha2=== $c2[$con25][2]) {
$co2++;
$arreglo2[$co2][0] = $arreglo1[$co1][0]; //id
$arreglo2[$co2][2] = $arreglo1[$co1][2]; //fecha
$arreglo2[$co2][3] = $arreglo1[$co1][3]; //inicio
$arreglo2[$co2][4] = $arreglo1[$co1][4]; //salida
}else {
//aquí trato de comparar las inasistencias ya que al tener un alumno alguna... los registros se recorren hacia arriba... bueno esto afecta la vista de una tabla que se obtiene en en html...
if (($fecha2 === $arreglo1[$co1][2]) == null) {
$co2++;
$arreglo2[$co2][0] = 0; //id
$arreglo2[$co2][2] = 0; //fecha
$arreglo2[$co2][3] = 0; //inicio
$arreglo2[$co2][4] = 0; //salida
}
}
}
$co1++;
}
// simulation of the database table
Student ID Assist
1 2018-11-01
2 2018-11-01
4 2018-11-01
5 2018-11-01
6 2018-11-01
7 2018-11-01
8 2018-11-01
10 2018-11-01
Student ID Assist
2 2018-11-02
3 2018-11-02
4 2018-11-02
5 2018-11-02
9 2018-11-02
11 2018-11-02
12 2018-11-02
I hope you can help me greetings ....