Commit be0d4b6a authored by Ranindya Paramitha's avatar Ranindya Paramitha
Browse files

[FIXING] edit edit_profile

parent d9028e07
<<<<<<< HEAD
<?php
require_once ("../autoload.php");
require_once("controller.php");
......@@ -30,37 +29,4 @@
}
header('Location: ../profile');
exit;
=======
<?php
require_once ("../autoload.php");
require_once("controller.php");
$user_token = $_COOKIE["login"];
$user_id = getUserIDbyToken($user_token);
echo "MASUK";
$update_name = $_POST["name"];
$update_address = $_POST["address"];
$update_phone = $_POST["phone"];
if (isset($_POST['submit'])){
// echo "MASUK SINI";
if(isset($_FILES["profile_picture"])){
$name = $_FILES["profile_picture"]["name"];
$tmp_name = $_FILES["profile_picture"]["tmp_name"];
} else{
$name = NULL;
$tmp_name = NULL;
}
} else{
$name = NULL;
$tmp_name = NULL;
}
// echo $update_name;
$update = setUserProfile($user_id, $update_name, $update_address, $update_phone, $name, $tmp_name);
// if ($update == 0){
// echo "<script type='text/javascript'>alert 'Update Failed';</script>";
// } else{
// echo "<script type='text/javascript'>alert 'Update Success';</script>";
// }
header('Location: ../profile');
exit;
>>>>>>> a5e114334a5152889bf7f3a02a656fb764097ebc
?>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment