PHP - Tracking Dhl Orders With Php
Hi, how can I track my order with DHL API? I want to implement SOAP request in PHP. Can you help me? Edited June 11 by requinixsplit from https://forums.phpfreaks.com/topic/310639-mydhl-soap-request/ Similar TutorialsI have this code below but the output on screen doesnt get sorted alphabetically. Any pointers please ? Many thanks ! Code: [Select] $resultxx = mysql_query(" SELECT DISTINCT CITYID FROM Address ORDER BY `CITYID` asc "); //ORDER here is immaterial if ($myrowxx = mysql_fetch_array($resultxx)) { do { $cityid = $myrowxx["CITYID"]; $sqlcity1 =" SELECT * FROM Cities WHERE CITYID = $cityid ORDER BY `City` asc "; //ORDER here is irrelevant $resultcity1 = mysql_query( $sqlcity1 ) or die (mysql_error()); $myrowcity1 = mysql_fetch_array($resultcity1); printf("<option value=%d> %s", $myrowcity1["CITYID"], $myrowcity1["City"]); } while ($myrowxx = mysql_fetch_array($resultxx)); echo "</select>\n"; } else { echo "Sorry, no records were found!"; echo "</select>\n"; } I've been staring at this for a few hours and know there is a solution...I will post my code...sorry about it's length...I think that is one of the problems when I am trying to think through the logic of what I am trying to do. //fetch production data if( isset ( $action ) && $action == 'fetch_production_data' ) { $query = " SELECT p1.order_id, p1.dept_code, p1.status_id, p1.expected_complete_time FROM production_status p1 LEFT JOIN production_status p2 ON -- find similar records p1.order_id = p2.order_id AND -- ...for the same order p1.dept_code = p2.dept_code AND -- ...and the same department p2.submit_time > p1.submit_time -- ...and that come after the row that p1 found WHERE p1.dept_code IN (5, 6, 7, 8, 10, 11, 12) AND -- limit to department we care about p2.id IS NULL -- filter to keep only the p1 rows that didn't have later p2 rows "; $stmt = $pdo->query( $query ); //array to store order statuses $statuses = []; //build array to store order statuses for each order that has a manufacturing status while ( $row = $stmt->fetch() ) { $statuses[ $row[ "order_id" ] ][ $row[ "dept_code" ] ] = array( 'status_id' => $row[ "status_id" ], 'expected_complete_time' => $row[ "expected_complete_time" ] ); } //filters are set if(isset($_GET['filters'])){ //check field for manipulation $field = $_GET['filters'][0]['field']; if ( $field == 'Job Number' ) $field = 'job_number'; else if ( $field == 'Enterprise' ) $field = 'enterprise'; else exit(); //check type for manipulation $type = $_GET['filters'][0]['type']; if ( $type == '=' ) $type = '='; else if ( $type == 'like' ) $type = 'LIKE'; else exit(); //check value for job_number as numeric $value = $_GET['filters'][0]['value']; if ( $field == 'job_number' && trim( !is_numeric ( $value ) ) ) exit(); else if ( $type == 'LIKE' ) $value = "'%" . $value . "%'"; $filter_data = TRUE; } //pagination if( isset( $field ) && isset( $type ) && isset( $value ) ) $total_pages_sql = "SELECT COUNT(*) FROM production_data WHERE ". $field ." ". $type ." ". $value; else $total_pages_sql = "SELECT COUNT(*) FROM production_data"; $stmt = $pdo->query($total_pages_sql); $stmt->execute(); $records_per_page = 14; $page = $_GET['page']; $offset = ($page-1) * $records_per_page; $total_rows = $stmt->fetchColumn(); $total_pages = ceil($total_rows / $records_per_page); /*fetch production data*/ if( isset( $field ) && isset( $type ) && isset( $value ) ) { $sql = 'SELECT id, job_number, enterprise, description, line_item, as400_ship_date, insert_time FROM production_data WHERE '. $field .' '. $type .' '. $value .' ORDER BY enterprise, job_number, line_item LIMIT '. $offset . ', '. $records_per_page; } else { $sql = 'SELECT id, job_number, enterprise, description, line_item, as400_ship_date, insert_time FROM production_data ORDER BY enterprise, job_number, line_item LIMIT '. $offset . ', '. $records_per_page; } //prepare SQL statement & execute $stmt = $pdo->query($sql); // define departments $dept_codes = [5,6,7,8,10,11,12]; //output data into spreadsheet view while(list($id, $job_number, $enterprise, $description, $line_item, $as400_ship_date, $insert_time) = $stmt->fetch(PDO::FETCH_NUM)) { // get/produce status values $status = []; foreach($dept_codes as $key) { $status[$key] = $statuses[$id][$key] ?? 0; } //set format for dates $date_format = 'm/d/Y'; //get crating shipping expected ship date and assign to expected ship date $expected_ship_date = ( $status[8]['expected_complete_time'] != '' ) ? $status[8]['expected_complete_time'] : 'N/A'; //format expected dates $expected_ship_date = ( $expected_ship_date != 'N/A' ) ? date( $date_format, strtotime( $expected_ship_date ) ) : $expected_ship_date; $as400_ship_date = date( $date_format, strtotime( $as400_ship_date ) ); // build the buttons, once $btns = build_change_order_status_btns($id, $user_dept_code, $job_number, $enterprise, $status); //determine if order is new or revised $latestRevisedsql = $pdo->query('SELECT insert_time FROM production_data_archive WHERE order_id = "'.$id.'" ORDER BY insert_time desc LIMIT 1'); $latestRevised = $latestRevisedsql->fetch(); $latestRevisedcnt = $latestRevisedsql->rowCount(); //setup dates for comparison $currentDate = strtotime(date('Y-m-d H:i:s')); $revisedDate = strtotime($latestRevised['insert_time']); $insertDate = strtotime($insert_time); //add 24hrs to revised date $revisedDate = $revisedDate + 86400; $insertDate = $insertDate + 86400; //see if the order is new or was revised in the last 24 hours $is_revised = ( $revisedDate > $currentDate ) ? TRUE : FALSE; $is_new = ( $insertDate > $currentDate && $latestRevisedcnt == 0 ) ? TRUE : FALSE; //build JSON response $json['data'][] = array( 'Enterprise' => $enterprise, 'Job Number' => $job_number, 'LN #' => '<a href="order_details.php?order=' . $id . '">' . $line_item . '</a>', 'Description' => $description, 'AS400 Ship Date' => $as400_ship_date, 'Est Ship' => $expected_ship_date, 'QC' => $btns[10], 'Pole Barn' => $btns[12], 'Thermoforming' => $btns[6], 'Vinyl/Paint' => $btns[5], 'Fnl Asmb 1' => $btns[7], 'Fnl Asmb 2' => $btns[11], 'Crating/Shipping' => $btns[8], 'New' => $is_new, 'Revised' => $is_revised, ); $json['new_orders'][] = [ $id => $latestRevised, 'cdate' => $currentDate, 'revised_date' => $revisedDate, 'is revised' => $is_revised ]; } $json['last_page'] = $total_pages; $json['current_page'] = $page; header('Content-type: text/javascript'); print(json_encode($json, JSON_PRETTY_PRINT)); } If a $_GET var is set (say $_GET['new'] or $_GET['revised']) I'd like to pull all of the orders in the system which were created or revised in the last 24hours. Between all of the other features of Tabulator I am using (pagination, filtering, and I need to setup AJAX sorting) my head is just spinning...the criteria that I am using to figure out if an order was revised or is new is as so: New Order: Created within the last 24 hours and doesn't have any matches in the production_data_archive table Revised Order: Revised in the last 24 hoursMaybe I need to clean up my code a bit...maybe I'm doing too much there. I don't like the way I am handling the pagination and when it comes to the AJAX sorting I'll likely have to handle it in a very similar way. Everything works...I just know I could probably be doing several things better. Hi, here's my problem let's say I gave an end user a url such as e.g http://www.test.com/index.php?user=asdf1234 and I did the same thing to different end users with unique $_GET['user'] value each . my question is, how to track the URLs ?, i mean, how will i know if those urls were clicked and how to count the clicks made ? some possible scenarios could be - the url is pasted and send via email - the url is embeded as a link in some portals Hey guys! I had a quick question that is more about php coding theory than actual code. Anyway, I was curious as to how one would track ad clicks and impressions (especially the impressions). There are tons of sites that do this but I don't really understand how. Thanks Hello.. Anyone knows a little bit about pixel tracking?? I need to implement it in my email.... hi i need a script to track how many times a link has been clicked, if this is possible can i have some guidance cheers matt I've been reading about trackbacks and pings but what I'm trying to do is a bit different. I'm trying to track a referral link. For example, I post this referral link http://www.my-site.com/3ji89 on youtube or a blog.. and that referral links to.. http://www.another-site.com in http://www.another-site.com is it possible to retrieve the referral link http://www.my-site.com/3ji89 ? Not youtube.com or the blog I posted the link on. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=350102.0 I have a small database snippet over at SQLFiddle: http://sqlfiddle.com/#!2/9ff722/55
I need help with writing a query that will allow me to track students in a certain cohort from beginning to graduation. I have two tables: application and stu_acad_cred. The application has the start term and the stu_acad_cred are course registrations. If I want to track students in a fall 2012 (12/FA) cohort, then the query must join the two tables; if the student has a start term of 12/FA *and* has registered for 12/FA courses, the student should be counted. I then want to track those student from year to year or term to term to see if the number of students that started in the 12/FA cohort actually decrease overtime. So, the results should return something similar to below.
| # Students (12/FA Cohort) | Year | ------------------------------------- | 2 | 2012 | | 2 | 2013 | | 2 | 2014 |I am not sure if this can be done straight forward or with a stored procedure but any help or direction is greatly appreciated. Hello everyone. I have a small problem. I might receive a ?aff=## or not on the end of my url when I get a visitor to my website. This depends on if they are sent from a affiliate website or not. If they are it shows fine on the home page but I loss it if they go to another page on my website. I need to keep this ?aff=## information while they look at the other pages. How would I capture and pass this information to my other pages as they surf my site? I tried this to no avail. $aff=$_GET['aff']; I have no clue no adding it back to the next page they go to. Any ideas would be helpful.. I am looking to save the user's access of an application. For instance, when they log in, I create a record in the "track_login" table which includes information such as the requesting IP, the user's ID, the date, (not the user's password), etc. And then for every page they visit, I store a record in the "track_page_viewed" table which includes a FK to the "track_login" table and also includes additional information about their request.
Both the track_login and track_page_viewed tables are currently in the same database as used by the primary application.
So far, so good.
Next, I want to start tracking when a user does special tasks such as when they forget their password and request that a new one be emailed to them. Or maybe when they attempt to login with an invalid username and password. Currently, I just included another table called "track_special" which includes the data, the type of special request, etc.
Now, I am thinking of adding three other things to track:
General PHP errors
MySQL errors
Try/Catch errors which I did not expect to happen
One option is just to add these to my "track_special" table or maybe make one or three new tables in the same database.
But is this a good idea? If I have a SQL error, do I really want to store the error in the same database? Maybe I should use a separate database called "myTrackerDB", and include all the above tables in that database? Or maybe I should just write the data to a flat file, and parse the file on a regular basis, and then store the information in the database?
Please provide any recommendations, guidance, suggestions, criticism, etc. Thank you
Hey guys im a little stumped. My pages has the following links. <a href="?page=yes">Yes</a> to Change content i use <?php if (isset($_GET['page'])) { include ("include/".$_GET['page'].".php"); } else { echo 'Welcome to Liquids Scripts PHP Code repository. Just select the categorie from the top and get all the info required '; } ?> Will this be tracked by google analytics? Any help would be awsome. Hi everyone, I'm developing an affiliate tracking process and after a lot of thought, I was wondering if someone might be able suggest if I'm on the right track. I'm trying to get away from the usual ...?id=135845 type of links. I was thinking about two possibilities: 1. (I don't know if this is possible), but to generate a subdomain with php at the time an affiliate signs up and then track them by extracting the subdomain to identify the affiliate, or 2. Somehow, maybe using a mod rewrite, using the affiliate username at the end of a url, ex. www.website.com/username , you can see that there is no extension, but when a person comes to that url, it will display the contents of www.website.com and I'd extract the username 'username' from the url and query the database to identify the affiliate. Any thoughts on how this can be done? Hi, I'm trying to make/ am looking for a script (that's free) to provide users with a button to donate, once they have donated they are then returned to the website and the donation amount is stored in a database. I have no idea how i would get this made and the paypal website wasn't much help either. If anyone knows of a free script or can help me make one i would be very greatful. Hey guys, I am not a coder at all and would love a little bit of help with my code not working. Basically, I have a redirect script that sends my visitors to a software download. I want to be able to track a snippet from the incoming refer and send it along with the download. I hope I am explaining this correctly. Here is my code: <?php $tid = $_GET["tid"]; header( 'Location: http://www.liutilities.com/affcb/?id=RBgendtd&aff=14231&xat=WU-<?php echo $tid; ?>' ); ?> The page that sends them to this script automatically adds ?tid={keyword here}. What the above script is supposed to do is grab tid and then put it after the &xat=WU- but instead, its only putting the actual code itself (&xat=WU-<?php echo $tid; ?>). Can anyone offer a suggestion? Thanks so much! As we have been working on an eCommerce project, we want to add an option in the eCommerce, that user should have the live location tracking of delivery boy (as same as SWIGGY) in the website. Is there any chance to track the live location using PHP and JavaScript? Searched on the google but nothing resolved my problem? Please anyone suggest us to track the live location of the delivery boy. Thanks in advance This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=311981.0 I am in need of suggestions on how too achive this: I have a surf exchange and whenever a member has viewv a site, it ads this members Id and time to a table called vtp_tracking. I have now created a team script, so I can count the total of surf for members within this team from the vtp_table. What I am in need of is this: I would like to add a bonus for the teams, so my idea was this: every hour run a cronjob to get the results for the last hour by team id lik so: Code: [Select] WHERE vtp_members.team_id="teamid" AND vtp_tracking.credit_members_id=vtp_members.id AND vtp_tracking.action_date>date_sub(NOW(),interval 60 minute I believe the above code will work fine and get me the results for team members for the last hour. Problem: how can I get this result, multiple it with the value from another field and divide by 100 and add this to a third field? eg: (result from above * value from other field / 100) then add to a third field. Anyone willing to try and answer this one? Hello, I'm working on this PHP website of my college. Where in after sending the order to the vendor an e-mail is sent to the person who ordered and the head of that department notifying them about the details of order along with that now I need to send a tracking number of every order in that e-mail which gets automatically incremented in subsequent orders. So please let me know how should I approach or do this. Thank you. I need like, http://www.trackcourier.in/ The customer chooses selected courier service and enters tracking id then clicks its redirect to the appropriate courier service website. eg: If tracking id 12345 the redirect link should be https://www.fedex.com/apps/fedextrack/index.html?tracknumbers=12345&cntry_code=in How to do for India courier services? |