Jump to content

Moron

Members
  • Posts

    369
  • Joined

  • Last visited

Everything posted by Moron

  1. [quote author=Caesar link=topic=104236.msg415687#msg415687 date=1155581146] You will need to store that information in order to make a reference to the last time the script was last accessed. If that is indeed your goal. Still unclear as to what it is you're asking. Regardless of what you're asking though, you will need to store data to make a reference to it, or compare it. [/quote] Okay, I guess I'm not expressing myself very well. Sorry, but this is also a bit confusing to me. It's actually very simple. What year was the last occurrence of July 1? That's it. As of right now, the answer would be July 1, 2006. This time next year, the code will show that the last occurrence was July 1, 2007, and so on. Our fiscal year begins July 1, but I need it to be Year-aware. Make sense?
  2. [quote author=Caesar link=topic=104236.msg415676#msg415676 date=1155579414] Kinda vague. Where do you want to get this last occurance? From a database? What type of database? MySQL? Can you post the current code you have? What format are these dates stored as? [/quote] Sorry I wasn't more clear. No, I don't mean the last occurrence with data. I mean the last time that date happened. For example, the last time it happened was July 1, [b]2006[/b]. If I had ran this program back in May or whatnot, then it would show the last occurrence as July 1, [b]2005[/b], and so on.
  3. Let me try this again. Our fiscal year begins on July 1, so how do I get the last occurrence of July 1? Example: 07012006. I also want it to know and post the correct year.
  4. [quote author=AndyB link=topic=104212.msg415493#msg415493 date=1155569450] [quote author=Moron link=topic=104212.msg415479#msg415479 date=1155568481] [quote author=AndyB link=topic=104212.msg415475#msg415475 date=1155568207] How is the date stored in your database table? [/quote] By Month, Day, Year. I also wrote a function that combines these... $combineddate="$RESULT[Lmo]$RESULT[Lda]$RESULT[LYR]"; [/quote] Oh, Lord!  It would make your life so much simpler if you stored the date using a single database field using the date format (yyyy-mm-dd). Then manipulations like the selection you want would be a zillion times simpler.  Unless you are absolutely committed to your own unique date storage method, I'd really recommend you change it to yyyy-mm-dd since that will make lots of sorting/retrieving by date much simpler - and I expect you'll have more of them in the future - otherwise you're in for lots of coding headaches. If your concern is how 'difficult' it is to get people to enter dates in that format, use a simple, human-friendly, javascript date picker to do it for them. [/quote] Heh heh! Trust me, I'm not committed to anything at all! I'm a total newbie at PHP and I'm struggling to get a program written. The problem is that this is an old database and it's all I have to work with. :)
  5. [quote author=AndyB link=topic=104212.msg415475#msg415475 date=1155568207] How is the date stored in your database table? [/quote] By Month, Day, Year. I also wrote a function that combines these... $combineddate="$RESULT[Lmo]$RESULT[Lda]$RESULT[LYR]";
  6. Our Fiscal year begins July 1. I want to pull records from that date forward and I also need it to understand calendar year changeover. In other words, next February 2007, I want it to understand that the Fiscal Year started July 1, 2006.
  7. I'm working on an employee leave system. My script is pulling [b]all[/b] leave incidents, but I only want it to pull the last six months. Here's the code where it plugs the leave items: echo $RESULT['Lmo'];  echo "/"; echo $RESULT['Lda']; echo "/"; echo $RESULT['LYR']; (Leave month, Leave day, Leave year). I also set a variable called.... $combineddate="$RESULT[Lmo]$RESULT[Lda]$RESULT[LYR]"; ..which combines the above three into "08112006" format. ...and another one called $pastdate which pulls the date on today's date six months ago. If I use... WHERE ('$currentdate' >= '$pastdate') or IF or WHILE or anything else I've tried, it either bombs or returns nothing. I want to show records from six months ago through the present. Anybody?
  8. Can this be done? while ($this = yes) and ($that = maybe) { do $theother; } I know my syntax is rotten, but can a while loop have multiple conditions? Thanks.
  9. [quote author=king arthur link=topic=103720.msg413249#msg413249 date=1155222915] [code] <?php print("<table border=10>"); while($RESULT = mssql_fetch_assoc($RESULTDS)){ echo "<tr>"; echo "<td>"; echo $RESULT['Leave Code']; echo "</td>"; echo "<td>"; echo $RESULT['Lmo']; echo "/"; echo $RESULT['Lda']; echo "/"; echo $RESULT['LYR'];  echo "</td>"; echo "<td>"; echo $RESULT['whatever your hours field is called']; echo "</td>"; echo "</tr>"; } print("</table>"); ?> [/code] Try that. [/quote] Works! You really ARE the king! Thanks! :)
  10. [quote author=king arthur link=topic=103720.msg413230#msg413230 date=1155221733] Just to be clear, you want Date in one cell, Leave Type in the next cell, Hours in the next cell, and then underneath that the next row, and so on? [/quote] Exactly. And thanks.
  11. [quote author=king arthur link=topic=103720.msg413215#msg413215 date=1155220685] So the first cell should contain a code, the date and some hours, not just the date as it does now? Where will you get the hours from? [/quote] From left to right, it should read: Date, Leave Type, Hours, then go to the next line and repeat. The Hours are a table in the database are there's no calculation involved in my code.
  12. Okay, I have my code pulling data from the database properly, BUT.... I can't seem to format it right for love or money. I'm good with HTML, so I initially just built an HTML table and then stuck my <?php......?> stuff inside the appropriate table section. Didn't work right. What I'm trying now is: [code]<?php print("<table border=10><tr><td>"); while($RESULT = mssql_fetch_assoc($RESULTDS)){ echo $RESULT['Lmo']; echo "/"; echo $RESULT['Lda']; echo "/"; echo $RESULT['LYR'].'<br />';  print("</td><td>"); echo $RESULT['Leave Code'].'<br />'; } print("</td></tr></table>"); ?>[/code] It comes out as: [img]http://mywebpages.comcast.net/techie4/formatting.gif[/img] What I want is Leave Date, Leave Type (code), and Hours across each column. Anybody? Thanks in advance! EDIT: My semicolons aren't bumped down to the next line. It just did that when I pasted it here. As I didnt use the [b]CODE[/b] tags.
  13. [quote author=ronverdonk link=topic=102615.msg407544#msg407544 date=1154464860] Before I go: are you certain that your PHP mail (email function) works? You'd better check that. Ronald   ;D [/quote] Yes, we do! :)
  14. [quote author=ronverdonk link=topic=102615.msg407526#msg407526 date=1154463484] I'll have to do some rework on some samples. Will be back within 12 hours with a workeable solution. I'll send the code via a private message from this site. Okay? Ronald   ;D [/quote] I can't possibly thank you enough! :)
  15. [quote author=ronverdonk link=topic=102615.msg407506#msg407506 date=1154462353] Does your reply mean that you've got it? [/quote] Unfortunately, no. I don't know where to begin. I do HTML and Javascript.That's pretty much it. I played with Perl a few years ago, but that's my only experience with anything server-side. Can you recommend a good starting script or just a generally good starting point? If I can find a script that's close to what I want that I can modify, that would be ideal. :)
  16. [quote author=ronverdonk link=topic=102615.msg407491#msg407491 date=1154461420] Now the process, as I understand it, should be as follows: [list] [*]Employee fills in FORM1 and submits[/list][/quote] Correct. [quote][list][*]FORM1 generates email to supervisor containing a link to the FORM2 [*]Supervisor receives email and clicks on link to FORM2[/list][/quote] Either it sends a link -OR- sends the form itself. A link sounds a lot easier. [quote][list][*]Supervisor gets FORM2 screen and fills decline/accept/comments [*]Supervisor submits forms [*]FORM2 generates an email and sends to whoever is in the distribution list [/list] Is this correctly understood? Ronald  ;D [/quote] You've pretty much got it. Either e-mail notifications are sent with a link to a form needing approval, or the form itself is sent in e-mail. The way you're describing, by sending links, sounds the most feasible. Thanks!
  17. Hi, Folks. I just stumbled across this fine forum and it looked like the right place to ask. I need some serious PHP help (see my username).  ;) What I'm trying to accomplish is an Employee Leave Management system using PHP with Microsoft SQL, NOT MySQL. This is because we already have PHP talking to MS SQL quite well, but I'm not a coder by "nature." I want it to work like the following. All must be BROWSER-based. 1. Employee pulls up the Leave Request form on our Intranet and fills it out (PHP and all other functions are already working fine). 2. He/She then clicks Submit. 3. The form arrives in the supervisor's e-mail (MS Exchange/Outlook 2000/2003). 4. Now, the supervisor can click Approve or Decline. There will also be a spot for Comments. 5. Next, the supervisor clicks Submit and it goes to: a. Personnel b. The original requestor c. Anyone else as needed. 6. The entire procedure is stored in a SQL Server database (Version 7, I *think*). Now, if there is a commercial or shareware product already out there to accomplish these things, I will consider them as well, but I would MUCH rather be able to code it in PHP or adapt it from existing code. Anybody either seen anything like this or can offer me some insight? Much obliged!
×
×
  • 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.