$(document).ready(function() {
var width = $('.left-content').width();
var height = $('.left-content').height();
$('#myVideo').attr('width', width);
$('#myVideo').attr('height', height);
$(window).resize(function(){
var width = $('.left-content').width();
var height = $('.left-content').height();
$('#myVideo').attr('width', width);
$('#myVideo').attr('height', height);
var heightRightContent = height - $('.nav-tabs').height();
$('.tab-content').css('height', heightRightContent);
});
var heightRightContent = height - $('.nav-tabs').height();
$('.tab-content').css('height', heightRightContent);
$('[data-toggle="tooltip"]').tooltip();
var tabID = 1;
$('#tablist').on('click','.close',function(){
var tabID = $(this).parents('a').attr('href');
$(this).parents('li').remove();
$(tabID).remove();
//display first tab
var tabFirst = $('#tablist a:first');
tabFirst.tab('show');
});
});
.main-content {
background-color: #E9EAEA;
padding-top: 30px;
padding-bottom: 30px;
}
.content-title h2 {
text-align: center;
font-weight: bold;
text-transform: uppercase;
font-size: 32px;
letter-spacing: .2rem;
padding: 0;
color: #5f5f5f;
vertical-align: middle;
margin: 20px 0 50px;
}
.content-img img {
width: 100%!important;
}
.content-detail {
position: relative;
background-color: #fff;
transition: all .25s;
border-radius: 2px;
transition: all 0.2s;
margin-bottom: 40px;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
}
.content-detail:hover {
box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.content-detail h3 {
color: #444;
margin-top: 15px;
font-weight: 700;
border-bottom: 2px solid #3c948b;
padding-bottom: 20px;
}
.content-description {
padding: 15px;
}
.content-description p {
font-size: 14px;
font-weight: 200;
line-height: 20px;
letter-spacing: 1px;
color: #7b8b8e;
margin-top: 20px;
padding-bottom: 20px;
}
class Users extends Controller {
public function index()
{
$users = $this->model->getAllUsers();
$province = $this->model->getAllProvince();
$amount_of_users = $this->model->getAmountOfUsers();
require APP . 'view/_templates/header.php';
require APP . 'view/users/index.php';
require APP . 'view/_templates/footer.php';
}
public function addUser()
{
if (isset($_POST["add"])) {
$avata = "";
if ($_FILES["avata"]["type"] == "image/jpeg" || $_FILES["avata"]["type"] == "image/png") {
move_uploaded_file($_FILES["avata"]["tmp_name"], "upload/".$_FILES["avata"]["name"]);
$avata = "upload/".$_FILES["avata"]["name"];
}
$_POST["avata"] = $avata;
$this->model->add("user", $_POST);
}
header('location: ' . URL . 'users/index');
}
public function add(){
$province = $this->model->getAllProvince();
require APP . 'view/_templates/header.php';
require APP . 'view/users/add.php';
require APP . 'view/_templates/footer.php';
}
public function deleteUser($user_id)
{
if (isset($user_id)) {
$this->model->deleteUser($user_id);
}
header('location: ' . URL . 'users/index');
}
public function editUser($user_id)
{
if (isset($user_id)) {
$user = $this->model->getUser($user_id);
$province = $this->model->getAllProvince();
require APP . 'view/_templates/header.php';
require APP . 'view/users/edit.php';
require APP . 'view/_templates/footer.php';
} else {
header('location: ' . URL . 'users/index');
}
}
public function updateUser()
{
if (isset($_POST["update"])) {
$user_id = $_POST["id"];
$username = $_POST["username"];
$email = $_POST["email"];
$gender = $_POST["gender"];
$province_id = $_POST["province_id"];
$birthday = date("Y-m-d",strtotime($_POST["birthday"]));
$description = addslashes($_POST["description"]);
$avata = $_POST["avata"];
if ($_FILES["avata"]["name"] != "") {
if ($_FILES["avata"]["type"] == "image/jpeg" || $_FILES["avata"]["type"] == "image/png"){
move_uploaded_file($_FILES["avata"]["tmp_name"], "upload/".$_FILES["avata"]["name"]);
$avata = "upload/".$_FILES["avata"]["name"];
}
}
$_POST["avata"] = $avata;
$this->model->update("user", $_POST);
}
header('location: ' . URL . 'users/index');
}
public function ajaxGetStats1()
{
$amount_of_users = $this->model->getAmountOfUsers();
echo $amount_of_users;
}
}
root@tom:~$ whoami
created with ♥ by @tomhapbia ;)|