Пример #1
0
function onoff_setValue($id, $field, $eid)
{
    global $wpdb;
    $element = getelement($eid);
    $Config = $element['Content'];
    $Data[$Config['_ReturnFields'][0]] = $id;
    $Data[$Config['_ReturnFields'][0]] = $id;
    $Values = $wpdb->get_results("SELECT * FROM `" . $Config['_main_table'] . "` WHERE `" . $Config['_ReturnFields'][0] . "` = '" . $id . "' LIMIT 1;", ARRAY_A);
    if (empty($Values[0][$field])) {
        $Values[0][$field] = 1;
    } else {
        $Values[0][$field] = 0;
    }
    $Data[$eid] = $Values[0];
    unset($Data[$eid][$Config['_ReturnFields'][0]]);
    df_processupdate($Data, $eid);
    return;
}
Пример #2
0
     } else {
         $Return['Message'] = 'No Data submitted';
         echo json_encode($Return);
     }
     exit;
     break;
 case 'update':
     if (empty($Config['_APIMethodUpdate'])) {
         api_Deny();
         exit;
     }
     if (!empty($_POST)) {
         $Data[$Config['_ReturnFields'][0]] = $_POST['itemID'];
         unset($_POST['itemID']);
         $Data[$interfaceID] = $_POST;
         $result = df_processupdate($Data, $interfaceID);
         echo json_encode($result);
     } else {
         $Return['Message'] = 'No Data submitted';
         echo json_encode($Return);
     }
     exit;
     break;
 case 'delete':
     if (empty($Config['_APIMethodDelete'])) {
         api_Deny();
         exit;
     }
     if (!empty($_POST['itemID'])) {
         $result = df_deleteEntries($interfaceID, $_POST['itemID']);
         echo json_encode($result);
Пример #3
0
function df_inlineedit($Entry, $ID, $Value)
{
    $part = explode('_', $Entry, 3);
    $Element = getelement($part[1]);
    $Config = $Element['Content'];
    $preQuery = mysql_query("SELECT * FROM `" . $Config['_main_table'] . "` WHERE `" . $Config['_ReturnFields'][0] . "` = '" . $ID . "'");
    $Data[$part[1]] = mysql_fetch_assoc($preQuery);
    $Data[$Config['_ReturnFields'][0]] = $ID;
    $Data[$part[1]][$part[2]] = $Value;
    $return = df_processupdate($Data, $part[1]);
    if (empty($Config['_NotificationsOff'])) {
        return $return['Message'];
    }
    return 1;
}