Current File : /home/itiffy/public_html/blog/wp-content/themes/itiffyblog/wpi/unified-invoice-page-active.php
<?php
/**
 * Unified Invoice Page template
 *
 * Displays Single invoice page
 */
global $invoice, $wpi_settings;
?><!DOCTYPE html>
<!--[if IE 6]>
<html id="ie6" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 7]>
<html id="ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html id="ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 6) & !(IE 7) & !(IE 8)]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
  <meta charset="<?php bloginfo('charset'); ?>"/>
  <meta name="viewport" content="width=device-width"/>
  <title><?php
    // Print the <title> tag based on what is being viewed.
    global $page, $paged;

    wp_title('|', true, 'right');

    // Add the blog name.
    bloginfo('name');

    // Add the blog description for the home/front page.
    $site_description = get_bloginfo('description', 'display');
    if ($site_description && (is_home() || is_front_page()))
      echo " | $site_description";

    ?></title>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" />
  <?php wp_head(); ?>
  <!--[if lt IE 9]>
  <script src="http://cdnjs.com/libraries/html5shiv"></script>
  <script src="https://cdnjs.com/libraries/respond.js"></script>
  <![endif]-->

  <script type="text/javascript">
    jQuery(document).ready(function(){
      jQuery('body').unified_page_template();
    });
  </script>
  <style>
  	.invoice .pageheader .header-info{
			display:none;
	}
	.invoice .invoice-head .wp-invoice-business-name{
			opacity:0;
	}
	.invoice .invoice-desc{
			border-bottom:1px solid #dddddd;
			border-top:1px solid #dddddd;
			background:#f0f0f0;
			padding:15px 15px 0 15px;
			margin:0;
	}
	.invoice .invoice-item-lists1{
			background:#efefef;
	}
	.invoice .invoice-item-lists.invoice-item-lists1 table thead tr th{
			background:#dbdbdb;
			color: #000;
			font-weight: bold;
	}
	.top-nav-links .btn-pay{
			text-transform: uppercase;
			font-weight: bold;
	}
	.wpi_checkout .wpi_checkout_block .wpi_checkout_row{
			float:left;
			width:100%;
	}
	#credit_card_information .wpi_checkout_block .section_title{
			margin:0 0 20px 0px;
	}
  </style>
</head>

<body class="inner-pages invoice">

  <header class="pageheader">

    <div class="container">

      <div class="row header-info">

        <?php if ( show_business_info() ) : ?>

        <div class="col-sm-4">
          <?php if ( $logo_url = wpi_get_business_logo_url() ): ?>
            <div class="logo"><img style="max-width: 90px;" src="<?php echo $logo_url; ?>" alt="Logo" /></div>
          <?php endif; ?>
            <?php if ( $business_name = wpi_get_business_name() ): ?>
              <h1 class="wp-invoice-business-name"><?php echo $business_name; ?></h1>
            <?php endif; ?>
            <?php if ( $business_address = wpi_get_business_address() ): ?>
              <p><?php echo $business_address; ?></p>
            <?php endif; ?>
        </div>

        <div class="col-sm-5 contacts">
          <div class="contact">
            <?php if ( $business_email = wpi_get_business_email() ): ?>
            <p><span class="ico mail"></span>
              <a href="mailto:<?php echo $business_email; ?>"><?php echo $business_email; ?></a></p>
            <?php endif; ?>
            <?php if ( $business_phone = wpi_get_business_phone() ): ?>
              <p><span class="ico tel"></span> <?php echo $business_phone; ?></p>
            <?php endif; ?>
          </div>
        </div>
        <?php else: ?>
          <div class="col-m-12" style="height: 100px;"></div>
        <?php endif; ?>

      </div>

      <div class="row top-nav-links">

        <div class="col-xs-6">
          <?php if ( wpi_dashboard_is_active() ): ?>
            <a href="<?php echo wpi_get_dashboard_permalink( $invoice['ID'] ); ?>" class="btn btn-back"> <?php _e( 'My dashboard', ud_get_wp_invoice()->domain ); ?></a>
          <?php endif; ?>
          <a href="<?php echo home_url(); ?>" class="btn"> <?php _e( 'Back to website', ud_get_wp_invoice()->domain ); ?></a>
        </div>

        <div class="col-xs-6 text-right">
          <div class="btn-group" role="group" aria-label="...">
            <?php if ( wpi_invoice_has_pdf() ): ?>
              <a href="<?php invoice_pdf_link(); ?>" target="_blank" class="btn btn-default"><?php _e('PDF', ud_get_wp_invoice()->domain); ?></a>
            <?php endif; ?>
          </div>

          <?php if ( is_invoice() || is_recurring() ): ?>
          <a href="javascript:void(0);" id="close-payment-form" class="btn btn-pay"><?php _e('Go Back', ud_get_wp_invoice()->domain); ?></a>
          <a href="javascript:void(0);" id="open-payment-form" class="btn btn-pay"><?php _e('Make Payment', ud_get_wp_invoice()->domain); ?></a>
          <?php endif; ?>

          <?php do_action('wpi_unified_template_top_navigation'); ?>

        </div>
      </div>

    </div><!--end /container-->

  </header><!--end /pageheader-->

  <div class="page-content" id="invoice-page-content">

    <div class="container" id="invoice-data-container">

      <div class="box-content">
        <div class="head-title">
          <h2><?php _e( wpi_get_invoice_type(), ud_get_wp_invoice()->domain ); ?></h2>
        </div>

        <div class="box-inner-content">
          <div class="row invoice-head">
            <div class="col-sm-8">
              <?php if ( $logo_url = wpi_get_business_logo_url() ): ?>
                <div class="logo"><img style="max-width: 90px;" src="<?php echo $logo_url; ?>" alt="Logo" /></div>
              <?php endif; ?>
              <?php if ( show_business_info() ) : ?>
                <?php if ( $business_name = wpi_get_business_name() ): ?>
                  <h1 class="wp-invoice-business-name"><?php echo $business_name; ?></h1>
                <?php endif; ?>
                <?php if ( $business_address = wpi_get_business_address() ): ?>
                  <p><?php echo $business_address; ?></p>
                <?php endif; ?>
              <?php endif; ?>
              <?php if ( $business_email = wpi_get_business_email() ): ?>
                <p><span><?php _e('Email:', ud_get_wp_invoice()->domain); ?></span> <a href="mailto:<?php echo $business_email; ?>"><?php echo $business_email; ?></a></p>
              <?php endif; ?>
              <?php if ( $business_phone = wpi_get_business_phone() ): ?>
                <p><span><?php _e('Phone:', ud_get_wp_invoice()->domain); ?></span> <?php echo $business_phone; ?></p>
              <?php endif; ?>
            </div>

            <div class="col-sm-4">
              <div class="invoice-info-details">
                <p><span><?php _e( 'Invoice ID', ud_get_wp_invoice()->domain ); ?></span>
                  <?php invoice_id(); ?>
                </p>

                <p><span><?php _e( 'Issue Date', ud_get_wp_invoice()->domain ); ?></span>
                  <?php echo wpi_get_invoice_issue_date(); ?>
                </p>

                <?php if ( wpi_invoice_has_due_date() ): ?>
                <p><span><?php _e('Due Date', ud_get_wp_invoice()->domain); ?></span>
                  <?php echo wpi_get_invoice_due_date(); ?>
                </p>
                <?php endif; ?>

                <p><span><?php _e('Invoice for', ud_get_wp_invoice()->domain); ?></span>
                  <?php recipients_name(); ?><br />
                  <?php echo wpi_get_company_address(); ?>
                </p>

                <?php do_action('wpi_unified_template_after_recipient'); ?>
              </div>
            </div>
          </div>

          <div class="invoice-desc">
            <h3><?php echo wpi_get_invoice_title(); ?></h3>
            <p><?php the_description(); ?></p>
          </div>

          <?php if ( wpi_invoice_has_items() ): ?>
            <div class="invoice-item-lists invoice-item-lists1">
              <div class="table-responsive">
                <table class="table">
                  <thead>
                  <tr>
                    <th class="description"><?php _e( 'Description', ud_get_wp_invoice()->domain ); ?></th>
                    <?php if ( wpi_show_quantity_column() ): ?>
                      <th class="quantity"><?php _e( 'Quantity', ud_get_wp_invoice()->domain ); ?></th>
                    <?php endif; ?>
                    <th class="unit-price"><?php _e( 'Unit Price', ud_get_wp_invoice()->domain ); ?></th>
                    <th class="amount"><?php _e( 'Amount', ud_get_wp_invoice()->domain ); ?></th>
                    <?php if ( wpi_get_invoice_total_tax() ): ?>
                      <th class="tax" style="text-align: right;"><?php _e( 'Tax', ud_get_wp_invoice()->domain ); ?></th>
                    <?php endif; ?>
                  </tr>
                  </thead>
                  <tbody>
                  <?php $i = 0; while( $line_item = wpi_get_line_item( $i ) ) : ?>
                  <tr>
                    <td>
                      <b><?php echo $line_item->get_name(); ?></b>
                      <?php if ( $_description = $line_item->get_description() ): ?>
                        <div><?php echo $_description; ?></div>
                      <?php endif; ?>
                    </td>
                    <?php if ( wpi_show_quantity_column() ): ?>
                      <td><?php echo $line_item->get_quantity(); ?></td>
                    <?php endif; ?>
                    <td><?php echo $line_item->get_price( wpi_get_invoice_currency_sign() ); ?></td>
                    <td><?php echo $line_item->get_amount( wpi_get_invoice_currency_sign() ); ?></td>
                    <?php if ( wpi_get_invoice_total_tax() ): ?>
                      <td><?php echo $line_item->get_tax( wpi_get_invoice_currency_sign() ); ?></td>
                    <?php endif; ?>
                  </tr>
                  <?php endwhile; ?>
                  </tbody>
                </table>
              </div>
            </div>
          <?php endif; ?>

          <?php if ( wpi_invoice_has_charges() ): ?>
            <h4><?php _e( 'Additional Charges', ud_get_wp_invoice()->domain ); ?></h4>
            <div class="invoice-item-lists">
              <div class="table-responsive">
                <table class="table">
                  <thead>
                  <tr>
                    <th class="description"><?php _e( 'Description', ud_get_wp_invoice()->domain ); ?></th>
                    <th class="amount"><?php _e( 'Amount', ud_get_wp_invoice()->domain ); ?></th>
                  </tr>
                  </thead>
                  <tbody>
                  <?php $i = 0; while( $line_item = wpi_get_line_charge( $i ) ) : ?>
                    <tr>
                      <td><?php echo $line_item->get_name(); ?></td>
                      <td><?php echo $line_item->get_amount( wpi_get_invoice_currency_sign() ); ?></td>
                    </tr>
                  <?php endwhile; ?>
                  </tbody>
                </table>
              </div>
            </div>
          <?php endif; ?>

          <div class="invoice-item-lists">
            <div class="table-responsive">
              <table class="table">
                <?php if ( wpi_get_invoice_total_tax() ): ?>
                <tr class="total-row">
                  <td><span><?php _e('Total:', ud_get_wp_invoice()->domain); ?></span> <?php echo wpi_get_total( wpi_get_invoice_currency_sign() ); ?></td>
                </tr>
                <tr class="total-row">
                  <td><span><?php _e('Total Tax:', ud_get_wp_invoice()->domain); ?></span> <?php echo wpi_get_invoice_total_tax( wpi_get_invoice_currency_sign() ); ?></td>
                </tr>
                <?php endif; ?>
                <?php if ( wpi_get_discount() ): ?>
                  <tr class="total-row">
                    <td><span><?php _e('Discount:', ud_get_wp_invoice()->domain); ?></span> <?php echo wpi_get_discount( wpi_get_invoice_currency_sign() ); ?></td>
                  </tr>
                <?php endif; ?>
                <?php if ( wpi_get_adjustments() ): ?>
                  <tr class="total-row">
                    <td><span><?php _e('Other Adjustments:', ud_get_wp_invoice()->domain); ?></span> <?php echo wpi_get_adjustments( wpi_get_invoice_currency_sign() ); ?></td>
                  </tr>
                <?php endif; ?>
                <?php if ( wpi_get_total_payments() ): ?>
                  <tr class="total-row">
                    <td><span><?php _e('Total Payments:', ud_get_wp_invoice()->domain); ?></span> <?php echo wpi_get_total_payments( wpi_get_invoice_currency_sign() ); ?></td>
                  </tr>
                <?php endif; ?>
                <tr class="total-row">
                  <td><span><?php _e('Amount Due:', ud_get_wp_invoice()->domain); ?></span> <?php echo wpi_get_amount_due( wpi_get_invoice_currency_sign() ); ?></td>
                </tr>
              </table>
            </div>
          </div>

        </div><!--end /box-inner-content-->
      </div>

      <?php ob_start(); comments_template(); ob_clean(); ?>

      <?php if ( ( is_quote() || is_invoice() ) && have_comments() ): ?>
      <div id="quote-responses">
        <h4><?php _e('Discussion Thread', ud_get_wp_invoice()->domain); ?></h4>

        <div id="comments" class="box-content">

          <div class="box-inner-content">
            <ul>
              <?php wp_list_comments(); ?>
            </ul>

            <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
              <nav id="comment-nav-above" class="comment-navigation">
                <div class="nav-previous"><?php previous_comments_link( __( '&larr; Previous Page', ud_get_wp_invoice()->domain ) ); ?></div>
                <div class="nav-next"><?php next_comments_link( __( 'Next Page &rarr;', ud_get_wp_invoice()->domain ) ); ?></div>
                <div class="clearfix"></div>
              </nav><!-- #comment-nav-above -->
              <div class="clearfix"></div>
            <?php endif; // Check for comment navigation. ?>
          </div>

          <div class="clearfix"></div>

        </div>
      </div>
      <?php endif; ?>

      <?php if ( is_quote() && comments_open() ): ?>
      <div id="quote-response-form">
        <h4><?php _e('Leave a Response', ud_get_wp_invoice()->domain); ?></h4>
        <div class="box-content">
          <div class="box-inner-content">
            <?php comment_form(); ?>
            <div class="clearfix"></div>
          </div>
        </div>
      </div>
      <?php endif; ?>

      <?php do_action('wpi_unified_template_before_actions_history'); ?>

      <?php if ( $history = wpi_get_invoice_log(array(
          'refund' => __('Refund', ud_get_wp_invoice()->domain),
          'notification' => __('Email', ud_get_wp_invoice()->domain),
          'add_charge' => __('Charge', ud_get_wp_invoice()->domain),
          'add_payment' => __('Paid', ud_get_wp_invoice()->domain),
          'do_adjustment' => __('Adjustment', ud_get_wp_invoice()->domain),
          'create' => __('Create', ud_get_wp_invoice()->domain))) ): ?>
      <div class="invoice-history">

        <h4><?php _e('Invoice History', ud_get_wp_invoice()->domain); ?></h4>

        <div class="box-content">
          <div class="box-inner-content">
            <?php foreach( $history as $hitem ): ?>
            <div class="row">
              <div class="col-md-2 label-item"><span class="label label-<?php echo $hitem['action']; ?>"><?php echo $hitem['label']; ?></span></div>
              <div class="col-md-7 description"><?php echo $hitem['text']; ?></div>
              <div class="col-md-3 date"><?php echo $hitem['time']; ?></div>
            </div>
            <?php endforeach; ?>
          </div><!--end /box-inner-content-->
        </div>
      </div>
      <?php endif; ?>

    </div><!--end /container-->

    <?php if (!is_quote()) : ?>
    <div id="payment-form-container" class="container invoice-payment">

      <div class="box-content">

        <div class="box-inner">

          <div class="wpi_checkout">
            <?php if (allow_partial_payments()): ?>
              <?php show_partial_payments(); ?>
            <?php endif; ?>

            <?php show_payment_selection(); ?>

            <?php
            $method = !empty($invoice['default_payment_method']) ? $invoice['default_payment_method'] : 'manual';
            if ($method == 'manual') {
              ?>
              <p><strong><?php _e('Manual Payment Information', ud_get_wp_invoice()->domain); ?></strong></p>
              <p><?php echo !empty($wpi_settings['manual_payment_info']) ? $wpi_settings['manual_payment_info'] : __('Contact site Administrator for payment information please.', ud_get_wp_invoice()->domain); ?></p>
            <?php
            } else {
              if (!empty($wpi_settings['installed_gateways'][$method])) {
                $wpi_settings['installed_gateways'][$method]['object']->frontend_display($invoice);
              } else {
                _e('Sorry, there is no payment method available. Please contact Administrator.', ud_get_wp_invoice()->domain);
              }
            }
            apply_filters("wpi_closed_comments", $invoice);
            ?>
          </div>

        </div><!--end /box-inner-content-->
      </div>

    </div><!--end /container-->
    <?php endif; ?>

  </div><!--end /page-content-->

  <div id="invoice-payment-success" class="page-content thankyou">

    <div class="container">

      <div class="box-content">

        <div class="box-inner-content">

          <div class="payment-logo">
            <img src="<?php echo ud_get_wp_invoice()->path('static/img/payment.png', 'url'); ?>" alt="" />
          </div>

          <h2><?php _e('Payment Sent Successfully', ud_get_wp_invoice()->domain); ?></h2>

          <p><?php _e('Thank you for your payment. You can check the invoice at your Invoices Dashboard.', ud_get_wp_invoice()->domain); ?></p>

          <div class="success-buttons">
            <a href="<?php echo get_invoice_permalink( $invoice['ID'] ); ?>" class="btn btn-success"><?php _e( 'Check Receipt', ud_get_wp_invoice()->domain ); ?></a>
            <?php if ( wpi_dashboard_is_active() ): ?>
              <a href="<?php echo wpi_get_dashboard_permalink( $invoice['ID'] ); ?>" class="btn btn-info"><?php _e( 'View Dashboard', ud_get_wp_invoice()->domain ); ?></a>
            <?php endif; ?>
          </div>

        </div><!--end /box-inner-content-->
      </div>

    </div><!--end /container-->

  </div><!--end /page-content-->

  <footer class="pagefooter">
    <div class="container">
      <a href="https://www.usabilitydynamics.com/product/wp-invoice" target="_blank">
        <p>Powered by <span>&copy<?php echo date('Y');?><!--<img src="<?php echo ud_get_wp_invoice()->path( 'static/img/wp-invoice.png', 'url' ); ?>" alt="WP-Invoice" />--></span> Itiffy. All rights reserved.</p>
      </a>
    </div><!--end /container-->
  </footer><!--end /pagefooter-->

  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</body>

<?php wp_footer(); ?>

</html>