$xml .= xmlEntry('contact_id', $result->fields['id']); $xml .= xmlEntry('short_name', $result->fields['short_name']); $xml .= xmlEntry('contact_middle', $result->fields['contact_middle']); $xml .= xmlEntry('contact_first', $result->fields['contact_first']); $xml .= xmlEntry('contact_last', $result->fields['contact_last']); $xml .= xmlEntry('account_number', $result->fields['account_number']); $xml .= xmlEntry('gov_id_number', $result->fields['gov_id_number']); break; case 'rm_address': $id = $_GET['aID']; $result = $db->Execute("select ref_id, type from " . TABLE_ADDRESS_BOOK . " where address_id = {$id}"); if ($result->fields['type'] == 'im') { // it's a contact record, also delete record $short_name = gen_get_contact_name($id); $contact = new contacts(); if ($contact->delete($result->fields['ref_id'])) { gen_add_audit_log(TEXT_CONTACTS . '-' . TEXT_DELETE . '-' . constant('ACT_' . strtoupper($type) . '_TYPE_NAME'), $short_name); $message[] = 'The record was successfully deleted!'; } else { $message[] = ACT_ERROR_CANNOT_DELETE; } } else { // just delete the address $db->Execute('delete from ' . TABLE_ADDRESS_BOOK . " where address_id = {$id}"); } $message[] = 'The record was successfully deleted!'; $xml .= xmlEntry('address_id', $id); break; case 'get_payment': $id = $_GET['pID']; $result = $db->Execute("select id, hint, enc_value from " . TABLE_DATA_SECURITY . " where id = {$id} limit 1");
<?php // +---------------------------------------------------------------------- // | Demila [ Beautiful Digital Content Trading System ] // +---------------------------------------------------------------------- // | Copyright (c) 2015 http://demila.org All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Email author@demila.org // +---------------------------------------------------------------------- define('USING_LANGUAGE', false); require_once '../../../config.php'; require_once $config['root_path'] . '/core/functions.php'; include_once $config['system_core'] . "/initEngine.php"; admin_login(); if (isset($_POST['deleteMail']) && isset($_POST['id']) && isset($_SESSION['user']['access']['contacts'])) { require_once ROOT_PATH . "/apps/contacts/models/contacts.class.php"; $cms = new contacts(); $cms->delete(intval($_POST['id'])); die(json_encode(array_merge($_POST, array('status' => 'true')))); } elseif (isset($_POST['deleteCategory']) && isset($_POST['id']) && isset($_SESSION['user']['access']['contacts'])) { require_once ROOT_PATH . "/apps/contacts/models/ccategories.class.php"; $cms = new ccategories(); $cms->delete(intval($_POST['id'])); die(json_encode(array_merge($_POST, array('status' => 'true')))); } echo json_encode(array_merge($_POST, array('status' => 'unknown error'))); die;