Example #1
0
function InsertAccomplishment()
{
    $request = Slim::getInstance()->request();
    $objAccomplishment = json_decode($request->getBody());
    $sql = "INSERT INTO user_accomplishment \t\n\t\t(user_id, company_id, accomplishment_id, accomplishment_desc) \n\t\tVALUES (:user_id, :company_id , :accomplishment_id, :accomplishment_desc)";
    $objAccomplishment->accomplishment_desc = _cleanup_text($objAccomplishment->accomplishment_desc);
    error_log("The sql is " . $sql);
    try {
        $db = getConnection();
        $stmt = $db->prepare($sql);
        $stmt->bindParam("user_id", $objAccomplishment->user_id);
        $stmt->bindParam("company_id", $objAccomplishment->company_id);
        $szGuid = NewGuid();
        $stmt->bindParam("accomplishment_id", $szGuid);
        $stmt->bindParam("accomplishment_desc", $objAccomplishment->accomplishment_desc);
        $stmt->execute();
        $db = null;
        echo json_encode($objAccomplishment);
    } catch (PDOException $e) {
        error_log($e->getMessage());
        echo '{"error":{"text":' . $e->getMessage() . '}}';
    }
}
Example #2
0
function addSalesInvoiceLineXml($lines, $lineNumber, $productCode, $qty, $price, $taxRate)
{
    $line = $lines->addChild('SalesInvoiceLine');
    $line->addChild('LineNumber', $lineNumber);
    $line->addChild('Guid', NewGuid());
    $product = $line->addChild('Product');
    $product->addChild('ProductCode', $productCode);
    $line->addChild('OrderQuantity', $qty);
    $line->addChild('UnitPrice', $price);
    $line->addChild('LineTotal', $qty * $price);
    $line->addChild('LineTax', $qty * $price * $taxRate);
    $tax = $product->addChild('Tax');
    $tax->addChild('Rate', $taxRate);
}
Example #3
0
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    $request_id = Req_UTS_ . $member_number;
    //echo $request_id;
    //die;
    $sql = "select comments from members where COMMENTS='" . $content . "'";
    $result = oci_parse($conn, $sql) or die(" ");
    oci_execute($result);
    $numrows = oci_fetch_all($result, $res);
    if ($numrows <= 0) {
        // End Generate Guid
        $Guid = NewGuid();
        $xml_data = '<?xml version="1.0" encoding="UTF-8"?>
<FIXML xsi:schemaLocation="http://www.finacle.com/fixml CustInq.xsd" xmlns="http://www.finacle.com/fixml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header>
<RequestHeader>
<MessageKey>
<RequestUUID>' . $request_id . '</RequestUUID>
<ServiceRequestId>CustInq</ServiceRequestId>
<ServiceRequestVersion>10.2</ServiceRequestVersion>
<ChannelId>UTS</ChannelId>
<LanguageId></LanguageId>