function parse_template($object, $body)
{
    if (preg_match_all('/{{{([^{|}]*)}}}/', $body, $template_vars)) {
        foreach ($template_vars[1] as $var) {
            switch ($var) {
                case 'invoice_guest_url':
                    $replace = site_url('guest/view/invoice/' . $object->invoice_url_key);
                    break;
                case 'invoice_date_due':
                    $replace = date_from_mysql($object->invoice_date_due, TRUE);
                    break;
                case 'invoice_date_created':
                    $replace = date_from_mysql($object->invoice_date_created, TRUE);
                    break;
                case 'invoice_total':
                    $replace = format_currency($object->invoice_total);
                    break;
                case 'invoice_paid':
                    $replace = format_currency($object->invoice_paid);
                    break;
                case 'invoice_balance':
                    $replace = format_currency($object->invoice_balance);
                    break;
                case 'quote_total':
                    $replace = format_currency($object->quote_total);
                    break;
                case 'quote_date_created':
                    $replace = date_from_mysql($object->quote_date_created, TRUE);
                    break;
                case 'quote_date_expires':
                    $replace = date_from_mysql($object->quote_date_expires, TRUE);
                    break;
                case 'quote_guest_url':
                    $replace = site_url('guest/view/quote/' . $object->quote_url_key);
                    break;
                default:
                    $replace = $object->{$var};
            }
            $body = str_replace('{{{' . $var . '}}}', $replace, $body);
        }
    }
    return $body;
}
Пример #2
0
<?php

foreach ($quote_notes_notes as $quote_note) {
    ?>
    <div class="alert alert-default">
        <p><strong><?php 
    echo date_from_mysql($quote_note->note_date, TRUE);
    ?>
</strong>&nbsp;
            <?php 
    echo $quote_note->note_author;
    ?>
			<?php 
    echo nl2br($quote_note->note);
    ?>
        </p>
    </div>
<?php 
}
Пример #3
0
                                    <td class="text-right color-n">
                                        <?php 
echo date_from_mysql($quote->quote_date_created, TRUE);
?>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="text-right color-n">
                                        <?php 
echo lang('expires');
?>
: &nbsp;
                                    </td>
                                    <td class="text-right color-n">
                                        <?php 
echo date_from_mysql($quote->quote_date_expires, TRUE);
?>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="text-right color-n">
                                        <?php 
echo lang('total');
?>
: &nbsp;
                                    </td>
                                    <td class="text-right color-n">
                                        <?php 
echo format_currency($quote->quote_total);
?>
                                    </td>
Пример #4
0
                                    <td class="text-right color-n">
                                        <?php 
echo date_from_mysql($invoice->invoice_date_created, TRUE);
?>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="text-right color-n">
                                        <?php 
echo lang('due_date');
?>
: &nbsp;
                                    </td>
                                    <td class="text-right color-n">
                                        <?php 
echo date_from_mysql($invoice->invoice_date_due, TRUE);
?>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="text-right color-n">
                                        <?php 
echo lang('amount_due');
?>
: &nbsp;
                                    </td>
                                    <td class="text-right color-n">
                                        <?php 
echo format_currency($invoice->invoice_balance);
?>
                                    </td>
    echo date_from_mysql($invoice->recur_start_date);
    ?>
                        </td>
                        <td>
                            <?php 
    echo date_from_mysql($invoice->recur_end_date);
    ?>
                        </td>
                        <td>
                            <?php 
    echo lang($recur_frequencies[$invoice->recur_frequency]);
    ?>
                        </td>
                        <td>
                            <?php 
    echo date_from_mysql($invoice->recur_next_date);
    ?>
</td>
                        <td>
                            <div class="options btn-group">
                                <a class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"
                                   href="#">
                                    <i class="fa fa-cog"></i> <?php 
    echo lang('options');
    ?>
                                </a>
                                <ul class="dropdown-menu">
                                    <li>
                                        <a href="<?php 
    echo site_url('invoices/recurring/stop/' . $invoice->invoice_recurring_id);
    ?>
?>
">
                </div>
            </div>

            <div class="form-group has-feedback">
                <label for="invoice_date_created"><?php 
echo trans('invoice_date');
?>
: </label>

                <div class="input-group">
                    <input name="invoice_date_created" id="invoice_date_created"
                           class="form-control datepicker"
                           value="<?php 
echo date_from_mysql(date('Y-m-d', time()), true);
?>
">
                    <span class="input-group-addon">
                        <i class="fa fa-calendar fa-fw"></i>
                    </span>
                </div>
            </div>

            <div class="form-group">
                <label for="invoice_password"><?php 
echo trans('invoice_password');
?>
</label>
                <input type="text" name="invoice_password" id="invoice_password" class="form-control"
                       value="<?php 
Пример #7
0
 <tr>
     <td>
         <span
             class="label <?php echo $quote_statuses[$quote->quote_status_id]['class']; ?>"><?php echo $quote_statuses[$quote->quote_status_id]['label']; ?></span>
     </td>
     <td>
         <a href="<?php echo site_url('quotes/view/' . $quote->quote_id); ?>"
            title="<?php echo lang('edit'); ?>">
             <?php echo $quote->quote_number; ?>
         </a>
     </td>
     <td>
         <?php echo date_from_mysql($quote->quote_date_created); ?>
     </td>
     <td>
         <?php echo date_from_mysql($quote->quote_date_expires); ?>
     </td>
     <td>
         <a href="<?php echo site_url('clients/view/' . $quote->client_id); ?>"
            title="<?php echo lang('view_client'); ?>">
             <?php echo $quote->client_name; ?>
         </a>
     </td>
     <td><?php echo $quote->quote_total_cost; ?> </td>
     <td><?php echo $quote->quote_nett_profit; ?></td>
     <td><?php echo $quote->quote_total_profit; ?></td>
     <td style="text-align: right; padding-right: 25px;">
         <?php echo format_currency($quote->quote_total); ?>
     </td>
     <td>
         <div class="options btn-group">
Пример #8
0
</option>
						<?php 
}
?>
					</select>
				</div>
			</div>

			<div class="control-group">
				<label class="control-label"><?php 
echo lang('date');
?>
: </label>
				<div class="controls input-append date datepicker">
					<input type="text" name="payment_date" id="payment_date" value="<?php 
echo date_from_mysql($this->mdl_payments->form_value('payment_date'));
?>
" readonly>
					<span class="add-on"><i class="icon-th"></i></span>
				</div>
			</div>

			<div class="control-group">
				<label class="control-label"><?php 
echo lang('amount');
?>
: </label>
				<div class="controls">
					<input type="text" name="payment_amount" id="payment_amount" value="<?php 
echo format_amount($this->mdl_payments->form_value('payment_amount'));
?>
Пример #9
0
                    <th><?php echo lang('invoice'); ?></th>
                    <th><?php echo lang('created'); ?></th>
                    <th><?php echo lang('due_date'); ?></th>
                    <th><?php echo lang('client_name'); ?></th>
                    <th><?php echo lang('amount'); ?></th>
                    <th><?php echo lang('balance'); ?></th>
                    <th><?php echo lang('options'); ?></th>
                </tr>
            </thead>

            <tbody>
                <?php foreach ($invoices as $invoice) { ?>
                <tr>
                    <td><a href="<?php echo site_url('guest/invoices/view/' . $invoice->invoice_id); ?>"><?php echo $invoice->invoice_number; ?></a></td>
                    <td><?php echo date_from_mysql($invoice->invoice_date_created); ?></td>
                    <td><?php echo date_from_mysql($invoice->invoice_date_due); ?></td>
                    <td><?php echo $invoice->client_name; ?></td>
                    <td><?php echo format_currency($invoice->invoice_total); ?></td>
                    <td><?php echo format_currency($invoice->invoice_balance); ?></td>
                    <td>
                        <a href="<?php echo site_url('guest/invoices/view/' . $invoice->invoice_id); ?>" class="btn btn-small">
                            <i class="icon-eye-open"></i> <?php echo lang('view'); ?>
                        </a>

                        <a href="<?php echo site_url('guest/invoices/generate_pdf/' . $invoice->invoice_id); ?>" class="btn btn-small">
                            <i class="icon-print"></i> <?php echo lang('pdf'); ?>
                        </a>
                        
                        <?php if ($this->mdl_settings->setting('merchant_enabled') == 1 and $invoice->invoice_balance > 0) { ?><a href="<?php echo site_url('guest/payment_handler/make_payment/' . $invoice->invoice_url_key); ?>" class="btn btn-small btn-success"><i class="icon-white icon-ok"></i> <?php echo lang('pay_now'); ?></a><?php } ?>
                    </td>
                </tr>
Пример #10
0
                <td><?php 
echo lang('quote_date') . ':';
?>
</td>
                <td><?php 
echo date_from_mysql($quote->quote_date_created, true);
?>
</td>
            </tr>
            <tr>
                <td><?php 
echo lang('expires') . ': ';
?>
</td>
                <td><?php 
echo date_from_mysql($quote->quote_date_expires, true);
?>
</td>
            </tr>
            <tr>
                <td><?php 
echo lang('total') . ': ';
?>
</td>
                <td><?php 
echo format_currency($quote->quote_total);
?>
</td>
            </tr>
        </table>
    </div>
Пример #11
0
    <?php $this->layout->load_view('layout/alerts'); ?>

    <div id="filter_results">
        <table class="table table-striped">

            <thead>
                <tr>
                    <th><?php echo lang('date'); ?></th>
                    <th><?php echo lang('invoice'); ?></th>
                    <th><?php echo lang('amount'); ?></th>
                    <th><?php echo lang('payment_method'); ?></th>
                    <th><?php echo lang('note'); ?></th>
                </tr>
            </thead>

            <tbody>
                <?php foreach ($payments as $payment) { ?>
                <tr>
                    <td><?php echo date_from_mysql($payment->payment_date); ?></td>
                    <td><?php echo $payment->invoice_number; ?></td>
                    <td><?php echo format_currency($payment->payment_amount); ?></td>
                    <td><?php echo $payment->payment_method_name; ?></td>
                    <td><?php echo $payment->payment_note; ?></td>
                </tr>
                <?php } ?>
            </tbody>

        </table>
    </div>

</div>
Пример #12
0
echo lang('client');
?>
</th>
								<th><?php 
echo lang('amount');
?>
</th>
							</tr>
						</thead>
						<tbody>
							<?php 
foreach ($recent_payments as $recent_payment) {
    ?>
							<tr>
								<td><?php 
    echo date_from_mysql($recent_payment->payment_date);
    ?>
</td>
								<td><?php 
    echo anchor('invoices/view/' . $recent_payment->invoice_id, $recent_payment->invoice_number);
    ?>
</td>
								<td><?php 
    echo $recent_payment->client_name;
    ?>
</td>
								<td><?php 
    echo format_currency($recent_payment->payment_amount);
    ?>
</td>
							</tr>
Пример #13
0
				<div class="controls">
					<input type="text" name="client_name" id="client_name" style="margin: 0 auto;" data-provide="typeahead" data-items="8" data-source='' autocomplete="off" value="<?php 
echo $quote->client_name;
?>
">
				</div>
			</div>

			<div class="control-group">
				<label class="control-label"><?php 
echo lang('quote_date');
?>
: </label>
				<div class="controls input-append date datepicker">
					<input size="16" type="text" name="quote_date_created" id="quote_date_created" value="<?php 
echo date_from_mysql($quote->quote_date_created, TRUE);
?>
" readonly>
					<span class="add-on"><i class="icon-th"></i></span>
				</div>
			</div>
			
			<div class="control-group">
				<label class="control-label"><?php 
echo lang('invoice_group');
?>
: </label>
				<div class="controls">
					<select name="invoice_group_id" id="invoice_group_id">
						<option value=""></option>
						<?php 
Пример #14
0
                     <?php if ($quote->client_state) { echo $quote->client_state . ' '; } ?>
                     <?php if ($quote->client_zip) { echo $quote->client_zip . '<br>'; } ?>
                     <?php if ($quote->client_phone) { ?><abbr>P:</abbr><?php echo $quote->client_phone; ?><br><?php } ?>
                 </p>
             </td>
             <td style="width:40%;"></td>
             <td style="text-align: right;">
                 <table id="invoice-to-right-table">
                     <tbody>
                         <tr>
                             <td><?php echo lang('quote_date'); ?>: </td>
                             <td><?php echo date_from_mysql($quote->quote_date_created, TRUE); ?></td>
                         </tr>
                         <tr>
                             <td><?php echo lang('expires'); ?>: </td>
                             <td><?php echo date_from_mysql($quote->quote_date_expires, TRUE); ?></td>
                         </tr>
                         <tr>
                             <td><?php echo lang('total'); ?>: </td>
                             <td><?php echo format_currency($quote->quote_total); ?></td>
                         </tr>
                     </tbody>
                 </table>
             </td>
         </tr>
     </table>
 </div>
 <div id="invoice-items">
     <table class="table table-striped" style="width: 100%;">
         <thead>
             <tr>
?>
">
                </div>
            </div>

            <div class="form-group has-feedback">
                <label for="invoice_date_created"><?php 
echo lang('invoice_date');
?>
: </label>

                <div class="input-group">
                    <input name="invoice_date_created" id="invoice_date_created"
                           class="form-control datepicker"
                           value="<?php 
echo date_from_mysql(date('Y-m-d', time()), TRUE);
?>
">
                    <span class="input-group-addon">
                        <i class="fa fa-calendar fa-fw"></i>
                    </span>
                </div>
            </div>

            <div class="form-group">
                <label for="invoice_password"><?php 
echo lang('invoice_password');
?>
</label>
                <input type="text" name="invoice_password" id="invoice_password" class="form-control"
                       value="<?php 
Пример #16
0
<?php

foreach ($client_notes as $client_note) {
    ?>
    <div class="alert alert-default">
        <p><strong><?php 
    echo date_from_mysql($client_note->client_note_date, TRUE);
    ?>
</strong>&nbsp;
            <?php 
    echo nl2br($client_note->client_note);
    ?>
        </p>
    </div>
<?php 
}
Пример #17
0
?>
</th>
			<th><?php 
echo lang('errors');
?>
</th>
		</tr>
	</thead>

	<tbody>
		<?php 
foreach ($versions as $version) {
    ?>
		<tr>
			<td><?php 
    echo date_from_mysql($version->version_date_applied);
    ?>
</td>
			<td><?php 
    echo $version->version_file;
    ?>
</td>
			<td><?php 
    echo $version->version_sql_errors;
    ?>
</td>
		</tr>
		<?php 
}
?>
	</tbody>
        <th><?php 
echo trans('note');
?>
</th>
        <th class="amount"><?php 
echo trans('amount');
?>
</th>
    </tr>
    <?php 
$sum = 0;
foreach ($results as $result) {
    ?>
        <tr>
            <td><?php 
    echo date_from_mysql($result->payment_date, true);
    ?>
</td>
            <td><?php 
    echo $result->invoice_number;
    ?>
</td>
            <td><?php 
    echo $result->client_name;
    ?>
</td>
            <td><?php 
    echo $result->payment_method_name;
    ?>
</td>
            <td><?php 
            <input type="hidden" name="parent_id" id="parent_id"
                   value="<?php 
echo $invoice->invoice_id;
?>
">

            <input type="hidden" name="client_name" id="client_name" class="hidden"
                   value="<?php 
echo $invoice->client_name;
?>
">

            <input type="hidden" name="invoice_date_created" id="invoice_date_created"
                   value="<?php 
$credit_date = date_from_mysql(date('Y-m-d', time()), TRUE);
echo $credit_date;
?>
">

            <div class="form-group">
                <label for="invoice_password"><?php 
echo lang('invoice_password');
?>
</label>
                <input type="text" name="invoice_password" id="invoice_password" class="form-control"
                       value="<?php 
if ($this->mdl_settings->setting('invoice_pre_password') == '') {
    echo '';
} else {
    echo $this->mdl_settings->setting('invoice_pre_password');
Пример #20
0
</th>
				<th><?php 
echo lang('note');
?>
</th>
				<th class="amount"><?php 
echo lang('amount');
?>
</th>
			</tr>
			<?php 
foreach ($results as $result) {
    ?>
			<tr>
				<td><?php 
    echo date_from_mysql($result->payment_date, TRUE);
    ?>
</td>
				<td><?php 
    echo $result->invoice_number;
    ?>
</td>
				<td><?php 
    echo $result->client_name;
    ?>
</td>
				<td><?php 
    echo $result->payment_method_name;
    ?>
</td>
				<td><?php 
Пример #21
0
				<div class="controls">
					<input type="text" name="client_name" id="client_name" style="margin: 0 auto;" data-provide="typeahead" data-items="8" data-source='' autocomplete="off" value="<?php 
echo $invoice->client_name;
?>
">
				</div>
			</div>

			<div class="control-group">
				<label class="control-label"><?php 
echo lang('invoice_date');
?>
: </label>
				<div class="controls input-append date datepicker">
					<input size="16" type="text" name="invoice_date_created" id="invoice_date_created" value="<?php 
echo date_from_mysql($invoice->invoice_date_created, TRUE);
?>
" readonly>
					<span class="add-on"><i class="icon-th"></i></span>
				</div>
			</div>
			
			<div class="control-group">
				<label class="control-label"><?php 
echo lang('invoice_group');
?>
: </label>
				<div class="controls">
					<select name="invoice_group_id" id="invoice_group_id">
						<option value=""></option>
						<?php 
Пример #22
0
?>
</th>
        </tr>
        </thead>

        <tbody>
        <?php 
foreach ($payments as $payment) {
    ?>
            <tr>
                <td><?php 
    echo date_from_mysql($payment->payment_date);
    ?>
</td>
                <td><?php 
    echo date_from_mysql($payment->invoice_date_created);
    ?>
</td>
                <td><?php 
    echo anchor('invoices/view/' . $payment->invoice_id, $payment->invoice_number);
    ?>
</td>
                <td>
                    <a href="<?php 
    echo site_url('clients/view/' . $payment->client_id);
    ?>
"
                       title="<?php 
    echo lang('view_client');
    ?>
">
Пример #23
0
                <th><?php echo lang('every'); ?></th>
                <th><?php echo lang('next_date'); ?></th>
                <th><?php echo lang('options'); ?></th>
            </tr>
        </thead>

        <tbody>
            <?php foreach ($recurring_invoices as $invoice) { ?>
            <tr>
                <td><span class="label <?php if ($invoice->recur_status == 'active') { ?>label-success<?php } ?>"><?php echo lang($invoice->recur_status); ?></span></td>
                <td><a href="<?php echo site_url('invoices/view/' . $invoice->invoice_id); ?>"><?php echo $invoice->invoice_number; ?></a></td>
                <td><?php echo anchor('clients/view/' . $invoice->client_id, $invoice->client_name); ?></td>
                <td><?php echo date_from_mysql($invoice->recur_start_date); ?></td>
                <td><?php echo date_from_mysql($invoice->recur_end_date); ?></td>
                <td><?php echo lang($recur_frequencies[$invoice->recur_frequency]); ?></td>
                <td><?php echo date_from_mysql($invoice->recur_next_date); ?></td>
                <td>
                    <div class="options btn-group">
                        <a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#"><i class="icon-cog"></i> <?php echo lang('options'); ?></a>
                        <ul class="dropdown-menu">
                            <li>
                                <a href="<?php echo site_url('invoices/recurring/stop/' . $invoice->invoice_recurring_id); ?>">
                                    <i class="icon-ban-circle"></i> <?php echo lang('stop'); ?>
                                </a>
                            </li>
                            <li>
                                <a href="<?php echo site_url('invoices/recurring/delete/' . $invoice->invoice_recurring_id); ?>" onclick="return confirm('<?php echo lang('delete_record_warning'); ?>');">
                                    <i class="icon-trash"></i> <?php echo lang('delete'); ?>
                                </a>
                            </li>
                        </ul>
">
                </div>
            </div>

            <div class="form-group has-feedback">
                <label for="quote_date_created">
                    <?php 
echo trans('quote_date');
?>
                </label>

                <div class="input-group">
                    <input name="quote_date_created" id="quote_date_created"
                           class="form-control datepicker"
                           value="<?php 
echo date_from_mysql($quote->quote_date_created, true);
?>
">
										<span class="input-group-addon">
												<i class="fa fa-calendar fa-fw"></i>
										</span>
                </div>
            </div>

            <div class="form-group">
                <label for="invoice_group_id">
                    <?php 
echo trans('invoice_group');
?>
                </label>
?>
</th>
			<th><?php 
echo lang('options');
?>
</th>
		</tr>
	</thead>

	<tbody>
		<?php 
foreach ($payments as $payment) {
    ?>
		<tr>
			<td><?php 
    echo date_from_mysql($payment->payment_date);
    ?>
</td>
			<td><?php 
    echo $payment->invoice_number;
    ?>
</td>
			<td><?php 
    echo format_currency($payment->payment_amount);
    ?>
</td>
			<td><?php 
    echo $payment->payment_method_name;
    ?>
</td>
			<td><?php 
Пример #26
0
                        </div>
                    </div>

                    <div class="form-group has-feedback">
                        <div class="col-xs-12 col-sm-3 text-right text-left-xs">
                            <label for="task_finish_date"><?php 
echo lang('task_finish_date');
?>
: </label>
                        </div>
                        <div class="col-xs-12 col-sm-9">
                            <div class="input-group">
                                <input name="task_finish_date" id="task_finish_date"
                                       class="form-control datepicker"
                                       value="<?php 
echo date_from_mysql($this->mdl_tasks->form_value('task_finish_date'));
?>
">
                            <span class="input-group-addon">
                                <i class="fa fa-calendar fa-fw"></i>
                            </span>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-xs-12 col-sm-3 text-right text-left-xs">
                            <label class="control-label"><?php 
echo lang('status');
?>
: </label>
                            <td style="text-align:right;"><?php 
echo date_from_mysql($invoice->invoice_date_created);
?>
</td>
                        </tr>
                        <tr class="<?php 
echo $is_overdue ? 'overdue' : '';
?>
">
                            <td><?php 
echo trans('due_date');
?>
</td>
                            <td class="text-right">
                                <?php 
echo date_from_mysql($invoice->invoice_date_due);
?>
                            </td>
                        </tr>
                        <tr class="<?php 
echo $is_overdue ? 'overdue' : '';
?>
">
                            <td><?php 
echo trans('amount_due');
?>
</td>
                            <td style="text-align:right;"><?php 
echo format_currency($invoice->invoice_balance);
?>
</td>
Пример #28
0
<?php

foreach ($client_notes as $client_note) {
    ?>
    <div class="alert alert-default">
        <p><strong><?php 
    echo date_from_mysql($client_note->client_note_date, true);
    ?>
</strong>&nbsp;
            <?php 
    echo nl2br($client_note->client_note);
    ?>
        </p>
    </div>
<?php 
}
Пример #29
0
    ?>
</td>
                    <td><?php 
    echo $task_statuses["{$task->task_status}"]["label"];
    ?>
</td>
                    <td>
                    <span class="<?php 
    if ($task->is_overdue) {
        ?>
font-overdue<?php 
    }
    ?>
">
                    <?php 
    echo date_from_mysql($task->task_finish_date);
    ?>
                    </span>
                    </td>
                    <td><?php 
    echo $task->project_name;
    ?>
</td>
                    <td><?php 
    echo format_currency($task->task_price);
    ?>
</td>
                    <td>
                        <a href="<?php 
    echo site_url('tasks/form/' . $task->task_id);
    ?>
            <input type="hidden" name="parent_id" id="parent_id"
                   value="<?php 
echo $invoice->invoice_id;
?>
">

            <input type="hidden" name="client_name" id="client_name" class="hidden"
                   value="<?php 
echo $invoice->client_name;
?>
">

            <input type="hidden" name="invoice_date_created" id="invoice_date_created"
                   value="<?php 
$credit_date = date_from_mysql(date('Y-m-d', time()), true);
echo $credit_date;
?>
">

            <div class="form-group">
                <label for="invoice_password"><?php 
echo trans('invoice_password');
?>
</label>
                <input type="text" name="invoice_password" id="invoice_password" class="form-control"
                       value="<?php 
if ($this->mdl_settings->setting('invoice_pre_password') == '') {
    echo '';
} else {
    echo $this->mdl_settings->setting('invoice_pre_password');