Posts by Leandro Teraoka • 183 points
22 posts
-
0
votes0
answers25
viewsQ: How to simulate a result based on a given probability (e.g.: 8%) in javascript
I am mounting a result simulator of football game from some variables. The logic is as follows: Every minute both teams have a chance to score a goal. This probability is calculated using some…
-
2
votes2
answers45
viewsQ: How to make a counter with javascript speed setting to simulate game time
I’m doing a football game simulation, and I need a function to count the time to 45; What I did worked out, but it’s very fast, I wanted to be able to control the speed, for example, speed 1 counts…
javascriptasked Leandro Teraoka 183 -
0
votes1
answer128
viewsQ: how to do Curl -X POST -d in PHP
I’m doing an integration with an api that brings real estate In the documentation, it looks like this: curl -X POST -d "client_id=1234&client_secret=abcd&grant_type=client_credentials" \…
-
0
votes1
answer371
viewsQ: Best way to create click report (PHP Mysql)
I’m putting together a real estate market system where developers can see the land available for construction. Then I want to record the clicks that each developer gives in any terrain and then I…
-
1
votes2
answers902
viewsQ: How to delete all jpg files inside a PHP folder
I have several folders with images that I need that, by PHP, it deletes all files. JPG before starting a particular function, without deleting the subfolders inside. How can I delete JPG without…
phpasked Leandro Teraoka 183 -
0
votes4
answers1877
viewsQ: Export MYSQL information to JSON
Sorry for the ignorance, I don’t know anything about JSON. I have a MYSQL database site that the client needs to export to JSON to integrate with an app. Can you give me a light where to start? Ex:…
-
1
votes3
answers2171
viewsQ: Javascript function when clicking on any class="foo"
I have a calendar where every day is: <a class="dia" href="#">(Número do dia, ex: 1, 2, 3, etc)</a> Then I need that whenever the class "day" is clicked it calls a function, for example…
-
0
votes1
answer850
viewsQ: Get the input value on the same page with PHP
td well? I have a script in PHP that converts the ZIP code to Coordinate and I would like it to convert automatically according to the value of an input. <input type="text" value="" id="cep" >…
phpasked Leandro Teraoka 183 -
0
votes2
answers522
viewsQ: Bulk change to MYSQL
Hey, guys, all right? I have a database in mysql and I need to make a massive change, it’s like? I want to change all records from the "show_address" column of the ptv_osrs_properties table to "1".…
-
0
votes1
answer169
viewsQ: Average value of entries up to 100km sql
I’m making a query that brings the average values, as long as the distance is up to 90km: SELECT avg(valor),(6371 * acos( cos( radians(-23.2632227) ) * cos( radians( lat ) ) * cos( radians( lng ) -…
-
2
votes1
answer416
viewsQ: PHP find addresses up to 5km away
Hello. I’m mounting a system to find the nearest service provider to the zip code. For this I used the script below to convert cep in coordinate. $cep = "01238010"; $geocode =…
-
1
votes1
answer389
viewsQ: Unsupported error operand types
When I import the immovable xml it does the math according to the criteria. One of the criteria is the price, the most expensive appear first, for that I divided the price value by 10 million and…
phpasked Leandro Teraoka 183 -
0
votes1
answer231
viewsQ: Javascript - Prevent select option smaller than other
Hello. I am making a system for scheduling by time. I have 2 select’s: start and end. I need a function to prevent the end time from being less than the start time + 3. Ex: start = 10, the end…
-
0
votes0
answers422
viewsQ: How to create a calendar field in PHP or Javascript?
I need the following, to have an open calendar (if possible already come with yesterday’s dates back blocked) to make service scheduling, when clicking the date X, then I’ll throw that date in a…
-
0
votes1
answer1160
viewsQ: How to select a select value and maintain after Submit with PHP
I have the following code that when selecting a month, it puts in the variable $mes, the selected value: if (isset($_POST['mes'])) { $mes = $_POST['mes']; echo "$mes"; } (isset($_POST["mes"])) ?…
phpasked Leandro Teraoka 183 -
2
votes1
answer971
viewsQ: SQL date filter on timestamp
I have the following query: SELECT name, commission, timestamp, state_name FROM magry_awoaffiliate_commission c INNER JOIN magry_users u ON (c.user_id = u.id) INNER JOIN magry_virtuemart_userinfos v…
-
1
votes3
answers1527
viewsQ: Connect 2 tables with same id
I think my doubt is easy (from beginner). I have 2 tables in mysql: tbl_commission: ID | comissao 1 | 13 2 | 26 tbl_usuario: ID | nome 1 | João 2 | Maria Need to list in table: Nome | Comissão João…
-
0
votes1
answer24
viewsQ: Trasnformar array in Divs?
I have a page php who brings me a registration list, but he brings a array and would like every item of it to come in divs or table with rows. Down with what I’m doing: $db = JFactory::getDbo();…
-
1
votes1
answer149
viewsQ: PHP for each with an if rule
I have a table that brings paid and unpaid commission results. I want him to bring only the pay, I mean, if number_format($row->amount_paid,2) = 0 not bring that line. <?php $i=-1;…
-
0
votes2
answers189
viewsQ: How can I not let the session expire in Joomla when it closes? (or last longer)
I have a building component installed. It has the option to add properties to favorites and creates a list, but when I close and open the browser, regardless of how long it was closed, it deletes…
-
1
votes3
answers1438
viewsQ: How to get value from selected checkbox
I am developing a site that has a search filter for neighborhoods, where the person selects in checkbox the neighborhoods. Then I need to take the values that are checked and play in a text (ex:…
-
1
votes1
answer44
viewsQ: How to view 2 tables within a mysql database?
I’m new with sql and php. is the following, I have an affiliate system that I need to bring a user’s affiliate list. for that use: <?php //traz os usuarios $query = sprintf("SELECT…