Jump to content

newphpbees

Members
  • Posts

    65
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

newphpbees's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi, I have table: plan which has fields : PCODE, max_lot, min_lot sample data: PCODE = P35 max_lot = 5 min_lot = 3 PCODE = P35M max_lot = 5 min_lot = 3 and table kanban_checker : PCODE, count_wip_chemicalweighing, count_wip_compounding, count_wip_extrusion, count_wip_forming, count_wip_deflashing, virtual, kanban and kanban_status.... I have this code of update to update kanban_checker table fields except kanban_status. here is my code that I want to add update for kanban_status: UPDATE kanban_checker kc SET count_wip_chemical_weighing = (SELECT COUNT(NULLIF(wip_chemicalweighing, 0)) AS count_wip_chemical_weighing FROM kanban_data kd WHERE kd.PCODE = kc.PCODE GROUP BY kc.PCODE), count_wip_compounding = (SELECT COUNT(NULLIF(wip_compounding, 0)) AS count_wip_compounding FROM kanban_data kd WHERE kd.PCODE = kc.PCODE GROUP BY kc.PCODE), count_wip_extrusion = (SELECT COUNT(NULLIF(wip_extrusion, 0)) AS count_wip_extrusion FROM kanban_data kd WHERE kd.PCODE = kc.PCODE GROUP BY kc.PCODE), count_wip_forming = (SELECT COUNT(NULLIF(wip_forming, 0)) AS count_wip_forming FROM kanban_data kd WHERE kd.PCODE = kc.PCODE GROUP BY kc.PCODE), count_wip_deflashing = (SELECT COUNT(NULLIF(wip_deflashing, 0)) AS count_wip_deflashing FROM kanban_data kd WHERE kd.PCODE = kc.PCODE GROUP BY kc.PCODE), virtual = (SELECT ((count(NULLIF(kd.wip_chemicalweighing, 0))) + (count(NULLIF(kd.wip_compounding, 0))) + (count(NULLIF(kd.wip_extrusion, 0))) + (count(NULLIF(kd.wip_forming, 0))) + (count(NULLIF(kd.wip_deflashing, 0)))) AS virtual FROM kanban_data kd WHERE kc.PCODE = kd.PCODE GROUP BY kc.PCODE); I need to check the max_lot and min_lot per PCODE in table plan for kanban_status.. IF virtual is >= max_lot then kanban_status = 'MAX' elseif virtual is <= min_lot then kanban_status = 'MIN'. IS it possible?HOw? Thank you
  2. Thanks for your code, now I'm thinking on my where clause to get only the non-zero and null. Thank you
  3. Good day! Hi, I encountered problem in Count. I have this data: REFNUM----LOT_CODE----PCODE--wip_chemicalweighing--wip_compounding-------wip_extrusion--wip_forming--wip_deflashing 000001----000001P35M--P35M---0.00------------------0.00------------------0.00-----------0.00---------40.00--------- 000002----000002P35M--P35M---73.30-----------------NULL------------------NULL-----------NULL---------NULL--------- and I have this code: SELECT PCODE, COUNT(LOT_CODE) AS lot_chemicalweighing, COUNT(wip_chemicalweighing + wip_compounding + wip_extrusion + wip_forming + wip_deflashing) AS virtual FROM kanban_data WHERE wip_chemicalweighing != '0.00' OR 'NULL' AND wip_compounding != '0.00' OR 'NULL' AND wip_extrusion != '0.00' OR 'NULL'AND wip_forming != '0.00' OR 'NULL' AND wip_deflashing != '0.00' OR 'NULL' GROUP BY PCODE; And the output of this code is : PCODE-- lot_chemicalweighing---virtual---- P35M----1----------------------0-------- the lot_chemicalweighing is correct but the virtual is wrong, because it should be 2 because I have 1 data in wip_chemicalweighing and 1 in wip_deflashing. Thank you
  4. I already resolved it using this code: $sql = "UPDATE kanban_data kd SET wip_chemicalweighing = (SELECT ROUND(IF (NOT ISNULL(SUM(compounding)), 0, SUM(chemicalweighing)),2) AS wip_chemicalweighing FROM kanban k WHERE k.LOT_CODE = kd.LOT_CODE AND k.REFNUM = kd.REFNUM GROUP BY k.REFNUM), wip_compounding = (SELECT ROUND(IF (NOT ISNULL(SUM(extrusion)), 0, SUM(compounding)),2) AS wip_compounding FROM kanban k WHERE k.LOT_CODE = kd.LOT_CODE AND k.REFNUM = kd.REFNUM GROUP BY k.REFNUM), wip_extrusion = (SELECT ROUND(IF (NOT ISNULL(SUM(forming)), 0, SUM(extrusion)),2) AS wip_extrusion FROM kanban k WHERE k.LOT_CODE = kd.LOT_CODE AND k.REFNUM = kd.REFNUM GROUP BY k.REFNUM), wip_forming = (SELECT ROUND(IF (NOT ISNULL(SUM(deflashing)), 0, SUM(forming)),2) AS wip_forming FROM kanban k WHERE k.LOT_CODE = kd.LOT_CODE AND k.REFNUM = kd.REFNUM GROUP BY k.REFNUM), wip_deflashing = (SELECT ROUND(SUM(deflashing),2) AS wip_deflashing FROM kanban k WHERE k.LOT_CODE = kd.LOT_CODE AND k.REFNUM = kd.REFNUM GROUP BY k.REFNUM)"; Thank you
  5. Hi Have this update query: UPDATE kanban_data kd SET (wip_chemicalweighing, wip_compounding, wip_extrusion, wip_forming, wip_deflashing) = (SELECT ROUND(IF (NOT ISNULL(SUM(compounding)), 0, SUM(chemicalweighing)),2) AS wip_chemicalweighing, ROUND(IF (NOT ISNULL(SUM(extrusion)), 0, SUM(compounding)),2) AS wip_compounding, ROUND(IF (NOT ISNULL(SUM(forming)), 0, SUM(extrusion)),2) AS wip_extrusion', 'ROUND(SUM(deflashing),2) AS wip_deflashing FROM kanban k WHERE k.LOT_CODE = kd.LOT_CODE AND k.REFNUM = kd.REFNUM GROUP BY k.REFNUM); and I got this error: Error Code : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(wip_chemicalweighing, wip_compounding, wip_extrusion, wip_forming, wip_deflashi' at line 1 (16 ms taken) Thank you
  6. I try your suggested code and still it was one line but i really appreciate your help.. Actually i already revised my code to change the design but still it was one side or one line. here is my code: <div> {section name=att loop=$rs_label} <table class="stat" border = "0" width="auto"> <tr> <td colspan="6" align="center"><b>{$rs_label[att].COMPANY_NAME}</b></td> <tr/> <tr> <td colspan="3" align="center"><b>{$rs_label[att].fullName}</b></td> <td colspan="3" align="center"><b>{$rs_label[att].Rate}</b></td> </tr> <tr> <td colspan="3"><b>{$rs_label[att].PERIOD} {$rs_label[att].FROM_DATE}-{$rs_label[att].TO_DATE}</b></td> <td colspan="3" align="center"><b>{$rs_label[att].RATE_Label}</b></td> <tr/> <tr> <td colspan="3"><b>{$rs_label[att].EARNINGS}</b></td> <td colspan="3"><b>{$rs_label[att].DEDUCTIONS_Label}</b></td> </tr> <tr> <td colspan="1"></td><td colspan="1" align="right">{$rs_label[att].HRS}</td><td colspan="1" align="right">{$rs_label[att].AMOUNT}</td><td colspan="1"></td><td colspan="1" align="right">{$rs_label[att].HRS}</td><td colspan="1" align="right">{$rs_label[att].AMOUNT}</td> </tr> <tr> <td colspan="1">{$rs_label[att].BASIC_PAY_Label}</td><td colspan="1" align="right">{$rs_label[att].Reg_Hours}</td><td colspan="1" align="right">{$rs_label[att].Basic_Pay}</td><td colspan="1">{$rs_label[att].Late_Label}</td><td colspan="1" align="right">{$rs_label[att].Late_Hours}</td><td colspan="1" align="right">{$rs_label[att].Late}</td> </tr> <tr> <td colspan="1">{$rs_label[att].REGULAR_OVERTIME}</td><td colspan="1" align="right">{$rs_label[att].OTReg_Hours}</td><td colspan="1" align="right">{$rs_label[att].OTReg_Amt}</td><td colspan="1">{$rs_label[att].WITHHOLDING_TAX_Label}</td><td colspan="1" align="right"></td><td colspan="1" align="right">{$rs_label[att].TAX}</td> </tr> <tr> <td colspan="1">{$rs_label[att].SUN_SPEC_HOLIDAY}</td><td colspan="1" align="right">{$rs_label[att].SunReg_Hours}</td><td colspan="1" align="right">{$rs_label[att].SunReg_Amt}</td><td colspan="1">{$rs_label[att].SSS_CONTRIBUTION_Label}</td><td colspan="1" align="right"></td><td colspan="1" align="right">{$rs_label[att].SSS}</td> </tr> <tr> <td colspan="1">{$rs_label[att].SUN_SPEC_HOL_OT}</td><td colspan="1" align="right">{$rs_label[att].OTSun_Hours}</td><td colspan="1" align="right">{$rs_label[att].OTSun_Amt}</td><td colspan="1">{$rs_label[att].MEDICARE_CONT_Label}</td><td colspan="1" align="right"></td><td colspan="1" align="right">{$rs_label[att].PCHL}</td> </tr> <tr> <td colspan="1">{$rs_label[att].REG_HOLIDAY}</td><td colspan="1" align="right">{$rs_label[att].HolReg_Hours}</td><td colspan="1" align="right">{$rs_label[att].HolReg_Amt}</td><td colspan="1">{$rs_label[att].HDMF_Label}</td><td colspan="1" align="right"></td><td colspan="1" align="right">{$rs_label[att].HDMF}</td> </tr> <tr> <td colspan="1">{$rs_label[att].REG_HOLIDAY_OT}</td><td colspan="1" align="right">{$rs_label[att].HolRegOT_Hours}</td><td colspan="1" align="right">{$rs_label[att].HolRegOT_Amt}</td><td colspan="1">{$rs_label[att].SSS_Loan_Label}</td><td colspan="1" align="right"></td><td colspan="1" align="right">{$rs_label[att].SSS_Amor}</td> </tr> <tr> <td colspan="1">{$rs_label[att].HOLIDAY_LEAVE}</td><td colspan="1" align="right">{$rs_label[att].HolLeave_Hours_Tot}</td><td colspan="1" align="right">{$rs_label[att].HolLeave_Amt}</td><td colspan="1">{$rs_label[att].HDMF_Loan_Label}</td><td colspan="1" align="right"></td><td colspan="1" align="right">{$rs_label[att].HDMF_Amor}</td> </tr> <tr> <td colspan="1">{$rs_label[att].NIGHT_PREMIUM_Label}</td><td colspan="1" align="right">{$rs_label[att].NIGHT_PREMIUM}</td><td colspan="1" align="right">{$rs_label[att].NP_Amt}</td><td colspan="1">{$rs_label[att].TAX_ADJT_Label}</td><td colspan="1" align="right"></td><td colspan="1" align="right">{$rs_label[att].TaxAjt}</td> </tr> <tr> <td colspan="1">{$rs_label[att].MEAL_ALLOWANCE_Label}</td><td colspan="1" align="right">{$rs_label[att].MEAL_ALLOWANCE}</td><td colspan="1" align="right">{$rs_label[att].Meal_Amt}</td><td colspan="1">{$rs_label[att].Cash_Advance_Label}</td><td colspan="1" align="right"></td><td colspan="1" align="right">{$rs_label[att].CashAdvance}</td> </tr> <tr> <td colspan="1">{$rs_label[att].COLA}</td><td colspan="1" align="right">{$rs_label[att].Cola_Hours}</td><td colspan="1" align="right">{$rs_label[att].Cola_Amt}</td><td colspan="1">{$rs_label[att].Advances_Shirt_Label}</td><td colspan="1" align="right"></td><td colspan="1" align="right">{$rs_label[att].AdvanceShirt}</td> </tr> <tr> <td colspan="1"></td><td colspan="1" align="right"></td><td colspan="1" align="right"></td><td colspan="1">{$rs_label[att].Advances_Medical_Label}</td><td colspan="1" align="right"></td><td colspan="1" align="right">{$rs_label[att].AdvanceMed}</td> </tr> <tr> <td colspan="1"></td><td colspan="1" align="right"></td><td colspan="1" align="right"></td><td colspan="1">{$rs_label[att].Advances_Others_Label}</td><td colspan="1" align="right"></td><td colspan="1" align="right">{$rs_label[att].AdvanceOther}</td> </tr> <tr> <td colspan="1"></td><td colspan="1" align="right"></td><td colspan="1" align="right"></td><td colspan="1">{$rs_label[att].CANTEEN_Label}</td><td colspan="1" align="right"></td><td colspan="1" align="right">{$rs_label[att].Canteen}</td> </tr> <tr> <td colspan="1"></td><td colspan="1" align="right"></td><td colspan="1" align="right">{$rs_label[att].LINE_Label}</td><td colspan="1"></td><td colspan="1" align="right"></td><td colspan="1" align="right">{$rs_label[att].LINE_Label}</td> </tr> <tr> <td colspan="1"><b>{$rs_label[att].TOTAL_EARNINGS_Label}</b></td><td colspan="1" align="right"></td><td colspan="1" align="right"><b>{$rs_label[att].TotalEarnings}</b></td><td colspan="1"><b>{$rs_label[att].TOTAL_DEDUCTIONS_Label}</b></td><td colspan="1" align="right"></td><td colspan="1" align="right"><b>{$rs_label[att].TotalDeductions}</b></td> </tr> <tr> <td colspan="1"></td><td colspan="1" align="right"></td><td colspan="1" align="right"></td><td colspan="1"></td><td colspan="1" align="right"></td><td colspan="1" align="right"></td> </tr> <tr> <td colspan="3" align="center">{$rs_label[att].Receipt_Pay}</td><td colspan="1"></td><td colspan="1" align="right"></td><td colspan="1" align="right"></td> </tr> <tr> <td colspan="3" align="center">{$rs_label[att].Receipt_Detail}</td><td colspan="1"></td><td colspan="1" align="right"></td><td colspan="1" align="right"></td> </tr> <tr> <td colspan="3" align="center">{$rs_label[att].Receipt_Detail1}</td><td colspan="1"></td><td colspan="1" align="right"></td><td colspan="1" align="right"></td> </tr> <tr> <td colspan="3" align="center">{$rs_label[att].Receipt_Detail2}</td><td colspan="1"></td><td colspan="1" align="right"></td><td colspan="1" align="right"></td> </tr> <tr> <td colspan="1"></td><td colspan="1" align="right"></td><td colspan="1" align="right"></td><td colspan="1"></td><td colspan="1" align="right"></td><td colspan="1" align="right"></td> </tr> <tr> <td colspan="1"></td><td colspan="1" align="right"></td><td colspan="1" align="right"></td><td colspan="1"></td><td colspan="1" align="right"></td><td colspan="1" align="right"></td> </tr> <tr> <td colspan="3" align="center">{$rs_label[att].fullName}</td><td colspan="1"></td><td colspan="1" align="right"></td><td colspan="1" align="right"></td> </tr> <tr> <td colspan="3" align="center">{$rs_label[att].FIRST_LINE}</td><td colspan="1"></td><td colspan="1" align="right"></td><td colspan="1" align="right"></td> </tr> <tr> <td colspan="3" align="center">{$rs_label[att].SIGNATURE}</td><td colspan="1"><b>{$rs_label[att].TAKE_HOME_PAY_Label}</b></td><td colspan="1" align="right"></td><td colspan="1" align="right"><b>{$rs_label[att].TakeHomePay}</b></td> </tr> <tr> <td colspan="1"></td><td colspan="1" align="right"></td><td colspan="1" align="right"></td><td colspan="1"></td><td colspan="1" align="right"></td><td colspan="1" align="right">{$rs_label[att].SECOND_LINE}</td> </tr> <tr> <td colspan="6">{$rs_label[att].FOURTH_LINE}</td> </tr> </table> {/section} </div> [code] I want is like this Payslip Employee 1 Payslip Employee 2 Payslip Employee 3 List of data1 List of data 2 List of data 3 a And so on… Now the result of my code is : Payslip Employee 1 List of data1 Payslip Employee 2 List of data2 Payslip Employee 3 List of data3 Payslip Employee 4 List of data4 Payslip Employee 5 List of data5 Payslip Employee 6 List of data6 Thank you
  7. Hi... Good day! I just want to know how can I change the format of my table. here is my code: <?php include 'config.php'; $sql = "SELECT DATE_FORMAT(d.FROM_DATE, '%M %c') AS FROM_DATE, DATE_FORMAT(d.TO_DATE, '%M %c, %Y') AS TO_DATE, g.EMP_NO, g.fullName, g.Rate, g.Reg_Hours, g.Basic_Pay, g.OTReg_Hours, g.SunReg_Hours, g.OTSun_Hours, g.HolReg_Hours, g.HolRegOT_Hours, g.HolLeave_Hours_Tot, SUM(g.NPReg_Hours + g.NPSun_Hours + g.NPHol_Hours) AS NIGHT_PREMIUM, SUM(g.MealReg_Hours + g.MealSun_Hours) AS MEAL_ALLOWANCE, g.Cola_Hours, g.Basic_Pay, g.OTReg_Amt, g.SunReg_Amt, g.OTSun_Amt, g.HolReg_Amt, g.HolRegOT_Amt, g.HolLeave_Amt, g.NP_Amt, g.Meal_Amt, g.Cola_Amt, p.COMPANY_NAME, p.PERIOD, p.NAME, p.FIRST_LINE, p.RATE_Label, p.EARNINGS, p.HRS, p.AMOUNT, p.BASIC_PAY_Label, p.REGULAR_OVERTIME, p.SUN_SPEC_HOLIDAY, p.SUN_SPEC_HOL_OT, p.REG_HOLIDAY, p.REG_HOLIDAY_OT, p.HOLIDAY_LEAVE, p.NIGHT_PREMIUM_Label, p.MEAL_ALLOWANCE_Label, p.COLA, p.13TH_MONTH, p.SECOND_LINE FROM $PAYROLL.casual_payslip_label p, $PAYROLL.casual_generate_payroll g, $PAYROLL.casual_date_upload d GROUP BY g.EMP_NO"or die(mysql_error()); $rs_label = $conn2->GetAll($sql); $smarty->assign('rs_label', $rs_label); $smarty->display('payslip.tpl'); $smarty->display('casual_payslip.tpl'); ?> <div> {section name=att loop=$rs_label} <table class="stat"> <tr> <td>{$rs_label[att].COMPANY_NAME}</td> <tr/> <tr> <td>{$rs_label[att].PERIOD} {$rs_label[att].FROM_DATE}-{$rs_label[att].TO_DATE}</td> <tr/> <tr> <td>{$rs_label[att].NAME} {$rs_label[att].fullName}</td> </tr> <tr> <td>{$rs_label[att].FIRST_LINE}</td> </tr> <tr> <td>{$rs_label[att].RATE_Label} {$rs_label[att].Rate}</td> </tr> <tr> <td>{$rs_label[att].EARNINGS} {$rs_label[att].HRS} {$rs_label[att].AMOUNT}</td> </tr> <tr> <td>{$rs_label[att].BASIC_PAY_Label} {$rs_label[att].Reg_Hours} {$rs_label[att].Basic_Pay}</td> </tr> <tr> <td>{$rs_label[att].REGULAR_OVERTIME} {$rs_label[att].OTReg_Hours} {$rs_label[att].OTReg_Amt}</td> </tr> <tr> <td>{$rs_label[att].SUN_SPEC_HOLIDAY} {$rs_label[att].SunReg_Hours} {$rs_label[att].SunReg_Amt}</td> </tr> <tr> <td>{$rs_label[att].SUN_SPEC_HOL_OT} {$rs_label[att].OTSun_Hours} {$rs_label[att].OTSun_Amt}</td> </tr> <tr> <td>{$rs_label[att].REG_HOLIDAY} {$rs_label[att].HolReg_Hours} {$rs_label[att].HolReg_Amt}</td> </tr> <tr> <td>{$rs_label[att].REG_HOLIDAY_OT} {$rs_label[att].HolRegOT_Hours} {$rs_label[att].HolRegOT_Amt}</td> </tr> <tr> <td>{$rs_label[att].HOLIDAY_LEAVE} {$rs_label[att].HolLeave_Hours_Tot} {$rs_label[att].HolLeave_Amt}</td> </tr> <tr> <td>{$rs_label[att].NIGHT_PREMIUM_Label} {$rs_label[att].NIGHT_PREMIUM} {$rs_label[att].NP_Amt}</td> </tr> <tr> <td>{$rs_label[att].MEAL_ALLOWANCE_Label} {$rs_label[att].MEAL_ALLOWANCE} {$rs_label[att].Meal_Amt}</td> </tr> <tr> <td>{$rs_label[att].COLA}{$rs_label[att].Cola_Hours} {$rs_label[att].Cola_Amt}</td> </tr> <tr> <td>{$rs_label[att].SECOND_LINE}</td> </tr> </table> {/section} </div> the output of this code: Company Name Period : jul 09- July 22,2011 Name : Juan Dela Cruz Rate : 339.80 EARNINGS HRS AMOUNT Basic Pay 91.45 3,884.34 Regular Overtime 0.00 0.00 Sun/Spec Holiday 0.00 0.00 Sun/Spec Hol. OT 0.00 0.00 Reg. Holiday 0.00 0.00 Reg. Holiday OT 0.00 0.00 Holiday/Leave 0.00 0.00 Night Premium 0.00 0.00 Meal Allowance 0.00 0.00 COLA (P28 Allow) 0.00 0.00 13th Month 0.00 Company Name Period : jul 09- July 22,2011 Name : Ann Chin Rate : 339.80 EARNINGS HRS AMOUNT Basic Pay 100.00 4247.5 Regular Overtime 0.00 0.00 Sun/Spec Holiday 0.00 0.00 Sun/Spec Hol. OT 0.00 0.00 Reg. Holiday 0.00 0.00 Reg. Holiday OT 0.00 0.00 Holiday/Leave 0.00 0.00 Night Premium 0.00 0.00 Meal Allowance 0.00 0.00 COLA (P28 Allow) 0.00 0.00 13th Month 0.00 Company Name Period : jul 09- July 22,2011 Name : John Lee Rate : 339.80 EARNINGS HRS AMOUNT Basic Pay 101 4289.96 Regular Overtime 0.00 0.00 Sun/Spec Holiday 0.00 0.00 Sun/Spec Hol. OT 0.00 0.00 Reg. Holiday 0.00 0.00 Reg. Holiday OT 0.00 0.00 Holiday/Leave 0.00 0.00 Night Premium 0.00 0.00 Meal Allowance 0.00 0.00 COLA (P28 Allow) 0.00 0.00 13th Month 0.00 Company Name Period : jul 09- July 22,2011 Name : Mary Ann Chan Rate : 339.80 EARNINGS HRS AMOUNT Basic Pay 90 3,882.75 Regular Overtime 0.00 0.00 Sun/Spec Holiday 0.00 0.00 Sun/Spec Hol. OT 0.00 0.00 Reg. Holiday 0.00 0.00 Reg. Holiday OT 0.00 0.00 Holiday/Leave 0.00 0.00 Night Premium 0.00 0.00 Meal Allowance 0.00 0.00 COLA (P28 Allow) 0.00 0.00 13th Month 0.00 I have a lot of employee so the data is long. I attach the format I want to happen. Thank you 17584_.doc
  8. How can i displayed it in smarty template? Thank you
  9. Hi... Good day! I have table that has a field from_date and to_date. Now I just want to know if how can I display as table format the dates between from_date to_date. Like this from_date: 2011-12-16 to_date: 2011-12-31 I want to display it: 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 // table format. Thank you
  10. I have this new code: $from_time = strtotime($IN); $to_time = strtotime($OUT); $OTHours = round(abs($to_time - $from_time) / 3600); $IN = 2011-12-22 13:30; $OUT = 2011-12-22 15:30; from this code the $OTHours result is 1.00 it should be 1.30 by the way the OTHours field is Decimal Type.
  11. Is it possible that first i only get the total hours and I save it in one field? then i add one field to put the total minutes? from sum of Hours? Thank you
  12. In payroll minutes was divided into 60. i tried this: $TotHours = substr($Hours, 0, 3); $Minutes = substr($Hours,4,2); $Minutes = substr($Hours,3,2); $Minutes_Convert = ($Minutes / 60); $Minutes_Convert = number_format($Minutes_Convert, 2, '.', ''); $Hours = $TotHours + $Minutes_Convert; but i encountered problem when TotHours = 100 the substr was not capable.
  13. Hi.. I got an issue in getting the total time. I have this code to get the sum of total time: $result = mysql_query("INSERT INTO payroll.casual_hours(EMP_NO, Hours) SELECT EMP_NO, sec_to_time(SUM(time_to_sec(Rendered))) FROM payroll.casual_att WHERE DATE_FORMAT(LOGOUT, '%W') IN ('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday') GROUP BY EMP_NO") or die(mysql_error()); Rendered: 09:00:00 09:00:00 09:00:00 08:00:00 08:00:00 07:48:00 and the result of this is 50:48 but I need result is 50:80 the minutes is divided to 60 Is there any way to get the 50:80 result. Thank you so much..
×
×
  • 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.