}); } ); </script> <?php if ($active_tab == 'addexpense') { $expense_id = 0; if (isset($_REQUEST['expense_id'])) { $expense_id = $_REQUEST['expense_id']; } $edit = 0; if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'edit') { $edit = 1; $result = $obj_payment->gmgt_get_income_data($expense_id); //var_dump($result); } ?> <div class="panel-body"> <form name="expense_form" action="" method="post" class="form-horizontal" id="expense_form"> <?php $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'insert'; ?> <input type="hidden" name="action" value="<?php echo $action; ?> "> <input type="hidden" name="expense_id" value="<?php echo $expense_id;
function gmgt_invoice_print($invoice_id) { $obj_payment = new Gmgtpayment(); if ($_REQUEST['invoice_type'] == 'invoice') { $invoice_data = get_invoice_data($invoice_id); } if ($_REQUEST['invoice_type'] == 'income') { $income_data = $obj_payment->gmgt_get_income_data($invoice_id); } if ($_REQUEST['invoice_type'] == 'expense') { $expense_data = $obj_payment->gmgt_get_income_data($invoice_id); } ?> <div class="modal-body"> <div id="invoice_print" style="width: 90%;margin:0 auto;"> <div class="modal-header"> <h4 class="modal-title"><?php echo get_option('gmgt_system_name'); ?> </h4> </div> <table width="100%" border="0"> <tbody> <tr> <td width="70%"> <img style="max-height:80px;" src="<?php echo get_option('gmgt_system_logo'); ?> "> </td> <td align="right" width="24%"> <h5><?php $issue_date = 'DD-MM-YYYY'; if (!empty($income_data)) { $issue_date = $income_data->invoice_date; $payment_status = $income_data->payment_status; } if (!empty($invoice_data)) { $issue_date = $invoice_data->payment_date; $payment_status = $invoice_data->payment_status; } if (!empty($expense_data)) { $issue_date = $expense_data->invoice_date; $payment_status = $expense_data->payment_status; } echo __('Issue Date', 'gym_mgt') . " : " . $issue_date; ?> </h5> <h5><?php echo __('Status', 'gym_mgt') . " : " . $payment_status; ?> </h5> </td> </tr> </tbody> </table> <hr> <table width="100%" border="0"> <tbody> <tr> <td align="left"> <h4><?php _e('Payment To', 'gym_mgt'); ?> </h4> </td> <td align="right"> <h4><?php _e('Bill To', 'gym_mgt'); ?> </h4> </td> </tr> <tr> <td valign="top" align="left"> <?php echo get_option('gmgt_system_name') . "<br>"; echo get_option('gmgt_gym_address') . ","; echo get_option('gmgt_contry') . "<br>"; echo get_option('gmgt_contact_number') . "<br>"; ?> </td> <td valign="top" align="right"> <?php if (!empty($expense_data)) { echo $party_name = $expense_data->supplier_name; } else { if (!empty($income_data)) { $member_id = $income_data->supplier_name; } if (!empty($invoice_data)) { $member_id = $invoice_data->member_id; } $patient = get_userdata($member_id); echo $patient->display_name . "<br>"; echo get_user_meta($member_id, 'address', true) . ","; echo get_user_meta($member_id, 'city_name', true) . ","; echo get_user_meta($member_id, 'mobile', true) . "<br>"; } ?> </td> </tr> </tbody> </table> <hr> <h4><?php _e('Invoice Entries', 'gym_mgt'); ?> </h4> <table class="table table-bordered" width="100%" border="1" style="border-collapse:collapse;"> <thead> <tr> <th class="text-center">#</th> <th class="text-center"> <?php _e('Date', 'gym_mgt'); ?> </th> <th width="60%"><?php _e('Entry', 'gym_mgt'); ?> </th> <th><?php _e('Price', 'gym_mgt'); ?> </th> <th class="text-center"> <?php _e('Username', 'gym_mgt'); ?> </th> </tr> </thead> <tbody> <?php $id = 1; $total_amount = 0; if (!empty($income_data) || !empty($expense_data)) { if (!empty($expense_data)) { $income_data = $expense_data; } $patient_all_income = $obj_payment->get_oneparty_income_data($income_data->supplier_name); foreach ($patient_all_income as $result_income) { $income_entries = json_decode($result_income->entry); foreach ($income_entries as $each_entry) { $total_amount += $each_entry->amount; ?> <tr> <td class="text-center"><?php echo $id; ?> </td> <td class="text-center"><?php echo $result_income->invoice_date; ?> </td> <td><?php echo $each_entry->entry; ?> </td> <td class="text-right"> <?php echo $each_entry->amount; ?> </td> <td class="text-center"><?php echo gym_get_display_name($result_income->receiver_id); ?> </td> </tr> <?php $id += 1; } } } if (!empty($invoice_data)) { $total_amount = $invoice_data->total_amount; ?> <tr> <td class="text-center"><?php echo $id; ?> </td> <td class="text-center"><?php echo $invoice_data->payment_date; ?> </td> <td><?php echo $invoice_data->title; ?> </td> <td class="text-right"> <?php echo $invoice_data->unit_price; ?> </td> <td class="text-center"><?php echo gym_get_display_name($invoice_data->receiver_id); ?> </td> </tr> <?php } ?> </tbody> </table> <table width="100%" border="0"> <tbody> <?php if (!empty($invoice_data)) { $total_amount = $invoice_data->unit_price; $grand_total = $invoice_data->unit_price - $invoice_data->discount; ?> <tr> <td width="80%" align="right"><?php _e('Sub Total :', 'gym_mgt'); ?> </td> <td align="right"><?php echo $total_amount; ?> </td> </tr> <tr> <td width="80%" align="right"><?php _e('Discount :', 'gym_mgt'); ?> </td> <td align="right"><?php echo $invoice_data->discount; ?> </td> </tr> <tr> <td colspan="2"> <hr style="margin:0px;"> </td> </tr> <?php } if (!empty($income_data)) { $grand_total = $total_amount; } ?> <tr> <td width="80%" align="right"><?php _e('Grand Total :', 'gym_mgt'); ?> </td> <td align="right"><h4><?php echo $grand_total; ?> </h4></td> </tr> </tbody> </table> </div> </div> <?php die; }