<?php echo $this->render('module/header_mobi.phtml'); ?>

<script type="text/javascript" language="javascript">

	$(document).ready(function () {

		<?php if( isset( $this->client_registration ) ){ ?>
			alertify.success("<i class='fa fa-check'></i> <?php echo @Lib_Lang::translate(front_account_youraccount_success); ?>");;
		<?php } ?>

		<?php if( isset( $this->client_registration_cp ) ){ ?>
			alertify.success("<i class='fa fa-check'></i> <?php echo @Lib_Lang::translate(front_account_changepass_success); ?>");;
		<?php } ?>

		<?php if( isset( $this->add_opinion ) ){ ?>
			alertify.success("<i class='fa fa-check'></i> <?php echo @Lib_Lang::translate(front_account_add_opinion_success); ?>");;
		<?php } ?>

		$('#formReg').validate({
			errorClass: "formError",
			errorElement: "div",
			rules: {
				client_firstname: {
					required: true
				},
				client_secondname: {
					required: true
				},
				client_address: {
					required: true
				},
				client_zipcode: {
					required: true
				},
				client_city: {
					required: true
				},
				client_country: {
					required: true
				},
				client_phone: {
					required: true
				}
			},
			messages: {
				client_firstname: {
					required: "<?php echo @Lib_Lang::translate(front_registration_required); ?>"
				},
				client_secondname: {
					required: "<?php echo @Lib_Lang::translate(front_registration_required); ?>"
				},
				client_address: {
					required: "<?php echo @Lib_Lang::translate(front_registration_required); ?>"
				},
				client_zipcode: {
					required: "<?php echo @Lib_Lang::translate(front_registration_required); ?>"
				},
				client_city: {
					required: "<?php echo @Lib_Lang::translate(front_registration_required); ?>"
				},
				client_country: {
					required: "<?php echo @Lib_Lang::translate(front_registration_required); ?>"
				},
				client_phone: {
					required: "<?php echo @Lib_Lang::translate(front_registration_required); ?>"
				}
			}
		});	

		$('#formRegCP').validate({
			errorClass: "formError",
			errorElement: "div",
			rules: {
				client_pass: {
					required: true
				},
				client_pass_rep: { 
					equalTo: "#client_pass"				
				}
			},
			messages: {
				client_pass: {
					required: "<?php echo @Lib_Lang::translate(front_registration_required); ?>"
				},
				client_pass_rep: { 
					equalTo: "<?php echo @Lib_Lang::translate(front_registration_pass); ?>"				
				}
			}
		});	
	
	});

</script>


<div class="conBox">
<div class="container widthDiv" style="padding-top:15px;">
	<div class="row">
		<div class="col-lg-12 categoryBox" style="padding-bottom:15px;">
		
		
		
		<?php if( $this->rowClient['client_opinion'] == 1 ){ ?>
		<div class="col-lg-8">
		<h1 style="margin:0;font-size:26px;"><?php echo @Lib_Lang::translate(front_account_opinion); ?></h1>
		</div>
		<div class="col-lg-4">
			<a href="<?php echo @$this->url(array('controller' => 'account', 'action' => 'addopinion'), 'default', true); ?>" class="form-control" style="text-align:center;"><?php echo @Lib_Lang::translate(front_account_opinion_add); ?></a>
		</div>
		<br /><br />
		<hr />
		<br />
		<?php } ?>
		
		
		
		
		
		
		
		
		
		
		
		
		
		<div class="col-lg-8">
		<h1 style="margin:0;font-size:26px;"><?php echo @Lib_Lang::translate(front_account_youraccount_top); ?></h1>
		</div>
		<div class="col-lg-4">
			<a href="<?php echo @$this->url(array('controller' => 'account', 'action' => 'historyorder'), 'default', true); ?>" class="form-control" style="text-align:center;"><?php echo @Lib_Lang::translate(front_account_youraccount_history_top); ?></a>
		</div>
		
		<form id="formReg" method="post">
		
		<div class="row vcenter">
			<div class="col-lg-2"></div>
			<div class="col-lg-2 text-right vcenter"><?php echo @Lib_Lang::translate(front_account_registration_login); ?></div>
			<div class="col-lg-6 vcenter"><?php echo$this->rowClient['client_login']; ?></div>
			<div class="col-lg-2"></div>
		</div>
		
		<div class="row vcenter">
			<div class="col-lg-2"></div>
			<div class="col-lg-2 text-right vcenter"><?php echo @Lib_Lang::translate(front_account_registration_type); ?></div>
			<div class="col-lg-6 vcenter">
			<?php if( $this->rowClient['client_type'] == 0 ){ ?>
				<?php echo @Lib_Lang::translate(front_client_type0); ?>
			<?php } ?>
			
			<?php if( $this->rowClient['client_type'] == 1 ){ ?>
				<?php echo @Lib_Lang::translate(front_client_type1); ?>
			<?php } ?>
			</div>
			<div class="col-lg-2"></div>
		</div>
		
		<?php if( $this->rowClient['client_type'] == 1 ){ ?>
				
	
<script type="text/javascript" language="javascript">

	$(document).ready(function () {		
		$("#formReg").validate(); 
		$( '[name="client_company"]' ).rules( "add", {
		  required: true,
		  messages: {
				required: "<?php echo @Lib_Lang::translate(front_registration_required); ?>"
			}
		});
		$( '[name="client_nip"]' ).rules( "add", {
		  required: true,
		  messages: {
			required: "<?php echo @Lib_Lang::translate(front_registration_required); ?>"
		  }
		});	
	});

</script>
		
		<div class="row vcenter">
			<div class="col-lg-2"></div>
			<div class="col-lg-2 text-right vcenter"><?php echo @Lib_Lang::translate(front_account_registration_company); ?></div>
			<div class="col-lg-6"><input name="client_company" value="<?php echo$this->rowClient['client_company']; ?>" class="form-control" /></div>
			<div class="col-lg-2"></div>
		</div>
		
		<div class="row vcenter">
			<div class="col-lg-2"></div>
			<div class="col-lg-2 text-right vcenter"><?php echo @Lib_Lang::translate(front_account_registration_nip); ?></div>
			<div class="col-lg-6"><input name="client_nip" value="<?php echo$this->rowClient['client_nip']; ?>" class="form-control" /></div>
			<div class="col-lg-2"></div>
		</div>
				
				
				
		<?php } ?>
		
		
		
		
		<div class="row vcenter">
			<div class="col-lg-2"></div>
			<div class="col-lg-2 text-right vcenter"><?php echo @Lib_Lang::translate(front_account_registration_firstname); ?></div>
			<div class="col-lg-6"><input name="client_firstname" value="<?php echo$this->rowClient['client_firstname']; ?>" class="form-control" /></div>
			<div class="col-lg-2"></div>
		</div>
		
		<div class="row vcenter">
			<div class="col-lg-2"></div>
			<div class="col-lg-2 text-right vcenter"><?php echo @Lib_Lang::translate(front_account_registration_secondname); ?></div>
			<div class="col-lg-6"><input name="client_secondname" value="<?php echo$this->rowClient['client_secondname']; ?>" class="form-control" /></div>
			<div class="col-lg-2"></div>
		</div>
		
		<div class="row vcenter">
			<div class="col-lg-2"></div>
			<div class="col-lg-2 text-right vcenter"><?php echo @Lib_Lang::translate(front_account_registration_address); ?></div>
			<div class="col-lg-6"><input name="client_address" value="<?php echo$this->rowClient['client_address']; ?>" class="form-control" /></div>
			<div class="col-lg-2"></div>
		</div>
		
		<div class="row vcenter">
			<div class="col-lg-2"></div>
			<div class="col-lg-2 text-right vcenter"><?php echo @Lib_Lang::translate(front_account_registration_zipcode); ?></div>
			<div class="col-lg-6"><input name="client_zipcode" value="<?php echo$this->rowClient['client_zipcode']; ?>" class="form-control" /></div>
			<div class="col-lg-2"></div>
		</div>
		
		<div class="row vcenter">
			<div class="col-lg-2"></div>
			<div class="col-lg-2 text-right vcenter"><?php echo @Lib_Lang::translate(front_account_registration_city); ?></div>
			<div class="col-lg-6"><input name="client_city" value="<?php echo$this->rowClient['client_city']; ?>" class="form-control" /></div>
			<div class="col-lg-2"></div>
		</div>
		
		<div class="row vcenter">
			<div class="col-lg-2"></div>
			<div class="col-lg-2 text-right vcenter"><?php echo @Lib_Lang::translate(front_account_registration_country); ?></div>
			<div class="col-lg-6"><input name="client_country" value="<?php echo$this->rowClient['client_country']; ?>" class="form-control" /></div>
			<div class="col-lg-2"></div>
		</div>
		
		<div class="row vcenter">
			<div class="col-lg-2"></div>
			<div class="col-lg-2 text-right vcenter"><?php echo @Lib_Lang::translate(front_account_registration_phone); ?></div>
			<div class="col-lg-6"><input name="client_phone" value="<?php echo$this->rowClient['client_phone']; ?>" class="form-control" /></div>
			<div class="col-lg-2"></div>
		</div>
		
<script type="text/javascript" language="javascript">

	$(document).ready(function () {	
	
		<?php if( $this->rowClient['client_shipment'] == 0 ){ ?>
			$('.shipmentBox').hide();
		<?php } ?>
	
		$('[name="client_shipment"]').change(function(){		
			var s = $(this).val();
			$("#formReg").validate(); 
			if( s == 0 ){
				$('.shipmentBox').hide();
				$( '[name="client_shipment_name"]' ).rules( "remove" );
				$( '[name="client_shipment_address"]' ).rules( "remove" );
				$( '[name="client_shipment_zipcode"]' ).rules( "remove" );
				$( '[name="client_shipment_city"]' ).rules( "remove" );
				$( '[name="client_shipment_country"]' ).rules( "remove" );
			}else{
				$('.shipmentBox').show();
				$( '[name="client_shipment_name"]' ).rules( "add", {
				  required: true,
				  messages: {
					required: "<?php echo @Lib_Lang::translate(front_registration_required); ?>"
				  }
				});
				$( '[name="client_shipment_address"]' ).rules( "add", {
				  required: true,
				  messages: {
					required: "<?php echo @Lib_Lang::translate(front_registration_required); ?>"
				  }
				});
				$( '[name="client_shipment_zipcode"]' ).rules( "add", {
				  required: true,
				  messages: {
					required: "<?php echo @Lib_Lang::translate(front_registration_required); ?>"
				  }
				});
				$( '[name="client_shipment_city"]' ).rules( "add", {
				  required: true,
				  messages: {
					required: "<?php echo @Lib_Lang::translate(front_registration_required); ?>"
				  }
				});
				$( '[name="client_shipment_country"]' ).rules( "add", {
				  required: true,
				  messages: {
					required: "<?php echo @Lib_Lang::translate(front_registration_required); ?>"
				  }
				});
			}
		});
			
	});

</script>	
		
		<div class="row vcenter">
			<div class="col-lg-2"></div>
			<div class="col-lg-2 text-right vcenter"><?php echo @Lib_Lang::translate(front_account_registration_shipment); ?></div>
			<div class="col-lg-6">
			
				<select name="client_shipment" class="form-control">
					<option value="0" <?php if( $this->rowClient['client_shipment'] == 0 )echo'selected'; ?>><?php echo @Lib_Lang::translate(front_account_registration_shipment_0); ?></option>
					<option value="1" <?php if( $this->rowClient['client_shipment'] == 1 )echo'selected'; ?>><?php echo @Lib_Lang::translate(front_account_registration_shipment_1); ?></option>
				</select>
			
			</div>
			<div class="col-lg-2"></div>
		</div>
		
		
		
		<div class="shipmentBox">
		
		<div class="row vcenter">
			<div class="col-lg-2"></div>
			<div class="col-lg-2 text-right vcenter"><?php echo @Lib_Lang::translate(front_account_registration_shipment_name); ?></div>
			<div class="col-lg-6"><input name="client_shipment_name" value="<?php echo$this->rowClient['client_shipment_name']; ?>" class="form-control" /></div>
			<div class="col-lg-2"></div>
		</div>
		
		<div class="row vcenter">
			<div class="col-lg-2"></div>
			<div class="col-lg-2 text-right vcenter"><?php echo @Lib_Lang::translate(front_account_registration_shipment_address); ?></div>
			<div class="col-lg-6"><input name="client_shipment_address" value="<?php echo$this->rowClient['client_shipment_address']; ?>" class="form-control" /></div>
			<div class="col-lg-2"></div>
		</div>
		
		<div class="row vcenter">
			<div class="col-lg-2"></div>
			<div class="col-lg-2 text-right vcenter"><?php echo @Lib_Lang::translate(front_account_registration_shipment_zipcode); ?></div>
			<div class="col-lg-6"><input name="client_shipment_zipcode" value="<?php echo$this->rowClient['client_shipment_zipcode']; ?>" class="form-control" /></div>
			<div class="col-lg-2"></div>
		</div>
		
		<div class="row vcenter">
			<div class="col-lg-2"></div>
			<div class="col-lg-2 text-right vcenter"><?php echo @Lib_Lang::translate(front_account_registration_shipment_city); ?></div>
			<div class="col-lg-6"><input name="client_shipment_city" value="<?php echo$this->rowClient['client_shipment_city']; ?>" class="form-control" /></div>
			<div class="col-lg-2"></div>
		</div>
		
		<div class="row vcenter">
			<div class="col-lg-2"></div>
			<div class="col-lg-2 text-right vcenter"><?php echo @Lib_Lang::translate(front_account_registration_shipment_country); ?></div>
			<div class="col-lg-6"><input name="client_shipment_country" value="<?php echo$this->rowClient['client_shipment_country']; ?>" class="form-control" /></div>
			<div class="col-lg-2"></div>
		</div>
		
		</div>
		
		
		<div class="row vcenter">
			<div class="col-lg-2"></div>
			<div class="col-lg-2 text-right vcenter"></div>
			<div class="col-lg-6"><input name="client_registration" class="form-control" type="submit" value="<?php echo @Lib_Lang::translate(front_account_youraccount_submit); ?>" /></div>
			<div class="col-lg-2"></div>
		</div>
		</form>
		
		
		<h1 style="margin:0;font-size:26px;"><?php echo @Lib_Lang::translate(front_account_youraccount_changepass); ?></h1>		
		<form id="formRegCP" method="post">
		
		
		
		<div class="row vcenter">
			<div class="col-lg-2"></div>
			<div class="col-lg-2 text-right vcenter"><?php echo @Lib_Lang::translate(front_account_registration_pass); ?></div>
			<div class="col-lg-6"><input type="password" id="client_pass" name="client_pass" class="form-control" /></div>
			<div class="col-lg-2"></div>
		</div>
		
		<div class="row vcenter">
			<div class="col-lg-2"></div>
			<div class="col-lg-2 text-right vcenter"><?php echo @Lib_Lang::translate(front_account_registration_reppass); ?></div>
			<div class="col-lg-6"><input type="password" name="client_pass_rep" class="form-control" /></div>
			<div class="col-lg-2"></div>
		</div>
		
		
		
		<div class="row vcenter">
			<div class="col-lg-2"></div>
			<div class="col-lg-2 text-right vcenter"></div>
			<div class="col-lg-6"><input name="client_registration_cp" class="form-control" type="submit" value="<?php echo @Lib_Lang::translate(front_account_changepass_submit); ?>" /></div>
			<div class="col-lg-2"></div>
		</div>
		</form>
		
		
		
		</div>
	</div>
	
	<div class="row">
	<hr />
	<?php echo$this->rowClient['client_info']; ?>
	</div>
	
</div>
</div>

<?php echo $this->render('module/footer_mobi.phtml'); ?>

