Jump to content

Paulqvz

Members
  • Posts

    35
  • Joined

  • Last visited

Everything posted by Paulqvz

  1. 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
  2. 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';}
  3. Exactly what i was looking for. Thank you thank you
  4. 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
  5. 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
  6. 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
  7. 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?
  8. 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' ");
  9. Good day. I have just written my first php phpexcell file importing into mysql without errors. now my next step is to try and read multiple excell files in a directory " files are same format" and import into mysql. Heres my code so far. <?php $db_host = "localhost";$db_user = "root";$db_pass = "";$db_name ="kk";$db_table = "test"; require '/Classes/PHPExcel.php'; require_once '/Classes/PHPExcel/IOFactory.php'; $objPHPExcel = PHPExcel_IOFactory::load('Amersfoort_WR.xlsx'); foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) { $worksheetTitle = $worksheet->getTitle(); $highestRow = $worksheet->getHighestRow(); // e.g. 10 $highestColumn = $worksheet->getHighestColumn(); // e.g 'F' $highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn); $nrColumns = ord($highestColumn) - 64; echo "File ".$worksheetTitle." has "; echo $nrColumns . ' columns'; echo ' y ' . $highestRow . ' rows.'; echo "$cellValue"; $link = mysql_connect($db_host,$db_user,$db_pass); if(!$link) die ('Could not connect to database: '.mysql_error()); mysql_select_db($db_name,$link); for ($row = 2; $row <= $highestRow; ++ $row) { $val=array(); for ($col = 0; $col < $highestColumnIndex; ++ $col) { $cell = $worksheet->getCellByColumnAndRow($col, $row); $val[] = $cell->getValue(); } $sql = "insert into test (F1, F2, F3, F4) values('".$val['0']."', '".$val['1']."', '".$val['2']."','".$val['3']."')"; mysql_query($sql); } } mysql_close($link); ?>
×
×
  • 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.