
@{
    ViewBag.Title = "Login";
    Layout = null;
}

<!doctype html>
<html lang="en">
<head>
    <!-- Required meta tags -->
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <!--Style-->
    <link rel="shortcut icon" type="image/x-icon" href="~/img/application/hdrIcon.png" />
    <link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,500,700,800,900" rel="stylesheet">
    <link href="../css/component.css" rel="stylesheet" />
    <link href="../css/main.css" rel="stylesheet" />
    <link href="../css/ApplicationTemplate.css" rel="stylesheet" />
	<link rel="canonical" href="https://admission.upes.ac.in/Login" />
    <!--Custom Css-->
    <title>UPES | Application Form</title>

    <style>
        .se-pre-con {
            position: fixed;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            z-index: 9999;
            /*background: #fff url(../img/application/loader.gif) center no-repeat;*/
            background: #fff url(../img/application/hdrIcon.PNG) center no-repeat;
        }
    </style>

    <script type="text/javascript" src="../scripts/component.js?qr=@DateTime.Now.Ticks"></script>
    <script type="text/javascript" src="../scripts/loader-min.js?qr=@DateTime.Now.Ticks"></script>
    <script type="text/javascript" src="../scripts/upes-appliaction.js?qr=@DateTime.Now.Ticks"></script>
    <script src="https://code.jquery.com/jquery-3.5.0.js"></script>

    <script type="text/javascript">
    function myFunction() {
        $(".se-pre-con").fadeOut("slow");
    }

    function getotp() {
        /// var mobile = $("#phone").val();
        var otpfirl = $("#otp").val();
        $("#otpcheckp").hide();
        var strEmail = $("#txtEmail").val();
        var strpwd = $("#txtPassword").val();
        if (strEmail == "") {

            $(".validation").remove();
            $("#txtEmail").focus();
            $("#txtEmail").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter Email ID</p>");
            return false;
        }
        if (strpwd == "") {

            $(".validation").remove();
            $("#txtPassword").focus();
            $("#txtPassword").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter Password</p>");
            return false;
        }
        var EmailValidate = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
        if (!(EmailValidate.test(strEmail))) {

            $(".validation").remove();
            $('#txtEmail').focus();
            $('#txtEmail').after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter Valid Email ID</p>");
            return false;
        }
        else {
            $(".validation").remove();
            genotp("",strEmail);
            $("#innerotp").show();
            $("#btnotp").text("Resend OTP");
        }
    }

    function genotp(phone,strEmail) {
        var serviceURLotp = '/Login/generateotp';
        $.ajax({
            url: serviceURLotp,
            type: "POST",
            dataType: "json",

            data: {
                phone: phone,
                emailTo: strEmail
            },

            async: false,
            success: function (data) {
                //  alert(data);
                if (data != "") {
                    data = data.split("###");
                    if (data[0] == "otp not send") {
                        $("#responseotp").show();
                        $("#responseotp").html(data[0]);
                        $("#hdnotp").val('');
                    }
                    else if (data[0] == "Enter OTP sent to your mobile number or Email ID") {
                        $("#responseotp").show();
                        $("#responseotp").html("OTP sent to Registered Mobile no. and Email ID.");
                        $("#hdnotp").val(data[1]);
                       // $("#otpcheckp").show();
                    }
                }
                else {
                    $("#responseotp").html('');
                }
            }
        });
    }
   
    $(document).ready(function () {

        $('#txtEmail').on('change', function (){
            var strEmail = $("#txtEmail").val();
            if (strEmail == "") {

                $(".validation").remove();
                $("#txtEmail").focus();
                $("#txtEmail").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter Email ID</p>");
                return false;
            }
            var EmailValidate = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
            if (!(EmailValidate.test(strEmail))) {
                $(".validation").remove();
                $('#txtEmail').focus();
                $('#txtEmail').after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter Valid Email ID</p>");
                return false;
            }
            else {
                $(".validation").remove();
                $("#divotp").show();
            }
        });
      
        $('#otp').on('change', function () {
            var hdnotp = $("#hdnotp").val();
            var cuotp = $("#otp").val();
            if (cuotp == "") {
                $(".validation").remove();
                $('#otp').focus();
                $('#otp').after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter otp</p>");
                return false;
            }
            if (hdnotp != cuotp) {
                $(".validation").remove();
                $('#otp').focus();
                $('#otp').after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter correct otp</p>");
                return false;
            }
            $(".validation").remove();
            $('#otp').focus();
            $('#otp').after("<p class='validation' style='color:green;margin-bottom:0px;'>OTP verified</p>");
            $("#responseotp").html('');
        });

    });

    function myFunction21(){
      //  $("#divotp").show();
    }



    </script>


	<!-- GTM - Head Part -->
<script>
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-5QTLTJ');
</script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-21981520-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'AW-964693448');
gtag('config', 'UA-21981520-1');
</script>

<!-- Remarketing Event Snippet -->
<script>
gtag('event', 'page_view', {
'send_to': 'AW-964693448',
'items': [{
'id': 'replace with value',
'location_id': 'replace with value',
'google_business_vertical': 'education'
}]
});
</script>
<!-- Facebook Pixel Code --> 
<script> 
!function(f,b,e,v,n,t,s) 
{if(f.fbq)return;n=f.fbq=function(){n.callMethod? 
n.callMethod.apply(n,arguments):n.queue.push(arguments)}; 
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; 
n.queue=[];t=b.createElement(e);t.async=!0; 
t.src=v;s=b.getElementsByTagName(e)[0]; 
s.parentNode.insertBefore(t,s)}(window, document,'script', 
'https://connect.facebook.net/en_US/fbevents.js'); 
fbq('init', '667790006758005'); 
fbq('track', 'PageView'); 
</script> 
<noscript><img height="1" width="1" style="display:none" 
src="https://www.facebook.com/tr?id=667790006758005&ev=PageView&noscript=1"
/></noscript> 
<!-- End Facebook Pixel Code -->
<!-- Bing Code -->
	<script>(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"25050676"};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,"script","//bat.bing.com/bat.js","uetq");</script>
</head>

<body onload="myFunction();" class="LoginModule">
<!-- GTM Body Part -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5QTLTJ"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    <!--Application Template-->
    <div class="se-pre-con"></div>
    <header class="position-relative">
        <section class="HeaderPanel HeaderBanner">
            <div class="plr70">
                <div class="headerInner">
                    <a href="/">
                        <img src="../img/application/upes logo.png" class="img-fluid" alt="Logo" />
                    </a>
                </div>
            </div>
        </section>

    </header>

    @using (Html.BeginForm("Index", "Login", FormMethod.Post, new { enctype = "multipart/form-data" }))
    {
        <main role="main" class="ApplicationTemplate LoginTEmplate">
            <section class="FormTemplate formBlkStyle">
                <div class="FormPosition">
                    <div class="text-center">
                        <h1 class="fontExBold ApplicationTitle">LOGIN</h1>
                    </div>
                    <!--Form Panel-->
                    <div class="FormPanel">
                        <!--PanelOne-->
                        <div class="FormPanelInner" id="FormPanelOne">
                            <p class="fontMedium form-text">Email</p>
                            <div class="form-group">
                                <input type="text" class="form-control FormStyle" id="txtEmail" placeholder="Enter your Email ID" onchange="myFunction21();" name="email" />
                            </div>
                            <p class="fontMedium form-text">Password</p>
                            <div class="form-group">
                                <input type="password" class="form-control FormStyle" id="txtPassword" name="password" placeholder="Enter your Password" />
                            </div>
                            <div class="form-group" id="divotp" style="display:none; height:auto;">
                                <button type="button" class="btn btn-primary BtnStyle ForOTP" id="btnotp" style="height:auto;" onclick="getotp()">send otp</button>
                                <div id="innerotp" style="display:none">
                                    <input type="text" class="form-control FormStyle" placeholder="OTP" id="otp" value="" />
                                    <p id="responseotp"></p>
                                    <p class="otpvalidation" style="color:red; margin-bottom:0px;display:none" id="otpcheckp">OTP sent to registered Mobile no. and Email ID.</p>     @*Please verify your mobile number with OTP*@
                                    <label id="otpmsg" style="color:green"></label>
                                    <input type="hidden" id="hdnotp" value="" />
                                </div>
                            </div>



                            <p style="color:red">@ViewBag.msglogin</p>
                            <p class="fontMedium form-text"><a href="/login/forgotpassword">Forgot Password?</a></p>
                            <div class="clearfix"></div>
                            <div class="text-center">
                                <button class="btn btn-primary BtnStyle" type="submit" onclick="return loginValidate();">SUBMIT</button>
                                <button style="display:none;" class="btn btn-primary BtnStyle" type="button" onclick="loginRest();">RESET</button>
                            </div>
                            <hr />
                            <p class="fontMedium form-text">Don't have an account? <a href="/apply" style="color:#EF3F3F">Register now with UPES</a></p>
                            <p>&nbsp;</p>
                        </div>
                    </div>
                </div>
            </section>
        </main>
        <!--Helpline Chat-->
        <div class="helplineChatPanel ">
            <div class="plr70">
                <div class="helplineChatInner fontBold ">
                    <a id="helplineCrop" href="tel:+91 18001028737">
                        <img src="../img/application/helpline.png" class="img-fluid" alt="helpline" />
                        <span>Helpline</span>
                    </a>
                    <div class="Number">
                        <a href="tel:+9118001028737">
                            +91 18001028737
                        </a>
                    </div>
                   <!-- <a href="javascript:void(0);" onclick="openChat();">
                        <img src="../img/application/chat.png" class="img-fluid" alt="helpline" />
                        <span>Chat</span>
                    </a>-->
                </div>
            </div>
        </div>
    }
    <!--Footer-->
    <footer>
        <section class="FooterPanel">
            <div class="foot_Btm foot_Btm_Height nobg">
                <div class="plr70">
                    <div class="footBtmRow foot_Btm_Height row align-items-center no-gutters">
                        <div class="col-sm-6 copyRights">
                            <h5 style="display:inline;" class="text-uppercase fontBold">
                                &copy; @DateTime.Now.Year UPES. All Rights Reserved.
                            </h5>
                            <span> <a style="color:#000;text-decoration:underline;" class="text-uppercase fontBold" href="/home/termsandconditions" target="_blank">Terms and Conditions</a></span>
                        </div>
                        <div class="col-sm-6 SocialIcon d-flex justify-content-end align-items-center">
                            <p class="text-uppercase fontBold">Follow Us On:</p>
                            <div class="social_icon_menus">
                                <a href="https://www.facebook.com/UniversityofPetroleumandEnergyStudies" target="_blank">
                                    <img src="../img/application/facebook-black.png" class="img-fluid" />
                                </a>
                                <a href="https://twitter.com/UPESDehradun" target="_blank">
                                    <img src="../img/application/twitter-black.png" class="img-fluid" />
                                </a>
                                <a href="https://www.instagram.com/upes_dehradun/" target="_blank">
                                    <img src="../img/application/insta-black.png" class="img-fluid" />
                                </a>
                                <a href="https://www.youtube.com/user/UPESUniversity/featured" target="_blank">
                                    <img src="../img/application/youtube-black.png" class="img-fluid" />
                                </a>
                                <a href="https://www.linkedin.com/school/university-of-petroleum-and-energy-studies/" target="_blank">
                                    <img src="../img/application/linkedin-black.png" class="img-fluid" />
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </footer>
 <!--Start of SuperBot Chat Script

    <script type="text/javascript">

        window.$superbot || (function (d, s) { var sb = $superbot = function (c) { sb._.push(c) }, $ = sb.s = d.createElement(s), e = d.getElementsByTagName(s)[0]; sb.set = function (o) { sb.set._.push(o) }; sb._ = []; sb.set._ = []; $.async = !0; $.setAttribute("charset", "utf-8"); $.src = "https://app.superbot.works/agent.js?a=bZm18BXLDz&l=en"; sb.t = +new Date; $.type = "text/javascript"; e.parentNode.insertBefore($, e) })(document, "script");

    </script>

    End of SuperBot Chat Script-->

    <script type="text/javascript" src="../scripts/component.js"></script>
    <script type="text/javascript" src="../scripts/loader-min.js"></script>
    <script type="text/javascript" src="../scripts/upes-appliaction.js"></script>
    <script type="text/javascript">
        function loginValidate() {
            var email = $('#txtEmail').val();
            var password = $('#txtPassword').val();
            var hdnotp = $("#hdnotp").val();
            var verfyotp = $("#otp").val();

            $(".validation").remove();
            if (email == "") {
                $(".validation").remove();
                $("#txtEmail").focus();
                $("#txtEmail").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please enter your Email ID</p>");
                return false;
            }
            if (!(isValidEmailAddress(email))) {
                $(".validation").remove();
                $('#txtEmail').focus();
                $('#txtEmail').after("<p class='validation' style='color:red;margin-bottom:0px;'>Please enter your valid Email ID</p>");
                return false;
            }
            if (password == "") {
                $(".validation").remove();
                $("#txtPassword").focus();
                $("#txtPassword").after("<p class='validation' style='color:red;margin-bottom:0px;'>Please enter your Password</p>");
                return false;
            }

            if (hdnotp == "") {
                $(".validation").remove();
                $("#otpcheckp").show();
                alert("Please click on Send OTP.");
                return false;
            }
            if (verfyotp == "") {
                $(".validation").remove();
                $('#otp').focus();
                $('#otp').after("<p class='validation' style='color:red;margin-bottom:0px;'>Please Enter OTP</p>");
                $("#responseotp").hide();
                return false;
            }
            if (hdnotp != verfyotp) {

                $(".validation").remove();
                $('#otp').focus();
                $('#otp').after("<p class='validation' style='color:red;margin-bottom:0px;'>The OTP entered seems to be incorrect, Please try again.</p>");
                return false;
            }           
        }

        function loginRest() {
            $('#txtEmail').val('');
            $('#txtPassword').val('');
            $(".validation").remove();
        }

        function openChat() {
          <!--  window.open("http://ameyo.delhi.upes.ac.in:8888/ameyochatjs/defaultChat/chatOfflinePage.html", "popupWindow", "width=600, height=720, scrollbars=yes");-->
		  window.open('https://app1.mioot.com/5069/livechat2.html','mioot chat software','toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no, width=570, height=450, screenX=10, screenY=10')
        }
    </script>
	
</body>

</html>