query($sqlquery); if ($db->connect_errno) die ("$PHP_SELF:
$sqlquery
" . $db->connect_error); // Generate output with checkboxes $output = "
\n"; $output .= "\n"; $output .= " \n"; $output .= " \n"; $output .= " "; $count = 0; $lineToggler = 0; while ($row = $result->fetch_assoc()): $retArray[] = array($row["usr_id"], $row["usr_name"], $row["usr_firstname"]); if ($lineToggler == 0) : $lineToggler = 1; else : $lineToggler = 0; endif; $cellColor = getListColorGeneric($count, $lineToggler); $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " "; $count++; endwhile; if ($count == 0) : $output .= "\n"; $output .= " \n"; $output .= ""; endif; $output .= "
" . getLngt($title). "
" . $row["usr_firstname"]. "" . $row["usr_name"]. "
" . getLngt("Zur Zeit ist die " . $title . " nicht besetzt."). "
\n"; $output .= "
\n"; $result->free(); if ($retMode == "1") : return $output; else : return $retArray; endif; } // Get ticker messages of the user to have to read function getUserMessages ($retMode = "", $tifIdFrom = "0") { global $db, $PHP_SELF, $hq_id, $emp_id; $tickerArray = array(); $outputJs = ""; $output = ""; $currentTime = getDateTime("0"); $whereClause = ""; if ($tifIdFrom != "" && is_numeric($tifIdFrom) && $tifIdFrom > "0") : $whereClause = " tif.tif_id > '" . $tifIdFrom . "' AND "; endif; $sqlquery = "SELECT tif.tif_id, tif.tif_createtime, tif.tif_endtime, tif.tif_text, tif.tif_subject, tif.emp_id_creator, tif.hq_id" . " FROM phoenix_group.tickerforum AS tif" . " WHERE tif.tif_starttime <= '" . $currentTime . "' AND '" . $currentTime . "' <= tif.tif_endtime AND" . $whereClause . " (tif.emp_id = '" . $emp_id . "' OR tif.emp_id = '0') AND" . " (tif.hq_id = '" . $hq_id . "' OR tif.hq_id = '0')" . " ORDER BY tif.tif_createtime DESC"; $result = $db->dbQ($sqlquery); $output = "
\n"; $output .= "\n"; $output .= " \n"; $output .= " \n"; $output .= " "; $count = 0; $lineToggler = 0; while ($row = $result->fetch_assoc()): $outputText = trim($row["tif_text"]); $outputText = str_replace("'", "", $outputText); $outputText = str_replace('"', '', $outputText); $outputText = nl2br($outputText); $tickerText = trim($row["tif_text"]); $tickerText = str_replace("\n", " ", $tickerText); $tickerText = str_replace("\r", " ", $tickerText); $tickerText = str_replace("'", "", $tickerText); $tickerText = str_replace('"', '', $tickerText); if ($tickerText != "") : $tickerArray[] = "+++ " . $tickerText . " +++"; if ($lineToggler == 0) : $lineToggler = 1; else : $lineToggler = 0; endif; $cellColor = getListColorGeneric($count, $lineToggler); if ($count == 0) : $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " "; endif; $tifCreattime = $row["tif_createtime"]; $empIdCreator = $row["emp_id_creator"]; $usrIdCreator = getFieldValueFromId("employee","emp_id",$empIdCreator,"usr_id"); $usrNameCreator = getFieldValueFromId("user","usr_id",$usrIdCreator,"usr_name"); $usrFirstnameCreator = getFieldValueFromId("user","usr_id",$usrIdCreator,"usr_firstname"); $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= " "; $count++; endif; endwhile; if ($count == 0) : $output .= "\n"; $output .= " \n"; $output .= ""; endif; $output .= "
" . getLngt("Mitteilungen"). "
" . "Ersteller" . "" . "Zeitpunkt" . "" . "Nachricht" . "
" . $usrFirstnameCreator . " " . $usrNameCreator . "" . $tifCreattime . "" . $outputText . "
" . getLngt("Zur Zeit liegen keine Mitteilungen vor."). "
\n"; $output .= "
\n"; // $result->free(); mysqli_free_result($result); $tickerArrayLen = count($tickerArray); $tmpTicker = ""; for ($j = 0; $j < $tickerArrayLen; $j++) : $tmpTicker .= "\"" . $tickerArray[$j] . "\""; if ($j < ($tickerArrayLen - 1)) : $tmpTicker .= ","; endif; endfor; if ($retMode == "1") : if ($tmpTicker == "") $tmpTicker = "\"\""; $outputJs .= "tl = new Array (" . $tmpTicker . ");"; $outputJs .= "max = tl.length;"; return $outputJs; elseif ($retMode == "2") : return $tickerArrayLen; elseif ($retMode == "3") : return $output; else : return $tickerArray; endif; } ?>