Posts by Arivan Bastos • 642 points
19 posts
-
2
votes3
answers624
viewsA: Analysis and Project in Javascript
An organized, easy-to-maintain JS project can be obtained with the help of some MVC JS frameworks: Angularjs Backbonejs Ember Some interesting patterns for using OOP in JS can be found in…
-
1
votes2
answers143
viewsA: Tabs with different PHP Query’s
It is unclear what content you want to display in the tab. It would also be interesting for you to inform which javascript library you are using to create the tabs. Aim to be a little more…
phpanswered Arivan Bastos 642 -
0
votes2
answers579
viewsA: Loading View only (No Layout) - Yii Framework
Utilize Yii::app()->request->isAjaxRequest to know if the request was ajax, and if so use renderPartial(). This way you can access the url '/Myproject/index.php? r=user/admin' either directly…
-
0
votes3
answers379
viewsA: How to get the value of the user ID in Cgridview - Yii
'url' => 'Yii::app()->controller->createUrl("view", array("id"=>$data->idUsuario))'
-
6
votes4
answers33983
viewsA: How to copy column data from one table to another table
UPDATE uc u SET (email) = (SELECT b.email FROM backup b WHERE u.idconsumidor = b.idconsumidor) WHERE EXISTS ( SELECT 1 FROM backup b2 WHERE u.idconsumidor = b2.idconsumidor) The outside WHERE (the…
-
2
votes1
answer1327
viewsA: Incorrect redirection
You need to review your logic a little better. There are redundant queries on the login page. You don’t need to separate login validation from password validation, even for security reasons (you…
-
2
votes2
answers601
viewsA: Swap the Ckeditor Toolbar
Use Toolbarsets. config.js config.ToolbarSets = new Object() ; config.ToolbarSets["MinhaToolbar"] = […
-
1
votes2
answers491
viewsA: Best Way to Pass Data to All MVC Controllers
This will depend a lot on how you are organizing your application. If you were using some framework it would be easier to suggest a solution. Follow below possible solutions. Option 1 Create an…
-
2
votes3
answers407
viewsA: Compare form domain with database domain
// Extrai apenas o dominio do e-mail. $dominio = explode('@', $_POST['email']); $dominio = $dominio[1]; // Torna a string segura para uso em consultas. // (Evita…
-
4
votes2
answers1395
viewsA: Doubt in inheritance exercise in C#
There are several ways to do this. One simple way is to create a new constructor that allows defining the number of seats: public Voo(int numeroVoo, int numeroAssentos, Data data) { ...…
-
19
votes2
answers7112
viewsA: How to translate a website into PHP?
The Gettext extension may not be available on the hosting service. It won’t help you much with translating Urls or BD records. Therefore, my suggestion is that you work with a more complete…
-
1
votes3
answers94
viewsA: Itemid = 435 being added at the bottom of the page link
If you want the link to open in a new tab/window replace: <a href="<?php echo $link; ?>" class="cat_child_a"> for <a href="<?php echo $link; ?>" target="_BLANK"…
-
3
votes5
answers5625
viewsA: URL friendly with . htaccess
Redirect all requests to an input script from your application. In this input script (index.php in the example below) interpret the URL including the appropriate page (this allows you to control…
htaccessanswered Arivan Bastos 642 -
2
votes2
answers1625
viewsA: How to make an empty select to pull all results from column
Never insert POST/GET parameters directly into the SQL string. This allows SQL Injection. You can use mysql_real_escape_string to handle the string so that it is safe and then mount the final query:…
-
1
votes4
answers145
viewsA: How to define database tables?
Record records per day. This will give you more options for improvements to your system in the future and will allow you to have years history. 1) Create a table for employees and another for daily…
-
1
votes2
answers1377
viewsA: How to recover query parameters after clicking on pagination
There is a term called DRY. "Don’t Repeat Yourself" that applies here. I fully agree with Sergio. 1) Better organize your code. Spend some time thinking about how to write it, deform it to be…
-
0
votes1
answer268
viewsA: Flashing image in Chrome
Be that as it may, do not replace all the contents of the div #load_tweets once a second. Only search for new content, and enter at the end of the div if there is. I do not know exactly what the…
-
2
votes2
answers793
viewsA: Calculate total days worked in a given month
1) Convert dates to PHP timestamp. Ex: $entrada = mktime(0,0,0,4,29,2014); //29/04/2014 $saida = mktime(0,0,0,5,3,2014); // 03/05/2014 2) Evaluate if there is a difference in the months. If there is…
-
1
votes3
answers9315
viewsA: Sum results values in mysql
You need to group the result by customer and by day, and need to remove the condition dt.valor < 0 query. It needs to enter as a having (which is processed after operations). See: SELECT…