Jump to content

HELP PLEASE


student4

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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>';
}

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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");

 

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.