<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<?php
/**
 * iCrew v4 Premium - Virtual Airline Crew Center
 * Copyright (c) 2017 iCrewSystems
 *
 * This CrewCenter & and it's Modules (which are distinguished, and limited to unless specified)
 * are protected by copyright under Indian Copyright Act, 1957, with the 2012 amendments
 * No part of the website design or layout may be reproduced or transmitted in any form or by any other
 * means electronic or mechanical to include photocopying, recording, reproducing, or electronic storage.
 * Any such act represents a copyright violation and theft of intellectual property owned by iCrewSystems.
 *
 * @author: Leonard Selvaraja
 * @copyright: Copyright (c) 2017, iCrewSystems
 * @link http://www.icrewsystems.com
 * @service name: iCrewSystems Virtual Airline Premium Services (with additions)
 * Caution : NO SUPPORT WILL BE PROVIDED IF ANY MODULE / TEMPLATE IS FOUND TO BE TAMPERED WITH.
 *
 */

?>
<!-- Login Full Background -->
	<?php
		$ref_pics = file_get_contents(LOGIN_BACKGROUND_FILE_PATH);
		// $ref_pics = file_get_contents(SITE_ROOT.'iCrew/backgrounds/backgrounds.txt');
		$login_form_pictures = explode(',',$ref_pics); //Split it by ','

	/* USE THIS if allow_url_open is not able to be set to 1 */

	// $url = LOGIN_BACKGROUND_FILE_PATH;
	// $ch = curl_init($url);
	// curl_setopt($ch, CURLOPT_ENCODING,"");
	// curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	// curl_setopt($ch, CURLOPT_HEADER, true);
	// curl_setopt($ch, CURLINFO_HEADER_OUT, true);
	// curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
	// curl_setopt($ch, CURLOPT_FILETIME, true);
	// curl_setopt($ch, CURLOPT_USERAGENT,"Mozilla/5.0 (Windows NT 5.1; rv:32.0) Gecko/20100101 Firefox/32.0");
	// curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 100);
	// curl_setopt($ch, CURLOPT_VERBOSE, true);
	// curl_setopt($ch, CURLOPT_AUTOREFERER, true);
	// curl_setopt($ch, CURLOPT_TIMEOUT,100);
	// curl_setopt($ch, CURLOPT_FAILONERROR,true);
	// $data = curl_exec($ch);
	//  //$ref_pics = LOGIN_BACKGROUND_FILE_PATH;
	// $login_form_pictures = explode(',',$data); //Split it by ','



	// $dir = PATH_TO_BG;
	// $dh  = opendir($dir);
	// 	while (false !== ($filename = readdir($dh))) {
	//   		$files[] = $filename;
	// }

	// $rand = rand(1, count($images));
	// $images = preg_grep ('/\.jpg$/i', $files);

	// echo PATH_TO_BG.$images[$rand];
	?>
	<!---->
	<style>
		.login_bg {
			-webkit-filter: blur(3px); /* Safari 6.0 - 9.0 */
			filter: blur(3px);
		}
	</style>
	<img src="<?php echo $login_form_pictures[array_rand($login_form_pictures)]; ?>" class="login_bg full-bg animation-pulseSlow">
  <!-- <img src="https://cdn.discordapp.com/attachments/755274134526623845/758416855609376839/unknown.png" class="login_bg full-bg animation-pulseSlow">   -->
<!-- END Login Full Background -->

<div class="container">
	<div class="row">
		<div class="col-md-12">
			<div id="login-container" class="animation-fadeIn">
		    <div class="login-title text-center">

		        <!--<h1><img src="https://cdn.discordapp.com/attachments/600190163544571904/632285555878789171/ics_logo.png" style="height: 80%; width: 80%;"><br>-->
		        <h1><img src="<?php echo SITE_URL; ?>/iCrew/ics_logo.png" style="height: 40%; width: 80%;">
       			</h1>

    		</div>
    <!-- Login Block -->
    <div class="block push-bit">
    	<?php
        if(isset($message))
            echo '<div class="alert alert-danger">
            <h4><i class="icon fa fa-exclamation-triangle"></i> Information</h4> '.$message.'</div>';

            if(isset($success))
            echo '<div class="alert alert-success">
            <h4>Information</h4> '.$success.'</div>';
        ?>
        <!-- Login Form -->
