Jump to content

dave_biscuits

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Everything posted by dave_biscuits

  1. Nuts, looks like it is (mysql ver 5.1) ... so no rollbacks, ouch that sucks (Edit: read up on switching to innodb, all good now ) Appreciate the help, cheers.
  2. Hi Everyone, I'm trying to do a simple procedure: begin, update, rollback ... only problem is it keeps committing!! I'm tearing my hair out here ... tried it numerous ways with no success so far. Current code looks like: /* turn autocommit off */ mysqli_autocommit($link, FALSE); mysqli_query($link, "UPDATE customer SET ".$update." WHERE customer_uid = '".$data['customer_uid']."';"); mysqli_rollback($link); But it keeps updating the database despite my efforts. PHP5, Apache 2.2, FreeBSD 7.0 ... pretty much out of the box setup config wise. Any ideas?? Thanks, Dave
  3. Hi everyone. Got an issue with a bit of code that I can't figure out: User submits the page with data to save. PHP reads a text file of saved data, updates the data with the changes, writes it back to the text file, then finally re-reads the text file in order to show on screen that the changes have definitely been written properly. The initial read and write works fine - it does definitely save it to the text file no problems - except the re-read after the write doesnt work properly - it keeps displaying on screen the data from the very first read (before changes were made). The result is I have to always refresh the page to get it to read the file again and display the changes properly. My only thought is that PHP only writes to the text file after the code has fully executed - rather than on the fly ... Code is below, any idea what I've done wrong or how I can get around this?? $my_array = ''; // If user submitted data, read, make changes, write new data string. if($_POST['dater']!='') { // READ CODE $my_array = ''; $filename = "../calendar.data"; if(filesize($filename)!='0') { $file = fopen($filename, 'r'); $theData = fread($file, filesize($filename)); fclose($file); $my_array = ''; $exploded = explode(',',$theData); foreach ($exploded as $explode) { if($explode!='') { $e2 = explode('#',$explode); $my_array[$e2[0]] = $e2[1]; } } } // INSERT NEW DATA $my_array[$_POST['dater']] = $_POST['status']; // WRITE CODE $imploded = ''; foreach($my_array as $key=>$val) { if($val!='') { $imploded = $imploded.rawurlencode($key)."#".rawurlencode($val).","; } } $filename = "../calendar.data"; $file = fopen($filename, 'w') or die("can't open file"); fwrite($file, $imploded); fclose($file); } // GO FOR MAIN READ // RE-READ DATA $booked_array = ''; $myFile = "../calendar.data"; if(filesize($myFile)!='0') { $fh = fopen($myFile, 'r'); $theData = fread($fh, filesize($myFile)); fclose($fh); $booked_array = ''; $exploded = explode(',',$theData); foreach ($exploded as $explode) { if($explode!='') { $e2 = explode('#',$explode); $booked_array[$e2[0]] = $e2[1]; } } } // **** Error: booked_array showing pre-changes array ... }
  4. > Your scripts are probably setting the error reporting level. Have you checked in them to see? You were correct - just as I was about to give up I found this in the database connection script that 99% of all the pages call upon starting: error_reporting(E_ERROR | E_WARNING | E_PARSE); Many thanks, cheers.
  5. Still no joy. I dont think php.ini is being overridden, I've changed php.ini to record to /var/log/php.log because I thought apache might be stuffing it around ... anyway, phpinfo() reads: error_log /var/log/php.log /var/log/php.log log_errors On On error_reporting 64 64 (error_reporting = E_COMPILE_ERROR for this particular test run ...) and yet php.log still stamps: [25-Mar-2009 15:00:27] PHP Warning: Invalid argument supplied for foreach() in /usr/local/www/data-dist/ ...... argh!
  6. Yep, rebooted numerous times and no change. Server is for an internal web app, so no real danger of hackers - plus the coding involved is enormous (~6 years worth) so making it squeaky clean isnt really an option - four billion warnings like running an empty variable through a foreach function doesnt really worry me. Either way, I still need to figure out why php wants to log everything when im trying to ask it to only log errors only ... perhaps it only affects 'display_errors' and not log_errors??
  7. I currently have PHP logging all errors to /var/log/httpd-error.log (FreeBSD 7.0) by default and I'm trying to get it to only log fatal errors (as warnings keep filling up the log file a lot). Now, I've currently got the following PHP variables set (and have confirmed the .ini path just in case): error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR display_errors = Off log_errors = On I've tried numerous syntax to try and get it to stop logging warnings but it just seems to keep logging every everything - what am I missing?? does log_errors just log everything no matter what?
  8. Hi Everyone, Stuck on a bit of an issue here ... im trying to find some add-ins for php that will allow me to grab an existing pdf, overlay some form fields (and a 'sign here' digital signature field), and enable acrobats 'user access enabled' option (such that acrobat reader can save the form / sign the document). Its sounds like PDFLib+PDI may be the only PHP package to let you do this - but I dont quite have a spare US$2000 to spend on a license. TCPDF seems to be able to do some of those things - but doesnt look like i can import a pdf to overlay onto etc ... Are there any other packages (preferably open source / freeware ... or just a lot cheaper than $2k) that might be able to allow me to do this in PHP?? (OS is FreeBSD as a side note). Any feedback would be much appreciated. Cheers, Dave
  9. .... and SECOND version: revised and cleaned up slightly to echo after each loop iteration of results ... function makeAllocateLine($category, $rain) { global $result; global $allocate_tag; if($allocate_tag[$category]=='') { $allocate_tag[$category] = '1'; } if($allocate_tag[$category] == "1") { $colour = "D6CFAD"; } else { $colour = "EDE7CB"; } $allocate_tag[$category] = $allocate_tag[$category]*-1; //if($results['nome']=='') { $results['nome'] = '?'; } echo $category." = ".$category."+unescape('".rawurlencode(" <TR STYLE='background:#".$colour."; height: 22px; cursor: hand;' onMouseOver=\"colorMe(document.getElementById('".$category."_".$result['bank_uid']."'),'".$colour."');\" onMouseOut=\"plainJane(document.getElementById('".$category."_".$result['bank_uid']."'),'".$colour."');\" ID='".$category."_".$result['bank_uid']."' COLOR_NOW='".$colour."' COLOR_RESTORE='".$colour."' BASTARD_AMOUNT='".$result['amount']."' BASTARD_COMMENTS='".$result['bank_comments']."'> <TD onClick=\"nailThis(document.getElementById('".$category."_".$result['bank_uid']."'),'".$colour."');\"> <TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0'> <TR> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD>".method_square($result['method'], $result['bank_uid'],'right')."</TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 50px;'><SPAN STYLE=' color: #333333;'>P".$result['bank_uid']."</SPAN></DIV></TD> <TD><TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' STYLE='color: #FFFFFF;'><TR><TD><IMG SRC='shim.gif' WIDTH='4' HEIGHT='1'></TD><TD><IMG SRC='".$rain.".png'></TD></TR></TABLE></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 40px;'><SPAN STYLE=' color: #333333;'>".date('d M',$result['created'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 150px;'><SPAN STYLE=' color: #333333;'>".$result['nome']."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 55px;'><SPAN STYLE=' color: #333333;'>$".$result['amount']."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 144px;'><SPAN STYLE=' color: #333333;'>".rawurldecode($result['bank_comments'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> </TR> </TABLE> </TD> <TD> <TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' STYLE='position: relative; top: 1px;'><TR><TD><DIV ID='w_allo_noter".$result['bank_uid']."' STYLE='width: 13px; height: 13px; background: "); if($result['bank_notes']!='') { $note_on = 'yes'; } else { $note_on = 'no'; } if($note_on=='yes') { echo rawurlencode("#0066CC; border: solid 1px #0066CC; "); } else { echo rawurlencode("#94B7D1; border: solid 1px #6698BD; "); } echo rawurlencode(" color: #FFFFFF; font-size: 9px; cursor: hand;'><SPAN onClick=\"loadNote('".$result['bank_uid']."');\"><CENTER>N</CENTER></SPAN></DIV></TD></TR></TABLE> </TD> <TD><IMG SRC='shim.gif' WIDTH='8' HEIGHT='1'></TD> <TD><IMG SRC='kharcross.gif' STYLE='position: relative; top: 1px;' onClick=\"deleteBankUID('".$result['bank_uid']."');\" ></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> </TR> "); echo "');"; // END OF FUNCTION } function makeAllocateLine_CREDIT($category, $rain) { global $result; global $allocate_tag; global $mesSsage; global $insert; global $insert2; global $insert3; if($allocate_tag[$category]=='') { $allocate_tag[$category] = '1'; } if($allocate_tag[$category] == "1") { $colour = "D6CFAD"; } else { $colour = "EDE7CB"; } $allocate_tag[$category] = $allocate_tag[$category]*-1; //if($results['nome']=='') { $results['nome'] = '?'; } echo $category." = ".$category."+unescape('".rawurlencode(" <TR STYLE='background:#".$colour."; height: 22px; cursor: hand;' onMouseOver=\"colorMe(this,'".$colour."');\" onMouseOut=\"plainJane(this,'".$colour."');\" ID='".$category."".$result['credit_uid']."' COLOR_NOW='".$colour."' COLOR_RESTORE='".$colour."' BASTARD_AMOUNT='".($result['credit_amount']-$result['credit_paid'])."' BASTARD_COMMENTS='".$result['bank_comments']."'> <TD onClick=\"nailThis2(document.getElementById('".$category."".$result['credit_uid']."'),'".$colour."', '".$result['credit_uid']."');\"> <TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0'> <TR> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD>".method_square('credit', $result['credit_uid'],'right')."</TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 50px;'><SPAN STYLE=' color: #333333;'>CN".$result['credit_uid']."</SPAN></DIV></TD> <TD><TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' STYLE='color: #FFFFFF;'><TR><TD><IMG SRC='shim.gif' WIDTH='4' HEIGHT='1'></TD><TD><IMG SRC='rain_c.png'></TD></TR></TABLE></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 40px;'><SPAN STYLE=' color: #333333;'>".date('d M',$result['credit_created'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 150px;'><SPAN STYLE=' color: #333333;'>".$result['nome']."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 55px;'><SPAN STYLE=' color: #333333;'>$".($result['credit_amount']-$result['credit_paid'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 144px;'><SPAN STYLE=' color: #333333;'>".rawurldecode($result['credit_reason'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> </TR> </TABLE> </TD> <TD>".$insert2."<IMG SRC='reddollar.png' STYLE=' ".$insert." position: relative; top: 1px;'>".$insert3."</TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD> <TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' STYLE='position: relative; top: 1px;'><TR><TD><DIV ID='w_allo_noter".$result['bank_uid']."' STYLE='width: 13px; height: 13px; background: "); if($result['credit_notes']!='') { $note_on = 'yes'; } else { $note_on = 'no'; } if($note_on=='yes') { echo rawurlencode("#0066CC; border: solid 1px #0066CC; "); } else { echo rawurlencode("#94B7D1; border: solid 1px #6698BD; "); } echo rawurlencode(" color: #FFFFFF; font-size: 9px; cursor: hand;'><SPAN STYLE='' onClick=\"loadNote2('".$result['credit_uid']."');\"><CENTER>N</CENTER></SPAN></DIV></TD></TR></TABLE> </TD> <TD><IMG SRC='shim.gif' WIDTH='8' HEIGHT='1'></TD> <TD><IMG SRC='kharcross.gif' STYLE='position: relative; top: 1px; visibility: hidden;' onClick=\"deleteBankUID('".$result['bank_uid']."');\" ></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> </TR> "); echo "');"; // END OF FUNCTION } if($_POST['method']=='refresh_allocate2') { $time_start = microtime_float(); $allocate_a = ''; $allocate_w = ''; $allocate_j = ''; $allocate_all = ''; $allocate_a_tag = '1'; $allocate_w_tag = '1'; $allocate_j_tag = '1'; $allocate_all_tag = '1'; if($special=='') { $special2 = " WHERE credit_status = 'issued' AND credit_amount <> credit_paid "; } else { $special2 = $special." AND credit_status = 'issued' AND credit_amount <> credit_paid "; } $results = ''; $query = "SELECT credits.*, customer.* from credits left outer join customer on (credits.credit_customer = customer.customer_no) ".$special2." order by credit_uid::integer DESC, credit_created::integer DESC; ;"; //echo "prompt('',unescape('".rawurlencode($query)."'));"; $query = pg_query($query); while($row = pg_fetch_array($query,NULL,PGSQL_ASSOC)) { $nome = ''; if($row['customer_surname']!='') { $nome = $row['customer_surname'].", ".$row['customer_firstname']; } else { $nome = $row['customer_name']; } if($row['customer_company']!='') { if($nome=='') { $nome = $row['customer_company']; } else { $nome = $nome." (".$row['customer_company'].")"; } } $row['nome'] = $nome; $results[] = $row; $last_cust = $row; } $credit_results = $results; if($special3=='') { $special3 = " WHERE bank_temporary.status = 'actual' AND bank_temporary.amount != '0' "; } $results = ''; $query = "SELECT bank_temporary.*, customer.* from bank_temporary left outer join customer on (bank_temporary.customer_uid = customer.customer_no) ".$special3." order by bank_uid::integer DESC, created::integer DESC; "; //echo "prompt('',unescape('".rawurlencode($query)."'));"; $query = pg_query($query); while($row = pg_fetch_array($query,NULL,PGSQL_ASSOC)) { $nome = ''; if($row['customer_surname']!='') { $nome = $row['customer_surname'].", ".$row['customer_firstname']; } else { $nome = $row['customer_name']; } if($row['customer_company']!='') { if($nome=='') { $nome = $row['customer_company']; } else { $nome = $nome." (".$row['customer_company'].")"; } } $row['nome'] = $nome; $results[] = $row; $last_cust = $row; } if($special!='') { echo "try { document.getElementById('allo_select_cust').innerHTML = \"<FONT STYLE='color: #009900;'><B>\"+unescape('".rawurlencode($last_cust['nome'])."')+\"</B></FONT>\"; } catch(e) { }"; if($last_cust['nome']=='') { echo "try { document.getElementById('allo_select_cust').innerHTML = \"<FONT STYLE='color: #990000;'><I>\"+unescape('".rawurlencode('No bankings under this customer.')."')+\"</I></FONT>\"; } catch(e) { }"; } } echo "var allocate_w = '';"; echo "var allocate_a = '';"; echo "var allocate_j = '';"; echo "var allocate_c = '';"; echo "var allocate_all = '';"; echo "var allocate_all_c = '';"; foreach ($results as $result) { if($result['customer_uid']=='') { makeAllocateLine('allocate_w','rain_w'); makeAllocateLine('allocate_all','rain_w'); } else { if($result['bank_category']=='banking') { makeAllocateLine('allocate_a','rain_a'); makeAllocateLine('allocate_all','rain_a'); } else { makeAllocateLine('allocate_j','rain_j'); makeAllocateLine('allocate_all','rain_j'); } } } // end foreach results foreach ($credit_results as $result) { // ADD IN MODULE FOR CREDIT NOTES ******************************************** START // ADD IN MODULE FOR CREDIT NOTES ******************************************** START // ADD IN MODULE FOR CREDIT NOTES ******************************************** START if($allocate_c_tag == "1") { $colour = "D6CFAD"; //Dark Grey } if($allocate_c_tag == "-1") { $colour = "EDE7CB"; //Light Grey } $allocate_c_tag = $allocate_c_tag*-1; //autoCred('".$row['credit_uid']."'); $temp = str_replace('%5E','',$result['credit_refinv']); $insert = ''; $insert2 = ''; $insert3 = ''; if(trim($temp)!='') { $insert = ""; $apply_data = ''; $apply_data = explode('^^',rawurldecode($result['credit_refinv'])); $precheck = ''; $ddata = ''; $supercounter = '0'; $mesSsage = ''; foreach ($apply_data as $ddata) { if($supercounter=='2') { $supercounter = '0'; if($failrate=='n') { $apply_counter++; $failrate = ''; } } if($supercounter=='0') { $precheck = $ddata; $supercounter++; continue; } if($supercounter=='1') { if((trim($precheck)!='') || (trim($ddata)!='')) { if($precheck=='') { $mesSsage = $mesSsage."<I>Job Unknown</I> "; } else { $mesSsage = $mesSsage.$precheck." "; } if($ddata!='') { $mesSsage = $mesSsage."($".$ddata.")"; } $mesSsage = $mesSsage."<IMG SRC='shim.gif' WIDTH='10' HEIGHT='1'>"; $failrate = 'n'; } $supercounter++; continue; } } //$mesSsage = 'blah'; if($mesSsage!='') { $mesSsage = "<DIV STYLE='width: 240px;'><SPAN STYLE=''><TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' STYLE='color: #333333;'><TR><TD>".$mesSsage."</TD></TR></TABLE></SPAN></DIV>"; $insert2 = "<FONT STYLE='color: #CC0000; cursor: help;' onMouseOver=\"smith('second', unescape('".rawurlencode($mesSsage)."')); document.all['smith'].style.display = 'block'; this.onmousemove = getMouseXY3;\" onMouseOut=\"document.all['smith'].style.display = 'none';\">"; $insert3 = "</FONT>"; } } else { $insert = "visibility: hidden;"; } makeAllocateLine_CREDIT('allocate_c','rain_c'); makeAllocateLine_CREDIT('allocate_all_c','rain_c'); } echo "allocate_all = allocate_all+allocate_all_c;"; echo "document.getElementById('sub_allocate_w').innerHTML = unescape('".rawurlencode("<TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' onSelectStart='return false;'>")."')+allocate_w+unescape('".rawurlencode("</TABLE>")."');"; echo "document.getElementById('sub_allocate_a').innerHTML = unescape('".rawurlencode("<TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' onSelectStart='return false;'>")."')+allocate_a+unescape('".rawurlencode("</TABLE>")."');"; echo "document.getElementById('sub_allocate_j').innerHTML = unescape('".rawurlencode("<TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' onSelectStart='return false;'>")."')+allocate_j+unescape('".rawurlencode("</TABLE>")."');"; echo "document.getElementById('sub_allocate_c').innerHTML = unescape('".rawurlencode("<TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' onSelectStart='return false;'>")."')+allocate_c+unescape('".rawurlencode("</TABLE>")."');"; echo "document.getElementById('sub_allocate_all').innerHTML = unescape('".rawurlencode("<TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' onSelectStart='return false;'>")."')+allocate_all+unescape('".rawurlencode("</TABLE>")."');"; /* echo "document.getElementById('sub_allocate_a').innerHTML = unescape('".rawurlencode("<TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' onSelectStart='return false;'>".$allocate_a."</TABLE>")."');"; echo "document.getElementById('sub_allocate_j').innerHTML = unescape('".rawurlencode("<TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' onSelectStart='return false;'>".$allocate_j."</TABLE>")."');"; echo "document.getElementById('sub_allocate_c').innerHTML = unescape('".rawurlencode("<TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' onSelectStart='return false;'>".$allocate_c."</TABLE>")."');"; echo "document.getElementById('sub_allocate_all').innerHTML = unescape('".rawurlencode("<TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' onSelectStart='return false;'>".$allocate_all."</TABLE>'")."');"; */ $time_end = microtime_float(); $time = $time_end - $time_start; //echo "alert('completed in ".$time." sec');"; } // end method refresh_allocate
  10. Ok, I'll have another go at posting this code ... Basically, you hit the "refresh" button on the HTML application, one AJAX call is made ($_POST['method']=='refresh_allocate2-ORIGINAL' used to activate this particular function). so, FIRST version: grubby code - store all javascript data in PHP variables, echo at end of script ... if($_POST['method']=='refresh_allocate2-ORIGINAL') { $time_start = microtime_float(); $allocate_a = ''; $allocate_w = ''; $allocate_j = ''; $allocate_all = ''; $allocate_a_tag = '1'; $allocate_w_tag = '1'; $allocate_j_tag = '1'; $allocate_all_tag = '1'; if($special=='') { $special2 = " WHERE credit_status = 'issued' AND credit_amount <> credit_paid "; } else { $special2 = $special." AND credit_status = 'issued' AND credit_amount <> credit_paid "; } $results = ''; $query = "SELECT credits.*, customer.* from credits left outer join customer on (credits.credit_customer = customer.customer_no) ".$special2." order by credit_uid::integer DESC, credit_created::integer DESC; ;"; //echo "prompt('',unescape('".rawurlencode($query)."'));"; $query = pg_query($query); while($row = pg_fetch_array($query,NULL,PGSQL_ASSOC)) { $nome = ''; if($row['customer_surname']!='') { $nome = $row['customer_surname'].", ".$row['customer_firstname']; } else { $nome = $row['customer_name']; } if($row['customer_company']!='') { if($nome=='') { $nome = $row['customer_company']; } else { $nome = $nome." (".$row['customer_company'].")"; } } $row['nome'] = $nome; $results[] = $row; $last_cust = $row; } $credit_results = $results; if($special3=='') { $special3 = " WHERE bank_temporary.status = 'actual' AND bank_temporary.amount != '0' "; } $results = ''; $query = "SELECT bank_temporary.*, customer.* from bank_temporary left outer join customer on (bank_temporary.customer_uid = customer.customer_no) ".$special3." order by bank_uid::integer DESC, created::integer DESC; "; //echo "prompt('',unescape('".rawurlencode($query)."'));"; $query = pg_query($query); while($row = pg_fetch_array($query,NULL,PGSQL_ASSOC)) { $nome = ''; if($row['customer_surname']!='') { $nome = $row['customer_surname'].", ".$row['customer_firstname']; } else { $nome = $row['customer_name']; } if($row['customer_company']!='') { if($nome=='') { $nome = $row['customer_company']; } else { $nome = $nome." (".$row['customer_company'].")"; } } $row['nome'] = $nome; $results[] = $row; $last_cust = $row; } if($special!='') { echo "try { document.getElementById('allo_select_cust').innerHTML = \"<FONT STYLE='color: #009900;'><B>\"+unescape('".rawurlencode($last_cust['nome'])."')+\"</B></FONT>\"; } catch(e) { }"; if($last_cust['nome']=='') { echo "try { document.getElementById('allo_select_cust').innerHTML = \"<FONT STYLE='color: #990000;'><I>\"+unescape('".rawurlencode('No bankings under this customer.')."')+\"</I></FONT>\"; } catch(e) { }"; } } foreach ($results as $result) { if($result['customer_uid']=='') { if($allocate_w_tag == "1") { $colour = "D6CFAD"; /* Dark */ } else { $colour = "EDE7CB"; /* Light */ } $allocate_w_tag = $allocate_w_tag*-1; //if($results['nome']=='') { $results['nome'] = '?'; } $allocate_w = $allocate_w." <TR STYLE='background:#".$colour."; height: 22px; cursor: hand;' onMouseOver=\"colorMe(document.getElementById('allocate_w_".$result['bank_uid']."'),'".$colour."');\" onMouseOut=\"plainJane(document.getElementById('allocate_w_".$result['bank_uid']."'),'".$colour."');\" ID='allocate_w_".$result['bank_uid']."' COLOR_NOW='".$colour."' COLOR_RESTORE='".$colour."' BASTARD_AMOUNT='".$result['amount']."' BASTARD_COMMENTS='".$result['bank_comments']."'> <TD onClick=\"nailThis(document.getElementById('allocate_w_".$result['bank_uid']."'),'".$colour."');\"> <TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0'> <TR> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD>".method_square($result['method'], $result['bank_uid'],'right')."</TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 50px;'><SPAN STYLE=' color: #333333;'>P".$result['bank_uid']."</SPAN></DIV></TD> <TD><TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' STYLE='color: #FFFFFF;'><TR><TD><IMG SRC='shim.gif' WIDTH='4' HEIGHT='1'></TD><TD><IMG SRC='rain_w.png'></TD></TR></TABLE></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 40px;'><SPAN STYLE=' color: #333333;'>".date('d M',$result['created'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 150px;'><SPAN STYLE=' color: #333333;'>".$result['nome']."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 55px;'><SPAN STYLE=' color: #333333;'>$".$result['amount']."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 144px;'><SPAN STYLE=' color: #333333;'>".rawurldecode($result['bank_comments'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> </TR> </TABLE> </TD> <TD> <TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' STYLE='position: relative; top: 1px;'><TR><TD><DIV ID='w_allo_noter".$result['bank_uid']."' STYLE='width: 13px; height: 13px; background: "; if($result['bank_notes']!='') { $note_on = 'yes'; } else { $note_on = 'no'; } if($note_on=='yes') { $allocate_w = $allocate_w."#0066CC; border: solid 1px #0066CC; "; } else { $allocate_w = $allocate_w."#94B7D1; border: solid 1px #6698BD; "; } $allocate_w = $allocate_w." color: #FFFFFF; font-size: 9px; cursor: hand;'><SPAN onClick=\"loadNote('".$result['bank_uid']."');\"><CENTER>N</CENTER></SPAN></DIV></TD></TR></TABLE> </TD> <TD><IMG SRC='shim.gif' WIDTH='8' HEIGHT='1'></TD> <TD><IMG SRC='kharcross.gif' STYLE='position: relative; top: 1px;' onClick=\"deleteBankUID('".$result['bank_uid']."');\" ></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> </TR> "; // START ALL ************* // START ALL ************* // START ALL ************* if($allocate_all_tag == "1") { $colour = "D6CFAD"; //Dark Grey } if($allocate_all_tag == "-1") { $colour = "EDE7CB"; //Light Grey } $allocate_all_tag = $allocate_all_tag*-1; $allocate_all = $allocate_all." <FONT ID='nailer".$result['bank_uid']."' CUSTOMERUID='".$result['customer_uid']."'></FONT> <TR STYLE='background:#".$colour."; height: 22px; cursor: hand;' onMouseOver=\"colorMe(this,'".$colour."');\" onMouseOut=\"plainJane(this,'".$colour."');\" ID='allocate_all_".$result['bank_uid']."' COLOR_NOW='".$colour."' COLOR_RESTORE='".$colour."' BASTARD_AMOUNT='".$result['amount']."' BASTARD_COMMENTS='".$result['bank_comments']."'> <TD onClick=\"nailThis(document.getElementById('allocate_all_".$result['bank_uid']."'),'".$colour."');\"> <TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' ID='check_customer".$result['bank_uid']."' CUSTOMER='".$result['customer_uid']."'> <TR> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD>".method_square($result['method'], $result['bank_uid'],'right')."</TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 50px;'><SPAN STYLE=' color: #333333;'>P".$result['bank_uid']."</SPAN></DIV></TD> <TD><TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' STYLE='color: #FFFFFF;'><TR><TD><IMG SRC='shim.gif' WIDTH='4' HEIGHT='1'></TD><TD><IMG SRC='rain_w.png'></TD></TR></TABLE></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 40px;'><SPAN STYLE=' color: #333333;'>".date('d M',$result['created'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 150px;'><SPAN STYLE=' color: #333333;'>".$result['nome']."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 55px;'><SPAN STYLE=' color: #333333;'>$".$result['amount']."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 144px;'><SPAN STYLE=' color: #333333;'>".rawurldecode($result['bank_comments'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> </TR> </TABLE> </TD> <TD> <TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' STYLE='position: relative; top: 1px;'><TR><TD><DIV ID='all_allo_noter".$result['bank_uid']."' STYLE='width: 13px; height: 13px; background: "; if($result['bank_notes']!='') { $note_on = 'yes'; } else { $note_on = 'no'; } if($note_on=='yes') { $allocate_all = $allocate_all."#0066CC; border: solid 1px #0066CC; "; } else { $allocate_all = $allocate_all."#94B7D1; border: solid 1px #6698BD; "; } $allocate_all = $allocate_all." color: #FFFFFF; font-size: 9px; cursor: hand;'><SPAN onClick=\"loadNote('".$result['bank_uid']."');\"><CENTER>N</CENTER></SPAN></DIV></TD></TR></TABLE> </TD> <TD><IMG SRC='shim.gif' WIDTH='8' HEIGHT='1'></TD> <TD><IMG SRC='kharcross.gif' STYLE='position: relative; top: 1px;' onClick=\"deleteBankUID('".$result['bank_uid']."');\" ></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> </TR> "; // END ALL ************* // END ALL ************* // END ALL ************* } else { if($result['bank_category']=='banking') { if($allocate_a_tag == "1") { $colour = "D6CFAD"; //Dark Grey } if($allocate_a_tag == "-1") { $colour = "EDE7CB"; //Light Grey } $allocate_a_tag = $allocate_a_tag*-1; $allocate_a = $allocate_a." <TR STYLE='background:#".$colour."; height: 22px; cursor: hand;' onMouseOver=\"colorMe(this,'".$colour."');\" onMouseOut=\"plainJane(this,'".$colour."');\" ID='allocate_a_".$result['bank_uid']."' COLOR_NOW='".$colour."' COLOR_RESTORE='".$colour."' BASTARD_AMOUNT='".$result['amount']."' BASTARD_COMMENTS='".$result['bank_comments']."'> <TD onClick=\"nailThis(document.getElementById('allocate_a_".$result['bank_uid']."'),'".$colour."');\"> <TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0'> <TR> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD>".method_square($result['method'], $result['bank_uid'],'right')."</TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 50px;'><SPAN STYLE=' color: #333333;'>P".$result['bank_uid']."</SPAN></DIV></TD> <TD><TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' STYLE='color: #FFFFFF;'><TR><TD><IMG SRC='shim.gif' WIDTH='4' HEIGHT='1'></TD><TD><IMG SRC='rain_a.png'></TD></TR></TABLE></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 40px;'><SPAN STYLE=' color: #333333;'>".date('d M',$result['created'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 150px;'><SPAN STYLE=' color: #333333;'>".$result['nome']."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 55px;'><SPAN STYLE=' color: #333333;'>$".$result['amount']."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 144px;'><SPAN STYLE=' color: #333333;'>".rawurldecode($result['bank_comments'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> </TR> </TABLE> </TD> <TD> <TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' STYLE='position: relative; top: 1px;'><TR><TD><DIV ID='a_allo_noter".$result['bank_uid']."' STYLE='width: 13px; height: 13px; background: "; if($result['bank_notes']!='') { $note_on = 'yes'; } else { $note_on = 'no'; } if($note_on=='yes') { $allocate_a = $allocate_a."#0066CC; border: solid 1px #0066CC; "; } else { $allocate_a = $allocate_a."#94B7D1; border: solid 1px #6698BD; "; } $allocate_a = $allocate_a." color: #FFFFFF; font-size: 9px; cursor: hand;'><SPAN onClick=\"loadNote('".$result['bank_uid']."');\"><CENTER>N</CENTER></SPAN></DIV></TD></TR></TABLE> </TD> <TD><IMG SRC='shim.gif' WIDTH='8' HEIGHT='1'></TD> <TD><IMG SRC='kharcross.gif' STYLE='position: relative; top: 1px;' onClick=\"deleteBankUID('".$result['bank_uid']."');\" ></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> </TR> "; // START ALL ************* // START ALL ************* // START ALL ************* if($allocate_all_tag == "1") { $colour = "D6CFAD"; //Dark Grey } if($allocate_all_tag == "-1") { $colour = "EDE7CB"; //Light Grey } $allocate_all_tag = $allocate_all_tag*-1; $allocate_all = $allocate_all." <FONT ID='nailer".$result['bank_uid']."' CUSTOMERUID='".$result['customer_uid']."'></FONT> <TR STYLE='background:#".$colour."; height: 22px; cursor: hand;' onMouseOver=\"colorMe(this,'".$colour."');\" onMouseOut=\"plainJane(this,'".$colour."');\" ID='allocate_all_".$result['bank_uid']."' COLOR_NOW='".$colour."' COLOR_RESTORE='".$colour."' BASTARD_AMOUNT='".$result['amount']."' BASTARD_COMMENTS='".$result['bank_comments']."'> <TD onClick=\"nailThis(document.getElementById('allocate_all_".$result['bank_uid']."'),'".$colour."');\"> <TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' ID='check_customer".$result['bank_uid']."' CUSTOMER='".$result['customer_uid']."'> <TR> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD>".method_square($result['method'], $result['bank_uid'],'right')."</TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 50px;'><SPAN STYLE=' color: #333333;'>P".$result['bank_uid']."</SPAN></DIV></TD> <TD><TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' STYLE='color: #FFFFFF;'><TR><TD><IMG SRC='shim.gif' WIDTH='4' HEIGHT='1'></TD><TD><IMG SRC='rain_a.png'></TD></TR></TABLE></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 40px;'><SPAN STYLE=' color: #333333;'>".date('d M',$result['created'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 150px;'><SPAN STYLE=' color: #333333;'>".$result['nome']."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 55px;'><SPAN STYLE=' color: #333333;'>$".$result['amount']."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 144px;'><SPAN STYLE=' color: #333333;'>".rawurldecode($result['bank_comments'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> </TR> </TABLE> </TD> <TD> <TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' STYLE='position: relative; top: 1px;'><TR><TD><DIV ID='all_allo_noter".$result['bank_uid']."' STYLE='width: 13px; height: 13px; background: "; if($result['bank_notes']!='') { $note_on = 'yes'; } else { $note_on = 'no'; } if($note_on=='yes') { $allocate_all = $allocate_all."#0066CC; border: solid 1px #0066CC; "; } else { $allocate_all = $allocate_all."#94B7D1; border: solid 1px #6698BD; "; } $allocate_all = $allocate_all." color: #FFFFFF; font-size: 9px; cursor: hand;'><SPAN onClick=\"loadNote('".$result['bank_uid']."');\"><CENTER>N</CENTER></SPAN></DIV></TD></TR></TABLE> </TD> <TD><IMG SRC='shim.gif' WIDTH='8' HEIGHT='1'></TD> <TD><IMG SRC='kharcross.gif' STYLE='position: relative; top: 1px;' onClick=\"deleteBankUID('".$result['bank_uid']."');\" ></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> </TR> "; // END ALL ************* // END ALL ************* // END ALL ************* } else { if($allocate_j_tag == "1") { $colour = "D6CFAD"; //Dark Grey } if($allocate_j_tag == "-1") { $colour = "EDE7CB"; //Light Grey } $allocate_j_tag = $allocate_j_tag*-1; $allocate_j = $allocate_j." <TR STYLE='background:#".$colour."; height: 22px; cursor: hand;' onMouseOver=\"colorMe(this,'".$colour."');\" onMouseOut=\"plainJane(this,'".$colour."');\" ID='allocate_j_".$result['bank_uid']."' COLOR_NOW='".$colour."' COLOR_RESTORE='".$colour."' BASTARD_AMOUNT='".$result['amount']."' BASTARD_COMMENTS='".$result['bank_comments']."'> <TD onClick=\"nailThis(document.getElementById('allocate_j_".$result['bank_uid']."'),'".$colour."');\"> <TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0'> <TR> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD>".method_square($result['method'], $result['bank_uid'],'right')."</TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 50px;'><SPAN STYLE=' color: #333333;'>P".$result['bank_uid']."</SPAN></DIV></TD> <TD><TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' STYLE='color: #FFFFFF;'><TR><TD><IMG SRC='shim.gif' WIDTH='4' HEIGHT='1'></TD><TD><IMG SRC='rain_j.png'></TD></TR></TABLE></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 40px;'><SPAN STYLE=' color: #333333;'>".date('d M',$result['created'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 150px;'><SPAN STYLE=' color: #333333;'>".$result['nome']."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 55px;'><SPAN STYLE=' color: #333333;'>$".$result['amount']."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 144px;'><SPAN STYLE=' color: #333333;'>".rawurldecode($result['bank_comments'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> </TR> </TABLE> </TD> <TD> <TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' STYLE='position: relative; top: 1px;'><TR><TD><DIV ID='j_allo_noter".$result['bank_uid']."' STYLE='width: 13px; height: 13px; background: "; if($result['bank_notes']!='') { $note_on = 'yes'; } else { $note_on = 'no'; } if($note_on=='yes') { $allocate_j = $allocate_j."#0066CC; border: solid 1px #0066CC; "; } else { $allocate_j = $allocate_j."#94B7D1; border: solid 1px #6698BD; "; } $allocate_j = $allocate_j." color: #FFFFFF; font-size: 9px; cursor: hand;'><SPAN onClick=\"loadNote('".$result['bank_uid']."');\"><CENTER>N</CENTER></SPAN></DIV></TD></TR></TABLE> </TD> <TD><IMG SRC='shim.gif' WIDTH='8' HEIGHT='1'></TD> <TD><IMG SRC='kharcross.gif' STYLE='position: relative; top: 1px;' onClick=\"deleteBankUID('".$result['bank_uid']."');\" ></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> </TR> "; // START ALL ************* // START ALL ************* // START ALL ************* if($allocate_all_tag == "1") { $colour = "D6CFAD"; //Dark Grey } if($allocate_all_tag == "-1") { $colour = "EDE7CB"; //Light Grey } $allocate_all_tag = $allocate_all_tag*-1; $allocate_all = $allocate_all." <FONT ID='nailer".$result['bank_uid']."' CUSTOMERUID='".$result['customer_uid']."'></FONT> <TR STYLE='background:#".$colour."; height: 22px; cursor: hand;' onMouseOver=\"colorMe(this,'".$colour."');\" onMouseOut=\"plainJane(this,'".$colour."');\" ID='allocate_all_".$result['bank_uid']."' COLOR_NOW='".$colour."' COLOR_RESTORE='".$colour."' BASTARD_AMOUNT='".$result['amount']."' BASTARD_COMMENTS='".$result['bank_comments']."'> <TD onClick=\"nailThis(document.getElementById('allocate_all_".$result['bank_uid']."'),'".$colour."');\"> <TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' ID='check_customer".$result['bank_uid']."' CUSTOMER='".$result['customer_uid']."'> <TR> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD>".method_square($result['method'], $result['bank_uid'],'right')."</TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 50px;'><SPAN STYLE=' color: #333333;'>P".$result['bank_uid']."</SPAN></DIV></TD> <TD><TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' STYLE='color: #FFFFFF;'><TR><TD><IMG SRC='shim.gif' WIDTH='4' HEIGHT='1'></TD><TD><IMG SRC='rain_j.png'></TD></TR></TABLE></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 40px;'><SPAN STYLE=' color: #333333;'>".date('d M',$result['created'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 150px;'><SPAN STYLE=' color: #333333;'>".$result['nome']."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 55px;'><SPAN STYLE=' color: #333333;'>$".$result['amount']."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 144px;'><SPAN STYLE=' color: #333333;'>".rawurldecode($result['bank_comments'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> </TR> </TABLE> </TD> <TD> <TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' STYLE='position: relative; top: 1px;'><TR><TD><DIV ID='all_allo_noter".$result['bank_uid']."' STYLE='width: 13px; height: 13px; background: "; if($result['bank_notes']!='') { $note_on = 'yes'; } else { $note_on = 'no'; } if($note_on=='yes') { $allocate_all = $allocate_all."#0066CC; border: solid 1px #0066CC; "; } else { $allocate_all = $allocate_all."#94B7D1; border: solid 1px #6698BD; "; } $allocate_all = $allocate_all." color: #FFFFFF; font-size: 9px; cursor: hand;'><SPAN onClick=\"loadNote('".$result['bank_uid']."');\"><CENTER>N</CENTER></SPAN></DIV></TD></TR></TABLE> </TD> <TD><IMG SRC='shim.gif' WIDTH='8' HEIGHT='1'></TD> <TD><IMG SRC='kharcross.gif' STYLE='position: relative; top: 1px;' onClick=\"deleteBankUID('".$result['bank_uid']."');\" ></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> </TR> "; // END ALL ************* // END ALL ************* // END ALL ************* } } } // end foreach results foreach ($credit_results as $result) { // ADD IN MODULE FOR CREDIT NOTES ******************************************** START // ADD IN MODULE FOR CREDIT NOTES ******************************************** START // ADD IN MODULE FOR CREDIT NOTES ******************************************** START if($allocate_c_tag == "1") { $colour = "D6CFAD"; //Dark Grey } if($allocate_c_tag == "-1") { $colour = "EDE7CB"; //Light Grey } $allocate_c_tag = $allocate_c_tag*-1; //autoCred('".$row['credit_uid']."'); $temp = str_replace('%5E','',$result['credit_refinv']); $insert = ''; $insert2 = ''; $insert3 = ''; if(trim($temp)!='') { $insert = ""; $apply_data = ''; $apply_data = explode('^^',rawurldecode($result['credit_refinv'])); $precheck = ''; $ddata = ''; $supercounter = '0'; $mesSsage = ''; foreach ($apply_data as $ddata) { if($supercounter=='2') { $supercounter = '0'; if($failrate=='n') { $apply_counter++; $failrate = ''; } } if($supercounter=='0') { $precheck = $ddata; $supercounter++; continue; } if($supercounter=='1') { if((trim($precheck)!='') || (trim($ddata)!='')) { if($precheck=='') { $mesSsage = $mesSsage."<I>Job Unknown</I> "; } else { $mesSsage = $mesSsage.$precheck." "; } if($ddata!='') { $mesSsage = $mesSsage."($".$ddata.")"; } $mesSsage = $mesSsage."<IMG SRC='shim.gif' WIDTH='10' HEIGHT='1'>"; $failrate = 'n'; } $supercounter++; continue; } } //$mesSsage = 'blah'; if($mesSsage!='') { $mesSsage = "<DIV STYLE='width: 240px;'><SPAN STYLE=''><TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' STYLE='color: #333333;'><TR><TD>".$mesSsage."</TD></TR></TABLE></SPAN></DIV>"; $insert2 = "<FONT STYLE='color: #CC0000; cursor: help;' onMouseOver=\"smith('second', unescape('".rawurlencode($mesSsage)."')); document.all['smith'].style.display = 'block'; this.onmousemove = getMouseXY3;\" onMouseOut=\"document.all['smith'].style.display = 'none';\">"; $insert3 = "</FONT>"; } } else { $insert = "visibility: hidden;"; } $allocate_c = $allocate_c." <TR STYLE='background:#".$colour."; height: 22px; cursor: hand;' onMouseOver=\"colorMe(this,'".$colour."');\" onMouseOut=\"plainJane(this,'".$colour."');\" ID='allocate_c".$result['credit_uid']."' COLOR_NOW='".$colour."' COLOR_RESTORE='".$colour."' BASTARD_AMOUNT='".($result['credit_amount']-$result['credit_paid'])."' BASTARD_COMMENTS='".$result['bank_comments']."'> <TD onClick=\"nailThis2(document.getElementById('allocate_c".$result['credit_uid']."'),'".$colour."', '".$result['credit_uid']."');\"> <TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0'> <TR> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD>".method_square('credit', $result['credit_uid'],'right')."</TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 50px;'><SPAN STYLE=' color: #333333;'>CN".$result['credit_uid']."</SPAN></DIV></TD> <TD><TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' STYLE='color: #FFFFFF;'><TR><TD><IMG SRC='shim.gif' WIDTH='4' HEIGHT='1'></TD><TD><IMG SRC='rain_c.png'></TD></TR></TABLE></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 40px;'><SPAN STYLE=' color: #333333;'>".date('d M',$result['credit_created'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 150px;'><SPAN STYLE=' color: #333333;'>".$result['nome']."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 55px;'><SPAN STYLE=' color: #333333;'>$".($result['credit_amount']-$result['credit_paid'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 144px;'><SPAN STYLE=' color: #333333;'>".rawurldecode($result['credit_reason'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> </TR> </TABLE> </TD> <TD>".$insert2."<IMG SRC='reddollar.png' STYLE=' ".$insert." position: relative; top: 1px;'>".$insert3."</TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD> <TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' STYLE='position: relative; top: 1px;'><TR><TD><DIV ID='w_allo_noter".$result['bank_uid']."' STYLE='width: 13px; height: 13px; background: "; if($result['credit_notes']!='') { $note_on = 'yes'; } else { $note_on = 'no'; } if($note_on=='yes') { $allocate_c = $allocate_c."#0066CC; border: solid 1px #0066CC; "; } else { $allocate_c = $allocate_c."#94B7D1; border: solid 1px #6698BD; "; } $allocate_c = $allocate_c." color: #FFFFFF; font-size: 9px; cursor: hand;'><SPAN STYLE='' onClick=\"loadNote2('".$result['credit_uid']."');\"><CENTER>N</CENTER></SPAN></DIV></TD></TR></TABLE> </TD> <TD><IMG SRC='shim.gif' WIDTH='8' HEIGHT='1'></TD> <TD><IMG SRC='kharcross.gif' STYLE='position: relative; top: 1px; visibility: hidden;' onClick=\"deleteBankUID('".$result['bank_uid']."');\" ></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> </TR> "; // START ALL ************* // START ALL ************* // START ALL ************* if($allocate_all_tag == "1") { $colour = "D6CFAD"; //Dark Grey } if($allocate_all_tag == "-1") { $colour = "EDE7CB"; //Light Grey } $allocate_all_tag = $allocate_all_tag*-1; $allocate_all = $allocate_all." <TR STYLE='background:#".$colour."; height: 22px; cursor: hand;' onMouseOver=\"colorMe(this,'".$colour."');\" onMouseOut=\"plainJane(this,'".$colour."');\" ID='allocate_all_c".$result['credit_uid']."' COLOR_NOW='".$colour."' COLOR_RESTORE='".$colour."' BASTARD_AMOUNT='".($result['credit_amount']-$result['credit_paid'])."' BASTARD_COMMENTS='".$result['bank_comments']."'> <TD onClick=\"nailThis2(document.getElementById('allocate_all_c".$result['credit_uid']."'),'".$colour."', '".$result['credit_uid']."');\"> <TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' ID='check_customerc".$result['credit_uid']."' CUSTOMER='".$result['credit_customer']."'> <TR> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD>".method_square('credit', $result['credit_uid'],'right')."</TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 50px;'><SPAN STYLE=' color: #333333;'>CN".$result['credit_uid']."</SPAN></DIV></TD> <TD><TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' STYLE='color: #FFFFFF;'><TR><TD><IMG SRC='shim.gif' WIDTH='4' HEIGHT='1'></TD><TD><IMG SRC='rain_c.png'></TD></TR></TABLE></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 40px;'><SPAN STYLE=' color: #333333;'>".date('d M',$result['credit_created'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 150px;'><SPAN STYLE=' color: #333333;'>".$result['nome']."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 55px;'><SPAN STYLE=' color: #333333;'>$".($result['credit_amount']-$result['credit_paid'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD><DIV STYLE='width: 144px;'><SPAN STYLE=' color: #333333;'>".rawurldecode($result['credit_reason'])."</SPAN></DIV></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> </TR> </TABLE> </TD> <TD>".$insert2."<IMG SRC='reddollar.png' STYLE=' ".$insert." position: relative; top: 1px;'>".$insert3."</TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> <TD> <TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' STYLE='position: relative; top: 1px;'><TR><TD><DIV ID='w_allo_noter".$result['bank_uid']."' STYLE='width: 13px; height: 13px; background: "; if($result['credit_notes']!='') { $note_on = 'yes'; } else { $note_on = 'no'; } if($note_on=='yes') { $allocate_all = $allocate_all."#0066CC; border: solid 1px #0066CC; "; } else { $allocate_all = $allocate_all."#94B7D1; border: solid 1px #6698BD; "; } $allocate_all = $allocate_all." color: #FFFFFF; font-size: 9px; cursor: hand;'><SPAN STYLE='' onClick=\"loadNote2('".$result['credit_uid']."');\"><CENTER>N</CENTER></SPAN></DIV></TD></TR></TABLE> </TD> <TD><IMG SRC='shim.gif' WIDTH='8' HEIGHT='1'></TD> <TD><IMG SRC='shim.gif' WIDTH='1' HEIGHT='1'></TD> <TD><IMG SRC='shim.gif' WIDTH='5' HEIGHT='1'></TD> </TR> "; // END ALL ************* // END ALL ************* // END ALL ************* // ADD IN MODULE FOR CREDIT NOTES ******************************************** FINISH // ADD IN MODULE FOR CREDIT NOTES ******************************************** FINISH // ADD IN MODULE FOR CREDIT NOTES ******************************************** FINISH } echo "document.getElementById('sub_allocate_w').innerHTML = unescape('".rawurlencode("<TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' onSelectStart='return false;'>".$allocate_w."</TABLE>")."');"; echo "document.getElementById('sub_allocate_a').innerHTML = unescape('".rawurlencode("<TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' onSelectStart='return false;'>".$allocate_a."</TABLE>")."');"; echo "document.getElementById('sub_allocate_j').innerHTML = unescape('".rawurlencode("<TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' onSelectStart='return false;'>".$allocate_j."</TABLE>")."');"; echo "document.getElementById('sub_allocate_c').innerHTML = unescape('".rawurlencode("<TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' onSelectStart='return false;'>".$allocate_c."</TABLE>")."');"; echo "document.getElementById('sub_allocate_all').innerHTML = unescape('".rawurlencode("<TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' onSelectStart='return false;'>".$allocate_all."</TABLE>'")."');"; $time_end = microtime_float(); $time = $time_end - $time_start; echo "alert('completed in ".$time." sec');"; } // end method refresh_allocate
  11. One thing I did think it might be was PHP's memory limit ... possibly running out of memory while storing up that 1MB+ data for javascript in a variable ... maybe chugging due to low resource limits or something ... but server has plenty of ram, and php.ini was set generously ... ;;;;;;;;;;;;;;;;;;; ; Resource Limits ; ;;;;;;;;;;;;;;;;;;; max_execution_time = 130 ; Maximum execution time of each script, in seconds max_input_time = 60 ; Maximum amount of time each script may spend parsing request data memory_limit = 150M ; Maximum amount of memory a script may consume (8MB) Cheers, Dave.
  12. Hmm ok ... I think everyone took me too literally here ... like i said, its more complicated than the snippet of code i drummed up for the example ... what i was trying to explain is that the script i posted was only a sample (eg concept) of what I was doing ... AJAX calls a php file to refresh the contents of a certain table in my HTML application ... Definitely not the browser chugging, have watched top (FreeBSD) and when PHP is storing the table contents to echo at the end of the loop (as opposed to echoing text at the end of every iteration), its httpd thats busy for 30 secs or so ... I tried posting the code ... but it exceeds the 40,000 character limit apparently ... anyway, just trust me on this one ... the size of the table returned by AJAX is ~ 1MB+ ... browser only takes 2-3 seconds to parse it tho once PHP passes it on in either senario ... Cheers, Dave.
  13. I'm scratching my head at the moment ... for simplified purposes, I have a complicated script that pretty much goes along the lines of: for ( $counter = 1; $counter <= 100; $counter += 1) { $message = $message."<TABLE><TR><TD> ... </TD></TR></TABLE>"; } echo "document.getElementById('results').innerHTML = '".$message."';"; now that takes ~30 seconds for the machine to crunch and display ... during this time, httpd goes CPU crazy. now, if i do this in a 'javascript' solution ... ie ... for ( $counter = 1; $counter <= 100; $counter += 1) { echo "document.getElementById('results').innerHTML = document.getElementById('results').innerHTML."<TABLE><TR><TD> ... </TD></TR></TABLE>"; } then the whole thing takes ~5 seconds ... WHY ???? (more importantly, why is PHP so inefficient in storing text in variables??) Cheers, Dave.
  14. I just built a new dual quad-core server for our apache / php html intranet applications Only problem is everytime you run an heavy-duty page on the html application, httpd chugs away for about 20 seconds or so using one core only until its finished. Is there any possible way to tweak apache / php to use the power of all 8 cores to speed this up?? (Otherwise i would have built a overclocked 4GHz dual core instead of spending big on an slow 2.5GHz 8 core xeon!!) Running FreeBSD 7.0 64bit, Apache22, PHP4.4.8 ... Thanks in advance, Dave. ???
  15. is_array() sounds like a winner ... except: [code]if(is_array($barrow[$jobinfobase2['uid']]['uid'])) {  echo "its an array"; } else { echo "its not an array"; }[/code] gives the error: [code]PHP Fatal error:  Cannot use string offset as an array in /usr/local/www/data-dist/Manhattan/g2a_price.php on line 811[/code] I havent even set $barrow[$jobinfobase2['uid']]['uid'] so i have no idea why it automatically assumes its a string offset ... ??? Cheers, Dave.
  16. Hi Everyone, Got a problem with string offsets ... ie: [quote]2. Illegal use of string offsets causes E_ERROR instead of E_WARNING.   EX :   <?php   $a = "foo";   unset($a[0][1][2]);   ?>   Fatal error: Cannot use string offset as an array in ... on line 1 [/quote] my specific code is fowling on: [code]$data2[$blah]['status'] = $results[$datastream['type']][$datastream['number']]['status'];[/code] because $results[$datastream['type']][$datastream['number']]['status'] doesnt exist, it throws up a string offset error (which it never used to do in php4... php4 just treated it as null ... ) anyone got any tips / suggestions how i can get around this problem in php5? I'd like to start using php5 (mainly to learn pdflib but thats another story) but not if it means i have to rewrite copious amounts of php4 code ... i liked my php4 multidimensional associative arrays as they were before  ;D Thanks in advance! Dave.
×
×
  • 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.