-
Posts
24,599 -
Joined
-
Last visited
-
Days Won
829
Everything posted by Barand
-
That code writes a value to $response in each iteration, each value overwriting the previous one. Try $response[] = ... instead of $response = ... to append to the $response array
-
The trick is to get the right ratio between gradient length and font size. With font "arial black" I found grad length px : font_size pt approx 1.8 : 1 <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example</title> <style type='text/css'> body { background-color: #000; } .gradhead { font-family: "arial black"; font-size: 30pt; background: repeating-linear-gradient(#FFF , #EEE , #006EFC 55px); -webkit-background-clip: text; -webkit-text-fill-color: transparent; width: 30%; float: left; padding: 8px; } </style> </head> <body> <div class="gradhead"> LINE 1 </div> <div class="gradhead"> LINE 1<br> LINE 2 </div> <div class="gradhead"> LINE 1<br> LINE 2<br> LINE 3 </div> </body> </html>
-
You could have a look at https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/repeating-linear-gradient
-
The gradient is applied across the whole element, not across each row. Put each row in it's own element
-
One way... <?php $data = array ( 0 => array ( 'Q_id' => '1.1.1|||1.1.2|||1.1.3|||1.1.4|||1.1.5|||1.1.6|||1.1.7|||1.1.8|||1.1.9|||1.1.10|||1.1.11|||1.1.12|||1.1.13|||1.1.14|||1.1.15|||1.1.16|||1.1.17|||1.1.18|||1.1.19|||1.1.20|||1.1.21|||1.1.22|||1.1.23|||1.1.24|||1.1.25|||1.1.26|||1.1.27|||1.1.28|||1.1.29|||1.1.30|||1.1.31|||1.1.32|||1.1.33|||1.1.34|||1.1.35|||1.1.36|||1.1.37|||1.1.38|||1.1.39|||1.1.40|||1.1.41|||1.1.42|||1.1.43|||1.1.44|||1.1.45|||1.1.46|||1.1.47|||1.1.48|||1.1.49|||1.1.50', 'QueNo' => NULL, 'qNo' => '1|||2|||3|||4|||5|||6|||7|||8|||9|||10|||11|||12|||13|||14|||15|||16|||17|||18|||19|||20|||21|||22|||23|||24|||25|||26|||27|||28|||29|||30|||31|||32|||33|||34|||35|||36|||37|||38|||39|||40|||41|||42|||43|||44|||45|||46|||47|||48|||49|||50', 'SECTION' => 'SECTION A', ), 1 => array ( 'Q_id' => '1.1.51|||1.1.51.2|||1.1.51.3|||1.1.51.4|||1.1.51.5|||1.1.51.6|||1.1.51.7|||1.1.51.8|||1.1.51.9|||1.1.51.10', 'QueNo' => 'b|||c|||d|||e|||f|||g|||h|||i|||j', 'qNo' => '51|||51|||51|||51|||51|||51|||51|||51|||51|||51','SECTION' => 'SECTION B', ), ) ; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example</title> <style type='text/css'> table { border-collapse: collapse; width: 500px; } td { padding: 8px } </style> </head> <body> <table border='1'> <?php foreach ($data as $k => $v) { foreach ($v as $k1 => $v1) { // do something (such as output) $vals = str_replace('|||', ', ', $v1); echo "<tr><td>$k</td><td>$k1</td><td>$vals</td></tr>"; } } ?> </table> </body> </html>
-
Can you post it again, using var_export() instead of var_dump() so we have something processable?
-
Again, with svg we can add the text shadow and letter spacing <div style='background-color: black; text-align: center;'> <svg width='380' height='80' viewBox='0 0 380 80'> <defs> <style type='text/css'> .olap { font-family: "arial black"; font-size: 60pt; letter-spacing: -15px; fill: #fff; text-shadow: -0.08em 0.03em 0.12em rgba(0, 0, 0, 0.7); } </style> </defs> <text class='olap' x='190' y='70' text-anchor='middle' >OVERLAP</text> </svg> </div>
-
Try using a shadowed font (such as Google's "Rubik Doodle Shadow) and set the element's letter-spacing attribute to a negative value
-
My version, once I'd unravelled your multiple keys (eg branchID & branchCode) on tables and weird naming conventions like "b.plantCode = a.sales_office". (More bruises on my forehead) I am all for single letter table aliases but please make them easier ("b" for billing, "p" for plant, "c" for customerMaster etc) and use two letters if there is a clash (such as "br" for branch). It makes it a lot easier to follow than just a, b, c, d, e regardless of the table name. SELECT branchname , CustomerID , Customername , CustomerSegment , CustomerType , COALESCE(bill.JanBilling, '-') as JanBilling , COALESCE(bill.FebBilling, '-') as FebBilling , COALESCE(bill.MarBilling, '-') as MarBilling , COALESCE(bill.AprBilling, '-') as AprBilling , COALESCE(bill.MayBilling, '-') as MayBilling , COALESCE(bill.JunBilling, '-') as JunBilling , COALESCE(bill.JulBilling, '-') as JulBilling , COALESCE(bill.AugBilling, '-') as AugBilling , COALESCE(bill.SepBilling, '-') as SepBilling , COALESCE(bill.OctBilling, '-') as OctBilling , COALESCE(bill.NovBilling, '-') as NovBilling , COALESCE(bill.DecBilling, '-') as DecBilling FROM ( SELECT br.branchname , b.sold_party as customerid , SUM(CASE DATE_FORMAT(billing_date, '%Y-%m') WHEN '2024-01' THEN gross_amount ELSE 0 END) / 100000 AS JanBilling , SUM(CASE DATE_FORMAT(billing_date, '%Y-%m') WHEN '2024-02' THEN gross_amount ELSE 0 END) / 100000 AS FebBilling , SUM(CASE DATE_FORMAT(billing_date, '%Y-%m') WHEN '2024-03' THEN gross_amount ELSE 0 END) / 100000 AS MarBilling , SUM(CASE DATE_FORMAT(billing_date, '%Y-%m') WHEN '2024-04' THEN gross_amount ELSE 0 END) / 100000 AS AprBilling , SUM(CASE DATE_FORMAT(billing_date, '%Y-%m') WHEN '2024-05' THEN gross_amount ELSE 0 END) / 100000 AS MayBilling , SUM(CASE DATE_FORMAT(billing_date, '%Y-%m') WHEN '2024-06' THEN gross_amount ELSE 0 END) / 100000 AS JunBilling , SUM(CASE DATE_FORMAT(billing_date, '%Y-%m') WHEN '2024-07' THEN gross_amount ELSE 0 END) / 100000 AS JulBilling , SUM(CASE DATE_FORMAT(billing_date, '%Y-%m') WHEN '2024-08' THEN gross_amount ELSE 0 END) / 100000 AS AugBilling , SUM(CASE DATE_FORMAT(billing_date, '%Y-%m') WHEN '2024-09' THEN gross_amount ELSE 0 END) / 100000 AS SepBilling , SUM(CASE DATE_FORMAT(billing_date, '%Y-%m') WHEN '2024-10' THEN gross_amount ELSE 0 END) / 100000 AS OctBilling , SUM(CASE DATE_FORMAT(billing_date, '%Y-%m') WHEN '2024-11' THEN gross_amount ELSE 0 END) / 100000 AS NovBilling , SUM(CASE DATE_FORMAT(billing_date, '%Y-%m') WHEN '2024-12' THEN gross_amount ELSE 0 END) / 100000 AS DecBilling FROM billing b JOIN plant p ON b.sales_office = p.plantcode JOIN branch br ON p.branchid = br.branchid WHERE b.sales_doc_type IN ('ZIEC', 'ZISC', 'ZEXS', 'ZSP', 'ZISS') AND b.product_div NOT IN ('X1', 'X3', 'X4', 'X5', 'X6', 'X7', 'X8', 'X9', 'XA', 'XB', 'XC', 'XD', 'XE', 'XG') GROUP BY branchname, customerid UNION SELECT m.branchname , m.customerid , NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM machinemaster m LEFT JOIN billing b ON m.customerid = b.sold_party WHERE m.machinestatus = 'A' AND b.sold_party IS NULL GROUP BY branchname, customerid ) bill JOIN customermaster USING (customerid) ORDER BY branchname, customerid;
-
I have crossed out columns that don't belong in the tables beacause they are dependent on foreign keys to other tables (such as customer, branch, product etc). I also highlighted those with incorrect types. It's indexing that greatly improves query performance. Fields used in joins should be indexed as should columns frequently used in where clauses. I'll continue to work on your query now.
-
Sorry, my head's hurting after banging it repeatedly aginst the wall in frustration after having looked at your table structures. Foe example... Columns which you are joining on, like CustomerID, are not indexed. ID columns, which (strangely) you are not using for your joins, are indexed twice (primary key and you also create another key on the same column). The gross_amount column that you are totalling is a varchar column!!! CustomerName, which belongs only in the customer table is repeated in billing and machinemaster tables. NORMALIZE!. And that's before I can comprehend what you want to do.
-
I know this isn't a CSS solution but, when in doubt, cheat. I used an SVG image. Fonts will differ I I don't know which you used. <body> <header style='text-align: center'> <svg width='90%' viewBox='0 0 500 100' style='max-width: 800;'> <defs> <style type='text/css'> #main { font-family: "arial black"; font-size: 20pt; font-weight: 800; fill: #000; } #better { font-family: "segoe script"; font-size: 40pt; font-weight: 600; fill: #80FF80; } </style> </defs> <text x='338' y='65' id='better'>better</text> <text x='12' y='60' id='main'>Making every day taste</text> </svg> </header> </body> screen width: 1024 screen width: 450
-
So you are only interested in the 203 customers that are in machinemaster but not in billing?
-
Could you explain that requirement, particularly "who are not doing the billing"?
-
How did you learn advanced SQL? With practice. How did you start tinkering with data? By designing and building databases to support applications I needed to develop, then developing them using the database. Problem is I've no data to tinker with. Then create some. (See tutorials link in my signature)
-
FYI - Matthew.
-
I have no idea how your chart software works but if you provide five data values (8, 19, 11, 3, 49) for one type and three data values (1, 3, 7) for the other, how is it supposed to know which months those values are for? You have a very weird x-axis for that chart (the month sequence is 6-5-4-3-2-1-12-11-10-9-8-7). The norm is to put them in chronological order.
-
Another option, maybe Create question in MSWord Save page as html doc Display it in an <iframe> on your page
-
Why don't you group by job type, month
-
If you save "X.doc", which contains an equation, as "X.html" into a "documents" folder it creates as subfolder "X_files" containing the equation as an image documents | +- X.html +- X_files | +- image1.jpg
-
Have you triedd using xpath()? <?php $str = '<xml><chapter num="17"> <verse num="1">And after six days Jesus taketh Peter, James, and John his brother, and bringeth them up into an high mountain apart,</verse> <verse num="2">And was transfigured before them: and his face did shine as the sun, and his raiment was white as the light.</verse> <verse num="3">And, behold, there appeared unto them Moses and Elias talking with him.</verse> <verse num="4">Then answered Peter, and said unto Jesus, Lord, it is good for us to be here: if thou wilt, let us make here three tabernacles; one for thee, and one for Moses, and one for Elias.</verse> <verse num="5">While he yet spake, behold, a bright cloud overshadowed them: and behold a voice out of the cloud, which said, This is my beloved Son, in whom I am well pleased; hear ye him.</verse> <verse num="6">And when the disciples heard <i>it,</i> they fell on their face, and were sore afraid.</verse> <verse num="7">And Jesus came and touched them, and said, <span class="j">Arise, and be not afraid. </span></verse> <verse num="8">And when they had lifted up their eyes, they saw no man, save Jesus only.</verse> <verse num="9">And as they came down from the mountain, Jesus charged them, saying, <span class="j">Tell the vision to no man, until the Son of man be risen again from the dead. </span></verse> <verse num="10">And his disciples asked him, saying, Why then say the scribes that Elias must first come?</verse> <verse num="11">And Jesus answered and said unto them, <span class="j">Elias truly shall first come, and restore all things. </span></verse> <verse num="12"><span class="j">But I say unto you, That Elias is come already, and they knew him not, but have done unto him whatsoever they listed. Likewise shall also the Son of man suffer of them. </span></verse> <verse num="13">Then the disciples understood that he spake unto them of John the Baptist.</verse> <verse num="14">And when they were come to the multitude, there came to him a <i>certain</i> man, kneeling down to him, and saying,</verse> <verse num="15">Lord, have mercy on my son: for he is lunatick, and sore vexed: for ofttimes he falleth into the fire, and oft into the water.</verse> <verse num="16">And I brought him to thy disciples, and they could not cure him.</verse> <verse num="17">Then Jesus answered and said, <span class="j">O faithless and perverse generation, how long shall I be with you? how long shall I suffer you? bring him hither to me. </span></verse> </chapter></xml> '; $xml = simplexml_load_string($str); $verses = $xml->xpath('//verse'); ?> <!DOCTYPE html> <html lang='en'> <head> <title>XML example</title> <meta charset='utf-8'> <style type='text/css'> .j { color: blue; font-style: italic; font-weight: 600; } </style> </head> <body> <?php foreach ($verses as $v) { echo "<p>{$v->asXML()}</p>"; } ?> </body> </html> Gives...
-
Open your browser's develop tools. Click on "Network" tab Click on one of the rows to view its headers FYI, when using date(), the default time is the current time, so this will suffice... <?= date("d-M-Y H:i:s") ?> BST
-
You can save MSWord docs as html. In this case, equations are saved as image files in a subfolder EG