Jump to content

Temnis

Members
  • Content Count

    10
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Temnis

  • Rank
    Newbie
  1. Hey guys! I am messing around with some jQuery Stuff. Now I thought about having some "Draggable" Objects and an "Droppable" Object to drop the "Draggable" stuff into. I also can get the current position of a "Draggable" Object when I drop it. BUT! Is it possible to get all Objects already dropped into the "Draggable" Object? Like something finished I could use? Example: I have a "Droppable" Object. Now I drag&drop some "Draggable" Objects into the "Droppable" Object. Now I push a button. This button calls a function. And inside that function I want to "ask" the "Droppable" Objects: "What is currently inside of you? And where is it?"
  2. Hey guys! This might be a very simple and stupid question, but here we go I have a php - function (getDropDownMenue($what, $id)). This functions works perfectly and returns a string, containing html - code. Now I am doing somthing on my Website and I need that string. To get it, I have a javascript Function (getDropDownMenue($what, $id)). It performs a POST Request using jQuery, asking the getDropDownMenue.php to return that string. The problem is, I only get "undefined" instead of the string. What am I doing wrong? functions.js - File function getDropDownMenue($what, $id){ $.post("getDropDownMenue.php", { what : $what, id : $id }, function($echoData) { return $echoData; }); } getDropDownMenue.php - File <?phprequire_once('functions.php');// Übergabe der Variabeln$what = $_POST["what"];$id = $_POST["id"];// Funktionsaufruf$string = getDropDownMenue($what, $id);echo $string;?> functions.php - File function getDropDownMenue($what, $id){ $string = "Irgendwas ist in der Funktion getDropDownMenue(php) schief gegangen..."; if($what == "ROOMPIC_URL"){ // Select Drop Down Menü $string = '<select id="' . $id . '" name="Grundrisse"><option value="" disabled selected>URL</option>'; // Finde alle Dateien in dem Verzeichniss if ($handle = opendir('roomPics')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $string = $string . "<option value="" . $file . "">" . $file . "</option>"; } } closedir($handle); } $string = $string . "</select>"; }else{ $string = "Der Funktion getDropDownMenue(php) ist die " . $what . " nicht bekannt!"; } return $string;}
  3. Canvas are not an option, because I use a fluid grild layout.
  4. Hey guys! This time, I have a very special problem. What do I want? I want to create a User Interface. With this User Interface the User shall be able to drag&drop a Button out of a html-Table into a SVG. Now I want to save this constellation of the SVG and the positioned Buttons permanently on my Webserver. I want to load the saved file later on another site to use the buttons. Here is a small picture of how it should look like (some day) What do I have? I have the html-Table with buttons inside. So what do you think? Is there an "easy" Solution for this Problem? If no, how could I accomplish such functionalities?
  5. Hey guys! I have yet again, another stupid noob question I have a php-file, which does something with my mySQL Database. <?php// something more or less useful?> Now I want this php-file to be executed every hour, or maybe once a day, or maybe even once a minute. I'm not pretty sure yet. But it shall happen without a client being logged in and telling the server to do so. How do I accomplish that? I have not the slightest clue where to start. My testserver is the IIS V8.5.9600.16384 on my Windows 8.1 PC, but the website will later be deployed on a raspberry pi.
  6. Hey guys! I have another pretty simple problem. I have some html-code with an onClick function call. <table> <th onclick="$(document).ready(somefunction());"> some stuff </th></table> Now I want to write a JavaScript function, to swap "somefunction()" with "someotherfunction()". How can I achieve that? The purpose of all of this is, to create a <table><th> that does something on the first click, and something else on the second click.
  7. This helped a lot! Looks like I didn't really understand how selectors work. Thank you very much! Problem solved!
  8. Hey guys! I have a simple problem. I have a html table with some stuff in it: <table id="selectable"> <th> some stuff </th> <tr><td> some stuff </td></tr> <tr><td> some stuff </td></tr> <tr><td> some stuff </td></tr></table> Now I have some CSS for all tables on my webpage, and some CSS for all tables with id="selectable". table { position: relative; margin-right: auto; margin-left: auto; width: auto;}#selectable table { position: relative; margin-right: 0px; margin-left: 0px; width: 100%;} BUT the table is always styled with the properties of table {...}, instead of the properties of #selectable table {...} and I have no clue why. What am I doing wrong?
  9. Hey guys! I have a stupid questions! I have a table with some rows. Every row has its unique id. <table id="CONNECTION"> <tr id="id1"> <td>1</td> <td>0</td> </tr> <tr id="id2"> <td>2</td> <td>0</td> </tr></table> Now I want to write a function. Something like popGreen($rowID). That function should change the background color of a single row to green. After that, the background color should slowly fade away. How do I do that? I'm pretty sure there is an easy way to do this with jQuery, but I don't know where to start. Any Ideas?
  10. Hello! I am pretty new to php & mySQL and I have some questions regarding to it. I have a function that reads out a mySQL database and shows the information in a HTML - table. It also creates buttons in some rows in a seperate column, depending on the value of the column named "ART". This part works already. Now the created buttons shall call the switchID() - function when clicked. But I don't have a clue how to do that. I marked the part in the code. Any advice is welcome! Here is the code: functions.php // -----------------------------------------------------------------------function getTable($page, $type){// ----------------------------------------------------------------------- require '/var/www/con2mySQL.php'; $result = mysqli_query($con,"SELECT * FROM CONNECTION"); // Creating first row echo "<table border='1'><tr> <th>ID</th> <th>Zustand</th> <th>Art</th> <th>Device</th> <th>Schalter</th> </tr>";// Creating the other rows while ($row = mysqli_fetch_array($result)) { $buttonName = "button" . $row['ID']; echo "<tr>"; echo "<td>" . $row['ID'] . "</td>"; echo "<td>" . $row['ZUSTAND'] . "</td>"; echo "<td>" . $row['ART'] . "</td>"; echo "<td>" . $row['DEVICE'] . "</td>"; echo "<td>";// Creating the button if ($row['ART'] == "o"){ echo "<form name='Buttons' action='" . $page . "." . $type . "' method='post'> <input type='submit' name='" . $buttonName . "' value='Zustand wechseln' /> </form>"; }// ----------------------------------------------------------------------- // Giving the button a function. This is the part I struggle and don't know how to solve. echo "<?php if(isset($_Post[" . $buttonName . "])){ switchID(" . $row['ID'] . ",0,1); } ?>";// ----------------------------------------------------------------------- echo "</td>"; echo "</tr>"; } echo "</table>"; mysqli_close($con); } Here is also the index.php, where the getTable() - function is used. <?php require_once('/var/www/functions.php'); ?><html><head> <title>Testing</title></head><body><form name="Buttons" action="index.php" method="post"> <input type="submit" name="GetTable" value="Datenbank auslesen" /> <input type="submit" name="Kill0to1" value="ID 1904 0 -> 1" /> <input type="submit" name="Kill1to0" value="ID 1904 1 -> 0" /></form><?php if (isset($_POST["GetTable"])) { getTable(index, php); } if (isset($_POST["Kill0to1"])) { switchID(1904,0,1); } if (isset($_POST["Kill1to0"])) { switchID(1904,1,0); }?></body></html> PS. Sorry for my bad english.
×
×
  • Create New...