Jump to content

zazu

Members
  • Posts

    49
  • Joined

  • Last visited

Everything posted by zazu

  1. Hey guys i have 2 buttons that i hide and show depending on users click. What i want to do is when a user click first button to rememeber in a cookie that the button is clicked and show the secound button and viceversa. My js code that i;m using right now is posted bellow. How can i do this? Thank you very much! var first = document.getElementById( 'first' ), second = document.getElementById( 'second' ); function toggle() { if ( first.style.display === "block" ) { first.style.display = "none"; second.style.display = "block"; } else { // switch back first.style.display = "block"; second.style.display = "none"; } } first.onclick = toggle; second.onclick = toggle;
  2. <?php $result = mysqli_query($conn, "SELECT * FROM user_pers_juridica WHERE categorie='marci'"); echo "<form action='compara-marci.php' method='get'>"; echo "<div class='form-group'>"; echo "<select name='id' id='id' class='form-control'>"; echo "<option value='' disabled selected>Alegeti un judet...</option>"; while($row = mysqli_fetch_array($result)) { echo "<option value='" . $row['id_companie'] . "'>" . $row['nume_companie'] . "</option>"; } echo "</select>"; echo "</div>"; echo "<p><button type='submit' class='btn btn-primary'><i class='fa fa-search'></i> Caută</button></p>"; echo "</form>"; $result = mysqli_query($conn, "SELECT nume_companie FROM user_pers_juridica WHERE id_companie = '$id'"); while($row = mysqli_fetch_array($result)) { echo $row['nume_companie']; } ?> This is the code for the first select. Now after submit my url looks like this compara-marci.php?id=23. How can i add anouter select in this script and on submit button to show me the valus from the rows with the selected id and the url to be like compara-marci.php?id=2&id=3?
  3. I've done something similar but with only one select dropdown list. The code is below <form action="oras.php" method="get"> <div class="form-group"> <?php $result = mysqli_query($conn, "SELECT * FROM orase_disponibile ORDER BY titlu_oras ASC"); echo "<select name='id' id='id' class='form-control' required>"; echo "<option value='' disabled selected>Alegeti un oras...</option>"; while($row = mysqli_fetch_array($result)) { echo "<option value='" . $row['id_oras'] . "'>" . $row['titlu_oras'] . "</option>"; } echo "</select>"; ?> </div> <p><button type="submit" class="btn btn-primary"><i class="fa fa-search"></i> Caută dupa oras</button></p> </form>
  4. Hello guys, I have a page named compare.php with two dropdown lists wich are populated with same values from a specific table. Now what i want to do is when a user is selecting one value from the first dropdown and another value from the secound dropdown to be redirected to a page lets say compare-items.php?id=1&id=2 and here in two different cols to get the values for the items, in the first col the values for the first item, and in the secound col the values from the sec item. How can i achive that? Thank you very much!
  5. Hi, I have the following code for playing a video on my page. The problem is that the video works good on desktop browsers, but on desktop safari and mobile browsers it displays me only the cover image not playing the video. I've tried a couple of solutions but none of them seems to be working for me. <video autoplay class="embed-responsive-item" poster="videos/cover.jpg"> <source src="videos/landing_page_video_vimeo5_converted.mp4" type="video/mp4"> <source src="videos/landing page video vimeo5.ogg" type="video/ogg"> <source src="videos/landing page video vimeo5.ogg" type="video/webm"> </video>
  6. Hi guys, I have a video into a bootstrap modal form that is opened on click. Now when i close the modal i want that video to stop playing. I've manage to do some javascript to do that but instead of stopping the the video i want it stops all the video from that page. How can i target in the script below only the ID of the modal that i want to be stoped from playing? <script> $('body').on('hidden.bs.modal', '.modal', function () { $('video').trigger('pause'); }); </script>
  7. I have 3 price tables on my page. These tables under 720px width resolution should get one under the other one (i use bootstrap). The problem is that in any browsers they align well but on desktop safari, ios safari, ios firefox, ios chorome the tables not aligning well at all. You can take a look HERE on safari under 720px resolution to see how it looks. I don't manage to see what is causing the problem.
  8. <script> $(function () { var frm = $('#inscriete-modal'); frm.submit(function (ev) { $.ajax({ type: frm.attr('method'), url: frm.attr('action'), data: frm.serialize(), success: function (data) { $("#form-inscriere").show(data); setTimeout(function(){location.reload();},3000); } }); ev.preventDefault(); }); }); </script>
  9. Hi guys. I have a Bootstrap modal that opens on click. Inside is a form with 4 fields. Now i want after the form is submited to show below the submit button a thank yo message, but instead of that the form closes and the page is beeing refreshed. I've manage to do some javascript to stop the form of beeing refreshed but now i want to know how can i make the thank you div to get showed below the submit button. <script> $(function () { var frm = $('#participa-modal'); frm.submit(function (ev) { $.ajax({ type: frm.attr('method'), url: frm.attr('action'), data: frm.serialize(), success: function (data) { $(".alert-success").html(data); location.reload(); } }); ev.preventDefault(); }); }); </script>
  10. If the the paid_status field from my data base is set to null display "some text". That is what i want to do.
  11. Hi guys, I've a little problem i have a fileld in my database that i want to check. If is null to display some text else display another text. I've manage to do something like this but doesn't work. The code is below: <?php $result = @$mysqli->query("SELECT * FROM depanarecuora_clients WHERE paid_status = '$paid_status'"); while ($result = mysqli_fetch_assoc($result)) if (is_null($paid_status)) { echo "some text"; } ?>
  12. I have 2 select inputs with diferent values ex: one with size 1,2,3,4 and the other one with color: red, green, yellow. In a table above this inputs i have the exact same values but with price such as: 1,red,250$, etc. What i want to do is when i select for example from the first input 1 and the secound input red to show me below the price 250$ how can i do that using javascript. The table that i was talking about is posted here The column on the left is represented by SIZE in my example and the HEADING ROW above with Ø is represented by COLOR in my example, and the price is in the cells.
  13. I want to make another thing is there any possibily to have 2 html select from where the user should choose the dimension 5.5ml and the size Ø 14 and below to return the price?
  14. It work very well, but how can i do if i want to put in another inpute the values of <th>Ø 14</th> <th>Ø 16</th> <th>Ø 18</th> <th>Ø 20</th> <th>Ø 25</th>
  15. Hi guys, i have a table with 6 COLS and 12 ROWS. In the first column is a filed with dimensions (4 ml) and in the other 5 columns are the prices with are different one from another. What i like to do is when i click on a cell from the table to autocomplete bellow 2 inputs 1 with dimension and another with the price from that cell. I've manage to do the first part but the secound one i don't know how to do. Please have a look at my code below. (function () { if (window.addEventListener) { window.addEventListener('load', run, false); } else if (window.attachEvent) { window.attachEvent('onclick', run); } function run() { var t = document.getElementById('myTable'); t.onclick = function (event) { event = event || window.event; //IE8 var target = event.target || event.srcElement; while (target && target.nodeName != 'TR') { // find TR target = target.parentElement; } //if (!target) { return; } //tr should be always found //var cells = target.cells; //cell collection - https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableRowElement var cells = target.getElementsByTagName('td'); //alternative var f1 = document.getElementById('Inaltime / Dimensiune'); var f2 = document.getElementById('Ø 14'); var f3 = document.getElementById('Ø 16'); var f4 = document.getElementById('Ø 18'); var f5 = document.getElementById('Ø 20'); var f6 = document.getElementById('Ø 25'); f1.value = cells[0].innerHTML; f2.value = cells[1].innerHTML; f3.value = cells[2].innerHTML; f4.value = cells[3].innerHTML; f5.value = cells[4].innerHTML; f6.value = cells[5].innerHTML; //console.log(target.nodeName, event); }; } })(); <table id="myTable" class="demo"> <caption> <h3>Sisteme de cosuri fum TONA <span class="orange-price">- 15% REDUCERE</span></h3></caption> <thead> <tr> <th> Inaltime / Dimensiune </th> <th>Ø 14</th> <th>Ø 16</th> <th>Ø 18</th> <th>Ø 20</th> <th>Ø 25</th> </tr> </thead> <tbody> <tr> <td>5 ml <br> </td> <td><span class="old-price">583 EUR</span> <br> <span class="orange-price">496 EUR</span> </td> <td><span class="old-price">630 EUR</span> <br> <span class="orange-price">536 EUR</span> </td> <td><span class="old-price">661 EUR</span> <br> <span class="orange-price">562 EUR</span> </td> <td><span class="old-price">704 EUR</span> <br> <span class="orange-price">598 EUR</span> </td> <td><span class="old-price">1125 EUR</span> <br> <span class="orange-price">956 EUR</span> </td> </tr> <tr> <td>5.5 ml</td> <td><span class="old-price">608 EUR</span> <br> <span class="orange-price">517 EUR</span> </td> <td><span class="old-price">659 EUR</span> <br> <span class="orange-price">560 EUR</span> </td> <td><span class="old-price">692 EUR</span> <br> <span class="orange-price">588 EUR</span> </td> <td><span class="old-price">737 EUR</span> <br> <span class="orange-price">626 EUR</span> </td> <td><span class="old-price">1187 EUR</span> <br> <span class="orange-price">1009 EUR</span> </td> </tr> <tr> <td>6 ml</td> <td><span class="old-price">634 EUR</span> <br> <span class="orange-price">539 EUR</span> </td> <td><span class="old-price">687 EUR</span> <br> <span class="orange-price">584 EUR</span> </td> <td><span class="old-price">722 EUR</span> <br> <span class="orange-price">614 EUR</span> </td> <td><span class="old-price">770 EUR</span> <br> <span class="orange-price">655 EUR</span> </td> <td><span class="old-price">1250 EUR</span> <br> <span class="orange-price">1063 EUR</span> </td> </tr> <tr> <td>6.5 ml</td> <td><span class="old-price">659 EUR</span> <br> <span class="orange-price">560 EUR</span> </td> <td><span class="old-price">716 EUR</span> <br> <span class="orange-price">609 EUR</span> </td> <td><span class="old-price">752 EUR</span> <br> <span class="orange-price">639 EUR</span> </td> <td><span class="old-price">803 EUR</span> <br> <span class="orange-price">683 EUR</span> </td> <td><span class="old-price">1313 EUR</span> <br> <span class="orange-price">1117 EUR</span> </td> </tr> <tr> <td>7 ml</td> <td><span class="old-price">685 EUR</span> <br> <span class="orange-price">582 EUR</span> </td> <td><span class="old-price">745 EUR</span> <br> <span class="orange-price">633 EUR</span> </td> <td><span class="old-price">782 EUR</span> <br> <span class="orange-price">665 EUR</span> </td> <td><span class="old-price">836 EUR</span> <br> <span class="orange-price">711 EUR</span> </td> <td><span class="old-price">1375 EUR</span> <br> <span class="orange-price">1169 EUR</span> </td> </tr> <tr> <td>7.5 ml</td> <td><span class="old-price">710 EUR</span> <br> <span class="orange-price">604 EUR</span> </td> <td><span class="old-price">774 EUR</span> <br> <span class="orange-price">660 EUR</span> </td> <td><span class="old-price">812 EUR</span> <br> <span class="orange-price">690 EUR</span> </td> <td><span class="old-price">869 EUR</span> <br> <span class="orange-price">739 EUR</span> </td> <td><span class="old-price">1438 EUR</span> <br> <span class="orange-price">1222 EUR</span> </td> </tr> <tr> <td>8 ml</td> <td><span class="old-price">735 EUR</span> <br> <span class="orange-price">625 EUR</span> </td> <td><span class="old-price">803 EUR</span> <br> <span class="orange-price">683 EUR</span> </td> <td><span class="old-price">843 EUR</span> <br> <span class="orange-price">717 EUR</span> </td> <td><span class="old-price">902 EUR</span> <br> <span class="orange-price">767 EUR</span> </td> <td><span class="old-price">1500 EUR</span> <br> <span class="orange-price">1275 EUR</span> </td> </tr> <tr> <td>8.5 ml</td> <td><span class="old-price">761 EUR</span> <br> <span class="orange-price">647 EUR</span> </td> <td><span class="old-price">831 EUR</span> <br> <span class="orange-price">706 EUR</span> </td> <td><span class="old-price">873 EUR</span> <br> <span class="orange-price">742 EUR</span> </td> <td><span class="old-price">935 EUR</span> <br> <span class="orange-price">795 EUR</span> </td> <td><span class="old-price">1563 EUR</span> <br> <span class="orange-price">1329 EUR</span> </td> </tr> <tr> <td>9 ml</td> <td><span class="old-price">802 EUR</span> <br> <span class="orange-price">682 EUR</span> </td> <td><span class="old-price">876 EUR</span> <br> <span class="orange-price">745 EUR</span> </td> <td><span class="old-price">919 EUR</span> <br> <span class="orange-price">781 EUR</span> </td> <td><span class="old-price">984 EUR</span> <br> <span class="orange-price">836 EUR</span> </td> <td><span class="old-price">1642 EUR</span> <br> <span class="orange-price">1396 EUR</span> </td> </tr> <tr> <td>9.5 ml</td> <td><span class="old-price">827 EUR</span> <br> <span class="orange-price">703 EUR</span> </td> <td><span class="old-price">905 EUR</span> <br> <span class="orange-price">769 EUR</span> </td> <td><span class="old-price">949 EUR</span> <br> <span class="orange-price">807 EUR</span> </td> <td><span class="old-price">1017 EUR</span> <br> <span class="orange-price">864 EUR</span> </td> <td><span class="old-price">1704 EUR</span> <br> <span class="orange-price">1448 EUR</span> </td> </tr> <tr> <td>10 ml</td> <td><span class="old-price">853 EUR</span> <br> <span class="orange-price">725 EUR</span> </td> <td><span class="old-price">934 EUR</span> <br> <span class="orange-price">794 EUR</span> </td> <td><span class="old-price">979 EUR</span> <br> <span class="orange-price">832 EUR</span> </td> <td><span class="old-price">1050 EUR</span> <br> <span class="orange-price">893 EUR</span> </td> <td><span class="old-price">1767 EUR</span> <br> <span class="orange-price">1502 EUR</span> </td> </tr> <tbody> </table>
  16. Ok mate! Thanks for help i've manage to solve the problem. The working code is listed bellow: mysqli_query($mysqli,"UPDATE evaluatori_users SET client_cv='$actual_image_name' WHERE id='$id'");
  17. When i execute the script the file i choose is sent to the specified folder, but the file name is not stored to the database! To be more specific the INSERT function doesn't work well.
  18. Doesn't work, and i don't know why because the code seems to be correct.
  19. Hi there guys, I've a little problem with inserting a file name into a database table. I can't see wich is the problem. The code is bellow and i think the problem is at INSERT INTO part. <?php $path = "./cv/"; $valid_formats = array("doc", "pdf"); if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST") { $name = $_FILES['photoimg']['name']; $size = $_FILES['photoimg']['size']; if(strlen($name)) { list($txt, $ext) = explode(".", $name); if(in_array($ext,$valid_formats)) { if($size<(20480*20480)) // Image size max 20 MB { $actual_image_name = time().$id.".".$ext; $tmp = $_FILES['photoimg']['tmp_name']; if(move_uploaded_file($tmp, $path.$actual_image_name)) { mysqli_query($mysqli,"INSERT INTO formular_client (client_cv = '$actual_image_name')"); } else echo "failed"; } else echo "Image file size max 20 MB"; } else echo "Invalid file format.."; } } ?> <input type="file" name="photoimg" id="photoimg" />
  20. Well let me explain you more exactly what i have to do. In my database i have a table where is a row named child_age. In the form i have 4 checkboxes 1-3 years.....10+ years. All these checkboxex must be inserted into child_age row like an array = 1-3 years, 3-6 years etc. depends what the user is selecting. And when the user edits his profile the form must returns him the selected checkboxex in the first time. So let's say in the first time he selected 1-3 years and 3-6 years, when he returns back on his profile and want to choose 6-8 years beside 1-3 years and 3-6 years the checkboxes with these values to be checked.
  21. Hei, works well but only when i have a single value in my database, when i have 2 or 3 values isn't showing any checked inputs. Why is that?
  22. Hi guys, thx for your replies, i'll try your suggestions as soon as i can and come back with an answer. In the meantime please take a look at this topic http://forums.phpfreaks.com/topic/296176-friendly-url-rewriteing-using-htaccess-problem/ if you can provide me some suggestions on how to. Thx in advance.
  23. <label class="checkbox-inline"> <input type="checkbox" name="children_age" value="1-3 years"> 1-3 years <input type="checkbox" name="children_age" value="2-4 years"> 2-4 years <input type="checkbox" name="children_age" value="4-6 years"> 4-6 years </label>
×
×
  • 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.