<form action="" method="post" role = "form">

	<div class="ulp-stuffbox">



    <h3 class="ulp-h3"><?php _e('Redirects', 'ulp');?></h3>



    <div class="inside">

	<div class="ulp-inside-item">

      <div class="row">

          <div class="col-xs-4">

            <h2><?php _e('Default Redirects', 'ulp');?></h2>

			<p><?php _e('Establish the official system redirects after specific stages. ', 'ulp');?></p>



        	<h4 style="margin-top:20px;"><?php _e('Default redirect', 'ulp');?></h4>

				<div class="form-group row">

						<select name="ulp_default_redirect" class="form-control m-bot15">

			        <option value="-1" <?php if($data['metas']['ulp_default_redirect']==-1) echo 'selected';?> >...</option>

							<?php	if ($data['pages']):?>

								<?php foreach ($data['pages'] as $k => $v):?>

									<?php $selected = $data['metas']['ulp_default_redirect']==$v->ID ? 'selected' : '';?>

									<option value="<?php echo $v->ID;?>" <?php echo $selected;?> ><?php echo $v->post_title;?></option>

								<?php endforeach;?>

			        <?php endif;?>

						</select>

						<?php if ($data['metas']['ulp_default_redirect']>-1):?>

							<div class="ulp-link-to-public"><?php echo __('View Page: ', 'ulp'); ?><a href="<?php echo $permalink = get_permalink($data['metas']['ulp_default_redirect']);?>" target="_blank" ><?php echo $permalink;?></a></div>

						<?php endif;?>

				</div>





			<h4 style="margin-top:20px;"><?php _e('User profile redirect', 'ulp');?></h4>

              <div class="form-group row">

                      <select name="ulp_user_profile_redirect" class="form-control m-bot15">

                  <option value="-1" <?php if($data['metas']['ulp_user_profile_redirect']==-1) echo 'selected';?> >...</option>

                          <?php	if ($data['pages']):?>

                              <?php foreach ($data['pages'] as $k => $v):?>

                                  <?php $selected = $data['metas']['ulp_user_profile_redirect']==$v->ID ? 'selected' : '';?>

                                  <option value="<?php echo $v->ID;?>" <?php echo $selected;?> ><?php echo $v->post_title;?></option>

                              <?php endforeach;?>

                  <?php endif;?>

                      </select>

                      <?php if ($data['metas']['ulp_user_profile_redirect']>-1):?>

                          <div class="ulp-link-to-public"><?php echo __('View Page: ', 'ulp'); ?><a href="<?php echo $permalink = get_permalink($data['metas']['ulp_user_profile_redirect']);?>" target="_blank" ><?php echo $permalink;?></a></div>

                      <?php endif;?>

              </div>


			<h4 style="margin-top:20px;"><?php _e('Unregistered user try to buy redirect', 'ulp');?></h4>
			<div class="form-group row">
							<select name="ulp_unregistered_user_try_to_buy_redirect" class="form-control m-bot15">
									<option value="-1" <?php if($data['metas']['ulp_unregistered_user_try_to_buy_redirect']==-1) echo 'selected';?> >...</option>
									<?php	if ($data['pages']):?>
											<?php foreach ($data['pages'] as $k => $v):?>
													<?php $selected = $data['metas']['ulp_unregistered_user_try_to_buy_redirect']==$v->ID ? 'selected' : '';?>
													<option value="<?php echo $v->ID;?>" <?php echo $selected;?> ><?php echo $v->post_title;?></option>
											<?php endforeach;?>
									<?php endif;?>
							</select>
							<?php if ($data['metas']['ulp_unregistered_user_try_to_buy_redirect']>-1):?>
									<div class="ulp-link-to-public"><?php echo __('View Page: ', 'ulp'); ?><a href="<?php echo $permalink = get_permalink($data['metas']['ulp_unregistered_user_try_to_buy_redirect']);?>" target="_blank" ><?php echo $permalink;?></a></div>
							<?php endif;?>
			</div>



		</div>

      </div>

    </div>

  	<div class="ulp-line-break"></div>

	<div class="ulp-inside-item">

      <div class="row">

          <div class="col-xs-6">



    		<div class="form-group row" style="margin-top:30px;">

    				<div class="col-4">

    						<input type="submit" name="submit" value="<?php _e('Save Changes', 'ulp');?>"  class="btn btn-primary pointer" />

    			  </div>

    		</div>

		</div>

      </div>

    </div>

	</div>

 </div>

</form>

