<div id="dialog-header">
          <img src="images/dialog-close-22x22.png" id="dialog-close"/>
          Dynamic Skim Scheme for '<?php 
echo $item['scheme'];
?>
'
        </div>

        <form method="post" action="xhr.php" class="xhr-form">

          <div id="dialog-panel" dwidth="860px">
            <div style="padding-top: 2px;">

              <?php 
require_once 'textdb.php';
$db = new SkimSchemesDynamicDB();
$db->db_file = DIR_SKIM_SCHEMES_DYNAMIC . '/' . $item['scheme'];
foreach ($db->RetrieveAll() as $index => $scheme) {
    ?>
              <fieldset class="p-relative" style="background-color: #fff;">
                <legend>Rule #<span class="rule-number"><?php 
    echo $index + 1;
    ?>
</span> </legend>

                <img src="images/delete-22x22.png" class="c-click" style="float: right;" title="Delete"/>
                <input type="hidden" name="rule[]" value=""/>

                <div class="field">
                  <label class="short" style="margin-top: 20px;">% To Content:</label>
                  <span>
Example #2
0
function _xSkimSchemesDynamicEdit()
{
    require_once 'textdb.php';
    $db = new SkimSchemesDynamicDB();
    $db->db_file = DIR_SKIM_SCHEMES_DYNAMIC . '/' . $_REQUEST['scheme'];
    $db->Clear();
    for ($i = 0; $i < count($_REQUEST['rule']); $i++) {
        $data = array();
        foreach ($_REQUEST as $field => $value) {
            if (is_array($value)) {
                $data[$field] = $value[$i];
            }
        }
        if (string_is_empty($data['cycle_1'])) {
            $data['cycle_1'] = 70;
        }
        $db->Add($data);
    }
    JSON::Success(array(JSON_KEY_MESSAGE => 'Dynamic skim scheme settings have been saved', JSON_KEY_DIALOG => _xIncludeCapture('skim-schemes-dynamic.php', $_REQUEST)));
}