Inheritance: extends AdvModel
Esempio n. 1
0
 public function getNotify($id_to)
 {
     if (empty(self::$conn)) {
         self::$conn = $this->connectPdo();
     }
     $sql = "SELECT distinct n.id,id_from,id_to,u.username,u2.username,content,time_on\r\n                    FROM notify AS n\r\n                        LEFT JOIN user AS u ON u.id=n.id_from\r\n                        LEFT JOIN user AS u2 ON u2.id=n.id_to\r\n                    WHERE id_to=? ORDER BY n.time_on DESC";
     $stmt = self::$conn->prepare($sql);
     $stmt->bindParam(1, $id_to);
     $stmt->execute();
     $stmt->setFetchMode(PDO::FETCH_ASSOC);
     $i = 0;
     $notify = array(array());
     while ($row = $stmt->fetch()) {
         $notify[$i++] = $row;
     }
     $i--;
     return $notify;
 }
Esempio n. 2
0
<?php

session_start();
include_once '../model/comment_model.php';
include_once '../model/diary_model.php';
include_once '../model/user_model.php';
include_once '../model/notify_model.php';
include_once '../model/friend_model.php';
include_once '../model/like_model.php';
$l = new LikeModel();
$t = new DiaryModel();
$c = new CommentModel();
$u = new UserModel();
$n = new NotifyModel();
$m = new NotifyModel();
$f = new FriendModel();
$button = '';
$p = 0;
$onclick1 = '';
$user_page = $u->getUser($_GET['user_id']);
if ($f->checkUserId($_SESSION['id'], $user_page['id'])) {
    $a = $f->getFlagFriend($_SESSION['id'], $user_page['id']);
    $flag['flag'] = $a['flag'];
}
if ($f->checkUserId($user_page['id'], $_SESSION['id'])) {
    $b = $f->getFlagFriend($user_page['id'], $_SESSION['id']);
    if ($b['flag'] == 2) {
        $flag['flag'] = 3;
    }
}
if (!$f->checkUserId($_SESSION['id'], $user_page['id']) && !$f->checkUserId($user_page['id'], $_SESSION['id'])) {
Esempio n. 3
0
<?php

// bai dang lay tu thong bao
session_start();
include '../model/diary_model.php';
include '../model/comment_model.php';
include '../model/notify_model.php';
include '../model/user_model.php';
include '../model/like_model.php';
include '../model/friend_model.php';
$f = new FriendModel();
$l = new LikeModel();
$t = new DIaryModel();
$c = new CommentModel();
$n = new NotifyModel();
$m = new NotifyModel();
$u = new userModel();
$diary_id = $_GET['diary_id'];
$diary = $t->getDiary($diary_id);
$id_notify = $_GET['id_nf'];
$m->notifyReed($id_notify);
include 'header.php';
$i = 0;
?>
  </div>
  </div>
    <div class="container">
  		<?php 
if ($diary == NULL) {
    echo '<div class="well">';
    echo 'bai dang khong hop le </div>';
Esempio n. 4
0
<?php

include_once '../model/notify_model.php';
$m = new NotifyModel();
$notyfy_type = $_GET['notify_type'];
$page_id = $_GET['page_id'];
$id_nf = $_GET['id_nf'];
$flag['flag'] = 3;
$m->notifyReed($id_nf);
if ($notyfy_type == 1) {
    $url = 'baidang.php?diary_id=' . $page_id . '&id_nf=' . $id_nf;
}
if ($notyfy_type == 2) {
    $user2 = $page_id;
    //include '../controler/check_friend';
    $url = 'page_user.php?user_id=' . $page_id . '&friend=' . $flag['flag'];
}
header('Location:' . $url);
Esempio n. 5
0
session_start();
include '../model/diary_model.php';
include '../model/comment_model.php';
include '../model/notify_model.php';
include '../model/user_model.php';
include '../model/like_model.php';
include '../model/friend_model.php';
$f = new FriendModel();
$l = new LikeModel();
$t = new DIaryModel();
$diary = array(array());
$diary = $t->getDiaryOfUserfriend($_SESSION['id']);
$c = new CommentModel();
$n = new NotifyModel();
$m = new NotifyModel();
$u2 = new UserModel();
$u = new UserModel();
$typeseach = $_GET['type'];
?>
  <?php 
//include_once 'header.php';
?>
  <!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>My Diary</title>
 
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">