Posts by phpricardo • 765 points
42 posts
-
-1
votes1
answer27
viewsQ: How to apply a style to the html of a text selected from a textarea field?
Hello, I have a question about how to create an action (button) that when clicking on it will be applied initially a style to a selected text within a textarea field. Yes it is like those same…
-
0
votes1
answer32
viewsQ: Merge different Methods Querys into a single JSON
I’m trying to create a select where returns data in json and then created a method that would be a "database" that is another select bringing a result, as I would to juxtapose all this and bring a…
-
0
votes1
answer82
viewsQ: Change json format output in Rails?
I have an API that has the data in the following format: [ { "id": 1, "vehicle": "350", "code": "350", "delivery_date": "2019-07-26T00:00:00.000Z", "created_at": "2019-08-07T17:00:37.000Z",…
-
1
votes0
answers37
viewsQ: Alert "Toasts" Materialize with Rails
I am lacking in understanding of how to apply the Toasts of Materialize in a Rails code. <% if notice %> <p class="alert alert-success"><%= notice %></p> <% end %>…
-
0
votes1
answer29
viewsQ: Json Merge with Javascript Array
I would like to know (understand) how to treat a json in javascript type: var arrDados = {"mes":["12","5","1"], "mes":["2","8","3"]}; var meses = {1:'Jan', 12:'Dez', 6:'Junho', 5:'Abril', 3:'Março',…
-
1
votes0
answers287
viewsQ: Enable (configure) Ctrl + Click on Vscode functions
There is how to configure or enable the option similar to Ides as phpstorm where you use the shortcut Ctrl + Click in the code functions and the editor Vscode makes the hyperlink of the same? Att.…
-
0
votes2
answers335
viewsQ: Rails + Materialize Select field
Diplomats, I have the following problem: <div class="input-field"> <%= f.label :kind_id %> <%= collection_select(:contact, :kind_id, @kind_options_for_select, :id, :description,…
-
2
votes2
answers1233
viewsQ: SELECT HTML field displaying Previous, current and next month only
I need to make the SELECT field that today is like this (code below) displayed only the previous, current and next month. For example: As we are in the month of MAY so it will display in this select…
-
7
votes2
answers4428
viewsQ: Table to record history record (Best way)?
I am doubtful what would be the best way to create a table so that each action of a record is saved thus creating a history of it. I have the following table, but I don’t know if it’s the best.…
-
1
votes1
answer521
viewsQ: Jquery history.go(-1); does not work Chrome
I’ve done some research even here on stackoverflow about creating a back button. The situation is that I click on a dynamic record to edit, then I have the option to Cancel (which is to go back) in…
-
3
votes6
answers12215
viewsQ: How to view php/mysql and Angularjs data?
I’m trying to do some tests with PHP + Mysql + Angularjs and I was stuck in a doubt of how to treat the database data with angular and send to screen, I have the following codes: con-bd.php <?php…
-
2
votes1
answer50
viewsQ: Back Button with Searched Records
I have a button that at the moment is only a button: <button type="button" name="voltar" id="voltar" class="btn btn-default" style="margin-left: 30px">Cancelar</button>…
-
0
votes1
answer2210
viewsQ: Delete record without page refresh?
I have the following Ajax/Jquery to delete a record as an action of a href. <script type="text/javascript"> function apagarRegistro(idTel) { var baseurl = '<?php echo $sig_url;?>';…
-
1
votes1
answer448
viewsQ: $this->_forward() and Zend Framework
Sirs, In the use of $this->_forward() in the Zend Framework 1 we give a redirect to the controller and action we want. In my case this is not working well in the following situation. I made an…
-
0
votes1
answer188
viewsQ: Zend_session and Zend_pagination with search form
I have problems in a pagination with searching via form in Zend Framework 1. There is a method in the model that makes a query with Where to bring the result as the search done, and the pagination…
-
0
votes1
answer109
viewsQ: Problem with Paging and forward with Zend Framework 1
Use ZF1 and I’m having trouble using the _forward(), The reason is that if I redirect it to a paginated page, the url gets the method of the action that was submitted. Well, for example, if I have a…
-
1
votes2
answers213
viewsQ: Zend Pagination does not display values on the next page
Good Afternoon. I’m using (trying) Zend Pagination (ZF 1) but it’s not displaying the rest of the result on the next page. I have the following method: public function pesquisadocumentosAction() {…
-
1
votes2
answers111
viewsQ: Treating bank search dates
I’m performing the following capture of a date: $dtInicial = $this->_getParam('dataInicial'); // Padrão dd/mm/aaaa To search the bank precisely leave it in the standard yyyy/mm/dd: $dt1 =…
-
0
votes1
answer892
viewsQ: Calculate deadlines other than on weekends
I’ll have a system that will have a term of days Ex: 30 days. I need to calculate a given date within a given deadline, which in case it is a weekend is interpreted as the last working day within…
phpasked phpricardo 765 -
2
votes1
answer153
viewsQ: Update query with select for Procedure
I’m trying to do a query that will enter a previous but I’m not succeeding, the query is like this: UPDATE sca_lotacao AS t0 SET t0.ativo = 0 WHERE ( SELECT * FROM sca_pessoa AS t1 RIGHT JOIN…
-
0
votes1
answer96
viewsQ: Switch in Application.ini ZF 1 configuration
Inside the Zend Framework 1 Application.ini I have the following configuration: resources.multidb.sga.adapter = "PDO_MYSQL" resources.multidb.sga.host = "host.acula.net"…
-
2
votes2
answers781
viewsQ: Group items by a field into different arrays
$resultado = $modelSga->getConsultaSga($ano, $mes, $unidade); foreach ($resultado as $res) { $idServico = $res->id_serv; $servico = array(); if($idServico != $idServicoAnterior) {…
-
1
votes1
answer328
viewsQ: Using confirm() javascript with checkbox
I got this line that’s inside a foreach: <input type="checkbox" id="idAprovacao" name="idAprovacao" onclick="atualizaSituacao(<?php echo $resulta->id_aprovacao;?>);" <?php echo…
-
1
votes3
answers21786
viewsQ: Array inside array... using push arrays
For study purposes and better understanding I am trying to make an array within another array by adding values using the push array_follow my example: <?php $ar1 = array(); array_push($ar1, 1, 2,…
-
2
votes3
answers7456
viewsQ: Button Submit turn a normal link
I need a button with the same values to be "converted" to a normal Link. <input type="submit" name="idPessoa" id="idPessoa" class="text-success" value="<?php echo $this->idPessoa =…
-
0
votes1
answer89
viewsQ: View all Model data in Zend Framework 1
The way I have in this explore I get only 1 dice from each table, but I would like to understand how to print all. // Criamos o objeto do model da tabela 'carros'. $carrosModel = new…
-
1
votes1
answer49
viewsQ: Correct ZF1 foreach in view
I have following controller (ZF1) where I get everyone’s ID from a table and with this ID I use to "filter" and take specific data from another table is a relationship by ID let’s say so. $tabFerias…
-
1
votes2
answers278
viewsQ: ZF1 resulting from controller in view
I’m not sure how in this case to play the values in the project view, follow the code: public function indexAction() { $actor = new Application_Model_Actor(); $resultadoActores =…
-
1
votes1
answer95
viewsQ: Autoloader Zend Framework 1.12
I’m starting (studying) project with zf where I’m not using modules yet. I initially have the following file .../projectozend/application/models/Dbtable/Actor.php <?php class…
-
1
votes2
answers2263
viewsQ: Calculate total "cell" average in php
I need to make a calculation as a result that I get from the query where he made only a division of the total value of a person by the average that was obtained from all. See the image: I don’t know…
phpasked phpricardo 765 -
3
votes3
answers614
viewsQ: Database query in Postgresql
I am trying to make a query in Postgre with the following query: SELECT t3.desc_serv, t3.nm_serv, t1.nm_usu, count(t2.id_atend) TOTAL_ATENDIMENTO FROM usuarios t1 INNER JOIN historico_atendimentos…
-
0
votes1
answer5107
viewsQ: How to average a mysql query result?
How do I get the "Count(t2.id_atend) TOTAL_ATENDIMENTO field " and calculate his PHP media? SELECT t3.desc_serv, t3.nm_serv, t1.nm_usu, count(t2.id_atend) TOTAL_ATENDIMENTO FROM usuarios t1 INNER…
-
-3
votes2
answers404
viewsQ: Using Mysqli, error query
I have the following code: $escolha = $_POST['unidade']; if($escolha == 'ut') { $conn = new mysqli($host1, $user, $pass, $bd); if (mysqli_connect_errno()) { die(mysqli_connect_error()); exit();…
phpasked phpricardo 765 -
-2
votes1
answer620
viewsQ: Function count comments and another program per C command line
I’m having trouble knowing how to develop a function that via command line will count and display the amount of commented lines of another program in . c, for example: Counter Programexample. c -c…
casked phpricardo 765 -
-4
votes1
answer161
viewsQ: What is the essence to model a system?
Due to my idleness in the internship and lack of knowledge to work in even medium-sized projects I am looking for a mission that makes me increase my knowledge both in PHP (mainly) and in databases…
-
2
votes2
answers1836
viewsQ: Duplicate column value, how to avoid?
How exactly do I get this column valueAuxilio does not have its values duplicated, that is, instead of four result lines would be only two. SELECT p.nome, d.nome, c.valorAuxilio FROM sca_pessoa p…
-
1
votes2
answers240
viewsQ: QUERY with no expected result, what might be missing?
Complementing with current information, I understood the current result, and what it seems is duplicated information even, but in different tables, but this is not even with me because I already…
-
2
votes3
answers694
viewsQ: Using function and header file (header)
I am making a simple program but using header file . h (header) and a hello world function, but I have the following warning message: Undefined Reference to 'imprime'. I asked someone else to test…
casked phpricardo 765 -
3
votes3
answers5625
viewsQ: Using Struct in Exercise C Language
/* Write an algorithm that reads data from "N" people (name, sex, age and health) and indicate whether you are fit or not to fulfill the mandatory military service. Inform the totals. */ #include…
casked phpricardo 765 -
2
votes2
answers155
viewsQ: Questions about using Git
I created a new project on Github and then tried to give the git push to upload the files that were on my machine. I did the basic procedures necessary (think) to work, but is giving error of failed…
-
2
votes2
answers706
viewsQ: Print highlighted matrix specific values
In my studies here with matrices I’m trying to highlight only the odd values (leave in bold), but I don’t understand how to do this. Below follows what I did, but I am printing both the numbers in…
-
11
votes5
answers10236
viewsQ: echo or print, what really is the best option?
I know the differences of echo or print, but in a real PHP project which one is best suited to use? Or simply whatever?
phpasked phpricardo 765