Jump to content

Crimpage

Members
  • Posts

    70
  • Joined

  • Last visited

    Never

Contact Methods

  • MSN
    dave@crimps.net
  • Website URL
    http://www.crimps.net

Profile Information

  • Gender
    Not Telling
  • Location
    Brisbane, Australia

Crimpage's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi Everyone, I'm generating a report that pulls data from our IT Support helpdesk software, and the report detirmines how long each request has been open for. I need it to work out the date minus any weekends that may have been involved. For instance, say a job was opened Thursday 4:00PM and was closed on Tuesday 10:00AM, that totals 90 hours or 5400 minutes. I need it to check and see if each day it was open was a saturday or sunday and if so, remove that from the total time open. so 90 hours would be - 48 for the weekend = 42 hours = 1.75 days open. The three details I will have to work with are the Created / Open date and either the Completed date, or if it is still open, the time right now. Thanks for your help. David
  2. Hi Fenway, Thanks for your response. I am connecting to an applications database, it is not one that I have created, so I don't have a choice with the formats they have chosen to store their dates in. I don't just want to NULL the values out, as SENDERID 1 could have sent 4 notifications for the 1 workorder and nothing else, so I don't want to see the workorder show up as 4 result lines all with null values. If senderid 1 was the only person to send a notification of any sort, I would like to see the workorder show once with null values in the senderid and notificaitontime fields. I haven't given all of the fields I will be using in the SELECT statement. The other LEFT JOINS join the users tables and workorderstates tables. Any help would be appreciated. Cheers, Dave.
  3. Hi, From what I have quickly read about the OLD_PASSWORD() function, that is for the actual MySQL User database, not your own databases. Are you creating MySQL users, or is this a user table you are creating for your own application. David.
  4. Hi everyone, Hopefully this is simple enough. I am doing a query from an IT Helpdesk database. The database keeps the request and the notifications (emails) in serperate tables linked by a notification_request table. A quick rundown on linking fields Request table: workorderid Notification_workorder table: workorderid notificationid notification table: notificationid So there can be multiple notifications to each request/workorder and from multiple senders. What I want to do, it filterout all notifications from senderid 1, and if by doing that, instead of not showing the request all together, to show the request, but with null notificationdate and senderid values. How it looks at the moment: Requestid createdtime (all other workorder fields) notificationid senderid notificationdate 100 01/05/2008 07:00:00 50 1 01/05/2008 07:00:00 100 01/05/2008 07:00:00 51 3 01/05/2008 07:00:00 101 01/05/2008 08:00:00 52 1 01/05/2008 01:00:00 In this case, when I filter the senderid, it will still show the result line for senderid 3 from request 100, but if the only sender was 1 like request 101, it wont show that request at all. What I would like it to show is: Requestid createdtime (all other workorder fields) notificationid senderid notificationdate 101 01/05/2008 08:00:00 NULL NULL NULL So I can still see the request, but easily see, that no one has responded to it yet. Here is the query I use, as you can see, the last line filters out the senderid of 1, and subsequently the requests that only have 1 as a sender. SELECT wo.workorderid, wo.createdtime, wo.title, nw.notificationid, note.senderid FROM servicedesk.WorkOrder_Threaded wot LEFT JOIN servicedesk.WorkOrder wo ON wot.WORKORDERID=wo.WORKORDERID LEFT JOIN servicedesk.WorkOrderStates wos ON wo.WORKORDERID=wos.WORKORDERID LEFT JOIN servicedesk.SDUser td ON wos.OWNERID=td.USERID LEFT JOIN servicedesk.AaaUser ti ON td.USERID=ti.USER_ID LEFT JOIN servicedesk.notify_workorder nw on nw.workorderid = wo.workorderid LEFT JOIN servicedesk.notification note on note.notificationid = nw.notificationid WHERE wo.createdtime > (UNIX_TIMESTAMP('2008-04-01 00:00:00') * 1000) AND wo.createdtime < (UNIX_TIMESTAMP('2008-04-01 23:59:59') * 1000) AND wo.CREATEDTIME != 0 AND wo.CREATEDTIME IS NOT NULL AND wot.THD_WOID=wot.WORKORDERID AND note.senderid <> 1 Cheers, Dave
  5. Hi, Thanks for the quick reply. I also need to get the array key values as these are dynamic. Basically for each row in Excel I will need: Office - Industry - Product - AmtFinanced - NumberofDeals - Brokerage - DocFee Which should look like: Adelaide - Agriculture - Chat. MTGE - $5,000 - 1 - $200 - $50 Adelaide - Agriculture - HP - $10,000 - 2 - $500 - $200 and so on... Cheers, Dave.
  6. Hi Everyone, I have data in an array that looks like this: Array ( [Adelaide] => Array ( [Agriculture] => Array ( [CHAT. MTGE] => Array ( [amtfinanced] => VALUE [numberofdeals] => VALUE [brokerage] => VALUE [docfee] => VALUE ) ) [Transport & Storage] => Array ( [CHAT. MTGE] => Array ( [amtfinanced] => VALUE [numberofdeals] => VALUE [brokerage] => VALUE [docfee] => VALUE ) ) [Agriculture,Forest & Fishing] => Array ( [LEASE] => Array ( [amtfinanced] => VALUE [numberofdeals] => VALUE [brokerage] => VALUE [docfee] => VALUE ) [CHAT. MTGE] => Array ( [amtfinanced] => VALUE [numberofdeals] => VALUE [brokerage] => VALUE [docfee] => VALUE ) ) ) ) And what I need to do, is get the values of the Office Name (Brisbane), Industry (Agriculture), Product(Chat. MTGE), then the values for amt finance, num deals, brokerage, docfee... The info is a report grouped by office, industry then product and I basically just need to get it into Excel. You can see there is a main array (Office), then under that it has an array for each industry, then an array for each product, then the total values will be in there. I also need to get the array key values as these are dynamic and will change. Any ideas would be great. The structure of the array won't change. Cheers, Dave.
  7. I have no tested knowledge on this but this would be my theory as to why it's happening. The referrer URL has to come from the client browser, otherwise how is my website going to send the new website its location? I think because PHP is processed before the page is displayed to the end user, and you are transferring them to another website before any HTML is actually sent to the browser, I would say that the last page the end user really actually sees really is the blah.com/ page. This may be why it is showing up like that. Maybe a Javascript redirect might help. That way something can be displayed in the browser for 2 seconds on the redirect.php page before it bounces them over to the new website? Hope that thought helps... somehow :| Dave.
  8. The problem is in this part on the first page... <input type="hidden" name="postArray" value="<?=$_POST?>"> All that is going to do is show <input type="hidden" name="postArray" value="Array()"> And if you right click on the page and view source, that's what you will see. You cannot pass an array from page to page like that through a form, I'm pretty sure it has to be done through a session. Dave
  9. Using the IF statement for the mysql_fetch_array command will pull the whole array of information, whereas using a while loop, will iterate through each row of the results. Using the while loop with the fetch_array, means there is no need for the fetch_row command. I would use: [code] <?php $i = 0; while ($row=mysql_fetch_array($mysql_result)) { $i++; $id=$row["calldate"]; $clid=$row["clid"]; $src=$row["src"]; $dst=$row["dst"]; $duration=$row["duration"]; echo "<tr class=\"d".($i & 1)."\">"; echo "<td>".$id."</td>"; echo "<td>".$clid."</td>"; echo "<td>".$src."</td>"; echo "<td>".$dst."</td>"; echo "<td>".$duration."</td>"; echo "</tr>\n"; } ?> [/code]
  10. You can count them with substr_count($haystack, ' ') or you could use a regular expression to do that...  I just searched google for "Regular Expression UK Postcode" and a lot of info came up. Cheers, Dave
  11. Can switch statements have multiple items per case, like in the IF statements above elseif($buildstring == "85.8.1" | $buildstring == "85.8") {       return "1.0.3";   } Would you have to split that into 2 case's? That would make the switch very long...
  12. Look at www.php.net/mysql for info on how to return error codes. You could to then, $query = mysql_query("UPDATE ur_hits SET counter=counter+1 WHERE page = '$PHP_SELF' AND user_id=\"$user_id\" ",$db); if (!$query) {     // return the mysql error } Also, just put echo "Testing"; just above the mysql_query line, that will let you know that the script is making it to that section... Cheers, Dave
  13. what html meta tags are you using? Do you have the Cache-Control one set? I think that will cause that by stopping the browser from remembering what was set so every time it loads the page, it just loads it blank like it was the first time you have been there...
  14. The Checkbox would have the value of the record_id and the name of id[] which tells php that all the checked options go into the one array. They would look like: <INPUT type='checkbox' name='id[]' value='1'> or whatever the value is. That will then go to $_POST['id'] when the form is submitted and you can iterate through the array and move the records that were selected. Cheers, Dave
  15. You need to escape the "'s with \'s [code] $content= "<br><strong> <font size=\"2\"> My Heading Here </strong></font> <br><a href=\"http://lussumo.com\"> Lussumo</a><br> <a href=\"http://google.com\"> Google</a>"; Enclosing all of that in " "'s tells php that it is a string and it doesnt care how it looks with <> or whatever. Without them, php wont like it. Dave [/code]
×
×
  • 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.