Jump to content

Abrar

Members
  • Posts

    24
  • 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. Thank you so much @requinix & @mac_gyver The information you provided were very useful. I sorted the issue. @mac_gyver - Your steps where the best to guide me in the right direction. Thanks once again.
  2. @requinix Thanks for your quick reply. Actually i tried different codes and i am not getting a solution for it. To make it more clear I have 2 tables. - 1st table i have the order# - 2nd table i query the SKUfor that order number which may have multiple records (SKU) and i want to formulate these in an array under same order #. and pass those values in the below json format API. Could you pls assist or guide me with some code. { "orderIncrementId": "5000003766", "items": [ { "extension_attributes": { "sku": "15882" }, "qty": 1 } ], "notify": false, "tracks": [ { "track_number": "123456", "title": "fedex Shipment", "carrier_code": "fedex" } ] }
  3. Hi Friends, Hope yo all having a great day! I would like to brief my issue. Below is the API post method where i need to pass the data from my database. { "orderIncrementId": "5000003766", "items": [ { "extension_attributes": { "sku": "15882" }, "qty": 1 } ], "notify": false, "tracks": [ { "track_number": "123456", "title": "fedex Shipment", "carrier_code": "fedex" } ] For a single order number eg,. 5000003766, I may have multiple arrays SKU as below and i need to pass that in the given API. Pls assist. Thanks
  4. Hi Friends, Please find the details: 1. Windows 10 2. Its a basic .PHP file program which has been made to trigger on regular basis using Task Scheduler in windows 10. 3. PHP version 8. 4 .I am trying to copy from one server to another server using a third server. 5. Below is the code i am using. <?php $source = 'xxx.xxx.xxx.xxx/sr/'; // source folder or file $destPath = 'xxx.xxx.xxx.xxx/dest/'; // destination folder or file $files = scandir($source); $archiveFiles = array(); foreach ($files as $file) { if (!in_array($file, array(".", ".."))) { $lastModified = date('d/m/y', filemtime($source . '/' . $file)); if ($lastModified == date("d/m/y")) { array_push($archiveFiles, $file); echo $file . '<br>'; if (copy($source . $file, $destPath . $file)) { echo "files copied"; } else { echo "Canot Copy file"; } } } else { echo "Not Copied " . '<br>'; } } ?>
  5. Hi Kicken, Thank you so much for your reply and support! Yes, even i am trying to copy db backup files on regular basis... The destination do support large files since we manually copy those files but trying to automate with PHP and facing this issue... The same program i am using for the backup ARC files and works like charm. Please guide me. Thank you.
  6. Hi Friends, I am trying to write a small program to copy files on regular basis automatically using PHP.. I have written the code and it works well but any file more than 4GB, its only copying up to 4GB, others are ignored. eg. a video file with 8GB, if we try to copy with the below code, It is only coping 4GB as a result the video is corrupt. Please help, Thanks <?php $source = 'd:/'; // source folder or file $destPath = 'C:/'; // destination folder or file $files = scandir($source); $archiveFiles = array(); foreach ($files as $file) { if (!in_array($file, array(".", ".."))) { $lastModified = date('d/m/y', filemtime($source . '/' . $file)); if ($lastModified == date("d/m/y")) { array_push($archiveFiles, $file); echo $file . '<br>'; if (copy($source . $file, $destPath . $file)) { echo "files copied"; } else { echo "Canot Copy file"; } } } else { echo "Not Copied " . '<br>'; } } ?>
  7. 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
  8. 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.
  9. 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
  10. 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.
  11. 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?
  12. 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?
  13. 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!"; } ?>
  14. 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?
×
×
  • 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.