Questions tagged as 'condiciones'

1
answer

Is there any way to optimize this if-else conditional example?

I'm looking for a conditional that looks like this or validates but without using so many lines of code if (is_file(PATH_CONTROLLERS.$controller."/".$controller."Controller.php") || is_file(PATH_CONTROLLERS.$controller."Controller.php") )...
asked by 25.06.2017 / 20:51
4
answers

If with $ _SESSION

if(!isset($_SESSION["TIP"])){ header("location:../index.php?msg=1"); }else if(isset($_SESSION["TIP"])){ if($_SESSION["TIP"]!="Normal"){ header("location:../index.php?msg=3"); }else if ($_SESSION["TIP"]!="Gold") { hea...
asked by 13.12.2018 / 06:54
1
answer

Error comparing two strings in an if in twig

I have an error comparing two strings in twig . Here is an example of my code: {% set var1 = "" %} {% set var2 = "" %} {% for unidad in array %} {% if unidad.var1 == var1 %} {% if unidad.var2 == var2 %}...
asked by 02.08.2016 / 09:18
2
answers

What is the error of this algorithm? [closed]

I would like to see if you could help me find the error in this algorithm, the exercise says to calculate the discount: if m> = 300 the discount is 25% - if 150
asked by 23.06.2017 / 18:34
2
answers

Print twice "Wrong date". Conditionals in Java

I have to have it print "correct date" when I write a date within the ranges considering months of 28, 30 and 31 days. When I insert by console for example 31/4/1982 (a date that is incorrect because April has 30 days) I print "Wrong date" twice...
asked by 06.12.2017 / 16:53
4
answers

Program that does not end

I am doing a program, it is asked to enter 3 data, if the 3 are incorrect the program ends, I do a loop do / while and asks for the 3 data the problem is that the program does not finish and passes to analyze the following condition , how do I e...
asked by 07.11.2016 / 18:03
2
answers

cancel execution element

I want to make a confirmation box in case of yes, the information will be deleted and if not, nothing is deleted and the information is saved; I've dealt with e.prevent default() , but I can not make it work. function removerinput(event)...
asked by 05.01.2019 / 17:23
1
answer

JAVA - Problem with the IF ELSE conditional when using the value of a STRING

The code is very simple. I just have to get the type of 'storage' that an article has. This can be from the 'deposit' or from the 'shelves / gondolas'. When obtaining that registry, I proceed to carry out a different process of each one. The pro...
asked by 15.12.2018 / 16:09
1
answer

asp.net mvc doubt with the conditional if with keys and without keys "{...}"

I have a question about what moments or parts of the code you can use a conditional if or another that can be written without the keys { ... } . For what I read this will depend on the amount of code that contains that conditiona...
asked by 09.05.2018 / 17:13
2
answers

perform query and condition update

Specifically, I tried a lot of things and it did not work out or I got messed up trying so hard. I have 2 tables Summary and Detail What I'm trying to do is get all records for a DNI in the DETAIL table, on the result check the values...
asked by 04.04.2018 / 04:47