<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Sacco Manager | Log in</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.4 -->
    <link href="<?php echo base_url();?>bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <!-- Font Awesome Icons -->
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <!-- Theme style -->
    <link href="<?php echo base_url();?>dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
    <!-- Custom Styles -->
    <link href="<?php echo base_url();?>dist/css/custom-styles.css" rel="stylesheet" type="text/css" />
    <style>
	.title{
		font-size:16px;
		font-weight:bold;
		}
	</style>

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body class="login-page">
    <div class="login-box">
      <div class="login-logo">
        <a href="#"><b>$acco Manager</b>-Login</a>
      </div><!-- /.login-logo -->
      <div class="login-box-body">
        <p class="login-box-msg">Multiple Accounts found.Select one(by clicking) to proceed</p>
        <form>
           <?php print_r($accounts); ?>
        </form>

      </div><!-- /.login-box-body -->
    </div><!-- /.login-box -->

    <!-- jQuery 2.1.4 -->
    <script src="<?php echo base_url();?>plugins/jQuery/jQuery-2.1.4.min.js" type="text/javascript"></script>
    <!-- Bootstrap 3.3.2 JS -->
    <script src="<?php echo base_url();?>bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script>
	
	function ajaxLogin(user_id) 
	{
		//var url = "http://localhost/saccomanager/";
		var str = window.location.href;
		if(str.search(/www/i)==-1)
		{
			var url = "http://saccomanager.com/";	
		}
		else
		{
			var url = "http://www.saccomanager.com/";	
		}
						  
		var user_id = user_id;
		var postForm = {'user_id' : user_id};
		$.ajax({ 
			type 		: 'POST',
			url 		: url+'dashboard/select_user_account',  
			data 		: postForm, 
			success 	: function(response) 
						{
							if(response == 2)
							{
								document.location.href = url+'dashboard/deactivated_account';
							}
							else if(response == 3)
							{
								document.location.href = url+'dashboard/welcome';
							}
							else
							{
								document.location.href = url+'dashboard/unauthorised';
							}
						}
		});					
	}
				   
	</script>
  </body>
</html>
