Beispiel #1
0
 function exeAdd()
 {
     $id = (int) Session::get('user')['id'];
     if ($id > 0) {
         $error = '';
         if (!empty($_FILES)) {
             $upload = new Upload('file');
             $upload->setFileExtension('jpg|jepg|png|gif');
             $upload->setUploadDir('public/uploads/members/');
             $upload->setFileSize(2048);
             $e = $upload->getError();
             if (!empty($e)) {
                 foreach ($e as $value) {
                     $error .= $value . '<br />';
                 }
             }
             if ($error != '') {
                 $message = '<div class="album" status="true"><p class="red">' . $error . '</p></div>';
             } else {
                 $imageName = Convert::makeLink($_FILES['file']['name']);
                 $imageLink = $upload->uploads($imageName);
                 $id = $this->model->add(Session::get('user')['username'], $imageName, $imageLink);
                 $message = '<div class="album" imageId="' . $id . '">
                     <img src="' . BASE_URL . '/' . $imageLink . '" alt="' . $imageName . '" class="imgage" />
                     <span class="img-delete" imageId="' . $id . '" title="Xoá ảnh này">X</span>
                     <p>Ngày đăng: ' . date('d-m-Y H:i', time()) . '</p>
                     </div>';
             }
         } else {
             $message = '<div class="album" status="true"><p class="red">Bạn chưa chọn file</p></div>';
         }
         echo $message;
     } else {
         Until::redirectTo();
     }
 }
Beispiel #2
0
<h2>Hỗ trợ</h2>
<ul class="categories_list">
    <?php 
foreach ($supports as $sp) {
    echo '<li><a href="' . $detail . $sp['id'] . '-' . Convert::makeLink($sp['question']) . '">' . $sp['question'] . '</a></li>';
}
?>
</ul>
Beispiel #3
0
<div class="content_section">
    <h2><?php 
echo '<h2>' . $service['feature'] . '</h2>';
?>
</h2>
    <?php 
if (empty($article)) {
    echo '<p>Chưa có bài viết nào</p>';
} else {
    foreach ($article as $value) {
        echo '<h3><a href="' . $detail . $value['id'] . '-' . Convert::makeLink($value['title']) . '">' . $value['title'] . '</a></h3>';
        echo '<div>' . $value['quote'] . '</div>';
        echo '<div class="button_01"><a href="' . $detail . $value['id'] . '-' . Convert::makeLink($value['title']) . '">Xem thêm</a></div>
                <div class="cleaner_h20"></div>';
    }
    ?>

    <?php 
}
?>
</div>
Beispiel #4
0
 function exeChangeAvatar()
 {
     $id = (int) Session::get('user')['id'];
     if ($id > 0) {
         $error = '';
         if (!empty($_FILES)) {
             $upload = new Upload('file');
             $upload->setFileExtension('jpg|jepg|png|gif');
             $upload->setUploadDir('public/uploads/avatar/');
             $upload->setFileSize(1024);
             $e = $upload->getError();
             if (!empty($e)) {
                 foreach ($e as $value) {
                     $error .= $value . '<br />';
                 }
             }
             if ($error != '') {
                 $message = '<p class="red">' . $error . '</p>';
             } else {
                 $imageName = Convert::makeLink($_FILES['file']['name']);
                 $imageLink = $upload->uploads($imageName);
                 $this->model->changeAvatar(Session::get('user')['id'], $imageLink);
                 if (Session::get('user')['avatar'] != 'public/uploads/members/member-1.png' || Session::get('user')['avatar'] != 'public/uploads/members/member-1.png') {
                     if (file_exists(Session::get('user')['avatar'])) {
                         unlink(Session::get('user')['avatar']);
                     }
                 }
                 $data = Session::get('user');
                 $data['avatar'] = $imageLink;
                 Session::set('user', $data);
                 $message = '1';
             }
         } else {
             $message = '<p class="red">Bạn chưa chọn file</p>';
         }
         echo $message;
     } else {
         Until::redirectTo();
     }
 }
Beispiel #5
0
 public function exeInsert()
 {
     if (isset($_POST['submit'])) {
         $file = false;
         $service = (int) Request::post('services');
         $title = Request::post('title');
         $content = Request::post('content');
         $author = Session::get('user')['username'];
         $quote = Request::post('quote');
         $pin = (int) Request::post('pin');
         $error = '';
         if ($title == null) {
             $error .= 'Tên bài viết không được trống.<br />';
         }
         if ($quote == null) {
             $error .= 'Trích dẫn không được trống.<br />';
         }
         if ($content == null) {
             $error .= 'Nội dung không được trống.<br />';
         }
         if ($_FILES['file']['tmp_name'] != null) {
             $upload = new Upload('file');
             $upload->setFileExtension('jpg|jepg|png|gif');
             $upload->setUploadDir('public/uploads/articles/');
             $upload->setFileSize(1024);
             $e = $upload->getError();
             if (!empty($e)) {
                 foreach ($e as $value) {
                     $error .= $value . '<br />';
                 }
             }
             $file = true;
         }
         if ($error != '') {
             Session::set('article', $_POST);
             Session::set('error', $error);
             Until::redirectTo('article/add');
         } else {
             $imageName = '';
             $imageLink = '';
             if ($file) {
                 $imageName = Convert::makeLink($title);
                 $imageLink = $upload->uploads($imageName);
             }
             $id = $this->model->add($service, $title, $content, $author, $quote, $imageName, $imageLink, $pin);
             Until::redirectTo('article/detail?id=' . $id);
         }
     } else {
         Until::redirectTo();
     }
 }
Beispiel #6
0
}
?>
<div class="cleaner_h10"></div>
<h2>Danh sách bạn</h2>
    <div id="friends">
<?php 
if (empty($friends)) {
    echo 'Không có bạn bè';
} else {
    foreach ($friends as $value) {
        if ($id == $value['userA']) {
            echo '<div class="member" userId="' . $value['userB'] . '">
                <a href="' . $detail . $value['userB'] . '-' . Convert::makeLink($value['fullnameA']) . '">
                <img src="' . $value['avatarB'] . '"  class="image"></a>
                <p><a href="' . $detail . $value['userB'] . '-' . Convert::makeLink($value['fullnameA']) . '">' . $value['fullnameB'] . ' (' . (getdate()['year'] - $value['bornB']) . ' tuổi)</a></p>
                <p><span class="rlsDelete"  userId="' . $value['userB'] . '" >Huỷ bạn bè</span></p>
                </div>';
        } else {
            echo '<div class="member" userId="' . $value['userA'] . '">
                <a href="' . $detail . $value['userA'] . '-' . Convert::makeLink($value['fullnameA']) . '">
                <img src="' . $value['avatarA'] . '"  class="image"></a>
                <p><a href="' . $detail . $value['userA'] . '-' . Convert::makeLink($value['fullnameA']) . '">' . $value['fullnameA'] . ' (' . (getdate()['year'] - $value['bornA']) . ' tuổi)</a></p>
                <p><span class="rlsDelete"  userId="' . $value['userA'] . '">Huỷ bạn bè</span></p>
                </div>';
        }
    }
}
?>
    </div>
    <div class="cleaner_h10"></div>
</div>
Beispiel #7
0
if (empty($users)) {
    echo 'Không có thành viên nào';
} else {
    foreach ($users as $user) {
        ?>
        <div class="member">
            <a href="<?php 
        echo $detail . $user['id'] . '-' . Convert::makeLink($user['fullname']);
        ?>
">
                <img src="<?php 
        echo BASE_URL . '/' . $user['avatar'];
        ?>
" alt="Không hiển thị được" /></a>
            <?php 
        echo '<a href="' . $detail . $user['id'] . '-' . Convert::makeLink($user['fullname']) . '"><span>' . $user['fullname'] . '</span></a>';
        ?>
            <p>Giới tinh: <?php 
        if ($user['gender'] == 1) {
            echo 'Nam';
        } else {
            echo 'Nữ';
        }
        ?>
</p>
            <p>Ngày sinh: <?php 
        echo date("d-m-Y", strtotime($user['born']));
        ?>
</p>
            <p>Ngày tham gia: <?php 
        echo date("d-m-Y", $user['time_join']);
Beispiel #8
0
        if ($data['imageLink'] != null) {
            echo '<img src="' . BASE_URL . '/' . $data['imageLink'] . '" alt="' . $data['imageName'] . '" title="' . $data['title'] . '">';
        }
        ?>
            <div>
                <?php 
        echo $data['quote'];
        ?>
            </div>
            <div class="cleaner"></div>
            <div class="button_01">
                <a href="<?php 
        echo $detailArticle . $data['id'] . '-' . Convert::makeLink($data['title']);
        ?>
">Xem thêm</a>
            </div>
            <div class="cleaner_h20"></div>
    <?php 
    } else {
        echo '<p><a href="' . $detailArticle . $data['id'] . '-' . Convert::makeLink($data['title']) . '" >' . $data['title'] . '</a></p>';
    }
    $i++;
}
?>

</div>
<div class="cleaner"></div>



Beispiel #9
0
<h2>Dịch vụ</h2>
<ul class="categories_list">
    <?php 
foreach ($services as $value) {
    echo '<li><a href="' . $detail . $value['id'] . '-' . Convert::makeLink($value['feature']) . '">' . $value['feature'] . '</a></li>';
}
?>
</ul>
Beispiel #10
0
    ?>
</h2></caption>
            <thead>
            <tr>
                <th scope="col">Tên bài viết</th>
                <th scope="col">Tác giả</th>
                <th scope="col">Ngày viết</th>
            </tr>
            </thead>
            <tbody>
            <?php 
    $emty = true;
    foreach ($thread as $key => $value) {
        if ($value['service_id'] == $service['id']) {
            echo '<tr>
                        <td><a href="' . $detailA . $value['id'] . '-' . Convert::makeLink($value['title']) . '">' . $value['title'] . '</a></td>
                        <td class="center">' . $value['author'] . '</td>
                        <td class="center">' . date('d-m-Y', $value['date']) . '</td>
                        </tr>';
            $emty = false;
            unset($thread[$key]);
        }
    }
    if ($emty) {
        echo '<tr><td colspan="3">Chưa có bài viết nào</td></tr>';
    }
    //
    ?>
            </tbody>
        </table>
<?php