Adding dashes to .number_format php function - php

I am a novice in working with the php language but have been learning over some time through testing and lots of time searching on the internet for examples and tutorials. Once in a while I get stumped with a task I just can't seem to figure out on my own. So I am asking that someone point me at least in the right direction in my current question.
I need to have the ability to add basically any character I want in a form field that will display the results I type in. Currently, the template uses the code below for the field and displays back only numbers. I need to upgrade or change it to allow any character I want.
Here it is
.number_format($price, 0, '.', ',')
Do I need to provide any additional info or does this get anyone's gears turning?
Much appreciated.

Related

Bring result of PHP-Script to accepted field in TYPO3 FORM

So, it's my first question here - i found a lot of hints which all working for itself but im struggling now with the final step to get solved.
Guess it's very specific pointed to TYPO3-CMS V9 and higher.
I can also support with all of the Codes, for the moment i guess this will be better on request.
Task: Create a simple Productorderform for logged-in-users pointing just there specific products form the specific price-lists. -> solved by using PHP-Script working with a CSV-File, grabbing also some functions from TYPO3 itself to get needed parameters.
This PHP creates a DATALIST on runtime for the INPUT-Field producing the needed HTML-Code -> solved and working as expected.
Tricky part.
As TYPO3 offers a CORE-Extension called FORM and the Option to - REPEAT - the fieldset.
Also for TYPO3 there is an extension which allows to put PHP-Code directly to TYPO3 as a Content-Element.
FORM itself allows to put Content-Element to a form.
Working so far, but as described, the field (its value) is not recognized when i fire the send button.
So for some reason i have to predefine the trigger also.
I tried step for step to extend the predefined field in the php with the tags of an empty one, all(?) the surrouding DIV etc. to make FORM recognize this field as a "native" field, just extend in the main tag with ... list="prodlist" ...
Well, as you might see, i'm not a developer or programmer, i might have some skills and experiences to know where and how to go with the level (and timeframe) i have.
So i guess the final step might not be that far, but as we say here, i can't see wood because of trees...
The FORM structure by the way is saved to a YAML-file which might be also manipulated, but as i have seen, it gets the triggers -what- to parse in some way from the FORM created.
Many thanks for hints, ideas an hopefully noone was falling to sleep reading this question... ;)

Wordpress Fields getting swapped when having specific values

This is a strange one, but it seems like it should be really easy to solve.
I have a wordpress website Version 4.8.3. PHP 5.6.32.
Whenever I put in a specific value into the title field 6147989800 (or other fields) it get's swapped out on the front end with 8552226270.
I searched in every file on the server for some code (i suspect javascript) that is swapping out the numbers. No luck.
When I search the database the original number 6147989800 is there. But when I do a var_dump of the field is shows 8552226270 and it shows up as 8552226270 on the front end.
This switch happens when I put in 6147989800, 614.798.9800, and 614-798-9800.
I'm at a loss. Even stranger is that when I duplicate the website to a local instance and on a test server the swap doesn't happen.
Any ideas would be great. Thanks!
Thank you John Ellmore for your help. It did end up being a third party Javascript that was doing the phone swap.
I don't know how I missed it [smacks palm against forehead]

PHP/ajax table and Google results

A couple years ago I had a client with a limited budget and a short deadline who wanted a sortable searchable table of their parts inventory online - at the time they had only an excel spreadsheet. I created a database, then I just used Script Artist (because I had it) to do the front end. It all works great and he's been happy with it, except now we'd like to make sure that Google can actually find all 17,000+ parts they have available and not just the first 25.
The page where the inventory is located is just www.thesite.com/inventory.php and the url remains the same no matter what page you're on.
I've been looking around at different options, using pushState vs html snapshots, and I'm not sure what would be the best option or if I can even do anything with the current Script Artist setup or if I should just pitch the whole thing. I'd really rather not have to start over since he still doesn't have much of a budget, so if anyone could give me any input that would be helpful. Thanks.

Google Maps filters

I am very frustrated with my one old month problem. This is my first web page and it's quite complicated (for me).
My problem is with AND and OR in filtering categories in google maps. All tutorials go in the direction of the OR (golf OR theather). What about Golf and London? The more boxes checked, the less markers on the map.
I have two questions:
(1)
I am trying to follow this tutorial. I guess this is a trivial question: where is the data that is displayed in the panel? (I have followed several other tutorials and never had problems with finding the data, but this one...). I believe this tutorial may solve my second question below.
(2) The goal is to have a real estate page where user-sellers can insert properties for sale and user-buyers can view it, filtering the the data by multiple checkbox and/or drop down menus.
The problem I have is that I can't find a way to coordinate the OR and AND.
OR: I could use the Mike's tutorial and I have studied it very carefully.
I didn't find any tutorial when the filters get more complex.
(2B) I tried to work with my old post, and it works with OR as well. but couldn't find the right code when user only checks one (or two) box (like anything in Berkeley). The code(based on the kind Jobsen's code) required user to fill out all checkboxes all the way to the end, then the marker would show up. Couldn't check only 2 boxes and leave others unchecked. Sometimes I want the first filter (City) to be filtered a second time (Bedrooms). Not add any Berkeley + Bedrooms (2 or 3 or 4). Or only Berkeley. Or Berkeley +zip code + type + bedroom OR any combination. The and / or were not working as expected.
Any help with any of the above will be greatly appreciated. Feel free to add any info in the old post as well.Thank you again for your time.
Answer for the question (1) above, pick one:
(a) CSV file; then take a look at this.
(b) stackoverflow question and answer;
(C) you tube;
i chose CSV format. Here is a screenshot to turn csv format into a table using phpmyadmin.
To do the static tutorial which requires only CSV file and not Json (no need to mess with phpmyadmin): download the csv document, but don't open and save it as csv from MS Excel. Saved it inside the notepad as csv file. No idea about google docs.
Any help with the other part of my question (how to filter database with Jquery or Javascript) will be greatly appreciated.

Separate a table in different tabs (HTML, PHP, JavaScript, etc)

Let me start off by saying that this is my first time working with PHP, HTML, JavaScript, and JQuery, so my experience is fairly lacking.
I am helping to build a Web Order Processor, which will display orders, dates, customers, and status. I am pulling orders from our database, and displaying them in a table. the Order Processor is being built in PHP.
Now, I've been asked to separate the table into different tabs, which will be labeled after the possible order statuses we have. Sort of like the tabs at the top of a browser.
My problem is quite a big one: I don't know where to start. I've been searching for a couple hours but I don't think I'm using the correct terminology.
Thank you all in advance. Any help would be appreciated, even if it's just pushing me in the right direction by giving me a couple things to search for.
I would suggest start with this: http://jqueryui.com/demos/tabs/
First make sure your tabs are working with the simple static content
Second upgrade it so every time tab switched, it loads content from the database.
Depending on a tab you can customize request to the server with the status=(NEW,PROCESSES,REFUND ...), and do the query and return a proper data for the tab.
Hope it helps

Categories