<?php
include("../../db.php");
// header('Content-Type: application/json');

    $appSession = $_REQUEST["session"];

    $schoolId = 1;

    $_SESSION["admin"]["session"] = $_REQUEST["session"];


    $fee_month = $db->getVal("SELECT fee_month FROM tbl_info WHERE id = '1' ");
    if ($fee_month == 5){
        $instalmentToMonth = array(1 => 4, 2 => 5, 3 => 6, 4 => 7);
        $_GET['month'] = $instalmentToMonth[$_GET["month"]];
    }elseif($fee_month == 1){
        $monthConversion = array(1 => 4, 2 => 5, 3 => 6, 4 => 7, 5 => 8, 6 => 9, 7 => 10, 8 => 11, 9 => 12, 10 => 1, 11 => 2, 12 => 3);
        $_GET['month'] = $monthConversion[$_GET["month"]];
    }else{
        $_GET['month'] = $_GET["month"];
    }


$monthsList1 = array(
    1=>'Apr',
    2=>'May',
    3=>'Jun',
    4=>'Jul ',
    5=>'Aug',
    6=>'Sep',
    7=>'Oct',
    8=>'Nov',
    9=>'Dec',
	10=>'Jan',
    11=>'Feb',
    12=>'Mar'
);    
    
		$overAllTotal=0;$overAlltution=0;$overAllTransport=0;$overAllhotel=0;$overAllOther=0;$overAllOther_hostel=0;$overAllFine=0;$overAllextra=array();					
		$overAllNewextra=0; $totalstrength = 0; $totalamount = 0;

        $classAry = $db->getRows("select class from class");

		$aryFeeType=$db->getRows("select distinct(type) from extrafee_type where  session='".$_SESSION["admin"]["session"]."' and status=1 order by type");

		$m=0;
		if(isset($_GET['month']) && $_GET['month']!=0){
			$month=$_GET["month"];
			  if($month<4){
				$m=($month+9);
			  }
			  else{
				$m=$month-3;
			  }
		}
		else{
			$m=12;
		}

        ?>

        <div class="well no-padding divclass" >

            <div class="row-fluid mydiv">
                <table class='table' id="tblData" border="1" cellspacing="0">
    				<thead>
        				<tr>
                        	<th>S.No</th>
        					<th>Class</th>
                            <th>Total Student</th>
                           <th>Total</th>
            			</tr>
        			</thead>
        			<tbody>
        <?php 
        $totalstrength = 0;
        foreach($classAry as $class){  $z++;
                $cls = $class['class'];
                

            $wheresection = '';        $sections = '';
                
                $secstu = $db->getRows("select * from student where class='$cls' and session='".$_SESSION["admin"]["session"]."' and status='1' ");
                ?>

    	                <?php //$allstudents = $db->getRows("select * from student where class='$cls' and section='$sec' and session='".$_SESSION["admin"]["session"]."' and status=1 ");
        	                $aryStudentList=$db->getRows("select idno, class, stype, htype from student where class='$cls' and session='".$_SESSION["admin"]["session"]."' and status=1 and issue_TC=0 order by class,section");

                            $i=0;$total_comp=0;
                			for($j=1; $j<=$m; $j++){
            						$md[]=$j;
            					}
        
        					 $mdf= implode(',',$md);
        
                            $monthlycolumn = [];
                            $otherfeecolumn = [];
        					$backduescolumn = [];
        					$hostelothercolumn = [];
        					$totalothercolumn = [];
        					$finecolumn = [];

                        foreach($aryStudentList as $fStudent){
					$mn=$m;

						$tution=0;$trasnport=0;$hostel=0;$otherExtra=0;$total=0;$fine=0;$total_full=0;
						$j=0;$other=0;$k=0;$total_extra=0;$count=0;
							$m1=$m+1;			
							foreach($monthsList1 as $key=>$val){$count++;

							if($mn===0){
							
							}
							else{ $mn--;

						$installTution=$db->getRow("select i".$key.",ip".$key." from installment where idno='".$fStudent["idno"]."'");
						if(is_array($installTution) && count($installTution)>0){
						    $tution = $installTution["i$key"]-$installTution["ip$key"];
						}else{
							$tution="";
						}
						$overAlltution=$tution;

						$installTution=$db->getRow("select b".$key.",bp".$key." from installment where idno='".$fStudent["idno"]."'");
						if(is_array($installTution) && count($installTution)>0){
						    $trasnport = $installTution["b$key"]-$installTution["bp$key"];
						}else{
							$trasnport="";
						}
						$overAllTransport=$trasnport;

						$installTution=$db->getRow("select i".$key.",ip".$key." from hostelinstallment where idno='".$fStudent["idno"]."'");
						if(is_array($installTution) && count($installTution)>0){
						    $hostel = $installTution["i$key"] - $installTution["ip$key"];
						} else{
							$hostel="";
						}
						$overAllhotel=$hostel;

						$extrasum=array();
						$extrafeesingle = 0;
						if(is_array($aryFeeType) && count($aryFeeType)>0){
							foreach($aryFeeType as $ftype){  
								$sums=0;
								$Ftypeid=$db->getVal("select id from extrafee_type where type='".$ftype["type"]."' and class='".$fStudent["class"]."'");
						$installTution=$db->getRow("select fee,pay from extrafee where type='".$Ftypeid."' and pid= 'p".$key."' and idno='".$fStudent["idno"]."'");

								$no=array();
								if(is_array($installTution) && count($installTution)>0){
								    $sums = $installTution["fee"]-$installTution["pay"];
								}else{
									$sums="";
								}
								$extrasum[]=$sums;
								$total_extra+=$sums;
								$tp=$ftype["type"];
								$overAllextra[$tp]+=$sums;
								$extrafeesingle+=$sums;
							}
						}
                        $monthlycolumn[$key] +=$tution+$trasnport+$extrafeesingle; 
						
						 $overAllNewextra=0;
						for($ij=0; $ij<count($aryFeeType); $ij++){
						 $overAllNewextra+=$extrasum[$ij];
						}

						  $total=0;
						if($overAlltution=="0"&&$overAllTransport==0&&$overAllhotel==0&&$overAllNewextra==0)
						 {$total==0;}
						elseif($overAlltution==""&&$overAllTransport==""&&$overAllhotel==""&&$overAllNewextra=="")
						{$total="";}
						 else{ $total=$overAlltution+$overAllTransport+$overAllhotel+$overAllNewextra;}
			
			$total_full=$total_full+$total;
			 }}
						$other2=0; $c = 0;
                    $install=$db->getRows("select * from otherfee_structure where (otype = '' or otype = 'old' or otype = 'new' ) and month <= '".$m."' and session='".$_SESSION["admin"]["session"]."' GROUP BY name");
                    foreach($install as $ins){ $c++;
                        $over = "";
                            $exists = $db->getRow("select * from otherfee_structure where name='$ins[name]' and class='".$fStudent["class"]."'  and (otype =  '' or otype = 'old' or otype = 'new' ) and month <= '".$m."' and session='".$_SESSION["admin"]["session"]."' ");
						    if($exists > 1){
    						    $fee = $exists['fee'];
    						    $paid = $db->getVal("select sum(amount) from reff_receipt where idno=".$fStudent['idno']." and type='$exists[name]' and session='".$_SESSION["admin"]["session"]."' ");

    						    $discount= $db->getVal("SELECT sum(discount) from otherfee_discount  WHERE  idno='$fStudent[idno]' and other_id='$exists[id]'   and session='".$_SESSION["admin"]["session"]."' "); 

    						    if($fStudent['stype']=="old" && $exists['otype']=="new"){
								    $over="";
    							}
    						   elseif($fStudent['stype']=="new" && $exists['otype']=="old"){
    								$over="";
    							}
    							else {
    							    $over = $exists['fee'] - $discount - $paid;
        							$other2+=$over;
    							}

						    }
						    else {
						        $over = "";
						    }
                        $otherfeecolumn[$c]+= $over;
						?>
						<!--<td> <?php //if($over=="0")echo "<lable style='color:red'>paid</label>";elseif($over=="") echo "<lable style='color:red'>X</label>"; else echo $over; ?></td>-->
						<?php
					}
					$total_full+=$other2;

					$install=$db->getRow("select * from otherfee_structure where otype ='".$fStudent['idno']."' and class='".$fStudent['class']."' and name like 'b%'  and session='".$_SESSION["admin"]["session"]."'");
					
									
					$discount= $db->getVal("SELECT sum(discount) from otherfee_discount  WHERE  idno='$fStudent[idno]' and class='".$fStudent['class']."' and other_id='$install[id]'   and session='".$_SESSION["admin"]["session"]."' ");
					
					$install2=$db->getRow("select id from otherfee_structure where otype ='".$fStudent['idno']."' and name like 'Latefine%'  and session='".$_SESSION["admin"]["session"]."'");
					
					$discount2= $db->getVal("SELECT COALESCE(sum(discount),0) from otherfee_discount  WHERE  idno='$fStudent[idno]' and other_id in(select id from otherfee_structure where otype ='".$fStudent['idno']."' and name like 'Latefine%'  and session='".$_SESSION["admin"]["session"]."')   and session='".$_SESSION["admin"]["session"]."' ");

							$dues=0;
							if(is_array($install) && count($install)>0){
								$installTution=$db->getRows("select * from installment_fine where idno=".$fStudent['idno']." and reasion = '".$install['name']."'"); 
                                								
								
								if(is_array($installTution) && count($installTution)>0){
									$total_dues=0;
									foreach($installTution as $ins){
										$total_dues+=$ins['fine'];
									}
									if($install['fee']==$total_dues)
										$dues=0;
									else $dues=$install['fee']-$total_dues-$discount;	
									   
									
									$installTution_remain=$db->getVal("select sum(fine) from installment_fine where idno=".$fStudent['idno']." and reasion like 'remain%' ");
											$dues=$dues-$installTution_remain;
								}
							  else 		
									$dues=$install['fee']-$discount;
							}
							else
								$dues="";
							$alldues+=$dues;
							
							$total_full+=$dues;
						$backduescolumn[0]+=$dues;	

						$install=$db->getRows("select * from otherfee_structure where class='".$fStudent['class']."' and otype ='".$fStudent['idno']."' and name like 'Latefine%' and month <= '".$m."' and session='".$_SESSION["admin"]["session"]."'");
							$dues=0;$total_dues=0;$fine_t=0;
							if(is_array($install) && count($install)>0){
								foreach($install as $ins){
									$fine_t+=$ins["fee"];
								$installTution=$db->getRows("select * from installment_fine where idno=".$fStudent['idno']." and reasion = '".$ins['name']."'");  
								      if(is_array($installTution) && count($installTution)>0){
											foreach($installTution as $ins){
												$total_dues+=$ins['fine'];
											}
									   }
									  else
										$dues=$ins['fee'];
								}
										if($fine_t==$total_dues)
												$dues=0;
								else $dues=$fine_t-$total_dues;
						    }
							else
								$dues="";
							$alldues+=$dues;
							
							$total_full+=$dues-$discount2;
						
                        $install2=$db->getRow("SELECT otype,GROUP_CONCAT(id) as id FROM `otherfee_structure` where otype='".$fStudent['idno']."'  and class='".$fStudent['class']."' and name like 'Latefine%'");

						$dis3= $db->getVal("SELECT sum(discount) from otherfee_discount  WHERE  idno='$fStudent[idno]' and class='".$fStudent['class']."' and other_id in($install2[id])   and session='".$_SESSION["admin"]["session"]."' ");

                        $to=$db->getVal("select sum(fee) from otherfee_structure where otype='".$fStudent['idno']."' and class='".$fStudent['class']."' and name!='Back_Dues' and name NOT like 'Latefine%' and month in ($mdf) and session='".$_SESSION["admin"]["session"]."'");
                        $to1=$db->getVal("SELECT sum(amount) FROM reff_receipt WHERE idno='".$fStudent['idno']."' and session='".$_SESSION["admin"]["session"]."' and type in (SELECT name FROM otherfee_structure WHERE otype='".$fStudent['idno']."' and class='".$fStudent['class']."' and name!='Back_Dues' and name NOT like 'Latefine%' and month in ($mdf))");
                        $dis1=$db->getVal("SELECT sum(discount) FROM otherfee_discount WHERE idno='".$fStudent['idno']."' and class='".$fStudent['class']."' and session='".$_SESSION["admin"]["session"]."' and other_id in (SELECT id FROM otherfee_structure WHERE otype='".$fStudent['idno']."' and class='".$fStudent['class']."' and name!='Back_Dues' and name NOT like 'Latefine%' and month in ($mdf))");

                        $t2=$to-$to1-$dis1;
                        $totalothercolumn[0]+=$t2;

    					if($dues=="0"){
                            $finetotal=$dues;
    					}
    					else
    					{
    					    $finetotal=$dues-$dis3;
    					}
    					$finecolumn[0]+=$finetotal;

    					$other2_hostel=0; $b = 0;
                        $install=$db->getRows("select * from hostel_otherfee_structure where (otype = '' or otype = 'old' or otype = 'new' ) and month <= '".$m."' and session='".$_SESSION["admin"]["session"]."' GROUP BY name");
                        foreach($install as $ins){ $b++;
                            $over_hostel = "";
                                $exists = $db->getRow("select * from hostel_otherfee_structure where name='$ins[name]' and class='".$fStudent["class"]."'  and (otype =  '' or otype = 'old' or otype = 'new' ) and month <= '".$m."' and session='".$_SESSION["admin"]["session"]."' ");
    						    if($exists > 1){
        						    $fee = $exists['fee'];
        						    $paid = $db->getVal("select sum(amount) from reff_receipt where idno=".$fStudent['idno']." and type='$exists[name]' and session='".$_SESSION["admin"]["session"]."' ");
    
        						    $discount= $db->getVal("SELECT sum(discount) from hostelotherfee_discount  WHERE  idno='$fStudent[idno]' and other_id='$exists[id]'   and session='".$_SESSION["admin"]["session"]."' "); 
    
        						    if($fStudent['htype']=="old" && $exists['otype']=="new"){
    								    $over_hostel="";
        							}
        						   elseif($fStudent['htype']=="new" && $exists['otype']=="old"){
        								$over_hostel="";
        							}
        							 elseif($fStudent['htype']==""){
        								$over_hostel="";
        							}
        							else {
        							    $over_hostel = $exists['fee'] - $discount - $paid;
            							$other2_hostel+=$over_hostel;
        							}
    						    }
    						    else {
    						        $over_hostel = "";
    						    }
    					}
    					$total_full+=$other2_hostel;

                  $total_comp+=$total_full+$t2; 
			}
			?>
                <tr>
                	<td><?php echo $z; ?></td>
					<td><?php echo $cls;  ?></td>
					<td><?php echo count($secstu); $totalstrength+=count($secstu); ?></td>
                    <td><?php echo $total_comp; $totalamount+=$total_comp; ?></td>
                </tr>

                <?php

        } ?>
        			</tbody>
                </table>
            </div>

            <label style="float:left;">Total Students: <?php echo $totalstrength; ?></label>
            <label style="float:right;">Total Dues: <?php echo $totalamount; ?></label>
        </div>


<style>.top-bar-minimize{display:none;}
thead, tfoot {display: table-header-group;}
.top-bar+.well,.accordion .accordion-heading+.accordion-body{display: inline-block !important;width: 100% !important;overflow: inherit !important;} 
.dynamic{display:none}
table td {
padding: 6px !important;
}
legend{line-height: 16px;font-weight:100;}



 .gmaps{margin:0;padding:0;height:400px;border-radius:0 0 5px 5px;overflow:hidden;box-sizing:content-box}
 .gmaps>div>div:nth-child(3),.gmaps>div>div:nth-child(2){display:none}
 .gmaps img{max-width:none}
 .gmaps.map-small{height:200px}
 table.dataTable td,table.dataTable th{padding:12px 0;line-height:24px}
 .table-bordered.table{background-color:#eee;border:1px solid #c2c2c2;box-shadow:0 1px 0 white}
 .table-bordered.table tbody>tr:nth-child(odd)>td,.table-bordered.table .table tbody>tr:nth-child(odd)>td,.table-bordered.table .data-table tbody>tr:nth-child(odd)>td,.table-bordered.table .table-striped tbody>tr:nth-child(odd)>th,.table-bordered.table .table tbody>tr:nth-child(odd)>th,.table-bordered.table .data-table tbody>tr:nth-child(odd)>th,.table-bordered.table tbody tr,.table-bordered.table tbody td,.table-bordered.table th,.table-bordered.table td{border:0;box-shadow:none}
 .table-bordered.table tbody>tr:nth-child(odd)>td,.table-bordered.table .table tbody>tr:nth-child(odd)>td,.table-bordered.table .data-table tbody>tr:nth-child(odd)>td,.table-bordered.table .table-striped tbody>tr:nth-child(odd)>th,.table-bordered.table .table tbody>tr:nth-child(odd)>th,.table-bordered.table .data-table tbody>tr:nth-child(odd)>th,.table-bordered.table tbody tr,.table-bordered.table tbody td,.table-bordered.table th,.table-bordered.table td{border-bottom:1px solid #c2c2c2;border-top:1px solid white}
 .table-bordered.table tbody tr:last-child td{border-bottom:0}
 table.dataTable{margin:0 auto;clear:both;width:100%}
 table.dataTable thead th{cursor:pointer;*cursor:hand}
 table.dataTable thead tr{background:#3B5999}
 .table thead{background:crimson;color:#fff;}
 table.dataTable tfoot th,table.dataTable thead th,table.dataTable thead td{font-weight:bold;background-image:-moz-linear-gradient(bottom,rgba(0,0,0,0.05) 0,rgba(255,255,255,0.05) 100%);background-image:-o-linear-gradient(bottom,rgba(0,0,0,0.05) 0,rgba(255,255,255,0.05) 100%);background-image:-webkit-linear-gradient(bottom,rgba(0,0,0,0.05) 0,rgba(255,255,255,0.05) 100%);background-image:linear-gradient(bottom,rgba(0,0,0,0.05) 0,rgba(255,255,255,0.05) 100%);color:#fff;border-bottom:1px solid #c2c2c2;-webkit-box-shadow:0 2px 0 #fff;-moz-box-shadow:0 2px 0 #fff;box-shadow:0 2px 0 #fff}
 table.dataTable tfoot th:first-child,table.dataTable thead th:first-child{padding-left:20px}
 table.dataTable thead th{border-top:1px solid #c2c2c2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.7),0 2px 0 white;-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.7),0 2px 0 white;box-shadow:inset 0 1px 0 rgba(255,255,255,0.7),0 2px 0 white}
 table.dataTable td.center,table.dataTable td.dataTables_empty{text-align:center}
 .dataTables_length select{max-width:50px}
 .dataTables_wrapper{position:relative;clear:both;*zoom:1}
 th.center{text-align:center}
 .dataTables_length{float:left}
 .dataTables_filter{float:right;text-align:right;padding-left:0!important}
 .dataTables_filter,.dataTables_length{padding:24px 20px}
 .dataTables_filter select,.dataTables_length select,.dataTables_filter textarea,.dataTables_length textarea,.dataTables_filter input[type="text"],.dataTables_length input[type="text"],.dataTables_filter input[type="password"],.dataTables_length input[type="password"]{margin:0;margin-left:5px}
 .dataTables_length{padding-top:24px;padding-bottom:23px;padding-right:0;display:none;}
 .dataTables_info{clear:both;float:left;padding:12px 20px;color:blue}
 .dataTables_paginate{float:right;text-align:right;padding:12px 20px}
 .paginate_disabled_previous,.paginate_enabled_previous,.paginate_disabled_next,.paginate_enabled_next{height:18px;float:left;cursor:pointer;*cursor:hand;color:#6b8a41!important}
 .paginate_disabled_previous:hover,.paginate_enabled_previous:hover,.paginate_disabled_next:hover,.paginate_enabled_next:hover{text-decoration:none!important}
 .paginate_disabled_previous:active,.paginate_enabled_previous:active,.paginate_disabled_next:active,.paginate_enabled_next:active{outline:0}
 .paginate_disabled_previous,.paginate_disabled_next{color:#c5c5c5!important}
 .paginate_disabled_previous,.paginate_enabled_previous{padding-left:23px}
 .paginate_disabled_next,.paginate_enabled_next{padding-right:0;margin-left:10px}
 .paging_full_numbers{height:28px}
 .paging_full_numbers a:active{outline:0}
 .paging_full_numbers a:hover{text-decoration:none}
 .paging_full_numbers a.paginate_button,.paging_full_numbers a.paginate_active{border:1px solid #aaa;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;padding:2px 5px;margin:0 3px;cursor:pointer;*cursor:hand;color:#333!important}
 .paging_full_numbers a.paginate_button{background-color: #88DFE2;font-weight: 800}
 .paging_full_numbers a.paginate_button:hover{background-color:#ccc;text-decoration:none!important}
 .paging_full_numbers a.paginate_active{background-color:#99b3ff}
 .dataTables_processing{position:absolute;top:50%;left:50%;width:250px;height:30px;margin-left:-125px;margin-top:-15px;padding:14px 0 2px 0;border:1px solid #ddd;text-align:center;color:#999;background-color:white}
 table.dataTable thead th:active,table.dataTable thead td:active{outline:0}
 .dataTables_scroll{clear:both}
 .dataTables_scrollBody{*margin-top:-1px;-webkit-overflow-scrolling:touch}
 .gallery{padding:24px}
 .gallery .element{display:inline-block;padding:0 1.5% 3% 1.5%;position:relative;text-align:center;width:16%}
 .gallery .element .img-polaroid{padding:5%;border-radius:5px;border:0;background-color:#fcfcfc;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,1),0 2px 4px rgba(0,0,0,0.08),inset 0 -1px 0 rgba(0,0,0,0.25);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,1),0 2px 4px rgba(0,0,0,0.08),inset 0 -1px 0 rgba(0,0,0,0.25);box-shadow:inset 0 1px 0 rgba(255,255,255,1),0 2px 4px rgba(0,0,0,0.08),inset 0 -1px 0 rgba(0,0,0,0.25)}
 .gallery .element a .icon-eye-open,.gallery .element a .icon-eye-open:hover{position:absolute;z-index:1006;color:white;text-shadow:0 -1px 0 rgba(0,0,0,0.3);vertical-align:center;background-color:rgba(0,0,0,0.7);border-radius:200em;left:50%;top:44%;margin-left:-26px;margin-top:-25px;width:52px;height:50px;padding:.70em .5em;box-sizing:border-box}
 .img-polaroid{padding:10px;box-sizing:border-box}
 .gallery img{zoom:1;filter:alpha(opacity=75);opacity:.75}
 .gallery img:hover{filter:alpha(opacity=100);opacity:1}
 
 .table,.data-table{margin-bottom:0}
 .table-striped,.table,.data-table{color:blue;font-weight:bolder;width:100%}
 .table-striped th,.table th,.data-table th,.table-striped td,.table td,.data-table td{padding:8px;text-align:left;vertical-align:top}
 .table-striped th,.table th,.data-table th{font-weight:bold}
 .table-striped thead th,.table thead th,.data-table thead th{vertical-align:bottom}
 .table-striped thead th:first-child,.table thead th:first-child,.data-table thead th:first-child{padding-left:20px}
 .table-striped thead th:last-child,.table thead th:last-child,.data-table thead th:last-child{padding-right:20px}
 .table-striped tbody i,.table tbody i,.data-table tbody i{color:#cacaca}
 .table-striped tbody td:first-child,.table tbody td:first-child,.data-table tbody td:first-child{padding-left:20px}
 .table-striped tbody td:last-child,.table tbody td:last-child,.data-table tbody td:last-child{padding-right:20px}
 .table-striped tbody td,.table tbody td,.data-table tbody td,.table-striped tbody th,.table tbody th,.data-table tbody th{background-image:-moz-linear-gradient(bottom,rgba(0,0,0,0.01) 0,rgba(255,255,255,0.01) 100%);background-image:-o-linear-gradient(bottom,rgba(0,0,0,0.01) 0,rgba(255,255,255,0.01) 100%);background-image:-webkit-linear-gradient(bottom,rgba(0,0,0,0.01) 0,rgba(255,255,255,0.01) 100%);background-image:linear-gradient(bottom,rgba(0,0,0,0.01) 0,rgba(255,255,255,0.01) 100%);border-bottom:1px solid #c2c2c2;-webkit-box-shadow:0 2px 0 #fff;-moz-box-shadow:0 2px 0 #fff;font-weight:800;box-shadow:0 2px 0 #fff}
 .st{font-weight:800;}
 .controls .input-block-level{font-weight:800;}
 .table-striped tbody .small,.table tbody .small,.data-table tbody .small{text-align:right;color:#c3c3c3}
 .table-striped tbody>tr:nth-child(odd)>td,.table tbody>tr:nth-child(odd)>td,.data-table tbody>tr:nth-child(odd)>td,.table-striped tbody>tr:nth-child(odd)>th,.table tbody>tr:nth-child(odd)>th,.data-table tbody>tr:nth-child(odd)>th{background-color:#f9f9f9;background-image:-moz-linear-gradient(bottom,rgba(0,0,0,0.03) 0,rgba(255,255,255,0.03) 100%);background-image:-o-linear-gradient(bottom,rgba(0,0,0,0.03) 0,rgba(255,255,255,0.03) 100%);background-image:-webkit-linear-gradient(bottom,rgba(0,0,0,0.03) 0,rgba(255,255,255,0.03) 100%);background-image:linear-gradient(bottom,rgba(0,0,0,0.03) 0,rgba(255,255,255,0.03) 100%);border-bottom:1px solid #c2c2c2}
 table .btn{padding:0 6px;margin-right:0;margin-left:2px !important;}
 table .right .btn{float:right}
 table.dataTable thead th.right,table.dataTable tfoot th.right{text-align:right;padding-right:20px}
</style>
