<?php $__env->startSection('content'); ?>

    
<div class="row margin-top-55">
    <div class="col-md-2">
         <ul class="left_nav">
         	<li><a href="<?php echo URL::to('trade/sell'); ?>">SELL</a></li>
            <li><a href="<?php echo URL::to('trade/buy'); ?>" class="active">BUY</a></li>
         </ul>
    </div>
    <div class="col-md-10">
        <div class="gray_container standart-15">
        	<?php echo Form::open(); ?>
            <div class="row">
                <div class="col-md-10 col-md-offset-1">
                    <h4 class="head_h4">BUY</h4>
                    <p>Since this is your first investment through Banq, you will need to setup your account at TriPoint Global Securities, LLC. Please complete the following form.</p><br><br>
                 	<?php if(Session::has('success')): ?>
                    	<div class="alert alert-success"><?php echo Session::get('success'); ?></div>
                    <?php endif; ?>
                    <?php if($errors->has()): ?>
                        <div class="alert alert-danger">
                        <?php foreach ($errors->all() as $row): ?>
                          <div><?php echo $row; ?></div>
                        <?php endforeach; ?>
                        </div>
                    <?php endif; ?>
                    <div class="account_application">
                        <ul>
                            <li>
                             	<?php if(!empty($accounts)): ?>
                            		<?php echo Form::select('accountnumber', $accounts, null, array('class' => 'form-control tooltip-info', 'data-toggle' => 'tooltip', 'data-placement' => 'right', 'data-original-title' => 'Select account')); ?>
                                <?php endif; ?>
                                
                            	<?php echo Form::select('orderconfig', array('dm' => 'MKT', 'dl' => 'LMT', 'ds' => 'STOP', 'dsl' => 'STOP LMT'), null, array('class' => 'form-control tooltip-info', 'data-toggle' => 'tooltip', 'data-placement' => 'right', 'data-original-title' => 'A flag to indicate the type of order to create.')); ?>
                                
                                <?php echo Form::select('term', array('0' => 'Day', '1' => 'GTC'), null, array('class' => 'form-control tooltip-info', 'data-toggle' => 'tooltip', 'data-placement' => 'right', 'data-html' => 'true', 'data-original-title' => 'Day. The order is good only for the day.<br />
GTC. The order is good until canceled (with a 90 day maximum on average)')); ?>
                                
                                <?php echo Form::select('solicited', array('true' => 'Yes', 'false' => 'No'), null, array('class' => 'form-control tooltip-info', 'data-toggle' => 'tooltip', 'data-placement' => 'right', 'data-original-title' => 'Solicited')); ?>
                                
                                <?php echo Form::select('reasonForTrade', array('AG' => 'Adjustment to Guidelines', 'CR' => 'Client Request', 'NS' => 'Not Specified', 'RC' => 'Raise Cash', 'SC' => 'Strategy Change', 'TL' => 'Tax Loss Selling', 'MS' => 'Model Sync', 'AS' => 'Account Sync', 'AT' => 'Account Template Sync', 'AI' => 'Auto Investment', 'DR' => 'Auto Dividend Reinvestment', 'OP' => 'Operations', 'OT' => 'Other'), null, array('class' => 'form-control tooltip-info', 'data-toggle' => 'tooltip', 'data-placement' => 'right', 'data-original-title' => 'Reasons for Trade')); ?> <!--??????-->
                                
                                <input type="text" name="security_ticker" value="<?php echo Input::old('security_ticker'); ?>" class="form-control tooltip-info" data-toggle="tooltip" data-trigger="focus" data-placement="right" data-original-title="The ticker of the security to sell." placeholder="The ticker of the security">
                                
                                <input type="text" name="requestedShareAmt" value="<?php echo Input::old('requestedShareAmt'); ?>" class="form-control tooltip-info" data-toggle="tooltip" data-trigger="focus" data-placement="right" data-original-title="The requested share amount to trade for this security. This should be used in conjunction with a share based indicator" placeholder="The requested share amount">
                                
                                <input type="text" name="limitPrice" value="<?php echo Input::old('limitPrice'); ?>" class="form-control tooltip-info hidden" data-toggle="tooltip" data-trigger="focus" data-placement="right" data-original-title="The limit price to execute at. This is only available for direct orders." placeholder="The limit price">
                                
                                <input type="text" name="stopPrice" value="<?php echo Input::old('stopPrice'); ?>" class="form-control tooltip-info hidden" data-toggle="tooltip" data-trigger="focus" data-placement="right" data-original-title="The stop price to execute at. This is only available for direct orders." placeholder="The stop price">
                                
                            </li>						
                        </ul>
                    </div>
                </div>
            </div>
            <div class="wrap_next_step">
                <button type="submit" class="btn next_step">NEXT STEP  &nbsp; &#62;</button>
            </div>
           <?php echo Form::close(); ?>
        </div>
    </div><!-- /col-md-10 -->
</div><!-- /row -->

<?php $__env->startSection('scripts'); ?>
<script type="text/javascript">
	$(function() {
		$( "select[name='taxlotreliefmethod']" ).change(function () {
			taxlotreliefmethod = $(this).val();	
			if(taxlotreliefmethod == 'WLFS' || taxlotreliefmethod == 'WGFS')
			{
				$("input[name='longTermTaxRate']").removeClass("hidden");	
				$("input[name='shortTermTaxRate']").removeClass("hidden");
			}
			else
			{
				$("input[name='longTermTaxRate']").addClass("hidden");	
				$("input[name='shortTermTaxRate']").addClass("hidden");	
			}
		});
		
		$( "select[name='orderconfig']" ).change(function () {
			orderconfig = $(this).val();
						
			if(orderconfig == 'dl' || orderconfig == 'dsl')
				$("input[name='limitPrice']").removeClass("hidden");
			else
				$("input[name='limitPrice']").addClass("hidden");	
				
			if(orderconfig == 'ds' || orderconfig == 'dsl')
				$("input[name='stopPrice']").removeClass("hidden");
			else
				$("input[name='stopPrice']").addClass("hidden");				
		});
		
		var orderconfig = $('select[name="orderconfig"] option:selected').val();
		var taxlotreliefmethod = $('select[name="taxlotreliefmethod"] option:selected').val();
		
		if(orderconfig == 'dl' || orderconfig == 'dsl')
			$("input[name='limitPrice']").removeClass("hidden");
		
		if(orderconfig == 'ds' || orderconfig == 'dsl')
			$("input[name='stopPrice']").removeClass("hidden");
			
		if(taxlotreliefmethod == 'WLFS' || taxlotreliefmethod == 'WGFS')
		{
			$("input[name='longTermTaxRate']").removeClass("hidden");	
			$("input[name='shortTermTaxRate']").removeClass("hidden");	
		}
		
	});
</script>
<?php $__env->stopSection(); ?>

<?php $__env->stopSection(); ?>


