<?php
defined('BASEPATH') OR exit('No direct script access allowed');

$errorMessage = $this->session->flashdata('error');

$title = "Output Books Cloud Signup";

if ($onpremises)
{
	$title = "Output Books On-Premises Register";
}
$title = 'Download and Register Billing Software';
?>
<div class="ui container" <?php echo $errorMessage ? "" : 'style="padding-top:1%"'; ?>>
<?php if (validation_errors() || $errorMessage) { ?>
	<div class="ui negative message"><i class="close icon"></i><p><?php echo $errorMessage ? $errorMessage : validation_errors(); ?></p></div>
<?php } ?>
	<div class="ui grid center aligned">
		<div class="row">
			<div class="sixteen wide tablet nine wide computer column">
				<div class="ui left aligned segment">
				<!-- <?php print_R($_GET); ?>-->
					<?php
						$q = (!empty($onpremises) ? "register" : "signup") . "?";

						if (!empty($_GET["ob_source"]))
						{
							$q .= "&ob_source=" . $_GET["ob_source"];
						}

						if (!empty($_GET["ref"]))
						{
							$q .= "&ref=" . $_GET["ref"];
						}

						if (!empty($_GET["ob_source_id"]))
						{
							$q .= "&ob_source_id=" . $_GET["ob_source_id"];
						}

						echo form_open($q, 'class="ui form" id="signup-form" target="_parent"');
/*
						<h1 class="ui header center aligned">
							<img src="img/logo.png" alt="stagblogo" class="ui small image">
						</h1>
*/
?>
						<h3 class="ui header center aligned"><?php echo $title; ?></h3><?php /*
						<div class="required field">
							<label>Username</label>
							<div class="ui fluid icon input">
								<input name="loginName" id="loginName" type="text" value="<?php echo set_value('loginName'); ?>" minlength="8" required autocomplete="off" />
								<i class="icon user outline"></i>
							</div>
						</div> */
						?>
						<div class="required field">
							<!--<label>Company Name</label>-->
							<div class="ui fluid input">
								<input name="company_name" id="company_name" type="text" placeholder="Company Name *" required autocomplete="off" value="<?php echo set_value('company_name'); ?>"/>
							</div>
						</div>
						<!-- div class="required field">
							<div class="ui fluid icon input">
								<input name="name" placeholder="User Name *" id="name" type="text" value="<?php echo set_value('name'); ?>" required autocomplete="off" />
								<i class="icon user outline"></i>
							</div>
						</div -->
						<div class="required field">
							<!--<label>Email</label>-->
							<div class="ui fluid icon input">
								<input name="email" id="email" placeholder="Email *" type="email" value="<?php echo set_value('email'); ?>" minlength="6" required autocomplete="off" />
								<i class="icon mail outline"></i>
							</div>
						</div>
						<div class="required field">
							<!--<label>Phone No</label>-->
							<div class="ui fluid icon input">
								<input name="phone" id="phone"  placeholder="Phone No *" type="tel" value="<?php echo set_value('phone'); ?>" required autocomplete="off" />
								<i class="icon phone"></i>
							</div>
						</div>
<?php /*
						<div class="required field">
							<!--<label>Password</label>-->
							<div class="ui fluid icon input">
								<input name="password" id="password" placeholder="Password *" type="password" minlength="6" required autocomplete="off" />
								<i class="icon key"></i>
							</div>
						</div>
						<div class="required field">
							<!--<label>Confirm Password</label>-->
							<div class="ui fluid icon input">
								<input name="passconf" id="passconf" placeholder="Confirm Password *" type="password" minlength="6" required autocomplete="off" />
								<i class="icon key"></i>
							</div>
						</div>
*/
?>						<div class="ui two fields">
							<div class="required field">
								<!--<label>Enter the word diplay on image</label>-->
								<div class="ui fluid input">
									<input name="captcha" type="text" placeholder="Captcha" required autocomplete="off" />
								</div>
							</div>
							<div class="field">
								<!--<label>&nbsp;</label>-->
								<?php echo $captcha; ?>
							</div>
						</div>
						<div class="field"><?php
							if ($onpremises)
							{
						?><label style="color:#999999">By clicking Register, you agree to our <a href="http://www.outputbooks.com/terms-of-service/" target="_blank">Terms of Service</a> and that you have read our <a href="http://www.outputbooks.com/privacy-policy/" target="_blank">Privacy Policy</a></label>
							<input type="hidden" name="onpremises" value="1" /><?php
							}
							
							if (!empty($_GET["ob_source"]))
							{
								echo '<input type="hidden" name="ob_source" value="' . $_GET["ob_source"] . '" />';
							}

							if (!empty($_GET["ob_source_id"]))
							{
								echo '<input type="hidden" name="ob_source_id" value="' . $_GET["ob_source_id"] . '" />';
							}

							?><button type="submit" name="submit" class="ui teal right labeled icon button fluid"><?php echo $onpremises ? "Register" : "Create Account"; ?></button>
						</div>
						<div class="field">
							<a href="<?php echo site_url('login'); ?>"><i class="arrow left icon"></i>Login</a>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</div>
<style>
body {
	overflow-y:auto;
}
input{
    font-size: 15px !important ;
}
::placeholder{
	font-size: 14px !important;
	color: #757575 !important;
}
@media only screen and (max-width: 767px) {
	body {
		zoom: 1 !important;
	}
}
</style>
