Jump to content

jakebur01

Members
  • Posts

    885
  • Joined

  • Last visited

Everything posted by jakebur01

  1. I have two tables with the same columns. ARINVOI and ARYINVO. ARINVOI stops at 2011-02-26 and ARYINVO starts at 2011-02-27. The ARYINVO is basically a history table. The ARINVOI only keeps data for so long before transferring it into ARYINVO. I am wanting to attach the tables together as if they were one and query sales data. Here is a query for one of the tables: SELECT ITOTAL FROM ARYINVO WHERE `INVDTE` >= '$YTDB' and `INVDTE` <= '$YTDE' AND `CUSTNO` <> '01885' AND `REFNO` <> 'CR. MEMO'
  2. I think I may have it. I am changing all of my echo's to $message =.
  3. I am generating a few different reports through mysql querys and displaying tables. I have a mail script that stores html code into a variable called $message. How can I store all of my queried data into the variable $message? Example of one of the three tables I am displaying and I am wanting to store this whole table into the variable $message. echo"<h3>Margin Less than 15% for $datequery</h3>"; echo"<table border=1 cellpadding=3><tr><td><center><b>Invoice Number</b></center></td><td><center><b>Invoice Date</b></center></td><td><center><b>Customer Number</b></center></td><td><center><b>Company</b></center></td><td><center><b>Margin</b></center></td></tr>"; while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $invoice=$row['INVNO']; $invoicedate=$row['INVDTE']; $customernumber=$row['CUSTNO']; $company=$row['COMPANY']; $invoicetotal=$row['ITOTAL']; $invoicecost=$row['ICOST']; @$ABOVE30= @($invoicecost * 100) / $invoicetotal; @$FINAL30=100 - $ABOVE30; $FINAL30=number_format($FINAL30, 2, '.', ''); IF($FINAL30<="15") { echo "<tr><td><center>$invoice</center></td><td><center>$invoicedate</center></td><td><center>$customernumber</center></td><td><center>$company</center></td><td><center>$FINAL30%</center></td></tr>"; } } echo"</table><hr />";
  4. How can I query for orders above 30% margin, orders below 15% margin, and orders below cost WHERE invoice date = tomorrow. Here are the fields I am working with: INVNO //invoice number IVDTE // invoice date CUSTNO //customer number COMPANY // company ITOTAL //invoice total ICOST //invoice cost I can query for orders below cost, but I am not advanced enough to query margins. - Jake.
  5. I basically have a page for updating information with 4 or 5 different tabs to navigate between. When the info is saved, I submit/post to the same page and I have an if $_POST statement at the top of the page that catches it. I am then trying to redirect to the the same page and same anchor.
  6. Still searching on how to store a javascript value into a php variable. I haven't figured it out yet. <?PHP $hash="<script type=text/javascript> document.write(location.hash); </script>"; ?> <input type="hidden" name="hash" id="textfield" value="<?php echo"$hash";?>"/>
  7. cool. that will work great. I'll pass it through in a hidden form field then attach it to the end of the http_referer . Thanks Ken.
  8. How can I get http_referer to retrieve the anchor in the url? It keeps url variables, but it does not get the anchor. Example: http://example.com/ex.php?id=10#tab=3 All http_referrer catches is http://example.com/ex.php?id=10 code: $refer = $_SERVER['HTTP_REFERER']; <script type="text/javascript"> <!-- window.location = "<?PHP echo"$refer";?>" //--> </script>
  9. It was the quotations. Thanks.
  10. Failed with error: Unknown column 'AD ALLOWANCE' in 'where clause'
  11. SELECT DISTINCT CLASS FROM ARINVT01 WHERE `CLASS` <> `AD ALLOWANCE` AND `CLASS` <> 'STOP CHARGE' AND `CLASS` <> 'MISCELLANEOUS' ORDER BY CLASS ASC
  12. I tried it with AND and OR and I get this error for both: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource SELECT DISTINCT CLASS FROM ARINVT01 WHERE `CLASS` <> `AD ALLOWANCE` AND `CLASS` <> 'STOP CHARGE' AND `CLASS` <> 'MISCELLANEOUS' ORDER BY CLASS ASC
  13. What is the correct way to do this? SELECT DISTINCT CLASS FROM ARINVT01 WHERE (`CLASS` <> `AD ALLOWANCE`, `CLASS` <> 'STOP CHARGE', `CLASS` <> 'MISCELLANEOUS') ORDER BY CLASS ASC
  14. I tried linking the tables using MS ACCESS. Then, I tried using the mysql migration toolkit. But, the linked tables would not show up. Does anyone know of any program similar to navicat that would allow me to connect to the ODBC data source directly and schedule it to migrate or mirror the data over to my mysql source? Thanks, Jake
  15. I am looking for an open source windows program that will mirror a local ODBC connection to a remote MySQL database hourly. Any ideas?
  16. It does not give me 404 Page Not Found in IE, this is happening in Safari. Jake
  17. jakebur01

    fdf

    I set up a pdf document with form fields and a submit button that will submit html to a php document which generates a .fdf document. All this is working, but when I call the .fdf document up in the browser, it then redirects me the .pdf. I get "404 page not found", but when I hit "refresh" the .pdf loads fine with the .fdf data pluged in. Any ideas? create pdf function function createFDF($file,$info){ $data="%FDF-1.2\n%âãÏÓ\n1 0 obj\n<< \n/FDF << /Fields [ "; foreach($info as $field => $val){ if(is_array($val)){ $data.='<</T('.$field.')/V['; foreach($val as $opt) $data.='('.trim($opt).')'; $data.=']>>'; }else{ $data.='<</T('.$field.')/V('.trim($val).')>>'; } } $data.="] \n/F (".$file.") /ID [ <".md5(time()).">\n] >>". " \n>> \nendobj\ntrailer\n". "<<\n/Root 1 0 R \n\n>>\n%%EOF\n"; return $data; } Here is one of the generated .fdf documents: %FDF-1.2 %âãÏÓ 1 0 obj << /FDF << /Fields [ <</T(business_name)/V(Test Company)>><</T(p1)/V(Yes)>><</T(p2)/V()>><</T(business_address)/V(123 Test Drive)>><</T(city)/V(Test City)>><</T(state)/V(TE)>><</T(zip)/V(12345)>><</T(business_mailing)/V(Test Business Address)>><</T(nearest_stores)/V(Test Nearest Store)>><</T(business_phone)/V(555-123-1234)>><</T(fax_number)/V(555-123-1233)>><</T(federal_id)/V(12-1234442)>><</T(owner)/V(Test Owner)>><</T(contact_name)/V(Test Contact Name)>><</T(home_address_1)/V(Test Home Address)>><</T(home_address_2)/V(Test Home Address 2)>><</T(ss)/V(111-22-22222)>><</T(home_phone)/V(222-111-2234)>><</T(drivers_lic)/V(2324235235425)>><</T(c1)/V(Yes)>><</T(c2)/V()>><</T(c3)/V()>><</T(c4)/V()>><</T(bank_name)/V(Test Bank Name)>><</T(bank_address)/V(Test Bank Address)>><</T(bank_city)/V(Test City)>><</T(bank_state)/V(TE)>><</T(bank_zip)/V(13498)>><</T(bank_phone)/V(444-444-2323)>><</T(checking_account)/V(3203o4iu2)>><</T(bank_officer)/V(Test Officer)>><</T(sig)/V(Test Sig)>>] /F (http://www.mysite.com/credit_application.pdf) /ID [ <5d8a41ab0ddaf80840cd79d7f1a57db9> ] >> >> endobj trailer << /Root 1 0 R >> %%EOF
  18. I moved all the code to the top of the page and the header error went away. I tried echo $cookies['PHPSESSID']; in the body and it did not return anything. Did it return anything for you when you tested it on your end?
  19. I get this header error, Warning: Cannot modify header information - headers already sent on this line -> setcookie($cookies['PHPSESSID']); echo $cookies['PHPSESSID'];
  20. Thanks! It works, although I get header errors. How can I store the SESSIONID in the variable $session ? Example: <script type="text/javascript"> <!-- window.location = "http://my3rdpartysite.com/customer?SESSIONID=<?PHP echo"$session";?>" //--> </script>
  21. EDIT: the form in the first post /// action should equal "http://my3rdpartysite.com/login" ONLY... The javascript should not be in there. That was from when I was playing with injecting javascript.
  22. A 3rd party hosts our online ordering site that is integrated with our inventory software program. I have a customer login page on our "Corporate Site" and I am wanting to login to our "online ordering site" directly from this page. First I tried: <p class="main_body"><form action="http://mysite.com/login javascript:window.location=http://my3rdparysite.com/login" method="post" id="contactform"><table><tr><td><input name="username" type="hidden" value="demo" /></td></tr><tr><td><input name="password" type="hidden" value="demo" /></td></tr><tr><td> </td><td><input name="Submit" type="submit" value="Sign in to Demo account" /></td></tr></table></form></p> This takes me to http://my3rdpartysite.com/login. The text on the page displays {"success":true,"route":"\/myname\/customer\/"} . So when I change the url in the browser from http://my3rdpartysite.com/login to http://my3rdpartysite.com/customer, I am logged in. So, then I researched to see if there is a way to inject javascript in the form or url so when it reaches 3rdpartysite.com/login, it would automatically redirect to 3rdpartysite.com/customer, then I would be logged in. _____________ Here is the other idea. Log into 3rdpartysite.com/login from customer login page on corporate site using curl, grab the sessionid, then redirect to the 3rdpartysite.com/customer?SESSIONID=$session....... except.. I do not know how to store the SESSIONID into $session. <?PHP $headers = array("User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0. Gecko/20061025 Firefox/1.5.0.8"); $url="http://my3rdpartysite.com/login"; $ch = curl_init(); curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookies.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt'); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, "username=demo&password=demo"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_MAXREDIRS, 4); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $store = curl_exec ($ch); curl_close ($ch); print_r($store); ?> <script type="text/javascript"> <!-- window.location = "http://my3rdpartysite.com/customer?SESSIONID=<?PHP echo"$SESSION";?>" //--> </script> Any ideas?
×
×
  • 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.