<?php
// define variables and set to empty values

include('../Secure/Cred.php');

	if ($_SERVER["REQUEST_METHOD"] == "POST") {
	  $cmpxname = trim(strtoupper($_POST["company"]));
	  $cmpxcode = trim(strtoupper($_POST["companycode"]));
	  $retail = trim(strtoupper($_POST["retail"]));
	  $cmpxlink =  time().rand().substr($cmpxname,1,1);

		
	  $m_errs = conn("INSERT `web_app_enrollment_form` ( `id` , `company` , `link`, `company_code`, `retail` ) VALUES ( NULL , '".$cmpxname."', '".$cmpxlink."','".$cmpxcode."','".$retail."' );");	

	}

        
    $cmplist='';
	
	$m_queues = conn("SELECT * FROM (`web_app_enrollment_form`)");
	while(list($idx,$companyx,$linkx,$company_codex) = mysqli_fetch_array($m_queues,MYSQLI_NUM))
	{		
	$cmplist.='<li> <div class="info"> <h3><a class="third after" href="'.'http://'.$_SERVER['HTTP_HOST'].'/enrollnow/index.php?cllocation='.$linkx.'">'.$companyx.' ('.$company_codex.')</a></h3> </div> </li>';	
	
	}
	$cmplist.='<li> <div class="info"> <h3><a class="third after" href=""></a></h3> </div> </li>';
?>
 

<!DOCTYPE html>
<html style="background-image: url(../final_20864245705555.5b18e0a95657b9.83368454.jpg); }">
<head>
    <meta charset="UTF-8">
    <title>Alleanza Form Admin</title>
    <style>
body{font-size:100%;
   background:url("./blurred-background-2.jpg")no-repeat center center fixed;
   -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
  font-family: "Lucida Grande", sans-serif;
}
.wrapper{
  
  width:70%;
  margin:0 auto;
}

ul{
  maring:0;
  padding:0px;
 
  list-style:none;
}
ul li{

    padding:20px;
    margin-top:20px;
    background-color:rgba(255,255,255,0.9);
   -webkit-border-radius:3px;
   -moz-border-radius:3px;
    border-radius:3px;
   -webkit-box-shadow: 0px 0px 2px #888888;
   -moz-box-shadow: 0px 0px 2px #888888;
     box-shadow: 0px 0px 2px #888888;
    
}
.head{ 
  padding:20px;
  font-size: 36px;
  text-align:center;
  background-color:rgba(255,255,255,0.9);
  color:#00f;
  -webkit-border-radius:3px;
   -moz-border-radius:3px;
    border-radius:3px;
  -webkit-box-shadow: 0px 0px 2px #888888;
  -moz-box-shadow: 0px 0px 2px #888888;
     box-shadow: 0px 0px 2px #888888;
}

li span{
  font-size:16px;

  color:#a0a29d;
  margin-right:40px;
   height: 32px;
  line-height: 32px;

 
}
.info{
  width:75%;

  margin:0;
  margin-left:5%;
  display:inline-block;

  
}

.social{
   
   padding-top:20px; 
}

h3{

  color:#767a7b;
  margin:0;
  padding-bottom:0px;
  font-size:26px;
  font-weight:100;
}

#contact input[type="text"],
#contact input[type="email"],
#contact input[type="tel"],
#contact input[type="url"],
#contact textarea {
  width: 70%;
  border: 1px solid #ccc;
  background: #FFF;
  margin: 0 0 5px;
  padding: 10px;
}

#contact input[type="text"]:hover,
#contact input[type="email"]:hover,
#contact input[type="tel"]:hover,
#contact input[type="url"]:hover,
#contact textarea:hover {
  -webkit-transition: border-color 0.3s ease-in-out;
  -moz-transition: border-color 0.3s ease-in-out;
  transition: border-color 0.3s ease-in-out;
  border: 1px solid #aaa;
}

fieldset {
  border: medium none !important;
  margin: 0 0 10px;
  min-width: 100%;
  padding: 0;
  width: 100%;
} 

#contact text {
  height: 100px;
  max-width: 100%;
  resize: none;
}

#contact input[type="submit"] {
  cursor: pointer;
  width: 30%;
  border: none;
  background: #4CAF50;
  color: #FFF;
  margin: 0 0 5px;
  padding: 10px;
  font-size: 15px;
}


a,a:visited,a:hover,a:active{
  -webkit-backface-visibility:hidden;
          backface-visibility:hidden;
	position:relative;
  transition:0.5s color ease;
	text-decoration:none;
	font-size:1.0em;
}
a:hover{
	color:#d73444;
}
a.before:before,a.after:after{
  content: "";
  transition:0.5s all ease;
  -webkit-backface-visibility:hidden;
          backface-visibility:hidden;
  position:absolute;
}
a.after:after{
  bottom:-0.25em;
}
a.before:before,a.after:after{
  height:5px;
  height:0.35rem;
  width:0;
  background:#d73444;
}
a.third:after,a.sixth:before,a.sixth:after{
  left:50%;
  -webkit-transform:translateX(-50%);
          transform:translateX(-50%);
}
a.before:hover:before,a.after:hover:after{
  width:100%;
}
    </style>
    
<script>
    if ( window.history.replaceState ) {
        window.history.replaceState( null, null, window.location.href );
    }
</script>    
    
</head>
<body>
<div class="wrapper">
    
  <div style="text-align:center">
		<img alt="" class="form-image" style="border:0" src="../Red-logo.png" height="212px" width="508px" data-component="image">
  </div>
  <ul class="menu">
      <div class="head">
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" id="contact" method="post" name="contact">
<fieldset><input  id="company"  name="company" placeholder="Company Name..." type="text" tabindex="1" required autofocus/></fieldset>
<fieldset><input  id="companycode"  name="companycode" placeholder="Company Code" type="text" tabindex="1" required autofocus/></fieldset>
<fieldset><input  id="retail"  name="retail" placeholder="Retail? Yes or No" type="text" tabindex="1" required autofocus/><input type="submit" value="Add Company" /></fieldset>
</form></div> 
  <ul>
    <?php echo $cmplist;?>
  </ul>

  </ul>
</div>
</body>
</html>
