Beispiel #1
0
?>
" name="setFilters" method="post" action="" style="margin:0;">
        <input type="hidden" id="reportFilters_<?php 
echo $Media['ID'];
?>
" value="<?php 
echo $Media['ID'];
?>
" name="reportFilter[<?php 
echo $Media['ID'];
?>
][EID]" />
            <?php 
if (!empty($_SESSION['reportFilters'][$Media['ID']])) {
    if (count($_SESSION['reportFilters'][$Media['ID']]) > 1) {
        $Filters = df_cleanArray($_SESSION['reportFilters'][$Media['ID']]);
        $_SESSION['reportFilters'][$Media['ID']] = $Filters;
        $FilterVisiable = 'block';
    }
}
if (!isset($Filters)) {
    $Filters = '';
}
echo dr_BuildReportFilters($Config, $Media['ID'], $Filters);
?>
        <div style="clear:both;"></div>
            <?php 
$ButtonAlign = 'center';
if (!empty($Config['_SubmitAlignment'])) {
    $ButtonAlign = $Config['_SubmitAlignment'];
}
Beispiel #2
0
function df_deleteEntries($EID, $Data)
{
    global $wpdb;
    $Data = df_cleanArray(explode('|||', $Data));
    $El = getelement($EID);
    $Config = $El['Content'];
    if (empty($Config['_Show_Delete']) && empty($Config['_Show_Delete_action'])) {
        return 'Deleting is Disabled';
    }
    if (!empty($RefConfig['Field'])) {
        if (in_array('imageupload', $RefConfig['Field'])) {
            $ImagesToDelete = array_keys($RefConfig['Field'], 'imageupload');
        }
    }
    $Index = 0;
    $Return = '';
    foreach ($Data as $ID) {
        $ID = str_replace($EID . '_', '', $ID);
        //$Pre = $wpdb->escape("SELECT * FROM `" . $Config['_main_table'] . "` WHERE `" . $Config['_ReturnFields'][0] . "` = '" . $ID . "' LIMIT 1;");
        $Pre = "SELECT * FROM `" . $Config['_main_table'] . "` WHERE `" . $Config['_ReturnFields'][0] . "` = '" . $ID . "' LIMIT 1;";
        $OldData = $wpdb->get_row($Pre, ARRAY_A);
        dr_trackActivity('Delete', $EID, $ID);
        if (!empty($ImagesToDelete)) {
            foreach ($ImagesToDelete as $Field) {
                if (file_exists($OldData[$Field])) {
                    unlink($OldData[$Field]);
                }
            }
        }
        // post update processess
        if (!empty($Config['_FormProcessors'])) {
            foreach ($Config['_FormProcessors'] as $processID => $Setup) {
                if (!empty($Setup['_onDelete'])) {
                    if (file_exists(WP_PLUGIN_DIR . '/db-toolkit/data_form/processors/' . $Setup['_process'] . '/functions.php')) {
                        include_once WP_PLUGIN_DIR . '/db-toolkit/data_form/processors/' . $Setup['_process'] . '/functions.php';
                        $func = 'pre_process_' . $Setup['_process'];
                        if (function_exists($func)) {
                            $OldData = $func($OldData, $Setup, $Config);
                        }
                    }
                }
            }
        }
        $deleteQuery = "DELETE FROM `" . $Config['_main_table'] . "` WHERE `" . $Config['_ReturnFields'][0] . "` = '" . $ID . "' LIMIT 1;";
        $Rows = $wpdb->query($deleteQuery);
        // post update processess
        if (!empty($Config['_FormProcessors'])) {
            foreach ($Config['_FormProcessors'] as $processID => $Setup) {
                if (!empty($Setup['_onDelete'])) {
                    if (file_exists(WP_PLUGIN_DIR . '/db-toolkit/data_form/processors/' . $Setup['_process'] . '/functions.php')) {
                        include_once WP_PLUGIN_DIR . '/db-toolkit/data_form/processors/' . $Setup['_process'] . '/functions.php';
                        $func = 'post_process_' . $Setup['_process'];
                        if (function_exists($func)) {
                            $OldData = $func($OldData, $Setup, $Config);
                            if (!is_array($OldData)) {
                                //$Config['_UpdateSuccess'] = $OldData;
                            }
                        }
                    }
                }
            }
        }
        $Index++;
    }
    $Note = 'Item';
    if ($Rows > 1) {
        $Note = 'Items';
    }
    return $Rows . ' ' . $Note . ' Deleted<br />';
}