} ?> </tr> </thead> <tbody> <?php $q1=""; $q2=""; $qry=""; $q3=""; $q4=" order by `id` desc "; if(!empty($_POST['reg_id'])) { $reg_id=$_POST['reg_id']; $q1="reg_id='".$reg_id."'"; } if(!empty($_POST['from'])&&!empty($_POST['to'])) { $from=datefordb($_POST['from']); $to=datefordb($_POST['to']); if($q1=="") $q2=" overtime_date between '".$from."' and '".$to."' "; else $q2=" AND overtime_date between '".$from."' and '".$to."' "; } if(!empty($_POST['depart_id'])) { $depart_id=$_POST['depart_id']; $res_reg="(select `id` from `registration` where `depart_id`=".$depart_id.")"; if($q1=="" && $q2=="") $q3=" `reg_id` in ".$res_reg." "; else $q3=" AND `reg_id` in ".$res_reg." "; } $qry="select * from `overtime` where ";
<?php } } ?> </tbody> <tr> <td colspan="4" id="my_output"></td> </tr> </table> </div> <?php } ?> </div> </div> <input type="hidden" value="<?php echo datefordb($_POST['attendance_date']); ?>" id="att_date" /> </form> </div> </div> </div> <!-- END CONTENT --> </div> <!-- END CONTAINER --> <?php footer(); ?> <script src="assets/js/jquery-1.8.3.min.js"></script>
{ $total_overtime=$row_time['total_overtime']; //$net_time+=get_time_difference($time1, $time2); $net_time+=$total_overtime; } $result_wages=mysql_query("select `wages` from `registration` where `id`='".$all_reg[$j]."'"); $row_wages=@mysql_fetch_array($result_wages); $wages_amnt=$row_wages['wages']/7; } $amnt_per_day_ot+=($net_time*$wages_amnt); /////////////////////////////////////////////////////////////////////////Ending Overtime//////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////Calculate Advance//////////////////////////////////////////////////////////////////////////////////////// $result_advance=mysql_query("select `amount` from `advance` where `reg_id`='".$all_reg[$j]."' && `advance_given_date`='".datefordb($all_dates[$i])."'"); if(mysql_num_rows($result_advance)>0) { while($row_advance=@mysql_fetch_array($result_advance)) { $advance_amnt+=$row_advance['amount']; } } $amnt_per_day_at+=$advance_amnt; /////////////////////////////////////////////////////////////////////////Ending Advance//////////////////////////////////////////////////////////////////////////////////////// } $amount_all_month+=$amnt_per_day; $amount_all_month_ot+=$amnt_per_day_ot; $total=$amount_all_month+$amount_all_month_ot;
<?php $s=0; $result=mysql_query("select `id`,`name`,`wages` from `registration` where `depart_id`='".$depart_id."' "); while($row=mysql_fetch_array($result)) { $total_days=0; $total_half=0; ?> <tr> <td style="text-align:left !important;font-size:13px;font-weight:bold"><?php echo fetchemployeename($row['id']); ?></td> <?php $all_advance1=0; for($k=0;$k<sizeof($all_dates);$k++) { $advance_amnt1=0; $res_advance1=mysql_query("select `amount` from `advance` where `reg_id`='".$row['id']."' and `advance_given_date`='".datefordb($all_dates[$k])."'"); while($row_advance1=@mysql_fetch_array($res_advance1)) { $advance_amnt1+=$row_advance1['amount']; $all_advance1+=$row_advance1['amount']; } ?> <td <?php if($advance_amnt1>0){ ?> style="background-color:#EBFCEE;font-weight:bold;" <?php } ?>><?php if($advance_amnt1>0) { echo $advance_amnt1; } else { echo "-"; } ?></td> <?php } ?> <td style="font-weight:bold;"><?php echo round($all_advance1); ?></td> </tr> <?php } ?>