Jump to content

gardan06

Members
  • Posts

    75
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

gardan06's Achievements

Member

Member (2/5)

0

Reputation

  1. So we have a website that runs on ASP, PHP and mySQL and so far, the japanese text are working fine with meta charset set to "shift_jis". However, i need to call values from the database that are also japanese characters, and this is where my problems begin. Firstly, i set collation to utf8, encoded the japanese text to utf8 then stored it in the database. i tried to decode it in the page that calls for that value, but it returns a different japanese text than the one i actually set, probably because meta charset is set to shift_jis. then, i set the column's collation to sjis, and tried to store the japanese text to the database, but it returns "????" and that was the the output on the actual page. So im in a deep hole right now. I need to output the correct japanese text from the database to the page that calls it, but how would i do that? Any kind of help is greatly appreciated. Thank you very much.
  2. someone out there has got to have a solution to this...
  3. i have this table: PR #PR # includedSub Dept Code A(NULL)1 B(NULL)5 C(NULL)2 D(NULL)4 E(NULL)7 F(NULL)9 Merged1A*B*C*D*E*F(NULL) i merged PRs A to F in Merged1. my problem is that i want to know which rows from A to F belong to sub_dept_code 1-5, then the other from 6-9, so that will make 2 count(*) queries right? my current query right now (which works by the way) is: select * from (select count(*) as total1 from PR where PRNo in ('A','B','C','D','E','F') and sub_dept_code in ('1','2','3','4','5')) as z, (select count(*) as total2 from PR where PRNo in ('A','B','C','D','E','F') and sub_dept_code in ('6','7','8','9')) as y ..but i feel there's a better way to code it. is there a better and more optimal way to translate my query, or is this it?
  4. i currently have this code: but i want to group them per sku, so i tried: the problem was it didn't recognize the receivedate ordering so while it did show only one SKU item, it also showed the earliest item, not the latest. i also tried: but the results were the same as the 1st one. would anyone be kind enough to show me how to code the query in a way that only one SKU item is shown and it should be the latest one. your help is greatly appreciated. thank you.
  5. oh i got it. instead of using style.visibility set to hidden or visible, i used a span tag and set style.display to inline or none. thanks for the help guys.
  6. well basically, i'm trying to have either an edit button or add button appear depending on an inputted item. if the item already exists on the database, the edit button appears. if it doesnt, the add button appears. the button positions are like this(they're hidden by default): i want the edit button to appear in the same position as the add button because for sure, they wont be appearing at the same time, but unfortunately, i had difficulty doing that. can anyone help me? i'd really appreciate your immediate response. thank you. Gardan
  7. never mind, i got it. to those who doesn't know yet, the command is $_SERVER['HTTP_HOST'] thanks for your time guys.
  8. long story short, is there a command that outputs your site's URL? (ex. http://www.phpfreaks.net/ will be outputted) thanks in advance.
  9. function updatePOHead(url) { if (url==undefined) url=''; var arr = new Array(); var optVendorKey = document.getElementById("optVendorKey").value; var optShipToKey = document.getElementById("optShipToKey").value; var txtPONumber = document.getElementById("txtPONumber").value; var optPOStatus = document.getElementById("optPOStatus").value; var optTermsKey = document.getElementById("optTermsKey").value; //var txtDiscount = document.getElementById("txtDiscount").value; var txtOrderDate = document.getElementById("txtOrderDate").value; var txtDeliveryDate = document.getElementById("txtDeliveryDate").value; var optPOType = document.getElementById("optPOType").value; var txtCancelDate = document.getElementById("txtCancelDate").value; //var radTermsKey; var txtDiscount = 0; var radTermsKey = ''; var controls = document.frmPO.length; var cnt = 0; var element; for (i = 0; i < controls; i++) { element = document.frmPO[i]; if (element.type == "radio") { if (element.checked == true) { radTermsKey = element.value; cnt++; } } } arr.push(optVendorKey); arr.push(optShipToKey); arr.push(optPOStatus); arr.push(optTermsKey); arr.push(txtDiscount); arr.push(radTermsKey); arr.push(txtOrderDate); arr.push(txtDeliveryDate); arr.push(optPOType); arr.push(txtCancelDate); //alert(arr.toString()); if(confirm("Save all changes?")) { alert(url); agent.call("", "updatepodraft", "callback_updatePOHead", txtPONumber, url, arr.toString()); } else { window.location=url; } } function callback_updatePOHead(response) { var message = document.getElementById("message"); alert(response[0]); alert(response[1]); return false; if (response[1]=='') { if(response[0]==1) response[0] = 'RECORD SAVED'; else response[0] = 'RECORD NOT SAVED, ERROR RUNNING COMMAND'; message.innerHTML = response[0]; } else { alert('Record Saved'); window.location=response[1]; } } function updatepodraft($po, $url, $arr) { global $db; $h = array(); $h = split(',',$arr); $sql = sprintf("update purchase_hdr set actual_vendor_code = '%s', ship_location_code = %s, po_status = '%s', terms_code = '%s', discount = %01.03f, discount_type = '%s', po_date = '%s', recdate = '%s', item_type_code = '%s', canceledbydate = '%s' where po_no = '%s'", $h[0], $h[1], $h[2], $h[3], $h[4], $h[5], $h[6], $h[7], $h[8], $h[9], $po); /*$rs = $db->db_query($sql); if(!$rs) $bjarr[0] = false; else $bjarr[0] = true;*/ $bjarr[0] = $sql; $bjarr[1] = $url; //$db->db_free_result($rs); return $bjarr; } What im trying to do is save the url as it was called from the javascript function to the PHP function and then back to the callback javascript function for the wind.location command. But the weird part is that somewhere between the javascript to php agent function, the url gets cut short (i.e. index.php?mode=po_entry&sub=header&po=xxxx becomes index.php?mode=po_entry). I have tried to error check if there's another way the url got cut short, but as i error checked every javascript code leading to the php code, i concluded that the problem would have occured on the translation to the php code. in addition, the url always get cut short to index.php?mode=po_entry, which made me think that the ampersand (&) probably have something to do with it, but it didnt. So pphp gurus, i ask for your help. Please tell me what went wrong in my code? Thanks.
  10. never mind, i got it myself.. seems like concat can be exploited to create your own like comparison
  11. i have 2 tables joined wherein a.seq_no (w/c value is either 1, 2 or 3) should exist in b.number_choice(w/c value is either 1*, 1*2* or 1*2*3*). is using the like function to a variable possible?
  12. Ok, i have no problem using window.open() it works fine to me. However, the problem is that the page's table is too long, it doesnt fit to an A4 in printing, even in landscape mode. The worse part is that it does not create a second page for the part that was cut, but what was weird is that it only doesnt accept 2nd pages horizontally, vertically long pages are 2nd page-able. My question is: how can i be able to print that 2nd page?
  13. I want my table to view percentages. Here's how: I want "Pct Qty" to automatically compute the percent of the "Qty" by the formula (qty/total qty)*100. is it possible ? thanks.
×
×
  • 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.