<form action="" method="post" id="invoice_form">


	<div class="ulp-stuffbox">


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


		<div class="inside">





			<div class="ulp-form-line">


					<h2><?php _e('Activate/Hold Invoices', 'ulp');?></h2>


				<label class="ulp_label_shiwtch" style="margin:10px 0 10px -10px;">


					<?php $checked = ($data['metas']['ulp_invoices_enable']) ? 'checked' : '';?>


					<input type="checkbox" class="ulp-switch" onClick="UltimateLearningPro.checkAndH(this, '#ulp_invoices_enable');" <?php echo $checked;?> />


					<div class="switch" style="display:inline-block;"></div>


				</label>


				<input type="hidden" name="ulp_invoices_enable" value="<?php echo $data['metas']['ulp_invoices_enable'];?>" id="ulp_invoices_enable"/>


			</div>





      <div class="ulp-form-line">


        <p><?php _e('Show only for \'Completed\' Payment', 'ulp'); ?></p>


      	<label class="ulp_label_shiwtch" style="margin:10px 0 10px -10px;">


      	   <?php $checked = ($data['metas']['ulp_invoices_only_completed_payments']) ? 'checked' : '';?>


      		 <input type="checkbox" class="ulp-switch" onClick="ulpCheckAndH(this, '#ulp_invoices_only_completed_payments');" <?php echo $checked;?> />


      		 <div class="switch" style="display:inline-block;"></div>


      	</label>


  			<input type="hidden" name="ulp_invoices_only_completed_payments" value="<?php echo $data['metas']['ulp_invoices_only_completed_payments'];?>" id="ulp_invoices_only_completed_payments" />


      </div>





        <div class="ulp-form-line">


					<h4><?php _e('Invoice Template', 'ulp');?></h4>


					<select name="ulp_invoices_template" onChange="ulpAdminPreviewInvoice();"><?php


						foreach (['ulp-invoice-template-1' => __('Template 1', 'ulp'), 'ulp-invoice-template-2' => __('Template 2', 'ulp')] as $k=>$v){


							$selected = ($data['metas']['ulp_invoices_template']==$k) ? 'selected' : '';


							?>


							<option value="<?php echo $k;?>" <?php echo $selected;?> ><?php echo $v;?></option>


							<?php


						}


					?></select>


				</div>





				<div class="ulp-form-line">


					<h4><?php _e('Invoice Logo', 'ulp');?></h4>


					<input type="text" onblur="ulpAdminPreviewInvoice();" style="width: 70%;" name="ulp_invoices_logo" value="<?php echo $data['metas']['ulp_invoices_logo'];?>" onClick="openMediaUp(this);" />	<i class="fa-ulp ulp-icon-remove-e ulp-pointer" onClick="jQuery('[name=ulp_invoices_logo]').val('');"></i>


				</div>





				<div class="ulp-form-line">


					<h4><?php _e('Invoice main Title', 'ulp');?></h4>


					<input type="text" onblur="ulpAdminPreviewInvoice();" name="ulp_invoices_title" value="<?php echo $data['metas']['ulp_invoices_title'];?>"/>


				</div>








        <div class="ulp-form-line">


          <h2><?php _e('Additional Invoice Details', 'ulp');?></h2>


        </div>





        <div class="row" style="margin-left:0;">


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


            <h4><?php _e('Company Field', 'ulp');?></h4>


            <div style="width:60%;">


              <?php wp_editor( stripslashes($data['metas']['ulp_invoices_company_field']), 'ulp_invoices_company_field', array('textarea_name'=>'ulp_invoices_company_field', 'quicktags'=>TRUE) );?>


            </div>


          </div>





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


            <h4><?php _e('Bill to', 'ulp');?></h4>


            <div style=" width: 50%; margin-right:1%; display:inline-block;">


              <?php wp_editor( stripslashes($data['metas']['ulp_invoices_bill_to']), 'ulp_invoices_bill_to', array('textarea_name'=>'ulp_invoices_bill_to', 'quicktags'=>TRUE) );?>


            </div>


            <div style="width: 19%; display: inline-block; vertical-align: top;">


                <?php


                  echo "<h4>".__('Standard Fields constants', 'ulp')."</h4>";


                  $constants = [


                            '{username}'=>'',


                            '{user_email}'=>'',


                            '{first_name}'=>'',


                            '{last_name}'=>'',


                            '{account_page}'=>'',


                            '{blogname}'=>'',


                            '{blogurl}'=>'',


                            '{currency}'=>'',


                            '{amount}'=>'',


                            '{current_date}' => '',


                            '{course_name}' => ''


                  ];


                  foreach ($constants as $k=>$v):?>


                    <div><?php echo $k;?></div>


                  <?php endforeach;?>


              </div>


          </div>





          <div class="ulp-clear"></div>


        </div>





        <div class="ulp-form-line">


          <h2><?php _e('Footer Invoice Info', 'ulp');?></h2>


        </div>





        <div style="width:60%; display:inline-block;">


          <?php wp_editor( stripslashes($data['metas']['ulp_invoices_footer']), 'ulp_invoices_footer', array('textarea_name'=>'ulp_invoices_footer', 'quicktags'=>TRUE) );?>


        </div>





        <div class="ulp-form-line">


          <h2><?php _e('Custom CSS', 'ulp');?></h2>


          <textarea name="ulp_invoices_custom_css" onblur="ulpAdminPreviewInvoice();" style="width: 100%; height: 150px;"><?php echo stripslashes($data['metas']['ulp_invoices_custom_css']);?></textarea>


        </div>








			<div class="ulp-submit-form" style="margin-top: 20px;">


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


			</div>





		</div>


	</div>





</form>





<div class="ulp-stuffbox">


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


	<div class="inside" id="preview_container">


	</div>


</div>


<script>


	jQuery('document').ready(function(){


		ulpAdminPreviewInvoice();


	});


</script>


