Jump to content

Moron

Members
  • Posts

    369
  • Joined

  • Last visited

Everything posted by Moron

  1. No, they are both the same script. I take the code I posted above and put it at the beginning of my PHP file and it works. That is, it shows the pie chart, but it shows nothing else on the page, just the pie chart. Conversely, if I put the code elsewhere on the page, the rest of the page works but the code above shows an ASCII representation of the JPG file, i.e. garbage.
  2. When I do that, I get nothing but a red 'x.' Doing it this way, I at least get the pie chart image.
  3. <?php require_once('class_PieChart.php'); $pie = &new PieChart(); // setup our data; value corresponds to the percentage $piedata = array( array('value'=>10,'title'=>'Fruit'), array('value'=>25,'title'=>'Vegetables'), array('value'=>40,'title'=>'Meat'), array('value'=>10,'title'=>'Dairy'), array('value'=>15,'title'=>'Pepsi'), ); // pass the data to the pie chart class $pie->data($piedata); // create a 170x110px image with a 150x150px pie chart, with a // drop shadow under the pie chart, antialiasing enabled, and legend disabled $pie->create_image(170,110,150,150,true,true,false); // display the image (outputs appropriate headers to the browser for a PNG // image, then displays the PNG) $pie->display(); // clean up $pie->destroy_image(); ?> When I run it on its own, it displays a pie chart (using hardcoded variables). When I embed this exact same code in one of my pages, I get the ASCII representation of the pie chart, not the actual chart image. Ideas?
  4. I'm using a different script now. No errors at all, but it displays the ASCII code for the image, not the image itself. What will it take to make the GD Library work?
  5. Okay, I get nothing but the little red 'x' when trying to display an image using the GD Library. When I run: <?php var_dump(gd_info()); ?> ...I get: array(12) { ["GD Version"]=> string(27) "bundled (2.0.28 compatible)" ["FreeType Support"]=> bool(true) ["FreeType Linkage"]=> string(13) "with freetype" ["T1Lib Support"]=> bool(false) ["GIF Read Support"]=> bool(true) ["GIF Create Support"]=> bool(true) ["JPG Support"]=> bool(true) ["PNG Support"]=> bool(true) ["WBMP Support"]=> bool(true) ["XPM Support"]=> bool(false) ["XBM Support"]=> bool(true) ["JIS-mapped Japanese Font Support"]=> bool(false) } JPG support is inded enabled in my PHP.ini file. I'm running PHP 5. Anyone?
  6. I had done that with each individual table. It works now. I changed my "from" statement to a table that was assured of having entries for all employees and used LEFT JOIN. Thanks, everyone!
  7. Thanks, guys, but still no luck. I can directly query the table(s) on one of the newer guys and the records appear, but nothing when done through the PHP page. It's weird.
  8. $RESULTDS=mssql_query("SELECT DISTINCT LH.[EMPNO], M2.[hrYRAT], M2.[EMPNO], M2.[MANLAP], M2.[PAYCTR], M2.[MANLAC], M2.[MANLTC], M2.[MSKLAB], M2.[MSKLTC], M2.[NAMEMI], M2.[NAMEL], M2.[NAMEF], EH.[DATE], EH.[ENETPA], EH.[EGRSER], EH.[EREGHR], EH.[EDEDUC], EH.[EROTHR], EH.[EFWHD], EH.[EPEDAT], EH.[ESSDED], EH.[EHOSPD], EH.[ELIFED], EH.[ECRUD], M2.[POSITN], M2.[MCTDWH], M2.[MHDATE], M2.[MCTDCS], M2.[MO3TOT], M2.[MCTDLD], M2.[MCTDGE], M2.[MALPPP], M2.[MSLPPP], M2.[MWHSTA], M2.[MWHALL], M2.[MWHADD], EH.[EGARND], EI.[DDEPTN], EI.[NEWOCC], EI.[hrYRAT], EI.[MEMPAD], EI.[MEMPCS], EI.[MEMPZI] FROM LeaveHistory LH JOIN MASTERL2 M2 ON LH.[EMPNO]=M2.EMPNO JOIN EARNHIST EH ON EH.[EEMPNO]=M2.EMPNO JOIN View_EmployeeInfo EI ON EI.[EMPNO]=M2.EMPNO WHERE M2.[MSSNO] = '".$_SESSION['password']."' and EH.[EPEDAT] = '8252007' ORDER BY EH.[DATE] desc"); $RESULT=mssql_fetch_assoc($RESULTDS); When I enter my own info, it gives me what I want. It works the same for my boss. He and I have been here for several years. But, when I enter the info for one of the newer guys, it pulls nothing. I directly queried M2 WHERE their SSN (password) matches and it shows. I queried EH WHERE the new guy's record has an EPEDAT of "8252007." Yet it pulls nothing on the new guys. Thoughts?
  9. 11012005. It's Month (one or two digits, as applicable), 2-digit Day, 4-digit Year. Yeah, it's pretty retarded but that's what I have to work with. I'm thinking that whatever technique I use, I'll need to count from the right, since the day and year are consistent.
  10. That would be January 11, 2005. Trust me, the date format wasn't my decision!
  11. Lets say that I have a date string in an older database where March 19th, 2004 is expressed as: 3192005 How can I truncate this to give me: Month: 3 Day: 19 Year: 2004 Thanks!
  12. The $_POST was from some older code when I was just starting with php and was even more clueless than I am now! As for the "die" part, it basically brings up some instructions if they get their employee number or SSN wrong, or of they don't match. Thanks!
  13. just a little note.. if you goto the page with the above code and you have NOT summited a post your wipeout the sessions, (over write with nothing) try this session_start(); if(isset($_POST['password'])) {$_SESSION['password'] = $_POST['password'];} if(isset($_POST['empcode'])) {$_SESSION['empcode'] = $_POST['empcode'];} That did the trick. Now I can go "back" (with a link) to employeeinformationmenu.php without losing the session. Thanks!
  14. For example, after they've logged in, employeeinformationmenu.php has the following at the top: session_start(); $_SESSION['password'] = $_POST['password']; $_SESSION['empcode'] = $_POST['empcode']; From there, they can click on Dental/Vision/Hearing, which is dentalvisionhearing.php. At the top, dentalvisionhearing.php has: session_start(); $empcode = $_POST['EMPNO']; $_SESSION['empcode']=$empcode; $SESSION['password'] = $_POST['password']; So how can I make a proper link back to employeeinformationmenu.php? Does the link back need to be a form, possibly? By the way, my query in employeeinformationmenu.php contains: WHERE ((M2.[EMPNO] = '".$_POST['empcode']."' and M2.[MSSNO] = '".$_POST['password']."') or (M2.[MSSNO] = '".$_SESSION['password']."' and M2.[EMPNO] = '".$_SESSION['empcode']."')) When I use the link back to employeeinformationmenu.php, it goes to the "die" part. I know the input is right or it wouldn't have given me anything in employeeinformationmenu.php in the first place. So I'm thinking that something isn't carrying over properly in my sessions. Thanks!
  15. I'm using sessions. For example, on the main menu page, I establish sessions so that they can click the other three pages and these pass fine. For some reason, though, I'm having a problem passing them back to the main menu page. In other words, they're passing forward just fine but I can't seem to get them to pass back. Do I need to convert a session variable back into a $_POST variable at some point?
  16. Page 1: The user logs in with employee number and password (their SSN). Page 2: A main menu displays with Leave History, Paystubs, and Dental reimbursement. These pages work individually, but how can I link back to the main menu by passing their employee number and SSN back there, without making them have to log in again? I've tried several methods of $_POST and $_GET. No luck so far.
  17. Maybe this will clarify: This screenshot is with my own info entered. I've used no Dental/Vision/Hearing reimbursement this fiscal year (2008), but I do have records for FY 2007. This next screenshot is of a gentleman who has used some reimbursement this fiscal year. As you can see, if records match in the first query, then the second one runs fine. If not, then the second query pulls nothing.
  18. All of my calls are made to $RESULT[FIELD]; $RESULT=mssql_fetch_assoc($RESULTDS); Is that what you mean?
  19. Those are my own functions (with some help from this board). Our fiscal year runs from July 1 through June 30, so $fiscal is defined as such. $fiscalprevious is $fiscal - 1.
  20. The first query: $RESULTDS=mssql_query("SELECT DV.[FY], DV.[EmpNo], DV.[NAME], DV.[EmpNo], M2.[NAMEL], M2.[NAMEF], M2.[NAMEMI], M2.[MSSNO], DV.[DATE OF SERVICE], DV.[^], DV.[sER(D-O-V-H)], DV.[CONSIDER], DV.[REIMBURSE] FROM DentalVisionHearing DV JOIN MASTERL2 M2 ON M2.[EMPNO]=DV.EmpNo WHERE M2.[MSSNO] = '".$_SESSION['password']."' and DV.[FY] = '$fiscal' ORDER BY DV.[FY] desc"); The second query: $RESULTDS=mssql_query("SELECT DV.[FY], DV.[EmpNo], DV.[NAME], DV.[EmpNo], M2.[NAMEL], M2.[NAMEF], M2.[NAMEMI], M2.[MSSNO], DV.[DATE OF SERVICE], DV.[^], DV.[sER(D-O-V-H)], DV.[CONSIDER], DV.[REIMBURSE] FROM DentalVisionHearing DV JOIN MASTERL2 M2 ON M2.[EMPNO]=DV.EmpNo WHERE M2.[MSSNO] = '".$_SESSION['password']."' and DV.[FY] = '$fiscalprevious' ORDER BY M2.[MSSNO] desc"); The first query runs fine. If no records match current fiscal year, then it shows blank data. However.....if the first query pulls no records, then the second one won't, either. ??? Cliffnotes: If a person has matching records for the first query (current fiscal year), then the second query shows their previous fiscal year records just fine. But.... if no records match the first query (current fiscal year), then the second query (previous fiscal year) pulls no records, either, even though I know the records are there. Thoughts?
  21. My first query is: $RESULTDS=mssql_query("SELECT DV.[FY], DV.[EmpNo], DV.[NAME], DV.[EmpNo], M2.[NAMEL], M2.[NAMEF], M2.[NAMEMI], M2.[MSSNO], DV.[DATE OF SERVICE], DV.[^], DV.[sER(D-O-V-H)], DV.[CONSIDER], DV.[REIMBURSE] FROM DentalVisionHearing DV JOIN MASTERL2 M2 ON M2.[EMPNO]=DV.EmpNo WHERE M2.[MSSNO] = '".$_SESSION['password']."' and DV.[FY] = '$fiscal' ORDER BY DV.[FY] desc"); $RESULT=mssql_fetch_assoc($RESULTDS) or die ("You have none"); If nothing meets the desired query criteria, how do I code this to go on and run the remaining code on the page instead of just saying "You have none?"
  22. That works! THANK YOU!!! I added a piece into the "where" clause and that's perfect. Thanks!
  23. Thanks, folks, but both of the above tactics echo nothing.
×
×
  • 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.