@extends("layout.menu")

@php 
 $strYear = date("d-m-y");
 $strtime = date("h:i:sa");


 if(!is_null($indieNow[0]->indieNow)){$indieNow1 = $indieNow[0]->indieNow;}else{$indieNow1 = 0.001;}
 if(!is_null($inovenNow[0]->inovenNow)){$inovenNow1 = $inovenNow[0]->inovenNow;}else{$inovenNow1 = 0.001;}
 if(!is_null($inwirebondNow[0]->inwirebondNow)){$inwirebondNow1 = $inwirebondNow[0]->inwirebondNow;}else{$inwirebondNow1 = 0.001;}
 if(!is_null($inbondingNow[0]->inbondingNow)){$inbondingNow1 = $inbondingNow[0]->inbondingNow;}else{$inbondingNow1 = 0.001;}
 if(!is_null($inmoldNow[0]->inmoldNow)){$inmoldNow1 = $inmoldNow[0]->inmoldNow;}else{$inmoldNow1 = 0.001;}
 if(!is_null($inovenmoldNow[0]->inovenmoldNow)){$inovenmoldNow1 = $inovenmoldNow[0]->inovenmoldNow;}else{$inovenmoldNow1 = 0.001;}
 if(!is_null($indicerNow[0]->indicerNow)){$indicerNow1 = $indicerNow[0]->indicerNow;}else{$indicerNow1 = 0.001;}
 if(!is_null($inappearaNow[0]->inappearaNow)){$inappearaNow1 = $inappearaNow[0]->inappearaNow;}else{$inappearaNow1 = 0.001;}
 if(!is_null($incalssNow[0]->incalssNow)){$incalssNow1 = $incalssNow[0]->incalssNow;}else{$incalssNow1 = 0.001;}

 if(!is_null($outdieend[0]->outdieend)){$outdieend1 = $outdieend[0]->outdieend;}else{$outdieend1 = 0;}
 if(!is_null($inbondingNow[0]->inbondingNow)){$outovenend1 = $outovenend[0]->outovenend;}else{$outovenend1 = 0;}
 if(!is_null($outwirebondend[0]->outwirebondend)){$outwirebondend1 = $outwirebondend[0]->outwirebondend;}else{$outwirebondend1 = 0;}
 if(!is_null($outbondingend[0]->outbondingend)){$outbondingend1 = $outbondingend[0]->outbondingend;}else{$outbondingend1 = 0;}
 if(!is_null($outmoldend[0]->outmoldend)){$outmoldend1 = $outmoldend[0]->outmoldend;}else{$outmoldend1 = 0;}
 if(!is_null($outoven_moldend[0]->outoven_moldend)){$outoven_moldend1 = $outoven_moldend[0]->outoven_moldend;}else{$outoven_moldend1 = 0;}
 if(!is_null($outdicer_actend[0]->outdicer_actend)){$outdicer_actend1 = $outdicer_actend[0]->outdicer_actend;}else{$outdicer_actend1 = 0;}
 if(!is_null($outappearanceend[0]->outappearanceend)){$outappearanceend1 = $outappearanceend[0]->outappearanceend;}else{$outappearanceend1 = 0;}
 if(!is_null($outclassifyend[0]->outclassifyend)){$outclassifyend1 = $outclassifyend[0]->outclassifyend;}else{$outclassifyend1 = 0;}

 if(!is_null($outdieend[0]->outdieend)){$outdieend2 = $outdieend[0]->outdieend;}else{$outdieend2 = 0.001;}
 if(!is_null($inbondingNow[0]->inbondingNow)){$outovenend2 = $outovenend[0]->outovenend;}else{$outovenend2 = 0.001;}
 if(!is_null($outwirebondend[0]->outwirebondend)){$outwirebondend2= $outwirebondend[0]->outwirebondend;}else{$outwirebondend2 = 0.001;}
 if(!is_null($outbondingend[0]->outbondingend)){$outbondingend2 = $outbondingend[0]->outbondingend;}else{$outbondingend2 = 0.001;}
 if(!is_null($outmoldend[0]->outmoldend)){$outmoldend2 = $outmoldend[0]->outmoldend;}else{$outmoldend2 = 0.001;}
 if(!is_null($outoven_moldend[0]->outoven_moldend)){$outoven_molden2 = $outoven_moldend[0]->outoven_moldend;}else{$outoven_moldend2 = 0.001;}
 if(!is_null($outdicer_actend[0]->outdicer_actend)){$outdicer_actend2 = $outdicer_actend[0]->outdicer_actend;}else{$outdicer_actend2 = 0.001;}
 if(!is_null($outappearanceend[0]->outappearanceend)){$outappearanceend2 = $outappearanceend[0]->outappearanceend;}else{$outappearanceend2 = 0.001;}
 if(!is_null($outclassifyend[0]->outclassifyend)){$outclassifyend2 = $outclassifyend[0]->outclassifyend;}else{$outclassifyend2 = 0.001;}


 if(!is_null($ngbonding[0]->ngbonding)){$ngbonding1 = $ngbonding[0]->ngbonding;}else{$ngbonding1 = 0.001;}
 if(!is_null($ngmold[0]->ngmold)){$ngmold1 = $ngmold[0]->ngmold;}else{$ngmold1 = 0.001;}
 if(!is_null($ngdicer[0]->ngdicer)){$ngdicer1 = $ngdicer[0]->ngdicer;}else{$ngdicer1 = 0.001;}
 if(!is_null($ngappear[0]->ngappear)){$ngappear1 = $ngappear[0]->ngappear;}else{$ngappear1 = 0.001;}
 if(!is_null($ngclassify[0]->ngclassify)){$ngclassify1 = $ngclassify[0]->ngclassify;}else{$ngclassify1 = 0.001;}

 $ant3bonding1;
 $ast3bonding1;
 $ant3bonding2;
 $ast3bonding2;
 $ant3bonding3;
 $ast3bonding3;

 $ant3mold1;
 $ast3mold1;
 $ant3mold2;
 $ast3mold2;
 $ant3mold3;
 $ast3mold3;

 $ant3dicer1;
 $ast3dicer1;
 $ant3dicer2;
 $ast3dicer2;
 $ant3dicer3;
 $ast3dicer3;

 $ant3appea1;
 $ast3appea1;
 $ant3appea2;
 $ast3appea2;
 $ant3appea3;
 $ast3appea3;

 $ant3classi1;
 $ast3classi1;
 $ant3classi2;
 $ast3classi2;
 $ant3classi3;
 $ast3classi3;

 if(!isset($t3bonding)){
  $ant3bonding1 = $t3bonding[0]->ng_name;
  $ast3bonding1 = $t3bonding[0]->sumqty;
  $ant3bonding2 = $t3bonding[1]->ng_name;
  $ast3bonding2 = $t3bonding[1]->sumqty;
  $ant3bonding3 = $t3bonding[2]->ng_name;
  $ast3bonding3 = $t3bonding[2]->sumqty;
  } else{
    $ant3bonding1 = "-";
    $ast3bonding1 = 0;
    $ant3bonding2 = "-";
    $ast3bonding2 = 0;
    $ant3bonding3 = "-";
    $ast3bonding3 = 0;
    }
  
  if(!isset($t3mold)){
  $ant3mold1 = $t3mold[0]->ng_name;
  $ast3mold1 = $t3mold[0]->sumqty;
  $ant3mold2 = $t3mold[1]->ng_name;
  $ast3mold2 = $t3mold[1]->sumqty;
  $ant3mold3 = $t3mold[2]->ng_name;
  $ast3mold3 = $t3mold[2]->sumqty;
  } else{
    $ant3mold1 = "-";
    $ast3mold1 = 0;
    $ant3mold2 = "-";
    $ast3mold2 = 0;
    $ant3mold3 = "-";
    $ast3mold3 = 0;
    }

  if(!isset($t3dicer)){
  $ant3dicer1 = $t3dicer[0]->ng_name;
  $ast3dicer1 = $t3dicer[0]->sumqty;
  $ant3dicer2 = $t3dicer[1]->ng_name;
  $ast3dicer2 = $t3dicer[1]->sumqty;
  $ant3dicer3 = $t3dicer[2]->ng_name;
  $ast3dicer3 = $t3dicer[2]->sumqty;
  } else{
    $ant3dicer1 = "-";
    $ast3dicer1 = 0;
    $ant3dicer2 = "-";
    $ast3dicer2 = 0;
    $ant3dicer3 = "-";
    $ast3dicer3 = 0;
    }

  if(!isset($t3appea)){
  $ant3appea1 = $t3appea[0]->ng_name;
  $ast3appea1 = $t3appea[0]->sumqty;
  $ant3appea2 = $t3appea[1]->ng_name;
  $ast3appea2 = $t3appea[1]->sumqty;
  $ant3appea3 = $t3appea[2]->ng_name;
  $ast3appea3 = $t3appea[2]->sumqty;
  } else{
    $ant3appea1 = "-";
    $ast3appea1 = 0;
    $ant3appea2 = "-";
    $ast3appea2 = 0;
    $ant3appea3 = "-";
    $ast3appea3 = 0;
    }

  if(!isset($t3classi)){
  $ant3classi1 = $t3classi[0]->ng_name;
  $ast3classi1 = $t3classi[0]->sumqty;
  $ant3classi2 = $t3classi[1]->ng_name;
  $ast3classi2 = $t3classi[1]->sumqty;
  $ant3classi3 = $t3classi[2]->ng_name;
  $ast3classi3 = $t3classi[2]->sumqty;
  } else{
    $ant3classi1 = "-";
    $ast3classi1 = 0;
    $ant3classi2 = "-";
    $ast3classi2 = 0;
    $ant3classi3 = "-";
    $ast3classi3 = 0;
    }

@endphp
<style>
 table, th, td {
  border: 1px solid black;
} 
.textAlignVer{
  display:block;
    filter: flipv fliph;
    -webkit-transform: rotate(-90deg); 
    -moz-transform: rotate(-90deg); 
    transform: rotate(-90deg); 
    position:relative;
    white-space:nowrap;
    font-size:12px;
    margin-bottom:50px;

}
.textnumberright{
  style="text-align: right;"
}

@font-face {
  font-family: 'DIGITAL';
  src: url('https://cssdeck.com/uploads/resources/fonts/digii/DS-DIGII.TTF');
}

html {
  height: 100%;
  background: radial-gradient(#000, #555);
}

.digital-clock {
  margin: auto;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  color: #333333;
  text-align: center;
  font: 50px/60px 'DIGITAL',;
}
  </style>

@section("content")
<table style="width:100%">
  <tr>
    <th colspan="11" style="text-align: center;"><h4>Production Control Board<h4></th>
  </tr>

  <tr>
    <td colspan="6" style="text-align: center;">Date :{{$strYear}}</td>

    <td colspan="5" style="text-align: center;">Time : <span class="digital-clock"> </span></td>

  </tr>
  <tr>
    <td colspan="2" style="text-align: center; height: 150;"><h1>5W<h1></td>
    <td ><span class="textAlignVer">DIE BOND</span></td>
    <td><span class="textAlignVer">OVEN DIEBON</span></td>
    <td><span class="textAlignVer">WIRE BOND</span></td>
    <td><span class="textAlignVer">BONDING INS</span></td>
    <td><span class="textAlignVer">MOLD</span></td>
    <td><span class="textAlignVer">OVEN MOLD</span></td>
    <td><span class="textAlignVer">DICER</span></td>
    <td><span class="textAlignVer">APPEARANCE</span></td>
    <td><span class="textAlignVer">CLASSIFINF</span></td>
   
  </tr>
  <tr>
    <td  colspan="2">Plan</td>
    <td style="text-align: right;">{{number_format($pdieNow[0]->pdieNow)}}/{{number_format($pdieFull[0]->pdieFull)}}</td>
    <td style="text-align: right;">{{number_format($povenNow[0]->povenNow)}}/{{number_format($povenFull[0]->povenFull)}}</td>
    <td style="text-align: right;">{{number_format($pwireNow[0]->pwireNow)}}/{{number_format($pwireFull[0]->pwireFull)}}</td>
    <td style="text-align: right;">{{number_format($pbondinNow[0]->pbondinNow)}}/{{number_format($pbondinFull[0]->pbondinFull)}}</td>
    <td style="text-align: right;">{{number_format($pmoldNow[0]->pmoldNow)}}/{{number_format($pmoldFull[0]->pmoldFull)}}</td>
    <td style="text-align: right;">{{number_format($povenmoldNow[0]->povenmoldNow)}}/{{number_format($povenmoldFull[0]->povenmoldFull)}}</td>
    <td style="text-align: right;">{{number_format($pdicerNow[0]->pdicerNow)}}/{{number_format($pdicerFull[0]->pdicerFull)}}</td>
    <td style="text-align: right;">{{number_format($pappeaNow[0]->pappeaNow)}}/{{number_format($pappeaFull[0]->pappeaFull)}}</td>
    <td style="text-align: right;">{{number_format($pcalssNow[0]->pcalssNow)}}/{{number_format($pcalssFull[0]->pcalssFull)}}</td>
    
  </tr>
  <tr>
    <td  colspan="2">Input</td>
    <td style="text-align: right;">{{number_format($indieNow[0]->indieNow)}}</td>
    <td style="text-align: right;">{{number_format($inovenNow[0]->inovenNow)}}</td>
    <td style="text-align: right;">{{number_format($inwirebondNow[0]->inwirebondNow)}}</td>
    <td style="text-align: right;">{{number_format($inbondingNow[0]->inbondingNow)}}</td>
    <td style="text-align: right;">{{number_format($inmoldNow[0]->inmoldNow)}}</td>
    <td style="text-align: right;">{{number_format($inovenmoldNow[0]->inovenmoldNow)}}</td>
    <td style="text-align: right;">{{number_format($indicerNow[0]->indicerNow)}}</td>
    <td style="text-align: right;">{{number_format($inappearaNow[0]->inappearaNow)}}</td>
    <td style="text-align: right;">{{number_format($incalssNow[0]->incalssNow)}}</td>
  
   
  </tr>
  <tr>
    <td  colspan="2">Output</td>
    <td style="text-align: right; ">{{number_format($outdieend[0]->outdieend)}}</td>
    <td style="text-align: right; ">{{number_format($outovenend[0]->outovenend)}}</td>
    <td style="text-align: right; ">{{number_format($outwirebondend[0]->outwirebondend)}}</td>
    <td style="text-align: right; ">{{number_format($outbondingend[0]->outbondingend)}}</td>
    <td style="text-align: right; ">{{number_format($outmoldend[0]->outmoldend)}}</td>
    <td style="text-align: right; ">{{number_format($outoven_moldend[0]->outoven_moldend)}}</td>
    <td style="text-align: right;">{{number_format($outdicer_actend[0]->outdicer_actend)}}</td>
    <td style="text-align: right; ">{{number_format($outappearanceend[0]->outappearanceend)}}</td>
    <td style="text-align: right; ">{{number_format($outclassifyend[0]->outclassifyend)}}</td>
  </tr>
  <tr>
    <td  colspan="2">Result</td>
    <td style="text-align: right; ">{{number_format(($outdieend1 / $indieNow1) * 100)}} %</td>
    <td style="text-align: right; ">{{number_format(($outovenend1 / $inovenNow1) * 100)}} %</td>
    <td style="text-align: right; ">{{number_format(($outwirebondend1 / $inwirebondNow1) * 100)}} %</td>
    <td style="text-align: right;">{{number_format(($outbondingend1 / $inbondingNow1) * 100)}} %</td>
    <td style="text-align: right; ">{{number_format(($outmoldend1 / $inmoldNow1) * 100)}} %</td>
    <td style="text-align: right; ">{{number_format(($outoven_moldend1 / $inovenmoldNow1) * 100)}} %</td>
    <td style="text-align: right; ">{{number_format(($outdicer_actend1 / $indicerNow1) * 100)}} %</td>
    <td style="text-align: right;">{{number_format(($outappearanceend1 / $inappearaNow1) * 100)}} %</td>
    <td style="text-align: right;">{{number_format(($outclassifyend1 / $incalssNow1) * 100)}} %</td>
  </tr>
  <tr>
    <td  colspan="2">NG</td>
    <td style="text-align: right;">0</td>
    <td style="text-align: right;">0</td>
    <td style="text-align: right;">0</td>
    <td style="text-align: right;">{{number_format($ngbonding[0]->ngbonding)}}</td>
    <td style="text-align: right;">{{number_format($ngmold[0]->ngmold)}}</td>
    <td style="text-align: right;">0</td>
    <td style="text-align: right;">{{number_format($ngdicer[0]->ngdicer)}}</td>
    <td style="text-align: right;">{{number_format($ngappear[0]->ngappear)}}</td>
    <td style="text-align: right;">{{number_format($ngclassify[0]->ngclassify)}}</td>
  </tr>
  <tr>
    <td  colspan="2">%NG</td>
    <td style="text-align: right;"></td>
    <td style="text-align: right;"></td>
    <td style="text-align: right;"></td>
    <td style="text-align: right; ">{{number_format(($ngbonding[0]->ngbonding / $outbondingend2 ) * 100)}} %</td>
    <td style="text-align: right; ">{{number_format(($ngmold[0]->ngmold / $outmoldend2 ) * 100)}} %</td>
    <td style="text-align: right;"></td>
    <td style="text-align: right; ">{{number_format(($ngdicer[0]->ngdicer / $outdicer_actend2 ) * 100)}} %</td>
    <td style="text-align: right; ">{{number_format(($ngappear[0]->ngappear / $outappearanceend2 ) * 100)}} %</td>
    <td style="text-align: right; ">{{number_format(($ngclassify[0]->ngclassify / $outclassifyend2) * 100)}} %</td>
  </tr>
  <tr>
    <td colspan="2" style="text-align: center;">TOP 3 NG</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>


  </tr>
  <tr>
    <td rowspan="3" style="text-align: center;">BONDING INS</td>
    <td>{{$ant3bonding1}}</td>
    <td></td>
    <td></td>
    <td></td>
    <td style="text-align: right;">{{number_format(($ast3bonding1 / $outbondingend2) * 100)}} %</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td>{{$ant3bonding2}}</td>
    <td></td>
    <td></td>
    <td></td>
    <td style="text-align: right;">{{number_format(($ast3bonding2 / $outbondingend2) * 100)}} %</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td>{{$ant3bonding3}}</td>
    <td></td>
    <td></td>
    <td></td>
    <td style="text-align: right;">{{number_format(($ast3bonding3 / $outbondingend2) * 100)}} %</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    
  </tr>
  <tr>

  <td rowspan="3" style="text-align: center;">MOLD</td>
    <td>{{$ant3mold1}}</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td style="text-align: right;">{{number_format(($ast3mold1 / $outmoldend2) * 100)}} %</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td>{{$ant3mold2}}</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td style="text-align: right;">{{number_format(($ast3mold2 / $outmoldend2) * 100)}} %</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td>{{$ant3mold3}}</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td style="text-align: right;">{{number_format(($ast3mold3 / $outmoldend2) * 100)}} %</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
   
  </tr>
  <tr>

    <td rowspan="3" style="text-align: center;">DICER</td>
    <td>{{$ant3dicer1}}</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td style="text-align: right;">{{number_format(($ast3dicer1 / $outdicer_actend2) * 100)}} %</td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td>{{$ant3dicer2}}</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td style="text-align: right;">{{number_format(($ast3dicer2 / $outdicer_actend2) * 100)}} %</td>
    <td></td>
    <td></td>
   
  </tr>
  <tr>
    <td>{{$ant3dicer3}}</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td style="text-align: right;">{{number_format(($ast3dicer3 / $outdicer_actend2) * 100)}} %</td>
    <td></td>
    <td></td>

  </tr>
  <tr>

    <td rowspan="3" style="text-align: center;">APPEARANCE</td>
    <td>{{$ant3appea1}}</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td style="text-align: right;">{{number_format(($ast3appea1 / $outappearanceend2) * 100)}} %</td>
    <td></td>
  </tr>
  <tr>
    <td>{{$ant3appea2}}</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td style="text-align: right;">{{number_format(($ast3appea2 / $outappearanceend2) * 100)}} %</td>
    <td></td>
    
  </tr>
  <tr>
    <td>{{$ant3appea3}}</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td style="text-align: right;">{{number_format(($ast3appea3 / $outappearanceend2) * 100)}} %</td>
    <td></td>

  </tr>
  <tr>
    <td rowspan="3" style="text-align: center;">CLASSIFYING</td>
    <td>{{$ant3classi1}}</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td style="text-align: right;">{{number_format(($ast3classi1 / $outclassifyend2) * 100)}} %</td>
  </tr>
  <tr>
    <td>{{$ant3classi2}}</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td style="text-align: right;">{{number_format(($ast3classi2 / $outclassifyend2) * 100)}} %</td>
    
  </tr>
  <tr>
    <td>{{$ant3classi3}}</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td style="text-align: right;">{{number_format(($ast3classi3 / $outclassifyend2) * 100)}} %</td>

  </tr>
  <tr>
    <td colspan="2">LOT OUT</td>
    <td></td>
    <td>600</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
   
  </tr>
  <tr>
    <td colspan="2">% LOT OUT</td>
    <td></td>
    <td>7.96%</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
   
  </tr>
  <tr>
    <td colspan="2" rowspan="5">Remark</td>
    <td></td>
    <td>ไฟดับ</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
     <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
  <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
  <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
  <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
 

  
</table>




@endsection
@section("script")
<script type="text/javascript">
$(document).ready(function () {

  clockUpdate();
  setInterval(clockUpdate, 1000);

  setTimeout(
  function() 
  {
    location.reload();
  }, 30000);
});

function clockUpdate() {
  var date = new Date();
  $('.digital-clock').css({'color': '#333'});
  function addZero(x) {
    if (x < 10) {
      return x = '0' + x;
    } else {
      return x;
    }
  }

  function twelveHour(x) {
    if (x > 12) {
      return x = x - 12;
    } else if (x == 0) {
      return x = 12;
    } else {
      return x;
    }
  }

  var h = addZero(twelveHour(date.getHours()));
  var m = addZero(date.getMinutes());
  var s = addZero(date.getSeconds());

  $('.digital-clock').text(h + ':' + m + ':' + s)
}
</script>
@endsection
