<?php 

include('view/new_header_file.php');

?>











  <!-- Add Tracker Modal -->

  <div class="modal fade" id="addTrackerModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">

    <div class="modal-dialog modal-dialog-centered" role="document">

      <div class="modal-content">

        <div class="modal-header">

          <h5 class="modal-title" id="exampleModalLongTitle">Add Tracker</h5>

          <button type="button" class="close" data-dismiss="modal" aria-label="Close">

            <span aria-hidden="true">&times;</span>

          </button>

        </div>

        <div class="modal-body">

          <form action="#" class="form" id="addTrackerForm">

            <input type="hidden" name="action" value="insertTracker">

             <div class="col-md-12">

              <label> Email </label>

                <input type="email" class="form form-control" required name="tracker_email" style="height: 50px;" />

             </div> 

             <div class="col-md-12">

              <label> Currency </label>

                <select style="height: 50px;" placeholder="Identifier" required class="form form-control newformcontrol" name="tracker_symbol" >

                    <option value="SGDCHF">SGDCHF </option>

                    <option value="NZDCHF">NZDCHF</option>

                    <option value="AUDCHF">AUDCHF</option>

                    <option value="SGDJPY">SGDJPY</option>

                    <option value="ZARJPY">ZARJPY</option>

                    <option value="TRYJPY">TRYJPY</option>

                    <option value="NZDCAD">NZDCAD</option>

                    <option value="GBPNZD">GBPNZD</option>

                    <option value="GBPCHF">GBPCHF</option>

                    <option value="GBPCAD">GBPCAD</option>

                    <option value="GBPAUD">GBPAUD</option>

                    <option value="EURNZD">EURNZD</option>

                    <option value="EURCHF">EURCHF</option>

                    <option value="EURCAD">EURCAD</option>

                    <option value="CADCHF">CADCHF</option>

                    <option value="AUDNZD">AUDNZD</option>

                    <option value="AUDCAD">AUDCAD</option>

                    <option value="GBPUSD">GBPUSD</option>

                    <option value="USDCHF">USDCHF</option>

                    <option value="USDCAD">USDCAD</option>

                    <option value="NZDUSD">NZDUSD</option>

                    <option value="NZDJPY">NZDJPY</option>

                    <option value="GBPJPY">GBPJPY</option>

                    <option value="EURGBP">EURGBP</option>

                    <option value="EURAUD">EURAUD</option>

                    <option value="CHFJPY">CHFJPY</option>

                    <option value="CADJPY">CADJPY</option>

                    <option value="AUDJPY">AUDJPY</option>

                    <option value="AUDUSD">AUDUSD</option>

                    <option value="EURJPY">EURJPY</option>

                    <option value="USDJPY">USDJPY</option>

                    <option value="EURUSD">EURUSD</option>

                  </select>

             </div> 

             <div class="col-md-12">

              <label>Price</label>

                <input type="text" class="form form-control" style="height: 50px;" required name="tracker_price" />

             </div> 

             <div class="col-md-12">

              <label>Length</label>

                <input name="tracker_length" required class="form form-control datetimepicker" style="height: 50px;" type="datetime-local">

             </div> 

             <div class="col-md-12" style="margin-top:1em;">

                <div class="row">

                  <div class="col-md-4">

                  </div>

                  <div class="col-md-3">

                    <button type="button" class="btn btn-secondary" data-dismiss="modal" style="width: 100%;">Close</button>    

                  </div>

                  <div class="col-md-5">

                    <input type="submit" class="btn btn-primary pull-right trackerSubmit" value="Add Tracker" style="background-color: #F15A24;width: 100%;border: none;">    

                  </div>

                </div>

                

                

            </div>

          </form>

        </div>

      </div>

    </div>

  </div>

  <!-- END Modal -->

















<link rel="stylesheet" type="text/css" href="node_modules/css-toggle-switch/dist/toggle-switch.css">

  <style type="text/css">

.item {

  display: block;

  position: absolute;

  z-index: 1;

  margin-top: 80px;

}



.item.muuri-item-dragging {

  z-index: 3;

}

.item.muuri-item-releasing {

  z-index: 2;

}

.item.muuri-item-hidden {

  z-index: 0;

}

  </style>

<style type="text/css">

    .panel-heading

  {

    background-color: #F7614E;

    text-align: center;

    padding: 7px !important;

    font-size: 18px !important;

    font-weight: 500;

  }

 

  .livetv

  {

    width: 100%;

    height: 400px;

    overflow: hidden;

    margin-top: -80px;

  }

  .resultPrice > span

  {

    text-align: center;

    font-size: 18px;

    color: #fff;

    padding: 10px;

  }

  .resultPrice{

    margin-top: -20px !important;

    margin-bottom: 0px !important;

  }

  

    .swal-modal

  {

    background-color: #202943;

  }

  .swal-title

  {

    color: #F7614E;

  }

  .swal-text

  {

    color: #fff;

  }

  .swal-icon--success:before, .swal-icon--success:after

  {

    background-color: #202943;  

  }

  .swal-icon--success__hide-corners {



    background-color: #202943;  

  }

  #tablelayout

  {

    height: 500px;

  }

  #boxlayout

  {

    height: 500px;

    overflow-y: scroll;

    overflow-x: hidden;

  }

</style>



<style type="text/css">

  

  .hoursTime > td

  {

    height: 50px;

    width: 60px;

    background-color: #000;

    color: #fff;

    text-align: center;

    margin-left: 5px;

  }

  .sweden

  {

    height: 50px;

    width: 60px;

    background-color: #79C844;

    color: #fff;

    text-align: center;

    margin-left: 5px;

    margin-top: 20px !important;

  }

  .tokyo

  {

        height: 50px;

    width: 60px;

    background-color: #FE9324;

    color: #fff;

    text-align: center;

    margin-left: 5px;

    margin-top: 20px !important;



  }

  .lon

  {

        height: 50px;

    width: 60px;

    background-color: #41A8F5;

    color: #fff;

    text-align: center;

    margin-left: 5px;

    margin-top: 20px !important;    

  }

  .ny

  {

        height: 50px;

    width: 60px;

    background-color: #EB2376;

    color: #fff;

    text-align: center;

    margin-left: 5px;

    margin-top: 20px !important;    

  }

</style>

<style type="text/css">

  .tableHeatMap > thead > tr > th, .tableHeatMap > tbody > tr > td

  {

    color: #fff !important;

    text-align: center !important;

    border: 1px solid #fff !important;

    min-width: 100px !important;

    padding: 16px 25px;

  }

  .tableHeatMap

  {

    width: 100%;

  }

  .tableHeatMap > thead

  {

    width: 100%;

  }

  .tableHeatMap > thead > tr

  {

    width: 100% !important;

  }

</style>



<style type="text/css">

  .hmLightTable > thead > tr > th

  {

    border: 1px solid #0E162D !important;

    color: #0E162D !important;

  }

  .hmLightTable > thead > tr > th

  {

    background: #eee !important;

  }

  .hmLightTable > tbody > tr > td

  {

    border: 1px solid #0E162D !important;

    color: #0E162D !important;

  }

</style>









      <div class="container-fluid">

           <!--  <div class="col-md-6 col-lg-6 col-xl-6 col-xxl-12">

              

                     <div class="tab-content crypt-tab-content">

                        <div role="tabpanel" class="tab-pane active" id="usd">

                        	<h3 style="text-align: center;">Account Details</h3>

                        

                        </div>

                     </div>

                  

              

            </div> -->

              <?php 

                  include('view/allinoe.view.php');

              ?>

    </div>





<?php

include('view/new_footer_file.php');

?>

  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>





   <script>

  $( function() {

    $( "#sendCommandLayout" ).draggable();

     $( "#sendCommandLayout" ).resizable();

  } );

  </script>



 <script>

  $( function() {

    $( "#ipCCommand" ).draggable();

     $( "#ipCCommand" ).resizable();

  } );

  </script>





<!-- Heat Map Start Here -->





<script type="text/javascript">

     function hmfunc(values)

     {

          if (values == 'hmper') {



               $(".hmp").show();

               $(".hm").hide();

          }





          if (values == 'hmprice') {



               $(".hmp").hide();

               $(".hm").show();

          }

     }

</script>


<script type="text/javascript">


heatmapController();

setTimeout(function()
{

  heatmapController();
  extra_heat_map();

}, 15000);


function heatmapController()
{
   $.post('/crons/heatmap-cron.php', $("#modifyTrackerId").serialize())
          .done(function(data){

            var data = JSON.parse(data);

            for (var i = 0; i < data.length; i++) {
                 
                  var result = JSON.parse(data[i]);
                  var sym = result['sym'];
                  var price = result['bid'];
                  var percentage = result['per'];

                  var sym = sym.replace('_','');
                  var sym = sym.toLowerCase();
                  var symid = "#"+sym+"hm";
                  $(symid).html(price);

                 var symperid = "#"+sym+"hmp";

                 if (percentage < 0) {
                      $(symperid).html("<span style='color:red;'>"+percentage+"%</span>");
                  }else{
                      $(symperid).html(percentage+"%");  
                  }



            }

          });
}

  
  function extra_heat_map()
  {
     // USD / EUR

          var eurusd = $("#eurusdhm").html();
          var usdeur = 1/ eurusd;

          var audusd = $("#audusdhm").html();
          var usdaud = 1 / audusd;
      
          var gbpusd = $("#gbpusdhm").html();
          var usdgbp = 1 / gbpusd;

          var nzdusd = $("#nzdusdhm").html();
          var usdnzd = 1 / nzdusd;

           var euraud = $("#euraudhm").html();
           var audeur = 1 / euraud;

           var gbpaud = $("#gbpaudhm").html();
           var audgbp = 1 / gbpaud;

           var eurgbp = $("#eurgbphm").html();
           var gbpeur = 1 / eurgbp;

           var eurnzd = $("#eurnzdhm").html();
           var nzdeur = 1 / eurnzd;

           var audnzd = $("#audnzdhm").html();
           var nzdaud = 1 / audnzd;

           var gbpnzd = $("#gbpnzdhm").html();
           var nzdgbp = 1 / gbpnzd;

           var eurcad = $("#eurcadhm").html();
           var cadeur = 1 / eurcad;

          var usdcad = $("#usdcadhm").html();
          var cadusd = 1 / usdcad;

          var audcad = $("#audcadhm").html();
          var cadaud = 1 / audcad;

          var gbpcad = $("#gbpcadhm").html();
          var cadgbp = 1 / gbpcad;

          var nzdcad = $("#nzdcadhm").html();
          var cadnzd = 1 / nzdcad;

           var eurchf = $("#eurchfhm").html();
           var chfeur = 1 / eurchf;

           var usdchf = $("#usdchfhm").html();
           var chfusd = 1 / usdchf;

           var audchf = $("#audchfhm").html();
           var chfaud = 1 / audchf;
         
           var gbpchf = $("#gbpchfhm").html();
           var chfgbp = 1 / gbpchf;

          var nzdchf = $("#nzdchfhm").html();
           var chfnzd = 1 / nzdchf;

         var sgdchf = $("#sgdchfhm").html();
           var chfsgd = 1 / sgdchf;

          var cadchf = $("#cadchfhm").html();
          var chfcad = 1 / cadchf;

          var eurjpy = $("#eurjpyhm").html();
          var jpyeur = 1 / eurjpy;


          var usdjpy = $("#usdjpyhm").html();
          var jpyusd = 1 / usdjpy;

          var audjpy = $("#audjpyhm").html();
          var jpyaud = 1 / audjpy;

          var gbpjpy = $("#gbpjpyhm").html();
          var jpygbp = 1 / gbpjpy;


          var nzdjpy = $("#nzdjpyhm").html();
          var jpynzd = 1 / nzdjpy;

          var cadjpy = $("#cadjpyhm").html();
          var jpycad = 1 / cadjpy;

          var chfjpy = $("#chfjpyhm").html();
          var jpychf = 1 / chfjpy;

          var hkdjpy = $("#hkdjpyhm").html();
          var jpyhkd = 1 / hkdjpy;

          var sgdjpy = $("#sgdjpyhm").html();
          var jpysgd = 1 / sgdjpy;

          var usdhkd = $("#usdhkdhm").html();
          var hkdusd = 1 / usdhkd;

          var eurhkd = $("#eurhkdhm").html();
          var hkdeur = 1 / eurhkd;

          var audhkd = $("#audhkdhm").html();
          var hkdaud = 1 / audhkd;

          var gbphkd = $("#gbphkdhm").html();
          var hkdgbp = 1 / gbphkd;

          // HKD / NZD
          var nzdhkd = $("#nzdhkdhm").html();
          var hkdnzd = 1 / nzdhkd;

          // HKD / CAD
          var cadhkd = $("#cadhkdhm").html();
          var hkdcad = 1 / cadhkd;

          // HKD / CHF
          var chfhkd = $("#chfhkdhm").html();

          var hkdchf = 1 / chfhkd;
         
          // HKD / SGD
          var sgdhkd = $("#sgdhkdhm").html();

          var hkdsgd = 1 / sgdhkd;
          
          // SGD / EUR
          var eursgd = $("#eursgdhm").html();
          
          var sgdeur = 1 / eursgd;

          // SGD / USD
          var usdsgd = $("#usdsgdhm").html();
          
          var sgdusd = 1 / usdsgd;

          // SGD / AUD
          var audsgd = $("#audsgdhm").html();
          
          var sgdaud = 1 / audsgd;

          // SGD / GBP
          var gbpsgd = $("#gbpsgdhm").html();
          
          var sgdgbp = 1 / gbpsgd;
          

          // SGD / NZD
          var nzdsgd = $("#nzdsgdhm").html();
          
          var sgdnzd = 1 / nzdsgd;

          // SGD / CAD
          var cadsgd = $("#cadsgdhm").html();
          
          var sgdcad = 1 / cadsgd;








        var chfjpyhmp = $("#chfjpyhmp").html();
        var cadjpyhmp = $("#cadjpyhmp").html();
        var nzdjpyhmp = $("#nzdjpyhmp").html();
        var gbpjpyhmp = $("#gbpjpyhmp").html();
        var audjpyhmp = $("#audjpyhmp").html();
        var usdjpyhmp = $("#usdjpyhmp").html();
        var eurjpyhmp = $("#eurjpyhmp").html();
        var cadchfhmp = $("#cadchfhmp").html();
        var sgdchfhmp = $("#sgdchfhmp").html();
        var nzdchfhmp = $("#nzdchfhmp").html();
        var gbpchfhmp = $("#gbpchfhmp").html();
        var audchfhmp = $("#audchfhmp").html();
        var usdchfhmp = $("#usdchfhmp").html();
        var eurchfhmp = $("#eurchfhmp").html();
        var nzdcadhmp = $("#nzdcadhmp").html();
        var cadsgdhmp = $("#cadsgdhmp").html();
        var nzdsgdhmp = $("#nzdsgdhmp").html();
        var gbpsgdhmp = $("#gbpsgdhmp").html();
        var audsgdhmp = $("#audsgdhmp").html();
        var usdsgdhmp = $("#usdsgdhmp").html();
        var eursgdhmp = $("#eursgdhmp").html();
        var sgdhkdhmp = $("#sgdhkdhmp").html();
        var chfhkdhmp = $("#chfhkdhmp").html();
        var cadhkdhmp = $("#cadhkdhmp").html();
        var nzdhkdhmp = $("#nzdhkdhmp").html();
        var gbphkdhmp = $("#gbphkdhmp").html();
        var eurhkdhmp = $("#eurhkdhmp").html();
        var usdhkdhmp = $("#usdhkdhmp").html();
        var sgdjpyhmp = $("#sgdjpyhmp").html();
        var hkdjpyhmp = $("#hkdjpyhmp").html();
        var audhkdhmp = $("#audhkdhmp").html();
        var audcadhmp = $("#audcadhmp").html();
        var usdcadhmp = $("#usdcadhmp").html();
        var eurusdhmp = $("#eurusdhmp").html();
        var audusdhmp = $("#audusdhmp").html();
        var gbpusdhmp = $("#gbpusdhmp").html();
        var nzdusdhmp = $("#nzdusdhmp").html();
        var euraudhmp = $("#euraudhmp").html();
        var gbpaudhmp = $("#gbpaudhmp").html();
        var eurgbphmp = $("#eurgbphmp").html();
        var nzdeurhmp = $("#nzdeurhmp").html();
        var audnzdhmp = $("#audnzdhmp").html();
        var gbpnzdhmp = $("#gbpnzdhmp").html();
        var eurcadhmp = $("#eurcadhmp").html();



        var hmpvalues = [chfjpyhmp, cadjpyhmp, nzdjpyhmp, gbpjpyhmp, audjpyhmp, usdjpyhmp, eurjpyhmp, cadchfhmp, sgdchfhmp, nzdchfhmp, gbpchfhmp, audchfhmp, usdchfhmp, eurchfhmp, nzdcadhmp, cadsgdhmp, nzdsgdhmp, gbpsgdhmp, audsgdhmp, usdsgdhmp, eursgdhmp, sgdhkdhmp, chfhkdhmp, cadhkdhmp, nzdhkdhmp, gbphkdhmp, eurhkdhmp, usdhkdhmp, sgdjpyhmp, hkdjpyhmp, audhkdhmp, audcadhmp, usdcadhmp, eurusdhmp, audusdhmp, gbpusdhmp, nzdusdhmp, euraudhmp, gbpaudhmp, eurgbphmp, nzdeurhmp, audnzdhmp, gbpnzdhmp, eurcadhmp];

        var hmpids = ["chfjpyhmp", "cadjpyhmp", "nzdjpyhmp", "gbpjpyhmp", "audjpyhmp", "usdjpyhmp", "eurjpyhmp", "cadchfhmp", "sgdchfhmp", "nzdchfhmp", "gbpchfhmp", "audchfhmp", "usdchfhmp", "eurchfhmp", "nzdcadhmp", "cadsgdhmp", "nzdsgdhmp", "gbpsgdhmp", "audsgdhmp", "usdsgdhmp", "eursgdhmp", "sgdhkdhmp", "chfhkdhmp", "cadhkdhmp", "nzdhkdhmp", "gbphkdhmp", "eurhkdhmp", "usdhkdhmp", "sgdjpyhmp", "hkdjpyhmp", "audhkdhmp", "audcadhmp", "usdcadhmp", "eurusdhmp", "audusdhmp", "gbpusdhmp", "nzdusdhmp", "euraudhmp", "gbpaudhmp", "eurgbphmp", "nzdeurhmp", "audnzdhmp", "gbpnzdhmp", "eurcadhmp"];


        for (var i = 0; i < hmpids.length; i++) {
            
            var hmp_id = hmpids[i];
            var hmp_value = hmpvalues[i];
            insertHmpValueFunction(hmp_id, hmp_value);
        }






          var forexidArray = ["#nzdgbphm", "#nzdaudhm", "#nzdeurhm", "#gbpeurhm", "#audgbphm", "#audeurhm", "#usdnzdhm", "#usdgbphm", "#usdaudhm", "#usdeurhm", "#sgdcadhm", "#sgdnzdhm", "#sgdgbphm", "#sgdaudhm", "#sgdusdhm", "#sgdeurhm", "#hkdsgdhm", "#hkdchfhm", "#hkdcadhm", "#hkdnzdhm", "#hkdgbphm", "#hkdaudhm", "#hkdeurhm", "#hkdusdhm", "#jpysgdhm", "#jpyhkdhm", "#jpychfhm", "#jpycadhm", "#jpynzdhm", "#jpygbphm", "#jpyaudhm", "#jpyusdhm", "#jpyeurhm", "#chfcadhm", "#chfsgdhm", "#chfnzdhm", "#chfgbphm", "#chfaudhm", "#chfusdhm", "#chfeurhm", "#cadnzdhm", "#cadgbphm", "#cadaudhm", "#cadusdhm","#cadeurhm"];

          var forexratearray = [nzdgbp, nzdaud, nzdeur, gbpeur, audgbp, audeur, usdnzd, usdgbp, usdaud, usdeur, sgdcad, sgdnzd, sgdgbp, sgdaud, sgdusd, sgdeur, hkdsgd, hkdchf, hkdcad, hkdnzd, hkdgbp, hkdaud, hkdeur, hkdusd,jpysgd, jpyhkd, jpychf, jpycad, jpynzd, jpygbp, jpyaud, jpyusd, jpyeur, chfcad, chfsgd, chfnzd, chfgbp, chfaud, chfusd, chfeur, cadnzd, cadgbp, cadaud, cadusd, cadeur];

          for (var i = 0; i < forexidArray.length; i++) {
               
               var forexid = forexidArray[i];
               var forextRate = forexratearray[i];
               forextRate = forextRate.toFixed(5);
               insertRateValue(forexid, forextRate);

          }
  }



  function insertHmpValueFunction(id, rate)
  {
      var firstthreecharid = id.substring(0, 3);
      var secondcharid = id.substring(3, 6);
      var thirdcharid = id.substring(6, 9);


      var reverse_id = secondcharid + firstthreecharid + thirdcharid;
      var reverse_full_id = $("#"+reverse_id);

      if (isNaN(rate) == false) {

        $(reverse_full_id).html('<span style="color:red;">0.00%</span>');

      }else{

          rate = rate.replace('%', '');
          rate = rate.replace('</span>', '');
          rate = rate.replace('<span style="color:red;">', '')

          var covertFloat = parseFloat(rate);
          covertFloat = covertFloat.toFixed(2);

          if (covertFloat < 0 ) {

              $(reverse_full_id).html('<span style="color:red;">'+covertFloat+'%</span>');
          
          }else{

              $(reverse_full_id).html(covertFloat + '%');

          }

      }

      

      



  }

   function insertRateValue(id, rate)
     {
          $(id).html(rate);
           var getsymbol = id.substring(1);
           var symbol1 = getsymbol.substring(0, 3);
           var symbol2 = getsymbol.substring(3, 6);
           var fullsymbol = symbol1 + "_"+symbol2;
           fullsymbol = fullsymbol.toUpperCase();

          $.post('controller/heatmap-reverse.controller.php', {action:"reverse", sym:fullsymbol, rate:rate})
          .done(function(data){

          });

     }
</script>

<script type="text/javascript">

  



      setInterval(function(){



          var getjsonvalue = '<?=$forjscurrange; ?>';



          var json_array_screener = JSON.parse(getjsonvalue);





          for (var i = 0; i < json_array_screener.length; i++) {

                var elem = json_array_screener[i];

            



                           $.ajax({

                            type: 'POST',

                            url: 'controller/screener.controller.php', 

                            data: {cur:elem},

                            success: function(res){

                               var result = JSON.parse(res);

                               var getelement = result.elem;

                               var bidvalue = result.bid;

                               var askvalue = result.ask;

                               var chg = result.chg;

                               var chgp = result.chgp;

                               var maxbid = result.maxbid;

                               var maxask = result.maxask;

                               var rating = result.rating;



                               $ratingvalue = '';



                               if (rating == 'buy') {



                                  ratingvalue = '<i class="fa fa-chevron-up" style="color:green;font-weight:700;"><span style="margin-left:5px;font-size:16px;font-weight:700;">Buy</span></i>';

                               }else if (rating == 'strongbuy') {

                                ratingvalue = '<i class="fa fa-chevron-up" style="color:green;font-weight:700;"><span style="margin-left:5px;font-size:16px;font-weight:700;">Strong Buy</span></i>';

                               }else if (rating == 'sell') {

                                ratingvalue = '<i class="fa fa-chevron-down" style="color:red;font-weight:700;"><span style="margin-left:5px;font-size:16px;font-weight:700;">Sell</span></i>';

                               }else if (rating == 'strongsell') {

                                ratingvalue = '<i class="fa fa-chevron-down" style="color:red;font-weight:700;"><span style="margin-left:5px;font-size:16px;font-weight:700;">Strong Sell</span></i>';

                               }



                              var changevalue = "";

                              var changevalueper = "";



                               if (chg < 0) {



                                changevalue = "<span style='color:red;font-weight:700;'>"+chg+"</span>";

                               }else{

                                changevalue = "<span style='color:green;font-weight:700;'>"+chg+"</span>";

                               }





                               if (chgp < 0) {



                                changevalueper = "<span style='color:red;font-weight:700;'>"+chgp+"%</span>";

                               }else{



                                changevalueper = "<span style='color:green;font-weight:700;'>"+chgp+"%</span>";

                               }





                               var lastvaluebid = $("#"+getelement+"_last").html(bidvalue);

                               var lastvaluebid = $("#"+getelement+"_chg").html(changevalue);

                               var lastvaluebid = $("#"+getelement+"_chg2").html(changevalueper);

                               var lastvaluebid = $("#"+getelement+"_bid").html(bidvalue);

                               var lastvaluebid = $("#"+getelement+"_ask").html(askvalue);

                               var lastvaluebid = $("#"+getelement+"_high").html(maxbid);

                               var lastvaluebid = $("#"+getelement+"_low").html(maxask);

                               var lastvaluebid = $("#"+getelement+"_rating").html(ratingvalue);



                            }



                            });



          }











         }, 6000);





</script>



<script type="text/javascript">

    var sndCommand = 0;

    function sendCommandLayoutBtn()

    {

        sndCommand++;



        var divElementSc = "sendCommandLayout"+sndCommand;



        var rowElementSc = "sendCommandElement"+sndCommand;



        $("#sendCommandLayoutShow").append('<div class="row sm-gutters" id="'+rowElementSc+'"><div class="col-md-6 col-lg-6 col-xl-4 col-xxl-4"><div class="row crypt-gross-market-cap mt-4"id="'+divElementSc+'"></div></div></div>');





        $("#"+divElementSc).append('<div class="col-md-12" style="margin-bottom: 10px;"><i onclick="closeSendWindow('+sndCommand+')" class="fa fa-window-close" style="float: right;text-align: right;color: red;font-size: 24px;"></i><h3 style="color:#fff;">Send Command</h3><select style="margin-top:10px;margin-bottom:10px;" placeholder="Identifier" class="form form-control newformcontrol" name="symbolCommand" id="symbolCommand'+sndCommand+'" ><option value="SGDCHF">SGDCHF </option><option value="NZDCHF">NZDCHF</option><option value="AUDCHF">AUDCHF</option><option value="SGDJPY">SGDJPY</option><option value="ZARJPY">ZARJPY</option><option value="TRYJPY">TRYJPY</option><option value="NZDCAD">NZDCAD</option><option value="GBPNZD">GBPNZD</option><option value="GBPCHF">GBPCHF</option><option value="GBPCAD">GBPCAD</option><option value="GBPAUD">GBPAUD</option><option value="EURNZD">EURNZD</option><option value="EURCHF">EURCHF</option><option value="EURCAD">EURCAD</option><option value="CADCHF">CADCHF</option><option value="AUDNZD">AUDNZD</option><option value="AUDCAD">AUDCAD</option><option value="GBPUSD">GBPUSD</option><option value="USDCHF">USDCHF</option><option value="USDCAD">USDCAD</option><option value="NZDUSD">NZDUSD</option><option value="NZDJPY">NZDJPY</option><option value="GBPJPY">GBPJPY</option><option value="EURGBP">EURGBP</option><option value="EURAUD">EURAUD</option><option value="CHFJPY">CHFJPY</option><option value="CADJPY">CADJPY</option><option value="AUDJPY">AUDJPY</option><option value="AUDUSD">AUDUSD</option><option value="EURJPY">EURJPY</option><option value="USDJPY">USDJPY</option><option value="EURUSD">EURUSD</option></select> <select style="margin-bottom:10px;" name="orderCommand" id="orderCommand'+sndCommand+'" class="form form-control newformcontrol"><option value="Buy">Buy</option><option value="Sell">Sell </option><option value="Close">Close</option></select> <input style="margin-bottom:10px;" type="number" class="form form-control newformcontrol" id="orderCommandPrice'+sndCommand+'" value="" placeholder="Unit Size"/><button name="executeCommand" style="border: none;" class="crypt-button-green-full" style="color:#fff !important;margin-top:10px;" id="executeCommand'+sndCommand+'" onclick="sendCommandFunction('+sndCommand+')"> Send Command </button></div>').draggable().resizable();







      }





</script>



<script type="text/javascript">

  function closeSendWindow(id)

  {

    var removeElement = "#sendCommandElement"+id;

    $(removeElement).remove();

  }

</script>



<script type="text/javascript">

  function sendCommandFunction(id)

  {

      var symbol = $('#symbolCommand'+id).val();

      var decision = $('#orderCommand'+id).val();

      $("#executeCommand"+id).html('Please wait');



       $.post('controller/order.controller.php', {symbol : symbol, decision : decision})

             .done(function(data){



              if (data == 'done') {



                var audioElement = document.createElement('audio');

                audioElement.setAttribute('src', 'sounds/ding.mp3');

                audioElement.play();



                $("#executeCommand"+id).html('Send Command');



              }



             });



  }

</script>



<script type="text/javascript">



  var inputCommandCount = 0;



  function addInputCommand()

  {

    inputCommandCount++;



    var divElement = "inputCommandLayout"+inputCommandCount;



    var rowElement = "rowElement"+inputCommandCount;



    $("#inputelement1").append('<div class="row sm-gutters" id="'+rowElement+'"><div class="col-md-6 col-lg-6 col-xl-4 col-xxl-4"><div class="row crypt-gross-market-cap mt-4"id="'+divElement+'"></div></div></div>');



    $("#"+divElement).append('<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 inputlayout"><i onclick="closeInputWindow('+inputCommandCount+')" class="fa fa-window-close" style="float: right;text-align: right;color: red;font-size: 24px;"></i><h3 style="text-align: center;">Input</h3><select placeholder="Identifier" class="form form-control newformcontrol" name="interest1" id="interest1'+inputCommandCount+'" ><option value="EUR_USD">EUR/USD</option><option value="USD_JPY">USD/JPY</option><option value="GBP_USD">GBP/USD</option><option value="GBP_JPY">GBP/JPY</option><option value="USD_CHF">USD/CHF</option><option value="NZD_USD">NZD/USD</option></select><input type="date" placeholder="Start Day" class="form form-control newformcontrol datepicker" name="interest2" id="interest2'+inputCommandCount+'" style="margin-top: 10px;" /><input type="date" placeholder="End Day" class="form form-control newformcontrol datepicker" name="interest4" id="interest4'+inputCommandCount+'" style="margin-top: 10px;" /><select class="form form-control newformcontrol" style="margin-top: 5px;" id="interest3'+inputCommandCount+'" placeholder="Time frame"><option value="M5">M5</option><option value="M15">M15</option><option value="M30">M30</option><option value="H1">H1</option><option value="H4">H4</option><option value="D">D1</option></select><input type="number" min="100" style="margin-top: 10px;" step="100" class="form form-control newformcontrol" placeholder="Units" name="amount" id="interest5'+inputCommandCount+'" /><div class="row" style="margin-top: 15px;"><div class="col-md-6"><div><a href="javascript:void(0)" onclick="calculate('+inputCommandCount+')" id="calculate'+inputCommandCount+'" class="crypt-button-green-full" style="font-size: 14px !important">Calculate</a></div></div><div class="col-md-6"><div><a href="javascript:void(0)" id="closeTrades" class="crypt-button-red-full" style="font-size: 14px !important">Close Trades</a></div></div></div></div>').draggable().resizable();



  }

</script>





 <script>

  $( function() {

    $( ".resizeableCommand" ).draggable();

     $( ".resizeableCommand" ).resizable();

  } );

  </script>

  <script type="text/javascript">

    function closeAlertBox()

    {

      $("#alertlayout").hide();

    }

  </script>



  <script type="text/javascript">

    function heatMapLayoutBtn()

    {

        $("#heatmpalayout").show();

    }

  </script>



  <script type="text/javascript">

    function closeHeatMap()

    {

      $("#heatmpalayout").hide();

    }

  </script>



  <script type="text/javascript">

    function closeInputWindow(id)

    {

      var rowdiv = "#rowElement"+id;

      $(rowdiv).remove();

    }

  </script>

  <script type="text/javascript">

    function alertSystemLayoutBtn()

    {

        $("#alertlayout").show();

    }

  </script>



  <script type="text/javascript">

    function calculate(id)

    {

      var intid1 = "#interest1"+id;

      var intid2 = "#interest2"+id;

      var intid3 = "#interest3"+id;

      var intid4 = "#interest4"+id;

      var intid5 = "#interest5"+id;



      var interest1 =  $(intid1).val();

      var interest2 =  $(intid2).val();

      var interest3 =  $(intid3).val();

      var interest4 =  $(intid4).val();

      var interest5 =  $(intid5).val();

      var calculateButton = "#calculate"+id;



      var refreshRate = 0;



      if(interest3 == "D")

      {

      refreshRate = 1000 * 60 * 60 * 24;  

      }

      else if(interest3 == "H4")

      {

      refreshRate = 1000 * 60 * 60 * 4;   

      }

      else if(interest3 == "H1")

      {

      refreshRate = 1000 * 60 * 60; 

      }

      else if(interest3 == "M30")

      {

      refreshRate = 1000 * 60 * 30; 

      }

      else if(interest3 == "H15")

      {

      refreshRate = 1000 * 60 * 15; 

      }

      else if(interest3 == "H5")

      {

      refreshRate = 1000 * 60 * 5;  

      }

      var temp = $("#calculate"+id).html();

      

      if(temp == "Stop"){

      $(calculateButton).html("Calculate");

      return false;

      }







      //       Allowing this to push the nodes through

      $.post('/controller/calculate.controller.php', { interest1 : interest1, interest2 : interest2, interest3 : interest3, interest4 : interest4, interest5 : interest5,  action : "calculate" })

      .done(function(data)

      {

      var info = jQuery.parseJSON(data);

      if(info.suggestion == "Short" || info.suggestion == "Strong Short"){

         $('#status').css('color', 'red');

      }

      else{

         $('#status').css('color', '#5cb85c');

      }



      var msg = "-------Invata.io------- \n" + "Suggestion: " + info.suggestion + "\nEntry Point: " + info.EntryPoint + "\nProfit Point: " + info.profitPoint + " \nStrength of Decision: " + info.strength + "%";

      $('#status').html(msg);





      });





      $(calculateButton).html("Stop");







    }

  </script>



  <script type="text/javascript">



      function outputCommand()

      {

        $("#outputLayout").show();

      }



  </script>

  <script type="text/javascript">

    function closeOutputBox()

    {

      $("#outputLayout").hide();

    }

  </script>



  <script type="text/javascript">

    

    function forexRates()

    {

      $("#bloobbergTv").show();

    }



  </script>



  <script type="text/javascript">

    function closeForexRate()

    {

      $("#bloobbergTv").hide();

    }

  </script>



  <script type="text/javascript">

    function forexHoursLayoutBtn()

    {

      $("#forexHoursLayout").show();

    }

    function closeForexHours()

    {

      $("#forexHoursLayout").hide();

    }

  </script>



  <script type="text/javascript">

    

    function forexScreenerLayoutBtn()

    {

      $("#forexScreenerLayout").show();

    }

  </script>

  <script type="text/javascript">

    function closeForexScreener()

    {

      $("#forexScreenerLayout").hide();

    }

  </script>