public function get_notification_nav($notification) { global $path_admin; $output = ""; $when = DateDifferenceFormat($notification->date, unixToMySQL(time())); if ($notification->links) { $link = "href='{$path_admin}.{$notification->links}'"; } else { $link = "href='#'"; } $output .= " <li>"; $output .= " <a"; $output .= " href=\""; $output .= $link; $output .= "\">"; $output .= " <div>\n <i class=\"fa fa-envelope fa-fw\"></i>"; $output .= $notification->message; $output .= " <span class=\"pull-right text-muted small\">"; $output .= $when; $output .= " </span>\n </div>\n </a>\n </li>\n <li class=\"divider\"></li>"; $output .= ""; $output .= ""; $output .= ""; return $output; }
function __construct($oid = 0, $cid = 0) { parent::__construct('OID', 'CID', 't_event'); $this->rs['OID'] = $oid; $this->rs['CID'] = $cid; $this->rs['created_dt'] = unixToMySQL(time()); $this->rs['teamId'] = ''; $this->rs['stationId'] = ''; $this->rs['eventType'] = Event::TYPE_BAD; $this->rs['points'] = 0; $this->rs['data'] = ''; if ($oid && $cid) { $this->retrieve($oid, $cid); } }
public static function chat_message($chat, $direction = "left") { global $session; $chat->set_up_display(); $from_user = User::find_by_id($chat->user_id); $when = DateDifferenceFormat($chat->date, unixToMySQL(time())); if ($from_user->username == "kamy") { $direction = "right"; } else { $direction = "left"; } $output = ""; $output .= " <div class='chat-message {$direction}'>"; $output .= "<img class='message-avatar' "; $output .= "src='"; $output .= $from_user->user_path_and_placeholder(); // $output.="img/a4.jpg"; $output .= "' alt='' >"; $output .= "<div class='message '>"; $output .= "<a class='message-author' href='#'>"; $output .= $from_user->full_name(); $output .= "</a>"; if ($session->user_id === $chat->user_id) { $output .= "<span class='message-edit'> "; $output .= "<a title='Edit message' href='" . static::$page_public . "?id={$chat->id}'>"; $output .= " <i class=\"fa fa-edit\"></i>"; $output .= "</a>"; $output .= "</span>"; $output .= "<span class='message-delete'> "; $output .= "<a class='' title='Delete message' href='" . static::$page_public . "?delid={$chat->id}' onclick=\"return confirm('Are you sure you want to delete your message?');\" >"; $output .= "<i class=\"fa fa-minus-square \" style='color: red'></i>"; $output .= "</a>"; $output .= "</span>"; } $output .= "<span class='message-date'> "; $output .= $when; $output .= "</span>"; $output .= "<span class='message-content'>"; $output .= $chat->message; if (!empty($chat->img)) { $output .= "<br>"; $output .= "<a href='" . static::$page_public . "?chat_id=" . u($chat->id) . "'>"; $output .= "<img class='hover_img' style='width:50px; height:50px' "; $output .= "src='"; $output .= $chat->chat_path_and_placeholder(); $output .= "' alt='' >"; $output .= "</a>"; } $output .= "</span>"; $output .= "</div>"; $output .= " </div>"; return $output; }
<?php require_once 'datenbank.php'; $data = $_POST[data]; $date = $data[date]; $date = substr($date, 0, 33); $timestamp = strtotime($date); $year = unixToMySQL($timestamp, "Y"); $month = unixToMySQL($timestamp, "m"); function unixToMySQL($timestamp, $type) { return date($type, $timestamp); } $db_link = mysqli_connect(MYSQL_HOST, MYSQL_BENUTZER, MYSQL_KENNWORT, MYSQL_DATENBANK); $sql = "SELECT * FROM events WHERE month = " . $month . " AND year =" . $year; $db_erg = mysqli_query($db_link, $sql); if (!$db_erg) { die('Ung�ltige Abfrage: ' . mysqli_error()); } while ($zeile = mysqli_fetch_array($db_erg, MYSQL_ASSOC)) { $events[] = array($zeile['id'], $zeile['title'], $zeile['description'], $zeile['clock'], $zeile['priority'], $zeile['day']); } $events = json_encode($events); print_r($events);
public function get_message_nav($chat) { global $path_admin; $chat->set_up_display(); $from_user = User::find_by_id($chat->user_id); $when = DateDifferenceFormat($chat->input_date, unixToMySQL(time())); $output = ""; $output .= "<div class=\"dropdown-messages-box\">"; $output .= "<a href=\" {$path_admin} profile.php\" class=\"pull-left\">"; $output .= " <img alt=\"image\" class=\"img-circle\" src=\""; $output .= $from_user->user_path_and_placeholder(); $output .= "\" >"; $output .= "</a>"; $output .= "<div class=\"media-body\">"; $output .= " <small class=\"pull-right\">"; $output .= $when; $output .= "</small><strong><span style=\"color: blue\">"; $output .= $from_user->full_name(); $output .= "</span></strong> wrote:<br> <strong>"; $output .= $chat->message; $output .= "</strong>. <br>\n <small class=\"text-muted\">"; $output .= datetime_to_text($chat->input_date); $output .= "</small>\n </div>\n </div>\n </li>\n <li class=\"divider\"></li>"; $output .= ""; $output .= ""; $output .= ""; $output .= ""; return $output; }
function create() { $this->rs['created_dt'] = unixToMySQL(time()); return parent::create(); }
function set_contact_data($tag, &$json) { $this->rs['lastContact'] = unixToMySQL(time()); $this->rs['URL'] = $json['station_url']; $this->rs['debug'] = "tag={$tag} " . json_encode($json); }