Jump to content

BluwAngel

Members
  • Posts

    52
  • Joined

  • Last visited

Posts posted by BluwAngel

  1. Yeah, my thoughts exactly. When it comes to frameworks, there is no be-all end-all "best" solution. No one framework is the right choice every time.

     

    ye i know but back 3-4 years ago there was prediction that zend will e huge, and today its on top but its slightly going down these days, event zend2 cant keep them on top, so is it good idea to invest time in what is good now or look for something that will be big in future? since i used to write php from scratch

  2. hi

     

    im wondering where do you see future of web in general, is internet currently at its highlight(except audio search etc but that is progressing too)

    what can happen in 5-10 years - will we have more developers then its needed

     

    and what backend development do you recommend as future investment (for web) zend, MVC, MVVM, codeigniter, coding in clear php code or maybe something else

    few years ago people talked alot about zend and it is now successful but zend2 is out and its not going good way as i can see - what in your opinion is "next new thing"

  3. hi

     

    i have some page where i write numbers and its stores them in database, but it would be great not to press tab (or click on that field) every time, how do i create when its loaded that i can just type in like google have when page is loaded

  4. so i have field for email

     

    <input id="email" name="email" type="email" /><br />
    

     

    is there and HTML command to prevent it from leaving blank (if you type "test" it will say its not email. any way to do that if some leave it blank?)

     

    i created filter with JS, but i want same that bubble box where it say "please enter email or something like that

  5. i started to do some simple javascripts and i created

    document.onclick = function(){
    alert("Hello");
    }
    

     

    but problem is i run it from loacalhost, when i run that from IE or FFX it works, but it wont work on chrome

    how do i fix that?

  6. Warning: mysql_fetch_array() expects parameter 1 to be resource, string given...

     

     

    im tryin to put class inside code if $dayNumber and $dan are equal

     

    i tried few ways but all are complicated since i have to call some functions this end up as "simple" solution but i dont know where did i get wrong PS that should be possible?

     

    else {
                      echo "<td width='40'";
    			  $moj_id = $_SESSION['id'];
    			  $query_event = mysql_query("SELECT * FROM events WHERE id_user='$moj_id' GROUP BY 'event_date'") ;
    			  $test = mysql_fetch_array('$query_event');
    			  $date_event = $test['event_date'];
    			  sscanf($date_event, "%d-%d-%d", $godina, $mjesec, $dan);
    			  if ($dan==$dayNumber && $mjesec==$month && godina==$year)
    			  {
    
    				  echo " class='radni'";
    			  }
    			  
    			  
    			  echo"><a href='day_info.php?dan=",$dayNumber,"&mj=",$month,"&gd=",$year,"'>" . $dayNumber . " </a></td>\n";
                      $dayNumber++;                           
                  }
    

  7. okay i have table named ZAMJENE with 2 rows only row that i need to setup is named id_zamjena and have values 15 and 16

     

    when i do echo on page it work great but when i press button i get only 16 for both entries

     

    full cde is too long so i paste only important parts

    $query_zamjene = mysql_query ("SELECT * FROM zamjene  WHERE id_user_1='$moj_id' AND zamjenjeno='0' ORDER BY id_event_1");
    
    echo "<form method='post' action='event_zamjenjen.php'>";
    
    
    while ($rows = mysql_fetch_array($query_zamjene))
    {
    $id_zamjena	= $rows['id_zamjena'];
    $id_event_1	= $rows['id_event_1'];
    $id_event_2	= $rows['id_event_2'];
    $id_user_2	= $rows['id_user_2'];
    
    echo "$id_zamjena";   // THIS ROW WORKS CORRECTLY
    echo "<input name='id_zamjena' type='hidden' value=$id_zamjena>";  // output of this is always 16
    
    echo "<input name='response' type='submit' value='Prihvati zamjenu' />
    <input name='response' type='submit' value='Odbaci zamjenu' />
    <br>";
    
    }
    echo"</form>";
    
    
    
    

     

  8. tried that before... for example in table ZAMJENA i have 1 rown and on EVENTS have 20 rows

    he fills data under id_event_1 and id_event_2 randomly (and i cant afford that)

     

    so far code is this

    <?php
    session_start();
    include "check.php";
    include "db_connect.php";
    
    //spojit na tablicu pogledat da li postoje termini za zamjenu
    $moj_id	= $_SESSION['id'];
    $query_zamjene = mysql_query ("SELECT * FROM zamjene JOIN users ON id_user_2=id WHERE id_user_1='$moj_id'");
    //broj zamjena
    $br_zamjena		= mysql_num_rows($query_zamjene);
    
    if ($br_zamjena >0){
    echo "Imate $br_zamjena mogućih zamjena
    <ul>";
    
    while($rows = mysql_fetch_array($query_zamjene))
    {
    $id_zamjena		= $rows['id_zamjena'];
    $id_event_1		= $rows['id_event_1'];
    $id_event_2		= $rows['id_event_2'];
    $id_user_2		= $rows['id_user_2'];
    $ime_2			= $rows['ime'];
    $prezime_2		= $rows['prezime'];
    
    
    echo "<li>Vaš event $id_event_1 zamjenite sa $id_event_2, zamjenu je tražio $ime_2 $prezime_2 </li>";
    //english  your event $id_event_1 can be changed with $id_event_2, requested by $ime_2 $prezime_2
    
    
    }
    
    }
    else echo "Nemate zahtjeva za zamjenu"; // no requests for change
    
    ?>
    

     

    here i work with 3 tables EVENTS ZAMJENE USER i mange to get name from USER table but i dont know that part with event

  9. this is the problem i have 2 tables

     

    table named ZAMJENE with fields id_event_1, id_event_2

    table named EVENTS with fields  id_event and event_date

     

    and i need echo

     

    $id_event_1 on date(EXTRACT FROM TABLE EVENTS FIELD event_date) can be replaced with $id_event_2 on date(EXTRACT FROM TABLE EVENTS FIELD event_date)

     

    structure must remains because i have half site build already and i have 3rd table where i just need use JOIN

     

    hope you understand problem

  10. i have problem i have file where i set 2 times (starts and ends)

    and i set example from 8:00 to 20:00 all combinations works except starting from 8:00 if i set 8:01 it works but cant find out problem help or idea? (time to 20:00 will work )

     

    <?php
    session_start();
    
    include '../db_connect.php.';
    
    
    $title          = $_POST['title'];
    $detail       = $_POST['detail'];
    $event_date      = $_POST['event_date'];
    $id_user      = $_POST['id_user'];
    
    $smjena_od_h   = $_POST['smjena_od_h'];
    $smjena_od_min   = $_POST['smjena_od_min'];
    $smjena_do_h   = $_POST['smjena_do_h'];
    $smjena_do_min   = $_POST['smjena_do_min'];
    
    $vrijeme_od = "$smjena_od_h:$smjena_od_min";
    $vrijeme_do = "$smjena_do_h:$smjena_do_min";
    
    function timeDiff($firstTime,$lastTime)
    {
    
    
    $firstTime=strtotime($firstTime);
    $lastTime=strtotime($lastTime);
    
    
    $timeDiff=$lastTime-$firstTime;
    
    
    return $timeDiff;
    }
    
    // converts to hours
    $radnih_sati=timeDiff(" $vrijeme_od","$vrijeme_do")/60/60;
    
    
    //check with other table
    $query_settings   = mysql_query("SELECT * FROM settings");
    $vrijeme      = mysql_fetch_array($query_settings);
    $od_settings   = $vrijeme['rv_otvoreno'];
    $do_settings   = $vrijeme['rv_zatvoreno'];
    $sati_settings   = $vrijeme['min_rv'];
    
    if ($vrijeme_od<$od_settings or $vrijeme_do>$do_settings or $radnih_sati<$sati_settings){
       echo "Pogrešno uneseni podaci!";
    }
    
    else{
    //data entry
    $insert_event   = 'INSERT INTO events ( title, detail, event_date, id_user, vrijeme_od, vrijeme_do, radnih_sati) 
                   VALUES ("'.$title.'", "'.$detail.'","'.$event_date.'", "'.$id_user.'", "'.$vrijeme_od.'", "'.$vrijeme_do.'", "'.$radnih_sati.'")';
                
                
    mysql_query($insert_event);
    echo "podaci uspješno pohranjeni.";
    
    }
    

  11. okay i need help with this part of code i need to set time 00:00 to 24:00

     

    $vrijeme_otvoreno	= "$rv_od_h:$rv_od_min";
    $vrijeme_zatvoreno	= "$rv_do_h:$rv_do_min";
    
    if ($vrijeme_otvoreno =="00:00" && $vrijeme_zatvoreno == "00:00")
    {
    $vrijme_zatvoreno = "24:00";
    echo $vrijeme_zatvoreno;
    }
    
    echo "$vrijeme_otvoreno - $vrijeme_zatvoreno <br>";
    

     

    i get echo 00:00 - 00:00 and i need it to be 00:00 - 24:00

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.