<?php session_start();
include("connection.php");

?>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Join</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">window.NREUM||(NREUM={});NREUM.info = {"beacon":"bam.nr-data.net","errorBeacon":"bam.nr-data.net","licenseKey":"8b63cb3591","applicationID":"15757213","transactionName":"NQZVZ0MCV0AAAkwNWwxMemVyTFhGFQl7C1oWEVhfXQZLHBIIXwpdDA==","queueTime":0,"applicationTime":20,"agent":"","atts":""}</script><script type="text/javascript">window.NREUM||(NREUM={}),__nr_require=function(e,n,t){function r(t){if(!n[t]){var o=n[t]={exports:{}};e[t][0].call(o.exports,function(n){var o=e[t][1][n];return r(o||n)},o,o.exports)}return n[t].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<t.length;o++)r(t[o]);return r}({1:[function(e,n,t){function r(){}function o(e,n,t){return function(){return i(e,[c.now()].concat(u(arguments)),n?null:this,t),n?void 0:this}}var i=e("handle"),a=e(3),u=e(4),f=e("ee").get("tracer"),c=e("loader"),s=NREUM;"undefined"==typeof window.newrelic&&(newrelic=s);var p=["setPageViewName","setCustomAttribute","setErrorHandler","finished","addToTrace","inlineHit","addRelease"],d="api-",l=d+"ixn-";a(p,function(e,n){s[n]=o(d+n,!0,"api")}),s.addPageAction=o(d+"addPageAction",!0),s.setCurrentRouteName=o(d+"routeName",!0),n.exports=newrelic,s.interaction=function(){return(new r).get()};var m=r.prototype={createTracer:function(e,n){var t={},r=this,o="function"==typeof n;return i(l+"tracer",[c.now(),e,t],r),function(){if(f.emit((o?"":"no-")+"fn-start",[c.now(),r,o],t),o)try{return n.apply(this,arguments)}catch(e){throw f.emit("fn-err",[arguments,this,e],t),e}finally{f.emit("fn-end",[c.now()],t)}}}};a("actionText,setName,setAttribute,save,ignore,onEnd,getContext,end,get".split(","),function(e,n){m[n]=o(l+n)}),newrelic.noticeError=function(e,n){"string"==typeof e&&(e=new Error(e)),i("err",[e,c.now(),!1,n])}},{}],2:[function(e,n,t){function r(e,n){if(!o)return!1;if(e!==o)return!1;if(!n)return!0;if(!i)return!1;for(var t=i.split("."),r=n.split("."),a=0;a<r.length;a++)if(r[a]!==t[a])return!1;return!0}var o=null,i=null,a=/Version\/(\S+)\s+Safari/;if(navigator.userAgent){var u=navigator.userAgent,f=u.match(a);f&&u.indexOf("Chrome")===-1&&u.indexOf("Chromium")===-1&&(o="Safari",i=f[1])}n.exports={agent:o,version:i,match:r}},{}],3:[function(e,n,t){function r(e,n){var t=[],r="",i=0;for(r in e)o.call(e,r)&&(t[i]=n(r,e[r]),i+=1);return t}var o=Object.prototype.hasOwnProperty;n.exports=r},{}],4:[function(e,n,t){function r(e,n,t){n||(n=0),"undefined"==typeof t&&(t=e?e.length:0);for(var r=-1,o=t-n||0,i=Array(o<0?0:o);++r<o;)i[r]=e[n+r];return i}n.exports=r},{}],5:[function(e,n,t){n.exports={exists:"undefined"!=typeof window.performance&&window.performance.timing&&"undefined"!=typeof window.performance.timing.navigationStart}},{}],ee:[function(e,n,t){function r(){}function o(e){function n(e){return e&&e instanceof r?e:e?f(e,u,i):i()}function t(t,r,o,i){if(!d.aborted||i){e&&e(t,r,o);for(var a=n(o),u=v(t),f=u.length,c=0;c<f;c++)u[c].apply(a,r);var p=s[y[t]];return p&&p.push([b,t,r,a]),a}}function l(e,n){h[e]=v(e).concat(n)}function m(e,n){var t=h[e];if(t)for(var r=0;r<t.length;r++)t[r]===n&&t.splice(r,1)}function v(e){return h[e]||[]}function g(e){return p[e]=p[e]||o(t)}function w(e,n){c(e,function(e,t){n=n||"feature",y[t]=n,n in s||(s[n]=[])})}var h={},y={},b={on:l,addEventListener:l,removeEventListener:m,emit:t,get:g,listeners:v,context:n,buffer:w,abort:a,aborted:!1};return b}function i(){return new r}function a(){(s.api||s.feature)&&(d.aborted=!0,s=d.backlog={})}var u="nr@context",f=e("gos"),c=e(3),s={},p={},d=n.exports=o();d.backlog=s},{}],gos:[function(e,n,t){function r(e,n,t){if(o.call(e,n))return e[n];var r=t();if(Object.defineProperty&&Object.keys)try{return Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!1}),r}catch(i){}return e[n]=r,r}var o=Object.prototype.hasOwnProperty;n.exports=r},{}],handle:[function(e,n,t){function r(e,n,t,r){o.buffer([e],r),o.emit(e,n,t)}var o=e("ee").get("handle");n.exports=r,r.ee=o},{}],id:[function(e,n,t){function r(e){var n=typeof e;return!e||"object"!==n&&"function"!==n?-1:e===window?0:a(e,i,function(){return o++})}var o=1,i="nr@id",a=e("gos");n.exports=r},{}],loader:[function(e,n,t){function r(){if(!E++){var e=x.info=NREUM.info,n=l.getElementsByTagName("script")[0];if(setTimeout(s.abort,3e4),!(e&&e.licenseKey&&e.applicationID&&n))return s.abort();c(y,function(n,t){e[n]||(e[n]=t)}),f("mark",["onload",a()+x.offset],null,"api");var t=l.createElement("script");t.src="https://"+e.agent,n.parentNode.insertBefore(t,n)}}function o(){"complete"===l.readyState&&i()}function i(){f("mark",["domContent",a()+x.offset],null,"api")}function a(){return O.exists&&performance.now?Math.round(performance.now()):(u=Math.max((new Date).getTime(),u))-x.offset}var u=(new Date).getTime(),f=e("handle"),c=e(3),s=e("ee"),p=e(2),d=window,l=d.document,m="addEventListener",v="attachEvent",g=d.XMLHttpRequest,w=g&&g.prototype;NREUM.o={ST:setTimeout,SI:d.setImmediate,CT:clearTimeout,XHR:g,REQ:d.Request,EV:d.Event,PR:d.Promise,MO:d.MutationObserver};var h=""+location,y={beacon:"bam.nr-data.net",errorBeacon:"bam.nr-data.net",agent:"js-agent.newrelic.com/nr-1118.min.js"},b=g&&w&&w[m]&&!/CriOS/.test(navigator.userAgent),x=n.exports={offset:u,now:a,origin:h,features:{},xhrWrappable:b,userAgent:p};e(1),l[m]?(l[m]("DOMContentLoaded",i,!1),d[m]("load",r,!1)):(l[v]("onreadystatechange",o),d[v]("onload",r)),f("mark",["firstbyte",u],null,"api");var E=0,O=e(5)},{}]},{},["loader"]);</script>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
    <link href="https://fonts.googleapis.com/css?family=Lato:300,300i,400,400i,600,600i,700,700i,800,800i" rel="stylesheet">
    <meta name="robots" content="index, follow" />
    <meta name="description" content="Lyrics" />
    <meta name="keywords" content="Lyrics" />
   
   
   
    <meta property="og:site_name" content="Lyricstubes">
    <meta property="og:title" content="Poems, Lyrics">
    <meta property="og:description" content="Poems, Lyrics">
    <meta property="og:image" content="http://lyricstubes.com/logo.png">
    <meta property="og:url" content="http://lyricstubes.com">
  <meta property="og:type" content="article" />
  
   
   
   
   
   
   
    <link rel="stylesheet" href="https://yuppstatic.akamaized.net/yupptv/yupptv_new/Web/minified/Content/css/bootstrap.min.css">
    <link href='https://fonts.googleapis.com/css?family=Lato:400,700' rel='stylesheet' type='text/css'>
    <link href="https://yuppstatic.akamaized.net/yupptv/yupptv_new/Web/minified/Content/css/combined-css.css" rel="stylesheet" />
    <link href="https://yuppstatic.akamaized.net/yupptv/yupptv_new/Web/minified/Content/css/signin-body.css" rel="stylesheet" />
    <link href="https://yuppstatic.akamaized.net/yupptv/yupptv_new/Web/minified/Content/css/font-awesome.min.css" rel="stylesheet" />
    <link href="https://yuppstatic.akamaized.net/yupptv/yupptv_new/Web/minified/Content/css/responsive-thumbnails.css" rel="stylesheet" />
    <link href="https://yuppstatic.akamaized.net/yupptv/yupptv_new/Web/minified/Content/css/signin.component.css" rel="stylesheet" type="text/css">
    <style>
        .input-pad-add {
            padding-left: 75px;
            padding-top:0
        }

        .yupptv-dropdown-border img {
            width: 18px;
             height: 18px;
        }

        .yupptv-selectedCountry-margin {
            font-size: 1em;
        }

        .country-code-pos {
            top: 32px;
            left: 10px;
            position: absolute;
        }

        .yupptv-country-seperator-padding {
            font-size: .825em;
            padding-left: 10px;
        }

        .drop-country-height-auto {
            height: auto;
            max-height: 215px;
            overflow: auto;
            border: 1px solid #cdcdcd;
            background: #f5f5f5;
            position: absolute;
            width: 100%;
            z-index: 999;
        }

            .drop-country-height-auto table {
                width: 100%;
            }

                .drop-country-height-auto table .row-eq-height {
                    padding: 5px 0px;
                }

                    .drop-country-height-auto table .row-eq-height:hover {
                        background: #ececec;
                    }

        .country-search {
            width: 95%;
            height: 35px;
            margin: 5px 0px 0px 10px;
            padding-left: 40px;
        }

        .yupptv-country-seperator-padding span {
            line-height: 23px;
            font-size: 1.21212em;
        }

        .yupptv-country-seperator-padding img {
            border-radius: 3px;
            width: 23px;
        }

        .glyphicon-search {
            position: absolute;
            top: 15px;
            left: 20px;
            color: #555;
        }

        .lineover {
            position: relative;
            z-index: 1;
        }

            .lineover:before {
                border-top: 2px solid #dfdfdf;
                content: "";
                margin: 0 auto; /* this centers the line to the full width specified */
                position: absolute; /* positioning must be absolute here, and relative positioning must be applied to the parent */
                top: 50%;
                left: 0;
                right: 0;
                bottom: 0;
                width: 95%;
                z-index: -1;
            }

            .lineover span {
                /* to hide the lines from behind the text, you have to set the background color the same as the container */
                background: #fff;
                padding: 12px 7px;
                position: absolute;
                left: 42%;
                top: -20px;
            }

        .pt15 {
            padding-top: 15px;
        }

        .ml20 {
            margin-left: 20%;
        }

        .chk-control {
                display: block;
                position: relative;
                padding-left: 30px;
                margin-bottom: 15px;
                cursor: pointer;
                font-size: 1.1666666666666667em;
                font-weight: 400;
                color: #555;
            }
            .chk-control input {
              position: absolute;
              z-index: -1;
              opacity: 0;
            }
            .chk-control__indicator {
              position: absolute;
              top: 2px;
              left: 0;
              height: 20px;
              width: 20px;
                            border:2px solid #e6e6e6;
            }
            
            .chk-control:hover input ~ .chk-control__indicator,
            .chk-control input:focus ~ .chk-control__indicator {
              border: 2px solid #5e5e5e;
            }
            .chk-control input:checked ~ .chk-control__indicator {
                border: 2px solid #989898;
            }
            
            .chk-control__indicator:after {
              content: '';
              position: absolute;
              display: none;
            }
            .chk-control input:checked ~ .chk-control__indicator:after {
              display: block;
            }
            .chk-control--checkbox .chk-control__indicator:after {
                  left: 6px;
                top: 2px;
                width: 5px;
                height: 9px;
                border: solid #000;
                border-width: 0 2px 2px 0;
                transform: rotate(45deg);
            }


    </style>
    <!-- Google Tag Manager -->
    <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-KHGQ2D');</script>
    <!-- End Google Tag Manager -->
    <!-- Start Clicky Tracking Code -->
    <script async src="//static.getclicky.com/js" type="text/javascript"></script>
    <script type="text/javascript">try { clicky.init(101005941); } catch (e) { }</script>
    <noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/101005941ns.gif" /></p></noscript>
    <!-- End Clicky Tracking Code -->
    <!-- Hotjar Tracking Code for http://www.yupptv.com -->
    <script>
        (function(h,o,t,j,a,r){
            h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
            h._hjSettings={hjid:178945,hjsv:5};
            a=o.getElementsByTagName('head')[0];
            r=o.createElement('script');r.async=1;
            r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
            a.appendChild(r);
        })(window,document,'//static.hotjar.com/c/hotjar-','.js?sv=');
    </script>
    <!-- Google Analytics code Tracking Code for http://www.yupptv.com -->
    <script>
        (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
            m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
        })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

        ga('create', 'UA-4068950-8', 'auto', {'allowLinker': true});
        ga('require', 'linker');
        ga('linker:autoLink', ['stream.yupptv.com', 'blog.yupptv.com'] );
        ga('send', 'pageview');

    </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', '242716032603945', {
            em: 'insert_email_variable,'
        });
        fbq('track', 'PageView');
    </script>
    <noscript>
        <img height="1" width="1" style="display:none"
             src="https://www.facebook.com/tr?id=242716032603945&ev=PageView&noscript=1" />
    </noscript>
    <!-- DO NOT MODIFY -->
    <!-- End Facebook Pixel Code -->
    <!-- Start Alexa Certify Javascript -->
    <script type="text/javascript">
        _atrk_opts = { atrk_acct:"6zXLj1a8wt0026", domain:"yupptv.com",dynamic: true};
        (function() { var as = document.createElement('script'); as.type = 'text/javascript'; as.async = true; as.src = "https://d31qbv1cthcecs.cloudfront.net/atrk.js"; var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(as, s); })();
    </script>
    <noscript><img src="https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=6zXLj1a8wt0026" style="display:none" height="1" width="1" alt="" /></noscript>
    <!-- End Alexa Certify Javascript -->
    <!-- Start of Woopra Code -->
   <!-- <script>
        (function(){
            var t,i,e,n=window,o=document,a=arguments,s="script",r=["config","track","identify","visit","push","call","trackForm","trackClick"],c=function(){var t,i=this;for(i._e=[],t=0;r.length>t;t++)(function(t){i[t]=function(){return i._e.push([t].concat(Array.prototype.slice.call(arguments,0))),i}})(r[t])};for(n._w=n._w||{},t=0;a.length>t;t++)n._w[a[t]]=n[a[t]]=n[a[t]]||new c;i=o.createElement(s),i.async=1,i.src="//static.woopra.com/js/w.js",e=o.getElementsByTagName(s)[0],e.parentNode.insertBefore(i,e)
        })("woopra");

        woopra.config({
            domain: 'yupptv.com'
        });
        woopra.track();
    </script> -->
</head>
<body id="bodyId">
<!-- Google Tag Manager (noscript) -->
<!-- <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KHGQ2D"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> -->
<!-- End Google Tag Manager (noscript) -->

    <form id="form1" method="post">
        <div class="row  yupptv-layout-margin">
            <input id="HdnBox" type="hidden" value="" />
            <input id="HdnRedirect" type="hidden" value="" />
            <div class="row remove-margin">
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 remove-padding ">
                    <div class="row  remove-margin">
                        <div class="col-xs-12 col-sm-12 col-md-6 col-lg-8 remove-padding yupptv-devices-width yupp-singin-disnone" id="yupptvopen">
                            <div class="row  remove-margin yupptv-logo-margin">
                                <a  href="http://www.lyricstubes.com" class="col-xs-12 col-sm-12 col-md-12 col-lg-12 remove-padding yupptv-logo-center ">
                                    <img role="button" src='http://www.lyricstubes.com/logo.png' width="167" />
                                </a>
                            </div>
                            
                           
                          

                           
                        </div>
                        <div class="col-xs-12 col-sm-12 col-md-6 col-lg-4 remove-padding yupptv-login-bg" id="yupptvclose">
                            <div class="row remove-margin">
                                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 remove-padding yupptv-login-margin">
                                    <div class="row  remove-margin yupptv-logo-img-margin">
                                        <div class="col-xs-3 col-sm-4 hidden-md hidden-lg remove-padding  "></div>
                                        <div class="col-xs-6 col-sm-4 hidden-md hidden-lg remove-padding  ">
                                            <center><img class="img img-responsive " src='logo_.png' width="50%" /></center>
                                        </div>
                                    </div>
                                    <div class="row remove-margin">
                                        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 remove-padding yupptv-signin-text">
                                            Forget Password<hr>
                                        </div>
                                    </div>
                                   
                                   <?php if($_REQUEST["phone"] !="") { ?>
                                            <h4>An SMS has been sent to your mobile no. regarding Login details</h4> <hr>
                                            <a href="signin.php"><img src="https://erp.vivekanandainstitution.org/login.png" width="100%"></a>
                                            <?php } else {?>
                                         
									
                                    <div id="divmail" style="display:block;">
                                           
                                        <div class="row remove-margin">
                                            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 remove-padding yupptv-email-margin yupptv-signin-margintop-main">
                                                
                                                
                                           <input type="text" name="phone" placeholder="Mobile No" />           
                                               
                                                   
                                                </div>
                                            </div>
                                           
                                        </div>
                                        <div class="row remove-margin">
                                            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 remove-padding yupptv-signin-margintop">
                                               
                                               <input type="submit" name="ok" value="Submit" style=" background-color:#990000; color:#FFFFFF"  >
                                             <br><br>	<center>	<a href="index.php"><img src="home.png" width="40"></a></center>
												   </div>
                                           
                                           
                                        </div>
                                        
                                        <?php } ?>

                                      
                                        
                                       
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</body>
<?php 
if(isset($_POST["ok"])) {
$phone=$_POST["phone"];
$password=$_POST["password"];
$q=mysqli_query($con,"select * from teacher where `phone`='".$phone."' and `status`='active'");
$qr=mysqli_fetch_array($q,MYSQLI_ASSOC);
$qn=mysqli_num_rows($q);
$status=$qr["status"];
if($qn>0 ) {
    $phone=$qr["phone"];
    $name=$qr["name"];
    $password=$qr["password"];
    $ch = curl_init();

$parampro['uname'] = "scriptlovers";
$parampro['password'] = "123456";
$parampro['sender'] = "KOCORD";
$parampro['receiver'] =$phone;
$parampro['route'] = "TA";
$parampro['msgtype'] = "1";
  $parampro['tempid'] = "1207162649661367728";

  
$parampro['sms'] = "Hello ".$name.", Your Password is ".$password. " Contact with us if you are unable to login - Katha O Cafe";
$sendsmspro = http_build_query($parampro);

$urlpro="http://sendsms.designhost.in/index.php/smsapi/httpapi/?".$sendsmspro;

curl_setopt($ch, CURLOPT_URL, $urlpro);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$resultpro = curl_exec($ch); 
curl_close($ch);	
    
	?>
    <script>window.location.href='?phone=<?php echo $phone; ?>'</script> <?php 
    
}
else
{ ?>
     <script> alert("Username or Password not Correct");</script> <?php 
}
}


?>
</html>
<script src="https://yuppstatic.akamaized.net/yupptv/yupptv_new/Web/minified/Scripts/js/combined.js"></script>
<script type="text/javascript">
    var loc = 'https://location.api.yuppcdn.net/auth/v1/serviceinfo';
    var v2 = 'https://prod.yupptv.com/yupptv/api/v2/';
    var lang = v2 + 'language/list';
    var session = 'YT-906e7a1c-d4c0-450a-9f2b-1892c04ede7a';
    var boxid = '9bec136bc0d445b3';
    var sugg = 'https://prod.yupptv.com/search/api/v2/get/suggestions';
    var searchres = 'https://www.yupptv.com/search/';
    var uplang = 'https://prod.yupptv.com/auth/api/v1/viewer/preferences/update';
    var rooturl = 'https://www.yupptv.com';
</script>
<script src="https://yuppstatic.akamaized.net/yupptv/yupptv_new/Web/minified/Scripts/js/need.js"></script>
<script src="https://yuppstatic.akamaized.net/yupptv/yupptv_new/Web/minified/Scripts/js/slick.js" type="text/javascript" charset="utf-8"></script>

<script>

    function myFunction() {

        var input, filter, table, tr, td, i;
        input = document.getElementById("txtLogin1");
        filter = input.value.toUpperCase();
        table = document.getElementById("DlCountries");
        tr = table.getElementsByTagName("tr");
        for (i = 0; i < tr.length; i++) {
            td = tr[i].getElementsByTagName("td")[0];
            if (td) {
                if (td.innerText.toUpperCase().indexOf(filter) > -1) {
                    tr[i].style.display = "";
                } else {
                    tr[i].style.display = "none";
                }
            }
        }
    }

    function show() {
        var p = document.getElementById("txtpassword");
        p.setAttribute("type", "value");
        document.getElementById("spanid").innerHTML = "Hide";
    }

    function hide() {
        var p = document.getElementById("txtpassword");
        p.setAttribute("type", "password");
        document.getElementById("spanid").innerHTML = "Show";
    }
    var pwShown = 0;
    function ShowHide() {
        if (pwShown == 0) {
            pwShown = 1;
            show();
        } else {
            pwShown = 0;
            hide();
        }
    }
    //******
    var specialKeys = new Array();
    specialKeys.push(8);
    specialKeys.push(13);
    function IsNumeric(e) {
        var i = document.getElementById("txtLogin").value.length;
        //console.log(i);
        document.getElementById('divListCountries').style.display = "None";
        var keyCode = e.which || e.keyCode //e.which ? e.which : e.keyCode
        if(keyCode != 13)
            document.getElementById('lblEmailMsg').innerHTML = " "
        var ret = ((keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 105) || specialKeys.indexOf(keyCode) != -1);
        if (i <= 0) {

            var keyCode = e.which ? e.which : e.keyCode
            var ret = ((keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 105) || specialKeys.indexOf(keyCode) != -1);
            document.getElementById("divcountry").style.display = "none";
            document.getElementById("txtLogin").classList.remove("input-pad-add");
            return keyCode;
        }
        if (i == 1) {

            var keyCode = e.which ? e.which : e.keyCode
            var keyCodechar = document.getElementById("txtLogin").value.charCodeAt(0);
            var ret = ((keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 105) || specialKeys.indexOf(keyCode) != -1);
            var rechart = ((keyCodechar >= 48 && keyCodechar <= 57) || (keyCode >= 96 && keyCode <= 105) || specialKeys.indexOf(keyCodechar) != -1);
            document.getElementById("divcountry").style.display = ret ? "block" : "none";
            document.getElementById("divcountry").style.display = rechart ? "block" : "none";
            ret ? document.getElementById("txtLogin").classList.add("input-pad-add") : document.getElementById("txtLogin").classList.remove("input-pad-add");
            rechart ? document.getElementById("txtLogin").classList.add("input-pad-add") : document.getElementById("txtLogin").classList.remove("input-pad-add");
            return keyCode;
        }
        if (i > 1) {
            //console.log('i2:' + ret);
            if (ret == false) {
                document.getElementById("divcountry").style.display = "none";
                document.getElementById("txtLogin").classList.remove("input-pad-add");
                return keyCode;
            }
        }
    }

    function CountryPop() {
        document.getElementById("txtLogin1").value = "";
        //myFunction()
        if (document.getElementById("divListCountries").style.display === "block") {
            document.getElementById('divListCountries').style.display = "none";
        }
        else {
            document.getElementById('divListCountries').style.display = "block";
        }
    }
    function Flag(flagurl, country) {
        document.getElementById('ImgDefaultcountryFlag').src = flagurl;
        document.getElementById('LblCountrycode').innerText = country.substring(country.indexOf(",") + 1);
        document.getElementById('divListCountries').style.display = "None";
    }
    // Validations starts
    function phoneValidation() {

        if (document.getElementById('txtLogin').value != "") {
            var Phno;
            var valid = false;
            Phno = document.getElementById('txtLogin').value
            console.log(Phno);
            var validChars = "0123456789-+ "
            var i = 0
            if (Phno.length >= 7 && Phno.length <= 15) {
                if (!Phno.match(/^[0-9]+$/)) {
                    valid = false;
                }
                else
                    valid = true;
            }
            if (valid == false) {
                document.getElementById('lblEmailMsg').innerHTML = "Please enter a valid Mobile Number "
                document.getElementById("txtLogin").select();
                document.getElementById("txtLogin").focus();
                return (false);
            }
        }
        document.getElementById('lblEmailMsg').innerHTML = "";
        return true;
    }

    function validation() {
        document.getElementById("lblEmailMsg").innerHTML = ""
        document.getElementById('lblPswrdMsg').innerHTML = ""
        document.getElementById('lblMsg').innerHTML = ""

        if (document.getElementById("txtLogin").value == "") {
            document.getElementById("lblEmailMsg").innerHTML = "Please enter a valid Email/Mobile Number";
            document.getElementById("txtLogin").focus();
            return (false);
        }
        if (document.getElementById('txtLogin').value != "") {

            var str = document.getElementById('txtLogin').value.replace(/^\s+|\s+$/gm,'');
            var filter = /^[A-Za-z][A-Za-z0-9]+$/
            var isNumeric = str.match(/^\d+$/);
            var letterNumber = /^[0-9a-zA-Z]+$/;
            if (!str.substr(0, 1).match(letterNumber)) {
                document.getElementById('lblEmailMsg').innerHTML = ""
                document.getElementById('lblEmailMsg').innerHTML = "Please enter a valid Email Id/Mobile Number"
                document.getElementById("txtLogin").select();
                document.getElementById("txtLogin").focus();
                return false;

            }
            else {
                //var filter = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
                if (isNumeric) {

                    if (!phoneValidation()) {
                        document.getElementById("txtLogin").select();
                        document.getElementById("txtLogin").focus();
                        return false;
                    }
                }
                else {
                    if (!str.toLowerCase().match(/[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/)) {
                        document.getElementById('lblEmailMsg').innerHTML = ""
                        document.getElementById('lblEmailMsg').innerHTML = "Please enter a valid Email Id"
                        document.getElementById("txtLogin").select();
                        document.getElementById("txtLogin").focus();
                        return false;

                    }
                }

            }
        }

        return ValidatePassword();

        return true;

    }

    function ValidatePassword() {

        if (document.getElementById('txtpassword').value == "") {
            document.getElementById('lblPswrdMsg').innerHTML = "Please enter your password.";
            document.getElementById("txtpassword").focus();
            return (false);
        }
        //else if (document.getElementById('txtpassword').value.length < 6) {
        //    document.getElementById('lblPswrdMsg').innerHTML = "Your password must be at least 6 characters long."
        //    document.getElementById("txtpassword").select();
        //    document.getElementById("txtpassword").focus();
        //    return false;
        //}
        document.getElementById('lblPswrdMsg').innerHTML = ""
        return true;
    }

    $('#txtpassword').on('keyup', function(e) {
        document.getElementById('lblPswrdMsg').innerHTML = "";        
    });

    $('#txtLogin').on('keypress', function(e) {
        var val = document.getElementById("txtLogin").value;
        var isNumeric=val.match(/^\d+$/);
        if(isNumeric){
            if(val.length >= 15)
                return false;
        }
    });

    //$('#txtLogin').on('blur input', function() {
    //    document.getElementById("divcountry").style.display = "block";
    //    document.getElementById("txtLogin").classList.add("input-pad-add");
    //});
    //added to handle autofill
    $('#txtLogin').on('input paste change keyup', function(event) {
        var val = document.getElementById("txtLogin").value;
        var isNumeric=val.match(/^\d+$/);
        if(isNumeric){
            document.getElementById("divcountry").style.display = "block";
            document.getElementById("txtLogin").classList.add("input-pad-add");
        }
        else
        {
            document.getElementById("divcountry").style.display = "none";
            document.getElementById("txtLogin").classList.remove("input-pad-add");
        }

    });

    //validations end
    function signin() {
        var isMobile =1;
        if(validation()) {
            var user  = document.getElementById('txtLogin').value;
            var password = document.getElementById('txtpassword').value;
            var countryCode = document.getElementById('LblCountrycode').innerHTML.replace("+", "");
            var isNumeric = user.match(/^\d+$/);
            if (isNumeric) {
                user = countryCode + '-' + user;
                isMobile = 1;
            }
            else{
                user = user;
                isMobile = 0;
            }
            if ($('#cbRemeber').is(':checked')) {
                var email = $('#txtLogin').val();
                var password = $('#txtpassword').val();
                $.cookie('user', email, { expires: 15, path: '/' });
                $.cookie('pwd', password, { expires: 15, path: '/' });
                $.cookie('myRememberCookie', true, { expires: 15, path: '/' });
            }
            else
            {
                $.cookie('user', null);
                $.cookie('pwd', null);
                $.cookie('myRememberCookie', null);
            }
            signinWithApi(user,password,isMobile);
        }
    }

    function signinWithApi(user,password,isMobile) {
        $('#loading').show();
        $.ajax({
            url: 'https://www.yupptv.com/auth/validateSignin',
            type: 'POST',
            data:{
                user: user.replace(/^\s+|\s+$/gm,''),
                password:  encodeURIComponent(password),
                isMobile: isMobile
            },
            success: function (result) {
                var redirect = document.getElementById('HdnRedirect').value;
                redirect = redirect.replace(/\&amp;/g, '&');
                if (result.Response.status == '1')
                {
                    if(result.Response.mobileRequired == "1" && '1' == "1")
                    {
                        $.cookie('referer', redirect, { expires: 1, path: '/' });
                        window.location.href = 'https://www.yupptv.com/addmobile';
                        return;
                    }
                    else if(result.Response.otpRequired == "1")
                    {
                        $.cookie('referer', redirect, { expires: 1, path: '/' });
                        window.location.href = 'https://www.yupptv.com/otp';
                        return;
                    }
                    if (redirect == '')
                        window.location.href = 'https://www.yupptv.com';
                    else
                        window.location.href = redirect;
                }
                else if(result.Response.status == '2')
                {
                    document.getElementById("divmail").style.display = "none";
                    document.getElementById("divPopup").style.display = "block";
                    document.getElementById('HdnBox').value = result.Response.tempBoxid;
                    $('#loading').hide();
                    return true;
                }
                else if (result.Response.errorCode == "1" || result.Response.errorCode == "-101" || result.Response.errorCode == "-32")
                {
                    document.getElementById("lblMsg").innerHTML = result.Response.statusmsg;
                    $('#loading').hide();
                }
                else
                {
                    //show common error here
                    $('#loading').hide();
                }
            },
            error: function (e) {
                console.log("error - signin - " + e.statusText);
            }
        });
    }

    function cancelLogout() {
        document.getElementById("divPopup").style.display = "none";
        document.getElementById("divmail").style.display = "block";
        return true;
    }

    function confirmLogout() {
        var isMobile = 1;
        var boxid = document.getElementById('HdnBox').value;
        if(boxid.length > 0){
            $.ajax({
                url: 'https://www.yupptv.com/auth/confirmLogout',
                type: 'GET',
                data: {
                    boxId: boxid
                },
                success: function (result) {
                    result = JSON.parse(result);
                    if (result.status == "1") {
                        var user  = document.getElementById('txtLogin').value;
                        var password = document.getElementById('txtpassword').value;
                        var countryCode = document.getElementById('LblCountrycode').innerHTML.replace("+", "");
                        var isNumeric = user.match(/^\d+$/);
                        if (isNumeric) {
                            user = countryCode + '-' + user;
                            isMobile = 1;
                        }
                        else{
                            user = user;
                            isMobile = 0;
                        }
                        signinWithApi(user,password,isMobile);
                    }
                    else{

                        document.getElementById("lblError").innerHTML = result.error.message;
                    }
                },
                error: function (e) {
                    console.log("error - signup resendOtp otp - " + e.statusText);
                }
            });

        }
    }

    function mySingnClick() {
        var x = document.getElementById('yupptvclose');
        var y = document.getElementById('yupptvopen');
        if (x.style.display === 'none') {
            x.style.display = 'block';
            y.style.display = 'none';

        } else {
            x.style.display = 'none';
            y.style.display = 'block';
        }
    }

    function goto(evt) {
        if (evt.target.id == "txtLogin1") {
            if (document.getElementById("divListCountries").style.display === "none") {
                document.getElementById('divListCountries').style.display = "block";
                document.getElementById('HdnValue').value = "Open";
            }
        }
        else if (evt.target.id == "btncountry" || evt.target.id == "ImgDefaultcountryFlag" || evt.target.id == "LblCountrycode" || evt.target.id == "spncountry") {
            CountryPop();
        }
        else {
            document.getElementById("divListCountries").style.display = "none";
        }
        return;
    }

    document.body.addEventListener('click', goto);


</script>