}
        if ($verbose_level >= 1) {
            echo "\n Total Customers Found: " . $numrow;
        }
        if ($numrow == 0) {
            if ($verbose_level >= 1) {
                echo "\n[No card to create the Invoice]\n";
            }
            exit;
        } else {
            foreach ($resmax as $Customer) {
                $invoice->RetrieveInformation($Customer[0], $billcalls == "on", $billcharges == "on", $nowdate);
                $invoice->CreateInvoice($choose_currency);
                $invoice->BillInvoice($enableminimalamount == 'on', $minimalamount, $customtemplate);
                if ($sendemail == "on") {
                    $invoice->SendEMail($smarty);
                }
            }
        }
    }
}
$HD_Form->init();
if (cardid != '' || !is_null($cardid)) {
    $HD_Form->FG_EDITION_CLAUSE = str_replace("%id", "{$cardid}", $HD_Form->FG_EDITION_CLAUSE);
}
$HD_Form->FG_OTHER_BUTTON1 = false;
$HD_Form->FG_OTHER_BUTTON2 = false;
$form_action = "list";
$list = $HD_Form->perform_action($form_action);
$smarty->display('main.tpl');
// #### TOP SECTION PAGE
                    ?>
' <?php 
                    if ($invoice->payment_status == $data[1]) {
                        ?>
selected<?php 
                    }
                    ?>
>
							<?php 
                    echo $data[0] . " - {$invoice->payment_status}";
                    ?>
						</option>
					<?php 
                }
                ?>
					</select>&nbsp;
					<input type="submit" class="form_input_button" name="submit" value="Update">
				</form>
				<?php 
            }
            break;
        case 'pdf':
            $invoice->DisplayPDF($smarty, $invoice_type_name, $templatefile);
            break;
        case 'email':
            $invoice->SendEMail($smarty, $templatefile);
            break;
    }
} catch (Exception $e) {
    echo "\nInvoice Error: " . $e;
}