Jump to content

Abrar

Members
  • Posts

    18
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Abrar's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi Requinix, Thanks for ur reply! here is my code! <table class="table table-hover font" id="user_table"> <tr> <th>PRODUCT</th> <th>DESCRIPTION</th> <th>REMARKS</th> <th>RESULT DESCRIPTION</th> <th>ACTION</th> </th> </tr> <?php $sql_fin_update = "SELECT A.Department_Code || '/' ||A.Product_Code as Product,B.Description_Arb as Description,A.Remarks as Remarks,D.Result_Description as Result_Description, C.Showroom_Code as showroom_Code,C.Invoice_No as Invoice_No,A.Entered_On as Entered_On,A.User_Id as User_Id From Inv_Qc_Schedule_Detail A ,Inv_Dsales C,Inv_Product B,Inv_Qc_Visitresult D Where A.Showroom_Code = '$SHOWROOM_CODE_Q' And A.Invoice_No = $invoice_q And C.Showroom_Code = A.Showroom_Code And C.Invoice_No = A.Invoice_No And C.Serial_No = A.Inv_Srlno And B.Department_Code = C.Department_Code And B.Product_Code = C.Product_Code And D.Visit_Result = A.Qc_Finding"; $sql_fin_parse = oci_parse($conn, $sql_fin_update); ociexecute($sql_fin_parse); while ($row_coun_fin = oci_fetch_array($sql_fin_parse, OCI_RETURN_NULLS + OCI_ASSOC)) { ?> <tr id="row<?php echo $row_coun_fin['PRODUCT']; ?>"> <td id="pro_val<?php echo $row_coun_fin['PRODUCT']; ?>"><?php echo $row_coun_fin['PRODUCT']; ?></td> <td id="desc_val<?php echo $row_coun_fin['PRODUCT']; ?>"><?php echo $row_coun_fin['DESCRIPTION']; ?></td> <td id="remarks_val<?php echo $row_coun_fin['PRODUCT']; ?>"><?php echo $row_coun_fin['REMARKS']; ?></td> <td id="result_val<?php echo $row_coun_fin['PRODUCT']; ?>"><?php echo $row_coun_fin['RESULT_DESCRIPTION']; ?></td> <td style="display: grid;"> <input type='button' class="edit_button btn btn-info btn-sm m-1" id="edit_button<?php echo $row_coun_fin['PRODUCT']; ?>" value="edit" onclick="edit_row('<?php echo $row_coun_fin['PRODUCT']; ?>');"> <input type='button' style="float: right;" class="save_button btn btn-success btn-sm m-1" id="save_button<?php echo $row_coun_fin['PRODUCT']; ?>" value="save" onclick="save_row('<?php echo $row_coun_fin['PRODUCT']; ?>')"> </td> </tr> <?php } ?> </table> function save_row(id) { var remarks_text = document.getElementById("remarks_text" + id).value; var remarks_text = document.getElementById("remarks_text" + id).value; var remarks_text = document.getElementById("remarks_text" + id).value; var result_text = document.getElementById("result_text" + id).value; console.log(remarks_text); console.log(result_text); $.ajax({ type: 'post', url: 'modify_records.php', data: { edit_row: 'edit_row', row_id: id, remarks_val: remarks_val, result_val: result_val, showroom_code_q: showroom_code_q, invoice_q: invoice_q // showroom_code_q: showroom_code_q, // invoice_q: invoice_q }, success: function(response) { if (response == "success") { document.getElementById("remarks_val" + id).innerHTML = remarks_val; document.getElementById("result_val" + id).innerHTML = result_val; document.getElementById("edit_button" + id).style.display = "block"; document.getElementById("save_button" + id).style.display = "none"; } } }); } Thank you. Please assist me
  2. Hi Friends, I need to create a editable table and all the values in the table should be summited with a single save button, Please help. I was able to save the rows separately but actually what i need is to submit all the modified text in a single button instead a separate button beside each rows.
  3. HI, gw1500se, Thank you so much for the reply! I understood but to make it little more clear, can you help me with some examples since i am newbie to PHP. Thank you so much
  4. Hi Friends, I have developed an API for a client and Could you please help me secure database connection as i don't want to hard code any credentials in the PHP script. Thanks in advance.
  5. Thank you so much Phill W! Exactly what i needed..
  6. Hi friends , I have developed an API and ready to provide that to our client. I would like to know how to handle the security parameters? How to generate API key?
  7. Thanks for the reply Barand! I went through that link, Still i have few confusions.. Can you be more specific please. I am actually making an API and need to provide that ink to client so i have created a connection file as above and uploaded that in a hosting and tried to trigger that from other WWW. But the page is blank and no error msg also... How can i get that connected? Hope i was able to explain you better...Thank you once more... Is this a right way to HOST the API?
  8. r/PHP •Posted by u/Abrar_Sh 5 minutes ago How to connect Oracle database in PHP from external network? Hi Friends, I am trying to connect to oracle db from outside network.. i have enable access to that public IP and port. I am also able to ping that IP from outside network, But not able to connect to database. Please let me know if there is any error in my code.. or is there any other way to connect. Your help is highly appreciated. <?php // Create connection to Oracle $conn = oci_connect("xxxxUSERNAME", "xxxxPASSWORD", "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = xx.xxx.xx.xx) (PORT = 2000) ) (CONNECT_DATA = (SID = xxxxx)))", "AL32UTF8"); if (!$conn) { $m = oci_error(); echo $m['message'], "\n"; exit; } else { print "Connected to Oracle!"; } ?>
  9. Hi @NotionCommotion, Hope you doing great! I contacted the clients and below is their reply with JSON data. { "contact_id": "dfg3453", "serial_no": "I/TEST/21-45", "name": "Bill's TEST Shop", "inv_date": "2021-01-23", "due_date": "2021-01-23", "currency": "KWD", "subtotal": "1065.0", "tax_total": "106.5", "shipment_data": [ { "serial_no": "I/TEST/21-45", "master_no": "123-26365653", "house_no": "QAS2131204", "cost_revenue_items": [ { "charge_ref": "K0067", "currency": "USD", "quantity": "1.0", "selling_rate": "1500.0", "exchange_rate": "0.71", "taxes": ["VAT"] } ] } ] } Their reply -> " The request type is up to your team to specify, as the request will be sent from our side to yours, please find attached the requested sample." My Question: How will they do a delete request for the above JSON data? Currently as you know i have done 3 different request for the same JSON data(Request(POST),Request(PUT),Request(DELETE)) all in a single PHP file, is this right?
  10. Thanks for the suggestion @NotionCommotion. I have contacted the client team that creates the request and asked them about the details, waiting for their reply. I believe after their reply it would we clear and i can proceed accordingly.
  11. Hi Friends, I am trying to do an API with oracle database. The JSON request from 3rd party will look like below. { "contact_id": "1", "serial_no": "100", "name": "baby", "inv_date": "2018-06-27", "due_date": "2018-06-27", "currency": "KD", "subtotal": "143", "tax_total": "13", "shipment_data": [ { "serial_no": "33", "master_no": "55", "house_no": "77", "cost_revenue_items": [ { "charge_ref": "rr", "currency": "INR", "quantity": "2", "selling_rate": "45", "exchange_rate": "7", "taxes": [ { "serial_no": "1", "ref": "INR", "voiding_remarks": "oo" },{ "serial_no": "2", "ref": "KWD", "voiding_remarks": "asd" } ] } ] } ] } how to handle request for JSON in which master is updated (PUT) and child record is (Either INSERTED, UPDATED or DELETED) ?
  12. Hello Barand, Thanks for replying . Sorry, I could not make you understand. I want to know , how the JSON request will Look like when we want to delete one record from "cost_revenue_items". Why I am confused, because "cost_revenue_items" is nested within "$invoice_data -> "Shipment_data". So If they only want to delete only a record from "cost_revenue_items" , in what format JSON request will come ? Will it be nested and sent within parent or will be sent standalone.
  13. Hi Friends , We have the JSON Data coming in this format, $invoice_data = { "CONTACT_ID": "1", "INV_SERIAL_NO": "100", "NAME": "baby", "INV_DATE": "2018-06-27", "DUE_DATE": "2018-06-27", "CURRENCY": "KD", "SUBTOTAL": "143", "TAX_TOTAL": "13", "shipment_data": [ { "SHIP_SERIAL_NO": "44", "MASTER_NO": "55", "HOUSE_NO": "88", "cost_revenue_items": [ { "CHARGE_REF": "tt", "CURRENCY": "INR", "QUANTITY": "2", "SELLING_RATE": "45", "EXCHANGE_RATE": "987" },{ "CHARGE_REF": "ii", "CURRENCY": "INR", "QUANTITY": "2", "SELLING_RATE": "45", "EXCHANGE_RATE": "456" },{ "CHARGE_REF": "op", "CURRENCY": "INR", "QUANTITY": "2", "SELLING_RATE": "45", "EXCHANGE_RATE": "456" } ] } ] } How to write DELETE End-point for child data-set "cost_revenue_items". What I mean to say is how to handle the request to delete one of item from "cost_revenue_items". When "cost_revenue_items" will be deleted ,master "invoice_data" will be updated. This update , we can handle by PUT, but how do we know under that PUT, we have to DELETE one of "cost_revenue_items". Like how the JSON request to only delete one of "cost_revenue_items" will look like. Will JSON request to delete "cost_revenue_items" looks like this ,if it want to delete last record : $invoice_data = { "CONTACT_ID": "1", "INV_SERIAL_NO": "100", "NAME": "baby", "INV_DATE": "2018-06-27", "DUE_DATE": "2018-06-27", "CURRENCY": "KD", "SUBTOTAL": "143", "TAX_TOTAL": "13", "shipment_data": [ { "SHIP_SERIAL_NO": "44", "MASTER_NO": "55", "HOUSE_NO": "88", "cost_revenue_items": [ { "CHARGE_REF": "tt", "CURRENCY": "INR", "QUANTITY": "2", "SELLING_RATE": "45", "EXCHANGE_RATE": "987" },{ "CHARGE_REF": "ii", "CURRENCY": "INR", "QUANTITY": "2", "SELLING_RATE": "45", "EXCHANGE_RATE": "456" } ] } ] } Kindly help me to know , how JSON request will look like ? Thanks a lot
  14. Thank you so much for the suggestions. I am preparing this application for others so we need to consider the security parameters. i will follow Barand suggestion and will use PDO and prepared statements. Thank you once again for your support..
  15. Thank you so much @NotionCommotion! That was a helpful document. Resolved with the below query foreach($request['shipment_data'] as $item) { $SHIP_SERIAL_NO= ($item['SHIP_SERIAL_NO']); $MASTER_NO= ($item['MASTER_NO']); $HOUSE_NO= ($item['HOUSE_NO']); $stid_2 = oci_parse($conn, "Insert into FL_SHIPMENT_DATA (CONTACT_ID,INV_SERIAL_NO,SHIP_SERIAL_NO,MASTER_NO,HOUSE_NO) Values ('$CONTACT_ID','$INV_SERIAL_NO','$SHIP_SERIAL_NO','$MASTER_NO','$HOUSE_NO')"); oci_execute($stid_2); }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.