gds584 Posted January 15, 2009 Share Posted January 15, 2009 Hi all, First post here, i'm not very up to scratch on php have only done a very small bit of it. I'm having trouble with an old program located here. https://sourceforge.net/projects/phphelpdesk/ I'm running the 0.6.16 Release on Cent OS 5.2 with mysql. I have managed to get it all working correctly had to change some bits around however i am having difficulty getting the time to display properly. This is what the saved updates look like. -0/1-/09 13: 1 Yet the current time displays ok when making an update. 01/13/09 13:50 My time format is DD/MM/YYYY i don't know if its reading it the wrong way but i need this fixed. I'd be happy to make a small donation to whoever can help me with it i just have limited knowledge in the programming area. Thanks Quote Link to comment Share on other sites More sharing options...
ngreenwood6 Posted January 15, 2009 Share Posted January 15, 2009 First off this should be in the php applications forum. Can you elaborate more on this: This is what the saved updates look like. -0/1-/09 13: 1 Yet the current time displays ok when making an update. 01/13/09 13:50 Can you show us the code where the date is displayed and/or stored? Please limit it so that there are not 100 lines of code. Quote Link to comment Share on other sites More sharing options...
gds584 Posted January 15, 2009 Author Share Posted January 15, 2009 First off this should be in the php applications forum. Can you elaborate more on this: This is what the saved updates look like. -0/1-/09 13: 1 Yet the current time displays ok when making an update. 01/13/09 13:50 Can you show us the code where the date is displayed and/or stored? Please limit it so that there are not 100 lines of code. OK what it does is writes from the pages to the mysql database based on your input. It records the Date /time whatever details you want and duration. this appears ok when displaying the timedate. However reading from the saved entries the time is showing as above, almost like its getting entered into mysql in the wrong format therefore it is displaying that way. I'm not too sure on where to look i have tried searching through but i don't fully understand what exactly i'd be looking for. Quote Link to comment Share on other sites More sharing options...
ngreenwood6 Posted January 15, 2009 Share Posted January 15, 2009 Does this script have admin interface? If it does is there a section where you can set the date format (would look like "d/m/Y"). If not then you will have to find it in the code. No one here is going to be able to help you if you don't know where the code is going wrong. Quote Link to comment Share on other sites More sharing options...
gds584 Posted January 15, 2009 Author Share Posted January 15, 2009 Does this script have admin interface? If it does is there a section where you can set the date format (would look like "d/m/Y"). If not then you will have to find it in the code. No one here is going to be able to help you if you don't know where the code is going wrong. No admin interface. i found this in one of the main files. $l_time = "Time"; Should that be datetime? This some of the table entry that get created to begin with CREATE TABLE ticket ( t_timestamp_opened DATETIME, t_timestamp_closed DATETIME, I'll keep looking through it for anything with date or time in it and post here Quote Link to comment Share on other sites More sharing options...
ngreenwood6 Posted January 15, 2009 Share Posted January 15, 2009 i found this in one of the main files. $l_time = "Time"; Should that be datetime? no that just defines the the variable $l_time as "Time" that makes no difference. This some of the table entry that get created to begin with CREATE TABLE ticket ( t_timestamp_opened DATETIME, t_timestamp_closed DATETIME, That just creates the table in the database. What I would do is go to where you would enter the ticket and look at the url(http://mysite.com) and see what the ending page is (index.php). Then I would go to that page and look to where the <form action="test.php">. Then go to the test.php page and in there you should see where the date is entered. That may seem confusing if you have any questions please ask. Quote Link to comment Share on other sites More sharing options...
awpti Posted January 15, 2009 Share Posted January 15, 2009 Please, keep an eye on the "Last Updated:" part Last Update: Aug 28 2003 This project has been abandoned. Don't use abandonware - it'll get you nowhere and is likely outdated and outclassed by other software available. Quote Link to comment Share on other sites More sharing options...
ngreenwood6 Posted January 15, 2009 Share Posted January 15, 2009 I agree with you awpti but if this is for a work thing I can understand why he is still using it. If his work is like mine they are very non-upgradeable meaning that everyone that has the authority to say yeah go to a better system is saying lets keep the old one while the rest of us are like lets get something more useful. Also, he may be using just for the sake of keeping track of all the old data without having to transfer it to a new database. Quote Link to comment Share on other sites More sharing options...
gds584 Posted January 15, 2009 Author Share Posted January 15, 2009 Hi guys, this will be for myself i am starting myown business and this is exactly the thing i am looking for. I have looked at many many other free helpdesk programs and unfortunatly basically none of them could do such simple things i wanted. IE putting duration on a job!!! I have also used this program in the past and it is customizable I have got it 95% working in my opinion yes it is old but it is simple and is all that i need, this little issue with the time and it's got me up and running. ngreenwood6 I searched for the end file as you said, it referenced another, then another etc etc , i'll have to spend some time and draw it out. Whattodo is the file it references to, don't know if anyone feels like downloading adn havign a stickybeak. Will see what i can find thanks for your help much appreciated. Quote Link to comment Share on other sites More sharing options...
ngreenwood6 Posted January 15, 2009 Share Posted January 15, 2009 What does the time look like in the database? Quote Link to comment Share on other sites More sharing options...
gds584 Posted January 15, 2009 Author Share Posted January 15, 2009 Getting closer found this $query = "SELECT t_id, e_description, "; $query .= "e_timestamp, e_duration, s_user, e_status, e_assignedto "; $query .= "FROM events "; $query .= "WHERE t_id='$t_id' ORDER BY e_timestamp;"; $mysqlresult = query($query); while ($row = mysql_fetch_row($mysqlresult)) { print "<TR bgcolor=#eeeeee>\n"; print " <TD valign=center>\n"; $date_var=$row[2]; $YY = "$date_var[2]$date_var[3]"; $MM = "$date_var[4]$date_var[5]"; $DD = "$date_var[6]$date_var[7]"; $hh = "$date_var[8]$date_var[9]"; $mm = "$date_var[10]$date_var[11]"; print " $DD/$MM/$YY $hh:$mm\n"; print " </TD\n>"; print " <TD valign=center>\n"; $thisevent = stripslashes($row[1]); print " $thisevent\n"; print " </TD>\n"; print " <TD valign=center>\n"; print " $row[3]\n"; print " </TD>\n"; print " <TD valign=center>\n"; print " $row[6]\n"; print " </TD>\n"; print "</TR>\n"; I changed the print " $DD/$MM/$YY $hh:$mm\n"; Now i am getting this 1-/-0/09 14: 1 Its a different date to the one above. Looks like its trying to put in YYYY and the 2009 is overlapping Quote Link to comment Share on other sites More sharing options...
ngreenwood6 Posted January 15, 2009 Share Posted January 15, 2009 try putting this: [code]$query = "SELECT t_id, e_description, "; $query .= "e_timestamp, e_duration, s_user, e_status, e_assignedto "; $query .= "FROM events "; $query .= "WHERE t_id='$t_id' ORDER BY e_timestamp;"; $mysqlresult = query($query); while ($row = mysql_fetch_row($mysqlresult)) { print "<TR bgcolor=#eeeeee>\n"; print " <TD valign=center>\n"; $date_var=$row[2]; $date_formatted = date("m/d/Y", $date_var); print " $date_formatted \n"; print " </TD\n>"; print " <TD valign=center>\n"; $thisevent = stripslashes($row[1]); print " $thisevent\n"; print " </TD>\n"; print " <TD valign=center>\n"; print " $row[3]\n"; print " </TD>\n"; print " <TD valign=center>\n"; print " $row[6]\n"; print " </TD>\n"; print "</TR>\n"; [/code] I am changing my post to use another script at this point tho. I downloaded that thing and have had nothing but problems trying to get it to work. Plus I had to enable register_globals which you do not want to do. Quote Link to comment Share on other sites More sharing options...
gds584 Posted January 15, 2009 Author Share Posted January 15, 2009 try putting this: [code]$query = "SELECT t_id, e_description, "; $query .= "e_timestamp, e_duration, s_user, e_status, e_assignedto "; $query .= "FROM events "; $query .= "WHERE t_id='$t_id' ORDER BY e_timestamp;"; $mysqlresult = query($query); while ($row = mysql_fetch_row($mysqlresult)) { print "<TR bgcolor=#eeeeee>\n"; print " <TD valign=center>\n"; $date_var=$row[2]; $date_formatted = date("m/d/Y", $date_var); print " $date_formatted \n"; print " </TD\n>"; print " <TD valign=center>\n"; $thisevent = stripslashes($row[1]); print " $thisevent\n"; print " </TD>\n"; print " <TD valign=center>\n"; print " $row[3]\n"; print " </TD>\n"; print " <TD valign=center>\n"; print " $row[6]\n"; print " </TD>\n"; print "</TR>\n"; [/code] I am changing my post to use another script at this point tho. I downloaded that thing and have had nothing but problems trying to get it to work. Plus I had to enable register_globals which you do not want to do. Add this to you functions if (!function_exists('showSummary')) { functions.php To about all 4 of them And i also changed all the inculdes to inculde_once on all files. That should get it working, php 5 latest apache, globals need to be on yes. Is that a big problem?? its only internal usage not to the internet. Quote Link to comment Share on other sites More sharing options...
gds584 Posted January 15, 2009 Author Share Posted January 15, 2009 Almost i made those changes, it popped up with 01/01/1970. then dissapeared and hasn't come back, maybe its the millenium bug lol the code is old. Quote Link to comment Share on other sites More sharing options...
gds584 Posted January 15, 2009 Author Share Posted January 15, 2009 OK sorry i made the changes to the printticket, this is effectively the last step, the date is still showing 01/01/1970 but i believe this is because the time is corrupt getting entered. Just need to find that and make the same changes and hopefully be it fixed. Quote Link to comment Share on other sites More sharing options...
gds584 Posted January 15, 2009 Author Share Posted January 15, 2009 Ok vj_showticket is the file its in. print "<TR bgcolor=#eeeeee>\n"; print " <TD valign=center align=center>\n"; $date_var=$row[2]; $date_formatted = date("d/m/Y", $date_var); print " $date_formatted \n"; //$YY = "$date_var[2]$date_var[3]"; //$MM = "$date_var[4]$date_var[5]"; // $DD = "$date_var[6]$date_var[7]"; // $hh = "$date_var[8]$date_var[9]"; // $mm = "$date_var[10]$date_var[11]"; // print " $MM/$DD/$YY $hh:$mm\n"; print " </TD>\n"; <TD valign=center align=center> <? $date_var= date("YmdHis"); $date_formatted = date("d/m/Y", $date_var); print " $date_formatted \n"; // $YY = "$date_var[2]$date_var[3]"; // $MM = "$date_var[4]$date_var[5]"; // $DD = "$date_var[6]$date_var[7]"; // $hh = "$date_var[8]$date_var[9]"; // $mm = "$date_var[10]$date_var[11]"; // print " $MM/$DD/$YY $hh:$mm\n"; Made changes above comment out the old. current time is now 14/12/1901 and saved time is 01/01/1970 if that means anything to anyone Quote Link to comment Share on other sites More sharing options...
gds584 Posted January 15, 2009 Author Share Posted January 15, 2009 woohoo i fixed it. removed that garbage and put in $date_var=$row[2]; echo date("d/m/Y H:i",strtotime($date_var)); All ok so far. Quote Link to comment Share on other sites More sharing options...
ngreenwood6 Posted January 15, 2009 Share Posted January 15, 2009 so everything is good then? Quote Link to comment 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.