Пример #1
0
     $root->addChild('TRANS_TXT', $row['trans_txt']);
     $root->addChild('COMMENT', $row['comment']);
     $root->addChild('IS_CONFIRMED', $row['is_confirmed']);
     $root->addChild('CONFIRMATION_DATE', c_data($row['confirmation_date']));
     $root->addChild('SELLER_TIN', $row['seller_tin']);
     $root->addChild('SELLER_NAME', $row['seller_name']);
     $root->addChild('CATEGORY', $row['category']);
     $root->addChild('ORIGIN_TYPE', $row['origin_type']);
     $root->addChild('ORIGIN_TEXT', $row['origin_text']);
     $doc = dom_import_simplexml($root);
     $xml = $doc->ownerDocument->saveXML($doc->ownerDocument->documentElement);
     $wsdl_res = $wsdl->save_waybill($xml);
     if ($wsdl_res['status'] == 0) {
         SetOverhead($overhead_id, $wsdl_res['rs_id'], $wsdl_res['waybill_number']);
     } else {
         $error = $wsdl->get_error($wsdl_res[status]);
     }
     break;
 case 'send_aletter':
     $aletter_id = $_REQUEST['id'];
     $row = GetALetter($aletter_id);
     $result = GetALetterDetails($aletter_id);
     $root = new SimpleXMLElement("<?xml version=\"1.0\" encoding=\"utf-8\" ?><WAYBILL/>");
     $first = $root->addChild('SUB_WAYBILLS');
     $first = $root->addChild('GOODS_LIST');
     while ($row_det = mysql_fetch_assoc($result)) {
         //Start Goods
         $second = $first->addChild('GOODS');
         $second->addChild('ID', $row_det['goods_id']);
         $second->addChild('W_NAME', $row_det['name']);
         $second->addChild('UNIT_ID', 1);