public function ipn($gateway = NULL) { $settings = $this->data['settings'] = $this->settings->get_settings(); $user = $this->data['user'] = $this->ion_auth->get_user(user_id()); $invoice = $this->data['invoice'] = $this->core->get_invoice_by_id($_REQUEST['item_number']); if ($gateway == 'paypal') { $this->core->make_paypal_payment($_REQUEST); $pay_data['user'] = $user->username; $pay_data['payment_amount'] = _money_format($_POST['payment_gross']); $pay_data['invoice_id'] = $invoice->invoice_id; // Email for paypal success foreach ($this->core->get_admin_emails() as $email) { $this->email->from($settings['company_email'], $settings['site_name']); $this->email->to($email); $this->email->subject('New Payment!'); $this->email->message($this->load->view('emails/new_payment', $pay_data, true)); $this->email->send(); } } }
?> </td> <td><?php echo $invoice->client->first_name . ' ' . $invoice->client->last_name; ?> </td> <td><?php echo $invoice->project->name; ?> </td> <td><?php echo _money_format($invoice->amount_paid); ?> </td> <td><?php echo _money_format($invoice->amount_due); ?> </td> <td><?php echo $invoice->status; ?> </td> <td> <a href="<?php echo base_url('admin/invoices/view/' . $invoice->id); ?> " rel="tooltip" title="View this invoice"><i class="icon-eye-open"></i></a> <a href="<?php echo base_url('admin/invoices/download/' . $invoice->id); ?> " rel="tooltip" title="Download this invoice as PDF"><i class="icon-download"></i></a>
<div class="panel"> <div class="page-header"> <h1>Successful Payment</h1> </div> <h3>Your payment of <?php echo _money_format($_POST['payment_gross']); ?> has successfully been processed</h3> <a href=".." class="btn btn-success">Click here to continue</a> </div>
<div class="admin-panel"> <div class="page-header"> <?php echo form_open(current_url(), array('class' => 'form-horizontal', 'id' => 'run_cron')); ?> <?php echo form_submit('run_cron', 'Run/ Update Cron', 'class="btn btn-info pull-right"'); ?> <?php echo form_close(); ?> <h1>Dashboard</h1> </div> <p class="lead">Welcome to the dashboard of your clients manager.</p> <h3>Your income this month (<?php echo date('F'); ?> ): <?php echo _money_format($monthly_income); ?> </h3> </div>
?> </td> </tr> <tr> <td colspan="3"></td> <td>Amount Paid</td> <td><?php echo _money_format($invoice->amount_paid); ?> </td> </tr> <tr> <td colspan="3"></td> <td>Balance Due</td> <td><?php echo _money_format($invoice->subtotal + $invoice->tax - $invoice->amount_paid); ?> </td> </tr> </tbody> </table> <div class="invoice-terms">TERMS</div> <p style="text-align:center;"><?php echo $settings['invoice_terms']; ?> </p> </div> </div> </div> <?php }
<td>Total</td> <td><?php echo _money_format($total['total']); ?> </td> </tr> <tr> <td colspan="3"></td> <td>Amount Paid</td> <td><?php echo _money_format($invoice_preview['amount_paid']); ?> </td> </tr> <tr> <td colspan="3"></td> <td>Balance Due</td> <td><?php echo _money_format($total['total'] - $invoice_preview['amount_paid']); ?> </td> </tr> </tbody> </table> <div class="invoice-terms">TERMS</div> <p style="text-align:center;"><?php echo $settings['invoice_terms']; ?> </p> </div>
<h1>New Invoice Created!</h1> <p>You have a new invoice for the amount of <?php echo _money_format($invoice_amount['total']); ?> on the <?php echo $project_name; ?> project.<br></p> Check it out: <a href="<?php echo base_url(); ?> "><?php echo base_url(); ?> </a>