I'd like to manage a timetable using Drupal 6, there are several pieces of equipment on which an administrator distributes people who get to use the equipment.
Essentially I want a table of equipment versus day of the week. The plan shows the occupation of all equipment for the whole week.
What makes it more complicated is that the editing of the timetable should be very easy and quick. Usually people have the equipment for multiple days, so one should be able e.g. to drag an entry and fill out more days this way. I'd also like to have a selection of people visible that one could drag onto the timetable and fill it out that way. I assume one can do that with javascript, but I have no experience with that.
Is it possible to create something
like that with the Drupal Forms API?
Any pointers/examples for the
dragging javascript?
Or is there some existing software or
Drupal module that can do that?
I've found a nice javascript example for drag and drop in a timetable, it should be possible to adapt that for my case. I'll just have to figure out how to best integrate it with Drupal.
Edit:
The script I've mentioned at the top of the answer did not work inside my Drupal installation so I switched to Jquery UI.
I've implemented it now as a custom Drupal module that uses JQuery UI for Drag&Drop functionality. I've enabled Drag&Drop for a HTML table, to save the timetable the elements of the table are read out via Javascript and then sent to my custom Drupal module using ajax.
A Fields drupal 7 module that creates a timetable field that can be display through an nice weekly grid. Can be use to display opening hours or working hours in a very neat way :
http://drupal.org/project/field_timetable
Couldn't Equipment be a Content Type, and have different properties as you describe? Then you can enter each piece of equipment as a node. This would save you a ton of time vs making it with the Form API.
CCK
TableField CCK
Why don't you use the Event module? Basically, it gives you an Event node type. Then a view can generate the calendar page of all nodes.
I am not exactly sure whether the MERCI module has every functionality you want. I ran some tests and it looks pretty good, works even better. It is though available only in the prerelease aplpha 5 version but it should do it's job.
To drag and drop. It should not be that difficult to improve the forms using some JQuery as #Fabian suggested.
Related
I have an about box on a profile page I'm working on (see below). Now that area shown by the textarea will have a PHP variable (about user column) produced in the space.
What I want to do is when a user clicks edit the paragraph content produced becomes an editable <textarea> which I can then save and it will write the new data to my PostGreSQL database and instantly show the new edit.
Basically I'm looking for a dynamically editable paragraph/textarea combo which will automatically update the database storing the original textual data in an about user column.
I have researched many JQuery examples like this on jsfiddle - http://jsfiddle.net/BenjaminRH/467S5/ but that doesn't have the database functionality I am looking for.
In essence, the HTML5 ContentEditable attribute could be perfect here.
This won't automatically update any databases, or anything for that matter, but nor will any other control that isn't some kind of composite made specifically for (and even genericised to handle) certain database types and scenarios and frameworks etc.
Therefore, in order to get this (a control that does it all) you're likely going to need to hunt down a third party product - there may be a free one (I've not seen one for the likes of PHP or ASP.NET or other major frameworks, and frankly I'm glad), or you may be stuck with having to buy one. As expected, I personally can't vouch for any, and wouldn't recommend such a plug n' play control anyway.
But, as per my first suggestion, there's half the task done - just write the code-behind in a reusable class and hook it up some how.
Let me start off by saying that this is my first time working with PHP, HTML, JavaScript, and JQuery, so my experience is fairly lacking.
I am helping to build a Web Order Processor, which will display orders, dates, customers, and status. I am pulling orders from our database, and displaying them in a table. the Order Processor is being built in PHP.
Now, I've been asked to separate the table into different tabs, which will be labeled after the possible order statuses we have. Sort of like the tabs at the top of a browser.
My problem is quite a big one: I don't know where to start. I've been searching for a couple hours but I don't think I'm using the correct terminology.
Thank you all in advance. Any help would be appreciated, even if it's just pushing me in the right direction by giving me a couple things to search for.
I would suggest start with this: http://jqueryui.com/demos/tabs/
First make sure your tabs are working with the simple static content
Second upgrade it so every time tab switched, it loads content from the database.
Depending on a tab you can customize request to the server with the status=(NEW,PROCESSES,REFUND ...), and do the query and return a proper data for the tab.
Hope it helps
I want to make Newegg's like catalouge functionality for my little website. I want mine to be sligthly different(greatly simplified) though. I haven't done anything so advanced(atleast in my books) before, and wanted to know if it's possible to do. I want to use PHP and JS. The new records will be added manually through using either phpMyAdmin or pehaps I will install and use either SQLyog, HeidiSQL or Navicat for such purposes. Could someone point me to the right resources to get this kind of job done as fast as possible and properly?
What I had in mind was:
For example the cell which contains the thumbimage, all the mini information about the product and the big price tag will not have a separate, more detailed page. Everything user will need to know will be inside that product cell.
Right under the thumbnail image there will be numbers(1 2 3 4 5 6), and when you hover over them, under the cursor, a big version of one of the all available images will appear.
Lastly, it should have the page generation(don't know what you call it). For example there's more than 20 product entries on the page, then the server should create a new page(First 1 >2< Last) to hold the older records.
Oh and there won't be any shopping cart functionality. You can't really "order" these kinds of products, you just find something you like and call me up about it.
TIA
I'm sure there are dozens of books on this subject. I'm attempting a short reply, however:
This sounds like something that could profit from:
a MCV-framework like CakePHP (or Django, Ruby on Rails etc), which could handle database-logic (including pagination, which is the word you're looking for), and
a JavaScript library like JQuery to handle Ajax, JavaScript and other UI-related stuff.
++?
For the page numbers, I recently had to do this. The technique is called pagination, and this thread helped me out immensely: PHP Formula For a Series of Numbers (Mathy Problem)
The thumbnail effect you want to include would need to be done in javascript. I'd recommend learning jQuery, as it is pretty easy to use for this sort of thing.
This is a hard question to answer because you haven't given much indication as to your skill level, or progress towards accomplishing your goal. Assuming we're starting at 0, there is probably more to discuss than this thread can contain. :\
UPDATE
To learn PHP's database functions, I would lean on W3School's PHP/MySQL tutorial for a quick summary, referring to the php manual's mysql documentation for details and code examples when W3schools isn't enough. This should at least get you the markup you will need to work with.
For the thumbnails, I would reiterate my recommendation for jQuery, specifically attaching a .hover() event to the image numbers (this is equivalent to the onmouseover and onmouseout events in JS) that uses the .fadeIn() and .fadeOut() animations to show and hide your full size images. Hope that helps.
I would like to build a Layout designer in PHP or would like to use a readymade script( even if it is a paid one )
Basically I would like to create a sort of Layout where users could choose fields to add from a "field chooser". Each field could be of any type... and we would like to provide a field group too, where the user could choose the number of columns, and make the columns of this "panel" droppable.
We should drag a field from a list, and drop the field to a placeholder on a Form (Panel?).
Finally, is it possible to "read" the form layout in order to store it for later use?
thanks
kabir
Yes there is a Drag and drop form/window designer for PHP - since 2007 the Delphi PHP IDE. It is now become part of the RADPHP X2 IDE available from Embarcadero. Both use the Delphi VCL framework.
There is RADPHP from Embarcadero technologies. It uses vcl for php framework for visual design. You can drag & drop while designing the page. But the html code it produces is not compatible with w3 standards.
Drag and drop isn't available in PHP. PHP is a server-side language; what you're asking for in client-side and would be accomplished using something like JavaScript. You would then use PHP to read the user's choices based on an event occuring, i.e. an item dropped or the user click a confirmation button.
I have a MySQL Database of more or less 100 teachers, their names, and their phone numbers, stored in tables based upon their department at the school. I'm creating an iPhone app, and I've found that UITableViews and all the work that comes with it is just too time consuming and too confusing. Instead, I've been trying to create a web page on my server that loads all the data from MySQL and displays it using HTML, PHP, jQuery, and jQTouch for formatting.
My concept is that the separators will be by department, and the staff will be sorted alphabetically under each department. On the main page, each person's name will be clickable so they can go to ANOTHER page listing their name, email address, and telephone number, all linked so that the user can tap on the email or number and immediately email or call that person, respectively.
HOWEVER, I am completely at a loss for how I should start. Can anyone point me in the right direction for displaying the data? Am I going about it wrong in using PHP? Should I opt for something COMPLETELY different?
PHP to manage the database interaction and generate HTML is fine. There are heaps of tutorials on how to do that (e.g. http://www.w3schools.com/PHP/php_mysql_intro.asp) How to make it look nice is beyond the scope of this answer, and I'd recommend you search for table/CSS examples to get some ideas of what looks good and how they're implemented. If you need interactivity such as expanding rows or changing colors, then jQuery would be an appropriate next step, though you certainly don't need more than HTML + CSS for a nice looking table representation.
What I don't know about is the auto email/call functionality you're after, and whether you can get that "for free" from whatever is rendering the HTML. That's iPhone specific, not PHP/jQuery/etc... And I'd second Alex's advice that if UITableView is the right tool for the job then you will definitely be better off in the long run just buckling down and learning it. (And going through that will probably make pickup up other parts of the API much easier to boot.)
Instead of loading my PHP in my <body>, I created a function that retrieved the data via mysql_fetch_assoc(), which added all the information and created each individual div of data AS WELL AS injecting a <script> to $.append() the list item content for each item retrieved via the mysql_fetch_assoc(). Thanks for the responses anyway!