Esempio n. 1
0
/**
 * Deletes a contact and its attribiutes
 *
 * @param string $party_id the id of the client
 * @param string $contact_mech_type the type of the contact
 * @return void
 */
function contact_delete($party_id, $contact_mech_type)
{
    $contact_mech_id = contact_generate_id($party_id, $contact_mech_type);
    $query = "DELETE FROM contact_mech_attribute WHERE CONTACT_MECH_ID = '{$contact_mech_id}'";
    db_query($query);
    $query = "DELETE FROM contact_mech WHERE CONTACT_MECH_ID = '{$contact_mech_id}'";
    db_query($query);
}
Esempio n. 2
0
     foreach ($_FILES['requisition']['name'] as $key => $_requisition) {
         if (!empty($_requisition)) {
             $file_prefix = $_SESSION['CART']['PRODUCTS'][$key]['PRODUCT_CATEGORY_ID'] . $_SESSION['CART']['PRODUCTS'][$key]['OFFER'];
             if (!document_upload($order_id, $file_prefix . '_' . $_FILES['requisition']['name'][$key], $_FILES['requisition']['tmp_name'][$key])) {
                 $errors[] = 'Error uploading requisition files. Please contact support';
             }
         }
     }
 }
 // Generating PDF for MM admin and to the customer
 // Generating PDF to be sent to production and the two MM mails
 import('html2pdf/html2pdf.class');
 include ROOT . 'scripts/order-confirmation-pdf.php';
 $customer_pdf = build_customer_pdf($order_id, $_SESSION['user']['PARTY_ID'], true);
 $production_pdf = build_customer_pdf($order_id, $_SESSION['user']['PARTY_ID'], false);
 $order_email = contact_mech_get_attribute(contact_generate_id($_SESSION['user']['PARTY_ID'], ORDER_CONTACTS), CNT_ATTR_EMAIL);
 $affiliate = $affiliate = person_affiliate_get($_SESSION['user']['PARTY_ID']);
 // Sending to client, additional email, profile responsible
 email_send([$system_settings['ORDER_SAFETY_EMAIL'], $affiliate['AFFILIATE_EMAIL']], 'Megamedia test Production', 'Production Body', $production_pdf);
 email_send([$order_email, $additional_email, $affiliate['AFFILIATE_EMAIL'], $system_settings['ORDER_SAFETY_EMAIL']], 'Megamedia test Customer', 'Customer Body', $customer_pdf);
 $Cart->reset();
 if (empty($errors)) {
     if ($is_offer) {
         $message = 'Your offer has been saved';
     } else {
         $message = 'Thank you for your order';
     }
     header(sprintf('location: /dashboard/dashboard?success=%s', $message));
     exit;
 } else {
     $success[] = 'Order accepted';