Your IP : 3.16.212.203


Current Path : /home/lentoinv/churchmr.com/report/
Upload File :
Current File : //home/lentoinv/churchmr.com/report/index.php

<?php 
    session_start(); ob_start();
	//error_reporting(0); 
	//@ini_set('display_error', 0);

 include('control.php'); 



 function loginUser($username,$password){
if(sqL1('mdata','phone',$username) != 1){ return 0; }
if(sqLx('mdata','phone',$username,'pass') != $password){return 0; }

$_SESSION['userdata'] = sqLr1('mdata', 'phone', $username);
$_SESSION['type'] = 4;
//for old platform
$data = json_decode($_SESSION['userdata']);
        $_SESSION['admin'] = $data->othername;
        $_SESSION['sn'] = $data->sn;
        $_SESSION['rid'] = $data->rid;
        $_SESSION['sid'] = $data->sid;
        $_SESSION['page']=3; 
header("location:dclm/myconverts.php");   exit;
return 4; 
 }

 function loginDistrict($username,$password){
if(sqL2('rcentre','district',$username,'pass',$password) != 1){ return 0; }

$_SESSION['userdata'] = sqLr2('rcentre', 'district', $username,'pass',$password);
$_SESSION['type'] = 1;
//for old platform
$data = json_decode($_SESSION['userdata']);
        $_SESSION['admin'] = $data->dc;
        $_SESSION['dsn'] = $data->sn;
        $_SESSION['rid'] = $data->rid;
        $_SESSION['sid'] = $data->sid;
        $_SESSION['page']=1; 

header("location:program.php");   exit;
return 1; 
 }

 function loginGroup($username,$password){
if(sqL2('zone','zone',$username,'pass',$password) != 1){ return 0; }
//if(sqLx('zone','zone',$username,'pass') != $password){return 0; }

$_SESSION['userdata'] = sqLr2('zone', 'zone', $username, 'pass', $password);
$_SESSION['type'] = 2;
//for old platform
$data = json_decode($_SESSION['userdata']);
        $_SESSION['admin'] = ucfirst($data->gc);
        $_SESSION['gid'] = $data->sn;
        $_SESSION['rid'] = $data->rid;
        $_SESSION['sid'] = $data->sid;
        $_SESSION['page'] = 2; 
header("location:dclm/programs.php");   exit;
return 2; 
 }

 function loginRegion($username,$password){
if(sqL1('admin','username',$username) != 1){ return 0; }
if(sqLx('admin','username',$username,'password') != $password){return 0; }

$_SESSION['userdata'] = sqLr1('admin', 'username', $username);
$_SESSION['type'] = 3;

//for old platform
$data = json_decode($_SESSION['userdata']);
               $_SESSION['admin'] = $data->firstname;
               $_SESSION['user'] = $data->usertype;
               $_SESSION['username'] = $username;
               $_SESSION['rid'] = $data->rid;
               $_SESSION['sid'] = $data->sid;
               $_SESSION['state'] = $data->state;
               $_SESSION['region'] = $data->region;
               $_SESSION['page'] = 4;
header("location:programreport.php"); exit;
return 3; 
 }

			
	 
   if(array_key_exists('login', $_POST)){

	    $username = strtolower($_POST['username']);
	   $password = $_POST['password'];
$msg = 'Invalid Login';
	   loginDistrict($username,$password);
	   loginRegion($username,$password);
	   loginGroup($username,$password);
     loginUser($username,$password);

		    }  
   
   
?>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>CHURCHMR | Login</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.5 -->
    <link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css">

    <!-- Ionicons -->
    <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="../dist/css/AdminLTE.min.css">
    <!-- iCheck -->
  
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

  </head>
<body class="">
    <div class="login-box">
      <center> <img src="../user/upload/user.jpg"> <h3>
        <a href="adminn.php"><b>RETREAT HEAD COUNT</b></a> </h3></center>
      <div class="login-box-body">
        <p class="login-box-msg">Sign in to manage your reports <br><font color="red"><?php echo $msg??''; ?></font></p>
        <form  method="post" enctype="multipart/form-data">
          <div class="form-group has-feedback">
            <input type="text" class="form-control" style="height:40px" placeholder="Location" name="username">
            <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
          </div>
          <div class="form-group has-feedback">
            <input type="password" class="form-control" style="height:40px" placeholder="Password" name="password">
            <span class="glyphicon glyphicon-lock form-control-feedback"></span>
          </div>
          <div class="row">
           
            <div class="col-md-12">
              <button type="submit" class="btn btn-primary btn-lg btn-block" style="width:100%" name="login">Sign In Here</button>
            </div><!-- /.col -->
          </div>
        </form>


      <!---  <a href="#">Admin</a><br>  ---->
        

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

    <!-- jQuery 2.1.4 -->
    <script src="plugins/jQuery/jQuery-2.1.4.min.js"></script>
    <!-- Bootstrap 3.3.5 -->
    <script src="bootstrap/js/bootstrap.min.js"></script>
    <!-- iCheck -->
   

  </body>
</html>

?>