Jump to content

Paulqvz

Members
  • Content Count

    12
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Paulqvz

  • Rank
    Member
  1. Good day I have three tables - receiving - shipping and stock movement. everyday i transfer into stock movent the sum of receining with date - havein a stock movent entry per day - I also at end of day update with shipping for that day, in stock table I calculate ne stock level. my problem is that when three days bac i stil have stock i need to start subtracting from oldest entry first till it reaches 0 the move over to second eldest? i have no idea where to start or how to achieve this
  2. Good morning guys. I am pulling data from vehicle tracking site via soap curl. but the data format that I am getting it in is unusable, maybee i am doing something wrong. please have a look. here is the code. <?php //Data, connection, auth $dataFromTheForm = $_POST['fieldName']; // request data from the form $soapUrl = "https://fleet11.******.co.za/api/"; // asmx URL of WSDL $soapUser = "********"; // username $soapPassword = "********"; // password // xml post structure $xml_post_string = '<?xml version="1.0" encoding="utf-8"?> <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="fleet11.cartrack.co.za/api/"> <soapenv:Header/> <soapenv:Body> <api:endpoint.get_vehicle_last_positions soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <username xsi:type="xsd:string">?</username> </api:endpoint.get_vehicle_last_positions> </soapenv:Body> </soapenv:Envelope>'; $headers = array( "Content-type: application/x-www-form-urlencoded", "Accept: text/xml", "Cache-Control: no-cache", "Pragma: no-cache", "SOAPAction: fleet11.******.co.za/api/#get_vehicle_last_positions", "Content-length: ".strlen($xml_post_string), ); $url = $soapUrl; // var_dump($url); $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERPWD, $soapUser.":".$soapPassword); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); `curl_setopt($ch, CURLOPT_HEADER, true);` // converting $response = curl_exec($ch); curl_close($ch); //paul add //echo "<pre>"; print_r($response); What is returning is single line entries How di i get this into a format to import into mysql
  3. Sorry this is my cases.js file the js looks like this if(category == 'itc_profile_update') {type_list_name = 'ITC Profile Update'; type_list_name2 = 'itc_profile_update_qt';} if(category == 'vehicle_sales') {type_list_name = 'Vehicle Sales'; type_list_name2 = 'Vehicle_Sales_qt';} if(category == 'icu_query') {type_list_name = 'ICU Query'; type_list_name2 = 'icu_query_qt';} if(category == 'self_help_app') {type_list_name = 'Self Help App Query'; type_list_name2 = 'self_help_app_qt';} if(category == 'general_non_finance') {type_list_name = 'gen_none_fin'; type_list_name2 = 'general_non_finance_qt';} if(category == 'legal') {type_list_name = 'Legal'; type_list_name2 = 'legal_qt';} if(category =='insurance_documents') {type_list_name = 'Insurance Documents'; type_list_name2 = 'insurance_documents_qt';} if(category == 'insurance_general_queries') {type_list_name = 'Insurance General Queries'; type_list_name2 = 'insurance_general_queries_qt';} if(category == 'contact_details_update') {type_list_name = 'contact_details_update'; type_list_name2 = 'contact_details_update_qt';} so i want to do a search form - php where if a person enters "general_non_finance" it will only bring back "gen_none_fin" . $complaint_type = 'general_non_finance'; $sub = "'if(category == ' "; $file = "//var/www/html/sataxicrm/modules/Cases/cases.js"; $content = file_get_contents($file); $pos = strpos($content,$sub.$complaint_type); $end = strpos($content,";}"); $string = substr($content,$pos,($end- $pos)); $array = nl2br($string); //print $content; echo "Query complaint value:Sub value <br>"; print $array; Hope this make more sense
  4. Quick question how would i get only 'ITC Profile Update if i search for itc_profile_update. then when category == 'itc_profile_update' = itc_profile_update then only show 'ITC Profile Update' from {type_list_name = 'ITC Profile Update'; if(category == 'itc_profile_update') {type_list_name = 'ITC Profile Update'; type_list_name2 = 'itc_profile_update_qt';}
  5. Exactly what i was looking for. Thank you thank you
  6. I am already reading it, getting the output, now i need a way to start a my start point and then to end at last tab before ne line without a tab
  7. stop worrying about "query_complaint_type_list" that was just me seeing if i can return data between 2 points - and it worked, but the problem is i wil always know the start point but never the end point, hend me trying to start at Example. \nsales_stage_dom $pos = strpos($content,"nsales_stage_dom"); and end befor \nsales_probability_dom as that is where the dropdown info stops' $end = strpos($content,"\n); and not $end = strpos($content,"\n\t); \nsales_stage_dom \n\t@clear \n\t@orig Closed Lost \n\t@orig Closed Won \n\t@orig Id. Decision Makers \n\t@orig Needs Analysis \n\t@orig Negotiation\/Review \n\t@orig Perception Analysis \n\t@orig Proposal\/Price Quote \n\t@orig Prospecting \n\t@orig Qualification \n\t@orig Value Proposition \nsales_probability_dom \n\t@clear \n\t\"\": \"\" \n\tClosed Won: \"100\" \n\tId. Decision Makers: \"40\" \n\tNeeds Analysis: \"25\" \n\tNegotiation\/Review: \"80\" \n\tPerception Analasis: \"50\" \n\tProposal\/Price Quote: \"65\" \n\tProspecting: \"10\" \n\tQualification: \"20\" \n\tValue Prospecting: \"30\" \nactivity_dom \n\t@clear \n\t@orig Call \n\t@orig Email \n\t@orig Meeting \n\t@orig Note \n\t@orig Task \nsalutation_dom \n\t@clear \n\t\"\": \"\" \n\t@orig Dr. \n\t@orig Mr. \n\t@orig Mrs. \n\t@orig Ms. \n\t@orig Prof. \nreminder_time_options \n\t@clear \n\t@orig 60 \n\t@orig 300 \n\t@orig 600 \n\t@orig 900 \n\t@orig 1800 \n\t@orig 3600 \n\t@orig 7200 \n\t10800: 3 hours prior \n\t18000: 5 hours prior \n\t@orig 86400 \ntask_status_dom
  8. requinix. yes that is the layout of the file. the php starts with <?php return; /* no output */> then the rest is this. query_complaint_type_list is a list name- same as account_type_dom,industry_dom When the api calls "account_type_dom" it must only return @clear "": "" @orig Customer "Brand Owner ": "Brand Owner " Printing Company: Printing Company Installation Company: Installation Company Sales Person: Sales Person Zebra: Zebra When the api calls "industry_dom" it must only return @clear "": "" @orig Apparel @orig Banking @orig Biotechnology @orig Chemicals @orig Communications
  9. Good day all. I am trying to get strings from txt file with a start and an end. $file = "/var/www/html/sataxicrm/custom/include/language/lang.en_us.lists.php"; $content = file_get_contents($file); $pos = strpos($content,"query_complaint_type_list"); $end = strpos($content,"status_0"); $string = substr($content,$pos,($end- $pos)); $array = nl2br($string); //print $content; echo "Database Value:Label Value <br>"; print $array; The above code works well if you knowwhat your end string is, but in my case i do not know. i only know the start. Below is an example of the text As you can see i know it starts with account_type_dom but i do not know that it will end before industry_dom. so i need to stop before industry_dom. how do i do this?
  10. I have below script. it does the while loop 100%. it updates the mysql database one at a time as it should. the problem I have now is that the while loop does not end and go to the next statement as it should. it keeps pollong the database. so when in back end you change to 0 it automatically updates again. Please see if you can help me to see where I can stop this while loop when there are no more loops // Here I select the amount of rows $sql_query = "SELECT ae FROM `debitorderrejectionimport` WHERE ae = '0'"; $rowCount = mysqli_query($conn,$sql_query); $rowCountUpdate = mysqli_num_rows($rowCount); echo $rowCountUpdate; while($rowCountUpdate > 0) { $sql = "UPDATE `ttee`.`au1` INNER JOIN `ttee`.`au` ON (`au1`.`id` = `au`.`id`) INNER JOIN `ttee`.`ae1` ON (`ae1`.`idd` = `au1`.`idd`) INNER JOIN `ttee`.`debitorderrejectionimport` ON (`debitorderrejectionimport`.`nr` = `ae1`.`id`) SET `au`.`amount` = `ae1`.`amount` + `au1`.`amount`, `debitorderrejectionimport`.`ae` = au.id ;"; $result = mysqli_query($conn, $sql); $updated = mysqli_affected_rows($conn); $rowCountUpdate - ($updated);} // if it finished updating and there is no more rows it must continue with below query mysqli_query($conn, " INSERT INTO `sataxicrm754`.`debitorderrejectionimport_back` ( `Outbound`, `Allocation`, `AccountName`, `QueryComplaintType`, `QueryStatus`, `Querytypeoption`, `Description`, `DealID`, `Deals`, `Assignedusername`, `Teams`, `CampaignName`, `CampaignID`, `inserted`, `idnumber`, `nr`, `datew`, `premium`, `policynumber`, `ContactNumber`, `CollectionType`, `OpportunityAmount`, `Broker`, `impref`, `id` ) SELECT `Outbound`, `Allocation`, `AccountName`, `QueryComplaintType`, `QueryStatus`, `Querytypeoption`, `Description`, `DealID`, `Deals`, `Assignedusername`, `Teams`, `CampaignName`, `CampaignID`, `inserted`, `idnumber`, `nr`, `datew`, `premium`, `policynumber`, `ContactNumber`, `CollectionType`, `OpportunityAmount`, `Broker`, `impref`, `id` FROM `sataxicrm754`.`debitorderrejectionimport` WHERE QueryComplaintType <> 'QueryComplaintType' ");
×
×
  • 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.