Jump to content

rvdveen27

Members
  • Posts

    17
  • Joined

  • Last visited

About rvdveen27

  • Birthday 11/23/1991

Profile Information

  • Location
    Netherlands

rvdveen27's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Time is stored in the following way: Which results in:
  2. Hello all,First of all, I'm fairly new to this. I had some (very) basic experiences with HTML/CSS/PHP/MySQL. I've recently bought a CMS package called TruckNet which was created for Euro Truck Simulator 2 Multiplayer, to simulate VTC's (Virtual Trucking Companies). The CMS package was created by StuartD and after buying it I'm free to change it to my own wishes. I saw this a nice to chance to create something for what I like to do and as well learning some new things. I would like to issue a query on my database that gets results based on the current month. Now I know how to get that information from the database, however I have no idea how I could tell a query to filter the results matching to the current month and how could I let the query/database know what the current month is without having to change it manually?
  3. Thank you for your help! I've managed to change the login.php code to restrict and redirect non-verified users upon login, which is a bit different from what I was aiming for earlier in my question (restricting to just a single page). But I will keep these answers as I have a feeling I will still need this in the future! Thanks again!
  4. This is the login page, I assume this would help you?
  5. Yep got that, the only thing I do not know is how to get the ID of the currently logged in user. How do I check for that?
  6. Okay so it's clear that I should use this code: <?phpheader("Location: notverified.php"); /* Redirect browser *//* Make sure that code below does not get executed when we redirect. */exit;?> Now how do I merge this with the SQL query, where it checks if the logged in user has a verifypend = 1? I understand that I need to include the session somehow, but how?
  7. What do I need to add to the code below to send users to a different page if verifypend = 1?
  8. The question is: Users need to be verified before they can submit a job and the code needs to check if they are and if not, stop them from being able to submit a job.I understand the logical way of thinking. I thougt it would be enough to just have the query check if they user is verified when they click the submit button, before the query inserts their submitted information into the database. The problem is just, with the little php/mysql knowledge I have, I have no idea how I should put that logic into code. I'm hoping you could show me and explain me.The system only needs to check on one page for now if the user is verified. My idea was that they would be able to view the submitjob page (if not verified) but that the submit button would stop them from inserting data into the database. If however, it is possible to stop them viewing the page and instead give them a page that explains why they can't view the submitjob page, that would be great too, better then my idea actually.
  9. Got it working! Many thanks! :)One more question. Back to the submitjob.php page (& code in first post). Users can get a verified status in the database, now I would like to make it so that users that aren't verified cannot submit jobs. For this, I think it's necessary that before the query puts the data into the database, it checks if the user is verified. If not verified it should give a message that users needs to be verified before being able to submit jobs.Below is a part of the code from the profile.php page, where it checks if the user is verified, if so it puts a verified logo on the profile.
  10. And would you be able to explain me how I would be able to do that according to my code?
  11. Except I would need a profit column in the table because I'd like to use that profit data again later on another page. So it still needs to save the result from the calculation to the database right?
  12. Hello all,First of all, I'm fairly new to this. I had some (very) basic experiences with HTML/CSS/PHP/MySQL. I've recently bought a CMS package called TruckNet which was created for Euro Truck Simulator 2 Multiplayer, to simulate VTC's (Virtual Trucking Companies). The CMS package was created by StuartD and after buying it I'm free to change it to my own wishes. I saw this a nice to chance to create something for what I like to do and as well learning some new things. I want to insert a calculation into my code. The calculation should go as follow: price before pickup - damages - costs = profit. I assumed that the calculation should happen when the forum is being submitted but before the data is put into the table, so I assumed that it would be somewhere in between that, which would be on the submitjobs page. The thing is, I have no idea where exactly to put that in between the existing code and what exactly to put there. I did google on how to calculate things in PHP & MySQL but there seem to be quite a lot of different options to do so and I'm confused as what to use. I'm hoping someone could explain me where the best location for the calculation would be and how I could create that calculation. Below is the code where I believe the calculation should be made in between.
  13. Okay now it's starting to make sense indeed. The only thing I do not get is, I obviously have to create those fields but where would I name them then? The fields Starting Position, Ending Position, Price and Costs are already named apparently but I can't seem to figure out where? EDIT: Omfg.. I am so dumb >.<..... I fixed it, behind the echo row3, it should say name, not startcompany... How did I not see this earlier... Many thanks to you again!
  14. This is what it's showing now. It leaves "Starting Company" and "Ending Company" empty, while these should be filled. The database does have the correct values in it.
  15. Hello all,First of all, I'm fairly new to this. I had some (very) basic experiences with HTML/CSS/PHP/MySQL. I've recently bought a CMS package called TruckNet which was created for Euro Truck Simulator 2 Multiplayer, to simulate VTC's (Virtual Trucking Companies). The CMS package was created by StuartD and after buying it I'm free to change it to my own wishes. I saw this a nice to chance to create something for what I like to do and as well learning some new things.I've been working on a page for re-viewing all the submitted deliveries, however I cannot get the page to show the field "Starting Company" and "Ending Company". It correctly shows "Starting Position" and "Ending Position". The MySQL database does have the correct data stored in it. I hope any of you could help me with this and possibly explain it to me so I can learn from it a bit also.I know at this points there are a lot of mistakes in the code that won't correctly show other data but at this point I'm currently only focussed on getting the data for "Starting company" and "Ending company" to show.
×
×
  • Create New...