- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
foreach ( $total_work_days_per_day as $key_year => $value_year ) {
foreach ( $total_work_days_per_day [$key_year] as $key_month => $value_month ) {
foreach ( $total_work_days_per_day [$key_year] [$key_month] as $key_day => $value_day ) {
$sql = "SELECT count(*) AS pocet
FROM srws_schedule
WHERE
(status=1 OR status=2 OR status=13 OR status=14)
AND year =" . $key_year . "
AND month=" . $key_month . "
AND day=" . $key_day . "
";
$stmt = $this->getDoctrine ()->getManager ()->getConnection ()->prepare ( $sql );
$stmt->execute ();
$res = $stmt->fetch ();
$script .= "$('.total_" . $key_month . "_" . $key_day . "').html('" . number_format ( $res ['pocet'], 0, ',', '' ) . "');";
}
}
}
Есть кусок кода с 4 запросами к базе в теле цикла, но сюда не влез.
Dummy00001 31.03.2017 15:23 # 0