<?php session_start(); error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED); include_once "../vendor/autoload.php"; use app\profile\profile; use app\utility\debuger; use app\utility\message; if (isset($_GET['user_id'])) { $user_id = $_GET['user_id']; } $profile = new profile(); $postCount = new profile(); $commentCount = new profile(); $shareCount = new profile(); $singleProfile = $profile->index($user_id); $postCount = $postCount->postCount($user_id); $commentCount = $commentCount->commentCount($user_id); $shareCount = $shareCount->shareCount($user_id); ?> <!DOCTYPE html> <html lang="en"> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta charset="UTF-8"> <title>Profile</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway"> <link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons">
<?php session_start(); include_once "../vendor/autoload.php"; //error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED); use app\profile\profile; use app\utility\debuger; use app\utility\configuration; use app\utility\message; $updateProfile = new profile(); //$profile_id=$_GET['id']; $user_id = $_REQUEST['user_id']; //debuger::debug($_FILES); if ($_FILES['update_image_name']['name']) { $sourceFile = $_FILES['update_image_name']['tmp_name']; $imageOrginalName = $_FILES['update_image_name']['name']; $destination = $_SERVER['DOCUMENT_ROOT'] . configuration::UPLOAD_DIR; $_REQUEST['img_name'] = $imageOrginalName; $_REQUEST['user_id'] = $user_id; $imageName = $updateProfile->updateInfoWithImage($_REQUEST); //debuger::debug($imageName); $imageMoveToDirectory = move_uploaded_file($sourceFile, $destination . $imageName); if ($imageMoveToDirectory) { header("Location:http://localhost/FinalProject/profiles/views/index.php?user_id=" . $user_id); } else { Message::failed("File is not being uploaded!"); header("Location:http://localhost/FinalProject/profiles/views/index.php?user_id=" . $user_id); } } else { $updateProfile->updateInfoWithoutImage($_REQUEST); }
<?php session_start(); include_once "../vendor/autoload.php"; use app\profile\profile; use app\utility\debuger; use app\utility\configuration; use app\utility\message; //debuger::debug($_FILES['image_name']); $createProfile = new profile(); //$profile_id=$_GET['id']; $user_id = $_REQUEST['user_id']; if ($_FILES['image_name']['name']) { $sourceFile = $_FILES['image_name']['tmp_name']; $imageOrginalName = $_FILES['image_name']['name']; $destination = $_SERVER['DOCUMENT_ROOT'] . configuration::UPLOAD_DIR; $_REQUEST['img_name'] = $imageOrginalName; $_REQUEST['user_id'] = $user_id; $imageName = $createProfile->storeInfoWithImage($_REQUEST); $imageMoveToDirectory = move_uploaded_file($sourceFile, $destination . $imageName); if ($imageMoveToDirectory) { header("Location:http://localhost/FinalProject/profiles/views/index.php?user_id=" . $user_id); } else { Message::failed("File is not being uploaded!"); header("Location:http://localhost/FinalProject/profiles/views/index.php?user_id=" . $user_id); } } else { $createProfile->storeInfoWithoutImage($_REQUEST); }
<?php session_start(); error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED); include_once "../vendor/autoload.php"; use app\profile\profile; use app\utility\debuger; use app\utility\message; $profile_id = $_POST['profile_id']; $user_id = $_POST['user_id']; $profile = new profile(); $profile_delete = $profile->profile_delete($profile_id, $user_id); if ($profile_delete) { $filename = '../public/profile_pic/' . $profile_delete; unlink($filename); Message::success("profile Successfully Deleted!"); header("Location:http://localhost/FinalProject/profiles/views/create.php?user_id=" . $user_id); } else { Message::failed("Profile is not being deleted!please try again"); header("Location:http://localhost/FinalProject/profiles/views/index.php?user_id=" . $user_id); }