<?php
/**
 * edit.php -- Edit page
 */

include '../inc/config.inc.php'; // Configuration

ob_start();
session_start();

//date_default_timezone_set('Africa/Lagos');

error_reporting(E_ALL);
ini_set('display_errors', 1);

if ( !isset($_SESSION['user']) || $_SESSION["loggedin"] !== true || trim($_SESSION['user']) == '' ){
	header('Location: ' . $BASE_URL . 'signin');
	exit;
}

// User Details
$stmt = $db_con->prepare("SELECT * FROM users WHERE id=:user_id");
$stmt->execute(array(":user_id"=>$_SESSION['user']));
$userRow = $stmt->fetch(PDO::FETCH_ASSOC);

?>

<!doctype html>
<html lang="en-uk">
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="description" content="">
    <meta name="keywords" content="investment, Forex, Trading, Bitcoin, Cryptocurrency, Global investment, Live Trade, Trading class, indics">
    <meta name="author" content="Paul HubWeb & Tech">
    <meta name="theme-color" content="#313131" />
    <!-- Site Properties -->
    <title>Edit Details - Trust 24hours Option</title>
    <link rel="shortcut icon" href="../img/Signals-Alert-3.png" type="image/x-icon">
    <link rel="apple-touch-icon-precomposed" href="../img/Signals-Alert-3.png">
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <!-- Typography CSS -->
    <link rel="stylesheet" href="css/typography.css">
    <!-- Style CSS -->
    <link rel="stylesheet" href="css/style.css">
    <!-- Responsive CSS -->
    <link rel="stylesheet" href="css/responsive.css">
    <style>
        * {
            box-sizing: border-box;
        }

        body {
            margin: 0;
            font-family: Arial, Helvetica, sans-serif;
        }

        .header {
            overflow: none;
            background-color: none;
            padding: 20px 10px;
            padding-left: 5px;
            position: fixed;
        }

                /*.header a {
        float: center;
        width:30px;
        color: #fff;
        text-align: center;
        padding: 12px;
        text-decoration: none;
        font-size: 18px; 
        line-height: 25px;
        border-radius: 4px;
        background-color:rgb(196, 0, 0);
        border-color: rgb(196, 0, 0);
        }*/

        .header a.logo {
            font-size: 25px;
            font-weight: bold;
        }

                /*.header a:hover {
        background-color:  #010847;
        color: #fff;
        }*/

                /*.header a.active {
        background-color: dodgerblue;
        color: white;
        }*/

        .header-center {
            float: left;
        }

        @media screen and (max-width: 500px) {
            .header a {
                float: none;
                display: block;
                text-align: left;
            }

            .header-right {
                float: none;
            }
        }
    </style>

    <script src="../plugins/sweetalerts/promise-polyfill.js"></script>
    <link href="../plugins/sweetalerts/sweetalert.css" rel="stylesheet" type="text/css" />

    <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,600,700" rel="stylesheet" />
    <style>
        /*------ Google Font Style ------ */
        body {font-family:'Roboto'!important;}
    </style>

</head>
<body class="sidebar-main-active right-column-fixed">
    <!-- loader Start -->
    <!-- loader END -->
    <!-- Wrapper Start -->
    <div class="wrapper">
        <?php include 'navbar.php' ?>
        <!-- Page Content  -->
        <div id="content-page" class="content-page" style="margin-top:90px;">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="iq-card">
                            <div class="iq-card-body p-0">
                                <div class="iq-edit-list">
                                    <ul class="iq-edit-profile d-flex nav nav-pills">
                                        <li class="col-md-3 p-0">
                                            <a class="nav-link active" data-toggle="pill" href="#personal-information">
                                                Personal Information
                                            </a>
                                        </li>
                                        <li class="col-md-3 p-0">
                                            <a class="nav-link" data-toggle="pill" href="#chang-pwd">
                                                Change Password
                                            </a>
                                        </li>
                                        <li class="col-md-3 p-0">
                                            <a class="nav-link" data-toggle="pill" href="#emailandsms">
                                                Email and SMS
                                            </a>
                                        </li>
                                        <li class="col-md-3 p-0">
                                            <a class="nav-link" data-toggle="pill" href="#manage-contact">
                                                Manage Contact
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-12">
                        <div class="iq-edit-list-data">
                            <div class="tab-content">
                                <div class="tab-pane fade active show" id="personal-information" role="tabpanel">
                                    <div class="iq-card">
                                        <div class="iq-card-header d-flex justify-content-between">
                                            <div class="iq-header-title">
                                                <h4 class="card-title">Personal Information</h4>
                                            </div>
                                        </div>
                                        <div class="iq-card-body">
                                            <form method="post" action="" enctype="multipart/form-data">
                                                <div class="form-group row align-items-center">
                                                    <div class="col-md-12">
                                                        <div class="profile-img-edit">
                                                            <?php
                                                            if ( empty($userRow['picture']) ){
                                                                echo '<img class="profile-pic" src="images/user/11.png" alt="profile-pic">';
                                                            } else {
                                                                echo '<img class="profile-pic" src="uploads/'.$userRow['picture'].'" alt="profile-pic">';
                                                            }
                                                            ?>
                                                            <div class="p-image">
                                                                <i class="ri-pencil-line upload-button"></i>
                                                                <input class="file-upload" type="file" name="changepicture" accept="image/*" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class=" row align-items-center">
                                                    <div class="form-group col-sm-6">
                                                        <label for="fname">Full Name:</label>
                                                        <input type="text" class="form-control" name="fullname" value="<?= $userRow['fullname']; ?>">
                                                    </div>
                                                    <div class="form-group col-sm-6">
                                                        <label for="uname">Username:</label>
                                                        <input type="text" class="form-control" name="username" value="<?= $userRow['username']; ?>">
                                                    </div>
                                                    <div class="form-group col-sm-6">
                                                        <label for="cname">City:</label>
                                                        <input type="text" class="form-control" name="city" value="<?= $userRow['city']; ?>">
                                                    </div>
                                                    <div class="form-group col-sm-6">
                                                        <label class="d-block">Gender:</label>
                                                        <div class="custom-control custom-radio custom-control-inline">
                                                            <input type="radio" id="customRadio6" name="gender" class="custom-control-input" <? if ($userRow['gender']=='Male') echo 'checked'; ?> value="Male">
                                                            <label class="custom-control-label" for="customRadio6">Male</label>
                                                        </div>
                                                        <div class="custom-control custom-radio custom-control-inline">
                                                            <input type="radio" id="customRadio7" name="gender" class="custom-control-input" <? if ($userRow['gender']=='Female') echo 'checked'; ?> value="Female">
                                                            <label class="custom-control-label" for="customRadio7">Female</label>
                                                        </div>
                                                    </div>
                                                    <div class="form-group col-sm-6">
                                                        <label for="dob">Date Of Birth:</label>
                                                        <input class="form-control" name="dob" value="1984-01-24">
                                                    </div>
                                                    <div class="form-group col-sm-6">
                                                        <label>Marital Status:</label>
                                                        <select class="form-control" name="marital_status">
                                                            <option value="Single" <? if ($userRow['marital_status']=='Single') echo 'selected'; ?>>Single</option>
                                                            <option value="Married" <? if ($userRow['marital_status']=='Married') echo 'selected'; ?>>Married</option>
                                                            <option value="Widowed" <? if ($userRow['marital_status']=='Widowed') echo 'selected'; ?>>Widowed</option>
                                                            <option value="Divorced" <? if ($userRow['marital_status']=='Divorced') echo 'selected'; ?>>Divorced</option>
                                                            <option value="Separated" <? if ($userRow['marital_status']=='Separated') echo 'selected'; ?>>Separated</option>
                                                        </select>
                                                    </div>
                                                    <div class="form-group col-sm-6">
                                                        <label>Age:</label>
                                                        <select class="form-control" name="age">
                                                            <option value="12 - 18" <? if ($userRow['age']=='12 - 18') echo 'selected'; ?>>12 - 18</option>
                                                            <option value="19 - 32" <? if ($userRow['age']=='19 - 32') echo 'selected'; ?>>19 - 32</option>
                                                            <option value="33 - 45" <? if ($userRow['age']=='33 - 45') echo 'selected'; ?>>33 - 45</option>
                                                            <option value="46 - 62" <? if ($userRow['age']=='46 - 62') echo 'selected'; ?>>46 - 62</option>
                                                            <option value="63 >" <? if ($userRow['age']=='63 >') echo 'selected'; ?>>63 > </option>
                                                        </select>
                                                    </div>
                                                    <div class="form-group col-sm-6">
                                                        <label>Country:</label>
                                                        <select class="form-control" name="country">
                                                            <option value="Canada" <? if ($userRow['country']=='Canada') echo 'selected'; ?>>Canada</option>
                                                            <option value="Noida" <? if ($userRow['country']=='Noida') echo 'selected'; ?>>Noida</option>
                                                            <option value="USA" <? if ($userRow['country']=='USA') echo 'selected'; ?>>USA</option>
                                                            <option value="India" <? if ($userRow['country']=='India') echo 'selected'; ?>>India</option>
                                                            <option value="Africa" <? if ($userRow['country']=='Africa') echo 'selected'; ?>>Africa</option>
                                                        </select>
                                                    </div>
                                                    <div class="form-group col-sm-6">
                                                        <label>State:</label>
                                                        <select class="form-control" name="state">
                                                            <option value="California" <? if ($userRow['state']=='California') echo 'selected'; ?>>California</option>
                                                            <option value="Florida" <? if ($userRow['state']=='Florida') echo 'selected'; ?>>Florida</option>
                                                            <option value="Georgia" <? if ($userRow['state']=='Georgia') echo 'selected'; ?>>Georgia</option>
                                                            <option value="Connecticut" <? if ($userRow['state']=='Connecticut') echo 'selected'; ?>>Connecticut</option>
                                                            <option value="Louisiana" <? if ($userRow['state']=='Louisiana') echo 'selected'; ?>>Louisiana</option>
                                                        </select>
                                                    </div>
                                                    <div class="form-group col-sm-12">
                                                        <label>Address:</label>
                                                        <textarea class="form-control" name="home_address" rows="5" style="line-height: 22px;"><?= $userRow['home_address']; ?></textarea>
                                                    </div>
                                                </div>
                                                <button type="submit" name="updatePI" class="btn btn-primary mr-2">Submit</button>
                                                <button type="reset" class="btn iq-bg-danger">Cancel</button>
                                            </form>
                                            <?php
                                            if ( isset($_POST['updatePI']) ){
                                                error_reporting(E_ALL);

                                                $username = $_POST['username'];
                                                $fullname = $_POST['fullname'];
                                                $city = $_POST['city'];
                                                $gender = $_POST['gender'];
                                                $dob = $_POST['dob'];
                                                $marital_status = $_POST['marital_status'];
                                                $age = $_POST['age'];
                                                $country = $_POST['country'];
                                                $state = $_POST['state'];
                                                $home_address = $_POST['home_address'];

                                                $targetDir = "uploads/"; // Directory to save in uploads
                                                $allowedExts = array('jpg', 'jpeg', 'png'); // Allowed File Types

                                                $stmt = $db_con->prepare("SELECT * FROM users WHERE username=:username");
                                                $stmt->execute(array(":username"=>$username));
                                                $row = $stmt->fetch(PDO::FETCH_ASSOC);

                                                if ( ($row['username'] == $username) AND ($row['id'] != $userRow['id']) ){
                                            ?>
                                                    <script>
                                                        setTimeout(function(){
                                                            noticePop('Username Already Exists!', 'error');
                                                        }, 2000);
                                                    </script>
                                            <?php
                                                }
                                                else {
                                                    $update = $db_con->prepare("UPDATE users SET username='$username', fullname='$fullname', city='$city', gender='$gender', dob='$dob', marital_status='$marital_status', age='$age', country='$country', state='$state', home_address='$home_address' WHERE id='".$userRow['id']."' AND username='".$userRow['username']."'");

                                                    if ( $update->execute() ){

                                                        if ( !empty($_FILES['changepicture']['name']) ){
                                                            $uploads = $db_con->prepare("SELECT picture FROM users WHERE id='".$userRow['id']."' AND username='".$userRow['username']."'");
                                                            $uploads->execute();
                                                            $get = $uploads->fetch(PDO::FETCH_ASSOC);
                                                
                                                            $extPicture = pathinfo(basename($_FILES['changepicture']['name']), PATHINFO_EXTENSION); // Get the extension
                                                            if ( !in_array(strtolower($extPicture), $allowedExts) ){
                                            ?>
                                                                <script>
                                                                    setTimeout(function(){
                                                                        noticePop('Invalid File Type', 'error');
                                                                    }, 2000);
                                                                </script>
                                            <?php
                                                            } else {
                                                                $newPicture = 'picture_' . randDoc($extPicture); // Randomization
                                                                if ( file_exists($targetDir . $get['picture']) AND !empty($get['picture']) ){
                                                                    unlink($targetDir . $get['picture']); // Delete Old File
                                                                }
                                                                $query = $db_con->prepare("UPDATE users SET picture='$newPicture' WHERE id='".$userRow['id']."' AND username='".$userRow['username']."'");
                                                                $query->execute(); // Update DB
                                                                /*if ( file_exists($target_dir) ){
                                                                    echo 'Dir Exists<br>';
                                                                } else { echo 'Does not exits<br>'; }
                                                                if ( is_writable($target_dir) ){
                                                                    echo 'Dir is writable<br>';
                                                                } else { echo 'Dir not writable<br>'; }*/
                                                                if ( move_uploaded_file($_FILES['changepicture']['tmp_name'], $targetDir . $newPicture) ){
                                            ?>
                                                                    <script>
                                                                        setTimeout(function(){
                                                                            noticePop('Profile and Picture Updated', 'success');
                                                                        }, 2000);
                                                                    </script>
                                            <?php
                                                                } else {
                                            ?>
                                                                    <script>
                                                                        setTimeout(function(){
                                                                            noticePop('Something Went Wrong. Try again.', 'error');
                                                                        }, 2000);
                                                                    </script>
                                            <?php
                                                                }
                                            ?>
                                                                <!--<script>
                                                                    setTimeout(function(){
                                                                        noticePop('Profile and Picture Updated', 'success');
                                                                    }, 2000);
                                                                </script>-->
                                            <?php
                                                            }
                                                            unset($uploads);
                                                        } else {
                                            ?>
                                                            <script>
                                                                setTimeout(function(){
                                                                    noticePop('Profile Updated', 'success');
                                                                }, 2000);
                                                            </script>
                                            <?php
                                                        }
                                                    } else {
                                            ?>
                                                        <script>
                                                            setTimeout(function(){
                                                                noticePop('Something Went Wrong. Try again.', 'error');
                                                            }, 2000);
                                                        </script>
                                            <?php
                                                    }
                                                }
                                            }
                                            ?>
                                        </div>
                                    </div>
                                </div>
                                <div class="tab-pane fade" id="chang-pwd" role="tabpanel">
                                    <div class="iq-card">
                                        <div class="iq-card-header d-flex justify-content-between">
                                            <div class="iq-header-title">
                                                <h4 class="card-title">Change Password</h4>
                                            </div>
                                        </div>
                                        <div class="iq-card-body">
                                            <form method="post" action="">
                                                <div class="form-group">
                                                    <label for="cpass">Current Password:</label>
                                                    <a href="javascripe:void();" class="float-right">Forgot Password</a>
                                                    <input type="Password" class="form-control" name="current_password" value="">
                                                </div>
                                                <div class="form-group">
                                                    <label for="npass">New Password:</label>
                                                    <input type="Password" class="form-control" name="new_password" value="">
                                                </div>
                                                <div class="form-group">
                                                    <label for="vpass">Verify Password:</label>
                                                    <input type="Password" class="form-control" name="verify_password" value="">
                                                </div>
                                                <button type="submit" name="changepassword" class="btn btn-primary mr-2">Submit</button>
                                                <button type="reset" class="btn iq-bg-danger">Cancel</button>
                                            </form>
                                            <?php
                                            if ( isset($_POST['changepassword']) ){
                                                error_reporting(E_ALL);

                                                $current_password = $_POST['current_password'];
                                                $new_password = $_POST['new_password'];
                                                $verify_password = $_POST['verify_password'];

                                                if ( $new_password != $verify_password ){
                                                    ?>
                                                    <script>
                                                        setTimeout(function(){
                                                            noticePop('New & Verify Password Do not Match', 'error');
                                                        }, 2000);
                                                    </script>
                                            <?php
                                                } else {
                                                    $getUser = $db_con->prepare("SELECT id, password FROM users WHERE id=:user_id");
                                                    $getUser->execute(array(":user_id"=>$userRow['id']));
                                                    $row = $getUser->fetch(PDO::FETCH_ASSOC);

                                                    if ( password_verify($current_password, $row['password']) ){
                                                        $password = password_hash($new_password, PASSWORD_DEFAULT); // hash password
                                                        
                                                        $query = $db_con->prepare("UPDATE users SET password='$password', password_plain='$new_password' WHERE id='".$userRow['id']."' AND username='".$userRow['username']."'");
                                                        $query->execute();
                                            ?>
                                                        <script>
                                                            setTimeout(function(){
                                                                noticePop('Your Password Has Been Updated', 'success');
                                                            }, 2000);
                                                        </script>
                                            <?php
                                                    } else {
                                            ?>
                                                        <script>
                                                            setTimeout(function(){
                                                                noticePop('The Password You Entered Doesn\'t Match Your Current Password', 'error');
                                                            }, 2000);
                                                        </script>
                                            <?php
                                                    }
                                                }
                                            }
                                            ?>
                                        </div>
                                    </div>
                                </div>
                                <div class="tab-pane fade" id="emailandsms" role="tabpanel">
                                    <div class="iq-card">
                                        <div class="iq-card-header d-flex justify-content-between">
                                            <div class="iq-header-title">
                                                <h4 class="card-title">Email and SMS</h4>
                                            </div>
                                        </div>
                                        <div class="iq-card-body">
                                            <form>
                                                <div class="form-group row align-items-center">
                                                    <label class="col-md-3" for="emailnotification">Email Notification:</label>
                                                    <div class="col-md-9 custom-control custom-switch">
                                                        <input type="checkbox" class="custom-control-input" id="emailnotification" checked="">
                                                        <label class="custom-control-label" for="emailnotification"></label>
                                                    </div>
                                                </div>
                                                <div class="form-group row align-items-center">
                                                    <label class="col-md-3" for="smsnotification">SMS Notification:</label>
                                                    <div class="col-md-9 custom-control custom-switch">
                                                        <input type="checkbox" class="custom-control-input" id="smsnotification" checked="">
                                                        <label class="custom-control-label" for="smsnotification"></label>
                                                    </div>
                                                </div>
                                                <div class="form-group row align-items-center">
                                                    <label class="col-md-3" for="npass">When To Email</label>
                                                    <div class="col-md-9">
                                                        <div class="custom-control custom-checkbox">
                                                            <input type="checkbox" class="custom-control-input" id="email01">
                                                            <label class="custom-control-label" for="email01">You have new notifications.</label>
                                                        </div>
                                                        <div class="custom-control custom-checkbox">
                                                            <input type="checkbox" class="custom-control-input" id="email02">
                                                            <label class="custom-control-label" for="email02">You're sent a direct message</label>
                                                        </div>
                                                        <div class="custom-control custom-checkbox">
                                                            <input type="checkbox" class="custom-control-input" id="email03" checked="">
                                                            <label class="custom-control-label" for="email03">Someone adds you as a connection</label>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="form-group row align-items-center">
                                                    <label class="col-md-3" for="npass">When To Escalate Emails</label>
                                                    <div class="col-md-9">
                                                        <div class="custom-control custom-checkbox">
                                                            <input type="checkbox" class="custom-control-input" id="email04">
                                                            <label class="custom-control-label" for="email04"> Upon new order.</label>
                                                        </div>
                                                        <div class="custom-control custom-checkbox">
                                                            <input type="checkbox" class="custom-control-input" id="email05">
                                                            <label class="custom-control-label" for="email05"> New membership approval</label>
                                                        </div>
                                                        <div class="custom-control custom-checkbox">
                                                            <input type="checkbox" class="custom-control-input" id="email06" checked="">
                                                            <label class="custom-control-label" for="email06"> Member registration</label>
                                                        </div>
                                                    </div>
                                                </div>
                                                <button type="submit" class="btn btn-primary mr-2">Submit</button>
                                                <button type="reset" class="btn iq-bg-danger">Cancel</button>
                                            </form>
                                        </div>
                                    </div>
                                </div>
                                <div class="tab-pane fade" id="manage-contact" role="tabpanel">
                                    <div class="iq-card">
                                        <div class="iq-card-header d-flex justify-content-between">
                                            <div class="iq-header-title">
                                                <h4 class="card-title">Manage Contact</h4>
                                            </div>
                                        </div>
                                        <div class="iq-card-body">
                                            <form method="post" action="">
                                                <div class="form-group">
                                                    <label for="cno">Contact Number:</label>
                                                    <input type="text" class="form-control" name="phone" value="<?= $userRow['phone']; ?>">
                                                </div>
                                                <div class="form-group">
                                                    <label for="email">Email:</label>
                                                    <input type="text" class="form-control" name="email" value="<?= $userRow['email']; ?>">
                                                </div>
                                                <div class="form-group">
                                                    <label for="url">Url:</label>
                                                    <input type="text" class="form-control" id="url" value="https://getbootstrap.com">
                                                </div>
                                                <button type="submit" name="updatedcontact" class="btn btn-primary mr-2">Submit</button>
                                                <button type="reset" class="btn iq-bg-danger">Cancel</button>
                                            </form>
                                            <?php
                                            if ( isset($_POST['updatedcontact']) ){
                                                error_reporting(E_ALL);

                                                $phone = $_POST['phone'];
                                                $email = $_POST['email'];

                                                if ( empty($phone) || empty($email) ){
                                                    ?>
                                                    <script>
                                                        setTimeout(function(){
                                                            noticePop('Phone and Email Are Required', 'error');
                                                        }, 2000);
                                                    </script>
                                            <?php
                                                } else {
                                                    $query = $db_con->prepare("UPDATE users SET phone='$phone', email='$email' WHERE id='".$userRow['id']."' AND username='".$userRow['username']."'");
                                                    $query->execute();
                                            ?>
                                                    <script>
                                                        setTimeout(function(){
                                                            noticePop('Contact Info Updated', 'success');
                                                        }, 2000);
                                                    </script>
                                            <?php
                                                }
                                            }
                                            ?>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- Wrapper END -->
    <?php include 'footer.php' ?>
    <!-- Optional JavaScript -->
    <script src="../plugins/jquery-3.1.1.min.js"></script>
    <script src="../plugins/sweetalerts/sweetalert2.min.js"></script>
    <script src="https://unpkg.com/@popperjs/core@2/dist/umd/popper.js"></script>

    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <!--<script src="js/jquery.min.js"></script>
    <script src="js/popper.min.js"></script>-->
    <script src="js/bootstrap.min.js"></script>
    <!-- Appear JavaScript -->
    <script src="js/jquery.appear.js"></script>
    <!-- Countdown JavaScript -->
    <script src="js/countdown.min.js"></script>
    <!-- Counterup JavaScript -->
    <script src="js/waypoints.min.js"></script>
    <script src="js/jquery.counterup.min.js"></script>
    <!-- Wow JavaScript -->
    <script src="js/wow.min.js"></script>
    <!-- Apexcharts JavaScript -->
    <script src="js/apexcharts.js"></script>
    <!-- Slick JavaScript -->
    <script src="js/slick.min.js"></script>
    <!-- Select2 JavaScript -->
    <script src="js/select2.min.js"></script>
    <!-- Owl Carousel JavaScript -->
    <script src="js/owl.carousel.min.js"></script>
    <!-- Magnific Popup JavaScript -->
    <script src="js/jquery.magnific-popup.min.js"></script>
    <!-- Smooth Scrollbar JavaScript -->
    <script src="js/smooth-scrollbar.js"></script>
    <!-- lottie JavaScript -->
    <script src="js/lottie.js"></script>
    <!-- am core JavaScript -->
    <script src="js/core.js"></script>
    <!-- am charts JavaScript -->
    <script src="js/charts.js"></script>
    <!-- am animated JavaScript -->
    <script src="js/animated.js"></script>
    <!-- am kelly JavaScript -->
    <script src="js/kelly.js"></script>
    <!-- am maps JavaScript -->
    <script src="js/maps.js"></script>
    <!-- am worldLow JavaScript -->
    <script src="js/worldLow.js"></script>
    <!-- Style Customizer -->
    <script src="js/style-customizer.js"></script>
    <!-- Chart Custom JavaScript -->
    <script src="js/chart-custom.js"></script>
    <!-- Custom JavaScript -->
    <script src="js/custom.js"></script>

    <script>
        function noticePop( value, type ){
            swal({
                html: '<span style="font-size:18px!important;">'+ `${value}` +'</span>',
                type: `${type}`,
                timer: 4000,
                showConfirmButton: false,
                allowOutsideClick: false,
                allowEscapeKey: false,
            }).then(function(){
                window.location.href = 'edit';
            });
        }
    </script>

</body>
</html>