Jump to content

thara

Members
  • Posts

    575
  • Joined

About thara

  • Birthday 02/05/1983

Profile Information

  • Gender
    Male
  • Location
    Panda

Contact Methods

  • Skype
    tharangagamage

Recent Profile Visitors

11,202 profile views

thara's Achievements

Advanced Member

Advanced Member (4/5)

5

Reputation

  1. Side Note: You also can't just insert PHP variables directory into URLs or HTML markup. They have to be escaped and encoded: <?php function html_escape($value, $encoding) { return htmlspecialchars($value, ENT_QUOTES | ENT_HTML5 | ENT_SUBSTITUTE, $encoding); } $url = 'icerik.php?'.http_build_query(['icerik' => $goster['icerik_id']]); echo '<a href="'.html_escape($url , 'UTF-8').'">'.html_escape($goster['baslik'], 'UTF-8').'</a>'; ?>
  2. I created a CSV file using Google Sheets. Then it works. I see the problem with the CSV file that I created using Excel on my computer.
  3. Sir, This is how I set charset, when my CSV file is saved.
  4. Sir, can you tell how I specified it on my page? <meta charset="utf-8"> Isn’t this how it was done?
  5. Yes Sir. I have set it inside page <head> tag as shown here. <meta charset="utf-8"> Do I need to set up a charset somewhere else to make it work, sir?
  6. In PHP, I am trying to create an array from a CSV file in this way. // CSV file: $csv = array_map('str_getcsv', file("{$uploadPath}/{$myFile}")); Of course it is working for me, but on thing I have to fixed. If I have non-English language characters in my CSV file, then those characters not showing correctly in PHP. That mean its showing question marks instead of showing original characters. This is the output of $csv array: Array ( [0] => Array ( [0] => SISP-0002 [1] => Harpic Floral 500ml [2] => ???????? ??????? 500ml [3] => 4792037107765 ) ) Can anybody tell me what would be the possible workaround to fix this issue.
  7. Thank you so much... Its sloved my problem.
  8. Thanks for mentioned it. new array should be in this order. Array ( [13] => 1934.00 [11] => 1716.00 [9] => 1210.00 [7] => 140.00 ) The amout should be clear the balance from oldest baskets
  9. Hi, My expectation is to get an array which is based on a given value. In my POS system, I do have an array that shows all the baskets that still have an outstanding balance to be due by the customer for each basket. The array looks like this: Array ( [15] => 1088.00 [13] => 2206.00 [11] => 1716.00 [9] => 1210.00 [7] => 140.00 ) key = basket_id value = balance due The customer can take the sum of the amount due and make payments in one lump sum or in installments without paying separately for each baskets. My question is, Depending on the amount the customer pays, I need to create a new array. Suppose the amount paid by the customer is 5000, then the new array should be as follows. Array ( [15] => 1088.00 [13] => 2206.00 [11] => 1706.00 ) In this newly created array, array_sum() should be equal to the amount paid by customer. (According to this particular example it should be 5000) Can I know the better workaround for this?
  10. Wow.... Thats the query I needed.. Many many thanks sir.
  11. Sorry for not giving a clear explanation sir. I meant "partial paid" and "partial due", suppose the store made a sale worth 1000, where the customer pays 700 and keeps the remaining 300 as payable to the store. Accordingly partial paid = 700 partial due = 300
  12. Sir, I think that's how it should be. But the relevant calculations should be changed as follows. Total Cash Sales = (cash(paid) + cash(partial paid) + cash on delivery (paid)) Total Credit Sales = (cash(due) + cash(partial due) + Cash on Delivery (due)) Total Cash on Delivery Sales = (cash on Delivery (paid) + Cash on Delivery (due)) Total card sales = (card(paid)
  13. Sir, I really want to get a sales report for the current date. Through this report, I want to get the following data. Total Cash Sales = (cash(paid) + card (paid) + cash on delivery (paid)) Total Credit Sales = (cash(due) + cash(partial) + Cash on Delivery (due)) Total Cash on Delivery Sales = (Cash on Delivery (paid) + Cash on Delivery (due)) Total card sales Sir, is it possible to get those data in a single query?
  14. Ooops! Yes sir It should be OR not AND... This is my updated query and its result as below. Also I changed GROUP BY to payment_method_id. SELECT DATE(bv.sale_time) , CASE WHEN p.payment_method_id IN (1, 2) THEN sum(amount_due) ELSE 0 END AS total_cash_sales , CASE p.payment_method_id WHEN 4 THEN sum(amount_due) ELSE 0 END AS total_credit_sales FROM basket_amount_due bv JOIN basket bt USING(basket_id) LEFT JOIN basket_payment p USING (basket_id) JOIN payment_method m USING(payment_method_id) WHERE DATE(bv.sale_time) = CURDATE() GROUP BY p.payment_method_id; +--------------------+------------------+--------------------+ | DATE(bv.sale_time) | total_cash_sales | total_credit_sales | +--------------------+------------------+--------------------+ | 2021-09-18 | 3042.10 | 0.00 | | 2021-09-18 | 2070.00 | 0.00 | | 2021-09-18 | 0.00 | 1688.40 | +--------------------+------------------+--------------------+ 3 rows in set (0.011 sec)
  15. Thank you Sir. select * from payment_method; +-------------------+-------------------+ | payment_method_id | method | +-------------------+-------------------+ | 1 | CASH | | 2 | Credit/Debit Card | | 3 | Store Credit | | 4 | Cash on Delivery | | 5 | Gift card | | 6 | Credit | +-------------------+-------------------+ 6 rows in set (0.001 sec) select * from basket_payment; +-------------------+-------------------+-----------+-------------+----------------+---------------------+--------------+ | basket_payment_id | payment_method_id | basket_id | amount_paid | amount_balance | date_paid | payment_note | +-------------------+-------------------+-----------+-------------+----------------+---------------------+--------------+ | 1 | 1 | 1 | 1170.00 | 0.00 | 2021-09-18 12:19:04 | | | 2 | 1 | 2 | 0.00 | 0.00 | 2021-09-18 12:19:39 | | | 3 | 1 | 4 | 1000.00 | 0.00 | 2021-09-18 12:20:22 | | | 4 | 4 | 5 | 990.00 | 0.00 | 2021-09-18 12:21:47 | | | 5 | 4 | 7 | 0.00 | 0.00 | 2021-09-18 12:23:33 | | | 8 | 2 | 10 | 2070.00 | 0.00 | 2021-09-18 12:29:45 | | +-------------------+-------------------+-----------+-------------+----------------+---------------------+--------------+ 6 rows in set (0.001 sec)
×
×
  • 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.