student4 Posted December 1, 2011 Share Posted December 1, 2011 I have a project to do for my exam. Can somebody helpp? The system should allow the management of household tasks in the home with the students - cleaning the house, buying food, buying household necessities, paying bills and so on. Users of the administrators, the head of household, household member, and an unregistered user. The system has a built-in administrator (username: admin, password: FOI). The administrator has logged in user with type = 0 The administrator manages the system users and approved by home community based on submitted requests from the user. The user automatically becomes the head of household. As an additional activity, which may not need to bring extra points, the administrator has the option of viewing statistics about users, their responsibilities, and households (eg households with up to the task, the user with the most tasks, a user with the most outstanding tasks and so on). Head of household creates Household. To household was created, an approval from the administrator. After approval by the administrator, the same household as the user manages to add and delete users of the household, creates jobs and assigns tasks to individual users. Each assignment has a deadline for execution. Household indebtedness may be awarded only to members of the household. The system has predifinirane events households buying household necessities, buying food, cleaning floors, jobs washing dishes, cleaning the common areas (bathrooms, toilets, etc.). This user has full access to users and a list of household debt to indicator izvršenosti by a user households. The user types by adding a household member becomes the head of household or stop logging in the home community and approval by the head of household. Its possibilities in the system, after awarding the home community, a review of household tasks, a review of its outstanding debt with a performance period of the review carried out his duties. He was also enabled anonymous evaluation of other members of the same household and evaluating the quality of completed tasks by other household members that can also comment. Unregistered users can only view the home communities (without access to home-users communities), and household debt (without access to responsible users, and enforcement of marks). The database is called IWA_2011_ZA_PROJEKT User access to the database is called a password is iwa_2011 FOI When creating the design solution should be exactly stick to the instructions and should not be modified (name of the database table structure, user and password) I've upload the attachment that contains everything I could make on my own. I'd be greatfull if could someone help me. contact me on my mail: dohrzic@foi.hr if i can send you the files i've done. thank you Quote Link to comment https://forums.phpfreaks.com/topic/252224-help-please/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 1, 2011 Share Posted December 1, 2011 Programming help forums can only help with specific problems, specific errors, or specific questions. Do you have a specific problem, specific error, or specific question about some php code you wrote? If so, post the relevant code, a statement of the symptom, the error message, or the specific question you want help with. Posting your list of requirements and asking if someone can help, is not a specific question that a programming help forum can or will answer. Quote Link to comment https://forums.phpfreaks.com/topic/252224-help-please/#findComment-1293116 Share on other sites More sharing options...
student4 Posted December 1, 2011 Author Share Posted December 1, 2011 the update function dost not set coloumn datum_zatrazen when it's null with NOW() (date example 2011-11-20 17:58:42) openDB(); $sql = "SELECT * FROM kucanstvo WHERE datum_odobren IS NULL"; if($rs = mysql_query($sql));{ echo "<table cellspacing='0' cellpadding='0'>"; ?><tr> <th>redni broj kućanstva</th> <th>naziv</th> <th>zatraženo</th> <?php if ($aktivni_korisnik_tip ==0 ) {echo '<th>Odobri</th>';} echo "</tr>"; while(list($idkuca, $idkorisnik, $naziv_kucanstvo, $datum_zatrazen, $datum_odobren) = mysql_fetch_array($rs)) {echo "<tr> <td>$idkuca</td> <td>$naziv_kucanstvo</td> <td>$datum_zatrazen</td>"; function odobriKucanstvo($idkuca, $idkorisnik, $naziv_kucanstvo, $datum_zatrazen, $datum_odobren) { $sql = "UPDATE kucanstvo SET datum_odobren=NOW() WHERE idkucanstvo = $idkuca" or die(mysql_error()); if(mysql_query($sql)) { return true; } else { return false; } } if($aktivni_korisnik_tip != 0) { echo '';} else {echo '<td><form action="lista_cekanja.php" method="post"> <input type="submit" value="Odobri kucanstvo" name="odobriKucanstvo" /></td> </form>'; } echo "</tr>";} echo "</table>"; } closeDB(); in DB a have a table wit the following structure idkucanstvo, idkorisnik naziv_kucanstvo, datum_zatrazen, datum_odobren Quote Link to comment https://forums.phpfreaks.com/topic/252224-help-please/#findComment-1293137 Share on other sites More sharing options...
Pikachu2000 Posted December 1, 2011 Share Posted December 1, 2011 or die(mysql_error()) is misplaced. You will never get any output from it where it is, because it will be triggered only if the value of the query string fails to be assigned to the $sql variable. mysql_error() should be in the else{}. } else { echo "<br>Query: $sql<br>Produced error: " . myql_error() . '<br>'; } Quote Link to comment https://forums.phpfreaks.com/topic/252224-help-please/#findComment-1293139 Share on other sites More sharing options...
student4 Posted December 1, 2011 Author Share Posted December 1, 2011 like this? function odobriKucanstvo($idkuca, $idkorisnik, $naziv_kucanstvo, $datum_zatrazen, $datum_odobren) { $sql = "UPDATE kucanstvo SET datum_odobren=NOW() WHERE idkucanstvo = $idkuca"; if(mysql_query($sql)) { echo "It is OK."; } else { echo "<br>Query: $sql<br>Produced error: " . myql_error() . '<br>'; } } It doesn't change in my database it's still: on button click it's doesn't change for a specific row where datum_odobren=NULL idkucanstvo idkorisnik naziv_kucanstvo datum_zatrazen datum_odobren 25 3 novo 2011-11-30 13:15:00 NULL Quote Link to comment https://forums.phpfreaks.com/topic/252224-help-please/#findComment-1293146 Share on other sites More sharing options...
Pikachu2000 Posted December 1, 2011 Share Posted December 1, 2011 Come to think of it, where do you actually call the function? I don't see the function call anywhere in the code you posted. Quote Link to comment https://forums.phpfreaks.com/topic/252224-help-please/#findComment-1293194 Share on other sites More sharing options...
student4 Posted December 1, 2011 Author Share Posted December 1, 2011 I'm not a expert at this.. I'm loosing too much bcs i can't understand lot's of things, can U help me? how, what and where ? this is the code i'have. Please understand that I am an amateur. <?php include("configBP.php"); include("header.php"); otvoriBP(); $sql = "SELECT * FROM kucanstvo WHERE datum_odobren IS NULL"; if($rs = mysql_query($sql));{ echo "<table cellspacing='0' cellpadding='0'>"; ?><tr> <th>redni broj kućanstva</th> <th>naziv</th> <th>zatraženo</th> <?php if ($aktivni_korisnik_tip ==0 ) {echo '<th>Odobri</th>';} echo "</tr>"; while(list($idkuca, $idkorisnik, $naziv_kucanstvo, $datum_zatrazen, $datum_odobren) = mysql_fetch_array($rs)) {echo "<tr> <td>$idkuca</td> <td>$naziv_kucanstvo</td> <td>$datum_zatrazen</td>"; function odobriKucanstvo($idkuca, $idkorisnik, $naziv_kucanstvo, $datum_zatrazen, $datum_odobren) { $sql = "UPDATE kucanstvo SET datum_odobren=NOW() WHERE idkucanstvo = $idkuca"; if(mysql_query($sql)) { echo "It is OK."; } else { echo "<br>Query: $sql<br>Produced error: " . myql_error() . '<br>'; } } if(isset($_GET['odobrenoKucanstvo'])) { if(odobriKucanstvo(($_GET['odobrenoKucanstvo'])) { echo ('odbreno'); } else { echo 'Došlo je do greške. '; } } if($aktivni_korisnik_tip != 0) { echo '';} else {echo '<td><form action="lista_cekanja.php" method="post"> <input type="submit" value="Odobri kucanstvo" name="odobriKucanstvo" /></td> </form>'; } echo "</tr>";} echo "</table>"; } zatvoriBP(); include("footer.php"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/252224-help-please/#findComment-1293210 Share on other sites More sharing options...
Pikachu2000 Posted December 1, 2011 Share Posted December 1, 2011 If you're far enough into a course to be taking an exam, and don't even know how to call a function, I'm afraid I can't help you. Quote Link to comment https://forums.phpfreaks.com/topic/252224-help-please/#findComment-1293227 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.