-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdo_offer_aed.php
More file actions
36 lines (30 loc) · 1.18 KB
/
Copy pathdo_offer_aed.php
File metadata and controls
36 lines (30 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
require_once(dirname(__FILE__) . "/classes/orderoffer.class.php");
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly');
}
// Check permissions
$acl = $AppUI->acl();
if (!$acl->checkModule('files', 'add')) {
$AppUI->redirect('m=public&a=access_denied');
}
// Receive and process parameters from client
$deliveryDate = w2PgetParam($_POST, "estDeliveryDate");
$projectId = w2PgetParam($_POST, "projectId");
$offeredBy = w2PgetParam($_POST, "offeredBy");
$offeredTo = w2PgetParam($_POST, "offeredTo");
$ownerId = w2PgetParam($_POST, "offerOwner");
$contactId = w2PgetParam($_POST, "offerContact");
$notes = w2PgetParam($_POST, "offerNotes");
$moduleIds = json_decode(w2PgetParam($_POST, "offerModules"), true);
$moduleAmounts = json_decode(w2PgetParam($_POST, "offerAmounts"), true);
$offer = COrderOffer::createNewOffer($projectId, $ownerId, $contactId, $offeredBy, $offeredTo, $deliveryDate, $notes);
$ids = array();
foreach($moduleIds as $mId) {
$ids[] = $mId['id'];
}
$offer->addModules($moduleAmounts, $ids);
echo json_encode(array(
"message" => "Routing ok!"
));
die;