- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
foreach ($userFilterList as $uParam) { // массив юзеров ~300
// ... говнокод
$usenb = $DB->getField("SELECT `usenb` FROM `users` WHERE `id`=" . $DB->F($uParam[0]) . ";"); // дозапрашиваем поле
// ... говнокод
for ($i = 0; $i < $dayCount; $i++) { // $dayCount по дефолту 3
$sql = "SELECT * FROM `link_empl` WHERE `user_id`=" . $DB->F($uParam[0]) .
" AND `sched_date`=" . $DB->F(date("Y-m-d", strtotime($startDate) + $i * 24 * 60 *
60)) . ";";
$r = $DB->getRow($sql);
// ... говнокод
if ($r) {
$wt = ($r[3] - $r[2]) / 30;
$timeStart = (strlen(floor($r[2] / 60)) == 1 ? "0" . floor($r[2] / 60) : floor($r[2] /
60)) . ":" . (strlen($r[2] % 60) == 1 ? "0" . $r[2] % 60 : $r[2] % 60);
$timeEnd = (strlen(floor($r[3] / 60)) == 1 ? "0" . floor($r[3] / 60) : floor($r[3] /
60)) . ":" . (strlen($r[3] % 60) == 1 ? "0" . $r[3] % 60 : $r[3] % 60);
$res = "<table cellpadding='0' cellspacing='0' class='sched seltf'><tr>";
$sql = "SELECT тут_много_полей FROM `bfx` AS bfx
LEFT JOIN `tasks` AS tsk ON tsk.id=bfx .task_id
LEFT JOIN `tickets` AS ticket ON ticket.task_id=bfx .task_id
LEFT JOIN `task_types` AS ttype ON ttype.id=ticket.task_type
LEFT JOIN `task_status` AS status ON status.id=tsk.status_id
LEFT JOIN `list_addr` AS addr ON addr.id=ticket.dom_id
WHERE bfx .em_id=" . $DB->F($uParam[0]) .
" AND bfx .c_date=" . $DB->F(date("Y-m-d", strtotime($startDate) + $i * 24 * 60 *
60)) . ";";
$DB->query($sql);
// ... говнокод
}
}
}
график работ аля диаграмма ганта by ©senior shaurma developer
guest 26.08.2016 18:54 # 0
void_maln 26.08.2016 19:04 # 0
guesto 26.08.2016 19:06 # −1
--конечно, вот: "SELECT * FROM `link_empl` WHERE `user_id`=" . $DB->F($uParam[0])
void_maln 26.08.2016 19:08 # 0
guest 26.08.2016 19:15 # 0
void_main 26.08.2016 19:17 # 0
CTEPTOP 26.08.2016 19:25 # 0