This topic is locked

A few questions

5/18/2008 11:19:54 AM
PHPRunner General questions
N
nitro23456 author

Hi, I am using phprunner 4.2
I am building a project that involves the entire project being duplicated four times on an intranet. One database with four different named tables. These will be four copies of exactly the same project fields (just different table names), each to be used by users from different departments.... who enter their data into the database.
I want a shared login page that all users use but it redirects them to the correct version for their department (done with different table prefixes for the database). So username, password and then maybe a drop down where they can select their department (1,2,3 or 4) and when they click login it takes them to their departments and the data they enter doesnt interfere with that of other departments. They still need to be able to access other departments as they sometimes work in others, so it is more of a redirect than anything (with one big lot of users), redirect dependant on that drop down on the login page. I want them to be able to only view their own records though. How do I do all this? - I can build all four projects first and then create the shared login screen after....... I would also need to assign a few users who can access the whole lot - all departments and all posts, not just their own.
I would also like the username and the department to echo once logged in - i.e. 'You are logged in as .... from department....'
I would then also like the username and department to be carried forward and entered automatically into respective fields when they click add a record.... so like field 1 autoincrement, field 2 - 'entered by ...', field 3 - 'department ... ' and this to be filled in automatically, but still visible.
Also, how do I go about making drop down menus for the fields afterwards, so users can select an option without having to type it out? and I would also like a second drop down field below with options that are dependant on what the user has selected in the first drop down. Other fields after this would just be typed apart from.........
..... I have a date field, I would like a javascript type calendar that users can select the date from and not have to type the date in manually.
Next it would be cool to create a unique ID field for each record as well dependant on the department and date entered. So, for e.g. department 1 18/05/2008 entry 1 which auto assigns and auto increments so we can't have two of the same entry!
Finally, on a completely different project, I would like Admins to be able to upload a MS Word file and users to only be able to read it as a PDF so they can't edit it. So two fields - first is 'title' that is searchable that the admins type in and second the upload field. The others users can search the titles to get to the document they want, but it opens up only as a PDF when they click the title? Must be Word format uploads and PDF viewable.
sorry for all the questions!!

J
Jane 5/20/2008

Hi,
see my answers below:

  1. create one project for all departments and create four security groups on the User group permissions dialog on the Security tab. Also you can create one group for admin account.
  2. to print username and department use Custom event (Insert PHP code snippet option on the Visual Editor tab).

    Current username is stored $_SESSION["UserID"] variables, groupID is stored in the $_SESSION["GroupID"] variable. To fill fields on the add page with this values use the same variables as default values on the "Edit as" settings dialog on the Visual Editor tab.
  3. to set up field as dropdown select Lookup wizard on the "Edit as" settings dialog on the Visual Editor tab. To open this dialog double click on the field. To set up field as edit box with small calndar select Date and Simple edit box with datapicker option on the same dialog.
  4. to create a unique ID field set up one of your field as autoincrement in teh database directly. Use any MySQL administrative tool for that.
  5. unfortunately it's impossible to upload file in Word format and download the same file in PDF format.
    Also I highly recommend you to have a look at the PHPRunner Help, livedemo and tutorials before:

    http://www.xlinesoft.com/phprunner/docs/

    http://www.xlinesoft.com/phprunner/livedemo4.htm

    http://xlinesoft.com/phprunner/php-database.htm