-
Posts
15,229 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
I know nothing about the industry so I really couldn't help you evaluate existing software for this. However the homegrown solution does allow you a lot more flexibility in terms of features and requirements. You'll probably need * Users * Permissions (who can do what) * Workflow (for the work orders and how they are created and dealt with) That's really the core of a work order system since you get the luxury of having the actual work done happening outside the system. Any specific questions? I personally can't offer any suggestions on books or tutorials.
-
You work at a hotel with at least three stories and they're looking internally, that is to you, to create a work order system? That's surprising. Have you looked for existing software that you can use? If they paid you a pitiful $20/hour and it took you a week to make this, that's $800. Far more expensive than pretty much all the non-free programs you might be able to find.
-
foreach($xml as $data){ foreach what part of the $xml?
-
echo "<IMG SRC=\"SecondType.php3?PicNum=$row->PicNum\">"; $PicNum = $_GET['number'];
-
If the "Form" is a unique string then why not use it as the array key instead of the numbers? array 'help' => array 'Age' => string '20' (length=2) 'City' => string 'New York' (length= 'Your_name' => string 'Jim' (length=3) 'Friend1' => string 'Joseph' (length=6) 'Friend2' => string 'Waldo' (length=5) 'Form' => string 'help' (length=4) 'welcome' => array 'Age' => string '25' (length=2) 'City' => string 'Sun Valley' (length=10) 'Your_name' => string 'Susan' (length=5) 'Friend1' => string 'Rick' (length=4) 'Friend2' => string 'Joe' (length=3) 'Form' => string 'welcome' (length=4) $key = 'help'; $array = $_SESSION['array']; if(isset($array[$key])){ echo "We have a match"; }
-
Parse errors have nothing to do with the extensions that are loaded. It means there is a fundamental flaw in the code that was typed. It does not conform to the syntax for the PHP language. In this case there's ==>s for the array arrows. That's wrong. There is only one equals sign. $stmt->execute(array(':date_proposed' => $date_proposed, ':proposer' => $proposer, ':title' => $title, ':discuss' => $discuss, ':prepare' => $prepare, ':comments' => $comments));
-
remotely access MySql DB on server A from remote Server B
requinix replied to inosent's topic in MySQL Help
Could be the MySQL server does not allow connections (for that user/password/database) from anything but server_a. For testing only stick an or die(mysql_error()) after the mysql_connect() and the mysql_select_db() (instead of what you have now) calls so you can get an error message indicating why it's not working. -
Either they wrote the code themselves or they got it from someplace else. Most of the time individual files fall under the former.
-
how to group invoices by date in 2-month periods
requinix replied to peppericious's topic in MySQL Help
Right now you have logic like if there are results { start table for each row { output row } end table } Refactor it into more of if there are results { grab a row previous year = year from the row previous month = month rounded down to an odd-numbered month // jan->jan, feb->jan, mar->mar, apr->mar, etc. // use a month number, not a name start table for this year and the couple months do { output row grab the next row current year = year from the new row current month = month rounded down to an odd-numbered month if the current year and month do not match the previous year and month { end table start table for the current year and the couple months update previous year and month with the current year and month } } end table } -
Take a look.
-
remotely access MySql DB on server A from remote Server B
requinix replied to inosent's topic in MySQL Help
Point to what? From where? -
PHP is too late in the process to handle DDoS attacks. The whole point of such an attack is to make your server use more resources to deal with requests and this script will play right into that. Your operating system/firewall is where you should focus your efforts. IIRC you can configure iptables to reject DDoSes, and failing that some automated log file reader (along the lines of fail2ban) can pick up the rest.
-
Every time you call fetch_object() you're fetching a new row from the results. Fetch one row/object separately and reference that. $res = db_query($mysqli, $sql); $obj = $res->fetch_object(); if($res->num_rows && $obj->verified == "Yes" && $obj->suspended == "No") { if($obj->changeofpasswordcode != "") { $randomcode = $obj->changeofpasswordcode; } else { $randomcode = createPasswordResetCode(); } // do something }
-
This would be the right place if you wanted to use regular expressions for it, but I would suggest you not go that route. Are you talking about spidering a site (crawling all the links you can find, for every page you can find) or about making a bot to "click" a very particular link or set of links?
-
how to group invoices by date in 2-month periods
requinix replied to peppericious's topic in MySQL Help
One question: is there a chance that there might not be invoices for a month pair? If so then the code is a fair bit more complicated. -
how to group invoices by date in 2-month periods
requinix replied to peppericious's topic in MySQL Help
How are you building the report now? I mean in terms of code and SQL. -
1. 2. When posting code, use or [code=php:0] tags. 3. Where's the ?
-
CURLOPT_FOLLOWLOCATION set to FALSE but redirects!
requinix replied to Arunkumar15's topic in PHP Coding Help
Works for me. HTTP/1.1 302 Movido temporálmente Date: Fri, 01 Feb 2013 07:45:09 GMT Server: Apache/2.2.3 (Red Hat) Set-Cookie: JSESSIONID=189E1AE60B58965957A9543F8E3623A2; Path=/actas Location: http://actas.rfef.es/actas/NLogin Content-Length: 0 Connection: close Content-Type: text/plain; charset=UTF-8 -
*You're.
-
Question?
-
Inside character sets ([...]) only individual characters matter. What you have now actually allows for a [|]...[/|] tag that I'm sure you don't want. Use regular parentheses for grouping, which you already have in place. Plus you've set it up so that [=x] is a valid tag. In every implementation of BBCode I've seen there are individual rules for every single tag to replace. One for bold, one for italic, one for underline, and one for color. Gives you a lot more control over how they're handled too, and the code to do it is simpler to read and understand.
-
You can't do a header() redirect to multiple locations at once. The browsers will ignore everything up to the last one. Rethink how you want users to do this. Maybe your script can submit the URLs directly? [edit] Code critique: please don't use one letter variable names for non-trivial variables. $d = 'http://www.'; What the heck does $d mean? header('location:'.$g); What was $g? What does it mean? In your short code sample it's easy to scroll up, but when you do it to code with hundreds of lines (or more) you're only creating grief for those who have to read it. Including yourself in the future.
-
Selecting a single directory with scandir, then select ranom image
requinix replied to slamothe's topic in PHP Coding Help
Break the filenames down into the month, day, and year components, then compare those. You can cheat by reassembling them into YYYY-MM-DD format and comparing as strings. function($a, $B) { list($am, $ad, $ay) = explode("_", basename($a)); list($bm, $bd, $by) = explode("_", basename($B)); return strcmp("{$ay}-{$am}-{$ad}", "{$by}-{$bm}-{$bd}"); } -
Selecting a single directory with scandir, then select ranom image
requinix replied to slamothe's topic in PHP Coding Help
You're relying entirely on the filenames being sortable. They are not. When the dates start overlapping years you'll get names like 12_22_2012 12_29_2012 01_05_2013 01_12_2013 That will not sort the way you want it to. -
Selecting a single directory with scandir, then select ranom image
requinix replied to slamothe's topic in PHP Coding Help
Eh, so you'd have to write a simple function for it instead. function($a, $B) { return filemtime($B) - filemtime($a); } pass that to usort instead of just "filemtime", the $b-$a means it'll sort in reverse order.