function merge_skim_scheme($scheme) { require_once 'dirdb.php'; $scheme_base = '-1|00|00|-1|00|00|' . file_get_contents(DIR_SKIM_SCHEMES_BASE . '/' . $scheme); $db = new SkimSchemeBaseDB(); $data = $db->Retrieve($scheme); if ($data['dynamic']) { $scheme_dynamic = file_get_contents(DIR_SKIM_SCHEMES_DYNAMIC . '/' . $scheme); file_write(DIR_SKIM_SCHEMES . '/' . $scheme, $scheme_dynamic . $scheme_base); } else { file_write(DIR_SKIM_SCHEMES . '/' . $scheme, $scheme_base); } }
<?php include 'global-header.php'; include 'global-menu.php'; require_once 'dirdb.php'; $db = new SkimSchemeBaseDB(); $schemes = $db->RetrieveAll(); ?> <script type="text/javascript" src="js/skim-schemes.js"></script> <div class="centered-header"> Skim Schemes: <span id="num-items"><?php echo count($schemes); ?> </span> Configured </div> <form action="xhr.php" method="post" class="xhr-form" id="skim-schemes-form"> <table align="center" width="90%" cellspacing="0" class="item-table"> <thead> <tr> <td class="ta-center" style="width: 25px;"> <input type="checkbox" class="check-all"/> </td> <td> Scheme </td> <td class="ta-center"> 1 </td>
function _xSkimSchemesDeleteBulk() { require_once 'dirdb.php'; $db = new SkimSchemeBaseDB(); foreach (explode(',', $_REQUEST['scheme']) as $scheme) { $db->Delete($scheme); @unlink(DIR_SKIM_SCHEMES . '/' . $scheme); @unlink(DIR_SKIM_SCHEMES_DYNAMIC . '/' . $scheme); } JSON::Success(array(JSON_KEY_MESSAGE => 'Skim schemes have been deleted')); }