Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- proc save_current_date_total_income_report { } {
- set filetype { { {Report as HTML File} {.html} } }
- set filename [tk_getSaveFile -filetypes $filetype]
- set fp [ open $filename "w"]
- set report_query { select * from current_date_customer_vs_income }
- puts $fp "<table border=1>\n"
- set html_table_headers [ list "<tr>" ]
- set headers [list "customer id" "customer first name" "customer father name" "customer last name" "customer mother name" "customer phone number" "customer address" "customer email address" "total payment" ]
- foreach column $headers {
- lappend html_table_row "<th>$column</th>"
- }
- lappend html_table_row "</tr>"
- puts $fp "$html_table_row\n"
- dbcmd eval $report_query {
- set html_table_row [ list "<tr>" ]
- set row [list $customer_id $customer_first_name $customer_father_name $customer_last_name $customer_mother_name $customer_phone_number $customer_address $customer_email_address $total_payment]
- foreach column $row {
- lappend html_table_row "<td>$column</td>"
- }
- lappend html_table_row "</tr>"
- puts $fp "$html_table_row\n"
- }
- set total_income [dbcmd eval {select * from current_date_total_income } ]
- puts $fp "<tr><th>Total Income</th></td>"
- puts $fp "<tr><td>$total_income</td></td>"
- puts $fp "</table>\n"
- close $fp
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement