<? global $vis_language; 
    $database=new class_database();
    $result=$database->query_exec('select * from '.VIS_TABLE_PREFIX.'single_login WHERE (login_type=16) and domain_id='.VIS_DOMAIN);
    $row=$database->fetch_result($result);
    $result1=$database->query_exec('select * from '.VIS_TABLE_PREFIX.'single_login WHERE (login_type=17) and domain_id='.VIS_DOMAIN);
    $row1=$database->fetch_result($result1);	
    $result2=$database->query_exec('select * from '.VIS_TABLE_PREFIX.'single_login WHERE (login_type=18) and domain_id='.VIS_DOMAIN);
    $row2=$database->fetch_result($result2);
	$result3=$database->query_exec('select * from '.VIS_TABLE_PREFIX.'single_login WHERE (login_type=19) and domain_id='.VIS_DOMAIN);
    $row3=$database->fetch_result($result3);
	$result4=$database->query_exec('select * from '.VIS_TABLE_PREFIX.'single_login WHERE (login_type=23) and domain_id='.VIS_DOMAIN);
    $row4=$database->fetch_result($result4);
	$result5=$database->query_exec('select * from '.VIS_TABLE_PREFIX.'single_login WHERE (login_type=26) and domain_id='.VIS_DOMAIN);
    $row5=$database->fetch_result($result5);

    ?>
 <section class="container m-t-md">
   <div class="row">
      <div class="col-md-12">
        <section class="panel shadow-none">
            
            <div class="panel-body">
                <section id="content" class="wrapper-md animated fadeInUp">
                    <header class="vis_login_head container aside-xl">
                        <?php  if(isset($operation['reg_message']) && $operation['reg_message']!='') {?>
				<script> $("#<?= (($operation['success']==1)?'vis_submit_msg_div':'vis_submit_err_div'); ?>").show(); $("#<?= (($operation['success']==1)?'vis_submit_msg_div':'vis_submit_err_div'); ?>").html('<? echo $operation['reg_message']; ?>'); </script> <?php } ?>
                        <div id="vis_login_msg_div" class="alert text-center" style="display:none;">
                            <? $flag=0;
                                if(isset($request_data['vis_action_data'][3]) && $request_data['vis_action_data'][3]=='password') { ?>
                            <strong><? echo $vis_language['MSGINVALIDLOGINDETAILS']; ?></strong><? $flag=1; }
                                if(isset($request_data['vis_action_data'][3]) && $request_data['vis_action_data'][3]=='banned') { ?>
                            <strong><? echo $vis_language['MSGACCSSDND']; ?></strong><? $flag=1; }
                                if(isset($request_data['vis_action_data'][3]) && $request_data['vis_action_data'][3]=='disapproved') { ?>
                            <strong><? echo $vis_language['TXTAPPROVALPENDING']; ?></strong><? $flag=1; }
                            if(isset($request_data['vis_action_data'][3]) && $request_data['vis_action_data'][3]=='notverified') { ?>
                            <strong><? echo $vis_language['TXTVERIFICATIONPENDING']."<Br>click <b><a class='link' href='?/home/resend_verification_link'>here</a></b> for resend verification link"; ?></strong><? $flag=1; }
                                if(isset($operation['message']) && $operation['message']) { ?>
                            <strong><? echo $operation['message']; ?></strong><? $flag=1; } 
                             if(isset($_SESSION['successmessage']) && $_SESSION['successmessage']) { ?>
                            <strong><? echo $_SESSION['successmessage']; ?></strong><? $operation['success']=1; $flag=1; unset($_SESSION['successmessage']); } 
                                if($flag==1) echo '<script> $("#vis_login_msg_div strong").parent().addClass("'.(($operation['success']==1)?'alert-success':'alert-danger').'").show().fadeOut(15000);
                                setTimeout( function(){ $("#vis_login_msg_div").removeClass("'.(($operation['success']==1)?'alert-success':'alert-danger').'"); }, 15000);</script>'; ?>
                        </div>
                    </header>
                    <div class="container aside-xl">
                        <section class="m-b-lg">
                            <form id="vis_form_login" name="vis_form_login" method="post">
                                <div class="list-group">
                                    <div class="login-list-group-item">
                                        <input type="text" placeholder="<? echo $vis_language['TXTEMAIL']; ?>" class="form-control no-border" name="vis_email" id="vis_email" />
                                    </div>
                                </div>
                                <div class="list-group">
                                    <div class="login-list-group-item">
                                        <input type="password" placeholder="<? echo $vis_language['TXTPASSWORD']; ?>" class="form-control no-border" name="vis_password"  id="vis_password" />
                                    </div>
                                </div>
                                <input type="hidden" name="vis_operation" value="check_login" /><input type="hidden" name="vis_module" value="home" /> 
                                <?if( strpos($operation['vis_action'],'#/home/login') === FALSE){?><input type="hidden" name="vis_prev_action" value="<?= $operation['vis_action'];?>" /><? } ?>
                                
                                <button type="submit" class="btn btn-lg btn-primary btn-block"><? echo $vis_language['TXTLOGIN']; ?></button>
                                <?php  include(VIS_PATH_TEMPLATE.'social_media_login.php'); ?> 
                                <div class="m-t-md text-center">
                                    <?php if($row['is_enabled']!='0' || $row1['is_enabled']!='0' || $row2['is_enabled']!='0'){ ?>  
                                   <!-- <label>Login with</label>-->
                                    <?php }?>  
                                    <?php if($row!='-1' && $row['login_type']=='16' && $row['is_enabled']=='1'){?>
                                    <a  href="<?php echo htmlspecialchars($loginURL);?>"><span class="btn btn-lg btn-defualt m-t vh-facebook-bgcolor" title="Login With Facebook" ><i class="vh vh-facebook"></i></span></a>
                                    <?php }?>
                                    <?php if($row1!='-1' && $row1['login_type']=='17' && $row1['is_enabled']=='1'){?>
                                    <a href="index.php?/client/check_twitter_login"><span class="btn btn-lg btn-defualt m-t vh-twitter-bgcolor" title="Login With Twitter" ><i class="vh vh-twitter"></i></span></a>
                                    <?php }?> 
                                    <?php if($row2!='-1' && $row2['login_type']=='18' && $row2['is_enabled']=='1'){?>        
                                    <a href="<?php echo $authUrl;?>"><span class="btn btn-lg btn-defualt m-t vh-google-bgcolor" m-t title="Login With Gmail"><i class="vh vh-google"></i></span></a>
                                    <?php }?>
                                     <?php if($row3!='-1' && $row3['login_type']=='19' && $row3['is_enabled']=='1'){?>        
                                    <a  href="index.php?/client/linkedin_auth"><span class="btn btn-lg btn-defualt m-t vh-linkedin-bgcolor" title="Login With LinkedIn"><i class="vh vh-linkedin"></i></span></a>
                                    <?php }
									  if($row5!='-1' && $row5['login_type']=='26' && $row5['is_enabled']=='1'){?> 
									<a href="javascript:void(0);" id="SignIn" onclick="signIn();"><span class="btn btn-lg btn-defualt m-t vh vh-ms-windows-bgcolor" title="Login With Office 365" ><i class="vh vh-ms-windows"></i></span></a>
									 <?php } /*if($row4!='-1' && $row4['login_type']=='23' && $row4['is_enabled']=='1'){?>     
                                    <a  href="https://login.salesforce.com/services/oauth2/authorize?response_type=code&client_id=<?= $row4['host_name'];?> &client_secret=<?= $row4['user_name'];?>&redirect_uri=<?= $row4['db_password'];?>"><span class="btn btn-lg btn-defualt m-t vh-salesforce-bg" title="Login With Salesforce"><i class="vh vh-salesforce"></i></span></a>
                                    <?php }*/?>
                                </div>
                                <div class="text-center m-t m-b"><a href="index.php?/home/forgot-password"><small><?= $vis_language['TXTFORGOTPASSWORD']; ?>?</small></a></div>
                                <div class="line line-dashed"></div>
								<? if(VIS_HEAD_MENU_REGISTER == 1) {?>
                                <p class="text-muted text-center"><small><?= $vis_language['TXTDONOTHAVEANACCOUNT']; ?></small></p>
                                <a href="index.php?/client/register" class="btn btn-lg btn-default btn-block"><?= $vis_language['TXTREGISTER']; ?></a>
								<? } ?>
                            </form>
                        </section>
                    </div>
                </section>
            </div>
        </section>        
        <!-- / .panel -->
    </div>
</div>
 </section>    
<script>
/*var filePath = 'http://iamdemo.com/vision4/tejas/index.php?/setting/widget';
var iframe='<iframe id="frame" name="widget" src ="#" frameborder="no" ></iframe>';
document.write(iframe); 
var myIframe = parent.document.getElementById("frame");
myIframe.height = '100%';
myIframe.width = '100%';
 
myIframe.src = filePath;
myIframe.style.border = "0px";
myIframe.style.padding = "0px";
myIframe.style.margin = "0px";
myIframe.style.top = "0px";
myIframe.style.bottom = "0px";
myIframe.style.right = "0px";
myIframe.style.left = "0px";
myIframe.style.position = "fixed";*/
</script>
