<?php
/**
 * HTML Change Password Form
 *
 * PHP version 7.3
 *
 * @package        SMS
 * @version        Release 1.0.0
 * @create_by      Mohammad aljaouni
 * @create_date    17-08-2020
 * @edited_by
 * @last_edit_date
 * @todo           Nothing
 */
ob_start();
session_start();
$chain = "AWdrh78y892Djk*^523*%$#ghgHGHia&%$*)AsfdsLJnLaad";
include("validateLogin.php");
include("includeInformation.php");
include("header.php");

?>
<!-- Start Dashboard page -->
    <!-- start main-content -->
    <div class="main-content">
        <!-- Start Page-content -->
        <div class="page-content">
        <!-- Page-Title -->
        <div class="page-title-box">
            <div class="container-fluid">
                <div class="row align-items-center">
                    <?php echo breadcrumbs(basename($_SERVER['PHP_SELF']));?>
                </div>
            </div>
        </div>
        <!-- end page title end breadcrumb -->
        <div class="page-content-wrapper">
            <div class="container-fluid">
                <div class="row justify-content-center align-items-center">
                    <div class="col-sm-12 col-lg-4 ">
                        <div class="card">
                            <div class="card-body">
                                <h5 class="mb-5 text-center"><?php echo $userEditLBL["userProfile"];?></h5>
								<form name="editInfoForm" action="userEdit2.php" method="post" onSubmit="return checkEdit();" >
                                <?php
								$queryNewUser  = "SELECT id,fullName,userName,password,mobile,email FROM `user_login` WHERE `id`=$_SESSION[userId]";
								$resultNewUser = mysqli_query($conn, $queryNewUser);
								$rowNewUser = mysqli_fetch_row($resultNewUser);		
								?>
                                    <div class="row">
                                        <?php
                                        if(!empty($_GET["res"]))
                                            echo result($_GET["res"]);
                                        ?>
                                        <div class="col-md-12">
                                            <div class="form-group form-group-custom mb-4">
                                                <input type="text" class="form-control" name="email" id="emailId" value="<?php echo $rowNewUser[5];?>"  onchange="this.setAttribute('value', this.value);">
                                                <label for="mobileId"><?php echo $userEditLBL["email"]?></label>
                                            </div>

                                            <div class="mt-4">
                                                <button class="btn btn-success btn-block waves-effect waves-light" type="submit"><?php echo $button["change"]?></button>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- end row -->
            </div>
            <!-- end container-fluid -->
        </div>
        <!-- end page-content-wrapper -->
    </div>
        <!-- End Page-content -->
</div>
    <!-- end main content -->
<!-- End Dashboard page -->
<script language="javascript" type="text/javascript">
function checkEdit()
{
   	if(document.editInfoForm.email.value=="")
    {
		alert("<?php echo sprintf($insert,$userEditLBL["email"]);?>");
      	document.editInfoForm.email.focus();
      	return false;
	}
   	str = document.editInfoForm.email.value;
   	if (str.indexOf('@') == -1 || str.indexOf('.') == -1)
	{
		alert ("<?php echo sprintf($insert,$userEditLBL["email"]);?>");
       	document.editInfoForm.email.focus();
       	return false;
	}
}
</script>
<?php
include("footer.php");
ob_end_flush();
?>
