Advertisement
Guest User

Untitled

a guest
Jan 26th, 2015
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*if(!isset($_GET['id_client']) || empty($_GET['id_client']))
  3.         header("location:index.php");*/
  4.  
  5. require_once("inc/init.php");
  6. require_once("inc/session.php");
  7. require_once('inc/sql.php');
  8. require_once("inc/config.ui.php");
  9. $page_title = "Les prestations";
  10. $page_css[] = "your_style.css";
  11. include("inc/header.php");
  12. $page_nav["client"]["sub"]["Commandes"]["active"] = true;
  13. include("inc/nav.php");
  14.  
  15. $Temp = $Mysql->TabResSQL("SELECT * FROM KIT WHERE CODE='".$_GET['KIT']."' " );
  16.  
  17. $clientid=$_GET['id_client'];
  18.  
  19.  
  20.  
  21. ?>
  22.  
  23.     <script type='text/javascript'>
  24.         $('#myModal').on('shown.bs.modal', function () {
  25.             $('#myInput').focus()
  26.         })
  27.     </script>
  28.  
  29.     <!-- Button trigger modal -->
  30.  
  31.     <div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true" id='myModal'>
  32.     <div class="modal-dialog modal-lg greater">
  33.     <div class="modal-content">
  34.     <div class="modal-header">
  35.         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  36.  
  37.         <h4 class="modal-title" id="myModalLabel">Fenetre modale</h4>
  38.     </div>
  39.     <div class='col-md-3 one'>
  40.  
  41.         <img src='img/logothis.png'>
  42.         M-animations<br/>
  43.         <?php
  44.         $Mysql = new Mysql();
  45.         $array_action = $Mysql->TabResSQL('SELECT * FROM LIST_ANTENNE inner join MAPS_VILLE on LIST_ANTENNE.VILLE_DEPART=MAPS_VILLE.ID_VILLE where CODE='.LOC.'');
  46.  
  47.         foreach($array_action as $key){
  48.             echo    $key->NOM_ANTENNE. "<br/>";
  49.             echo     $key->NOM_VILLE. "<br/>";
  50.             echo     $key->ADRESSE. "<br/>";
  51.             echo    $key->NUM_TELEPHONE. "<br/>";
  52.  
  53.         }
  54.  
  55.         ?>
  56.         <br/>
  57.         <br/>
  58.         <?php
  59.         $Mysql = new Mysql();
  60.         $array_action = $Mysql->TabResSQL('SELECT DISTINCT ID_RESPONSABLE ,NAME FROM '.LOC.'_CLIENT inner join USERS on '.LOC.'_CLIENT.ID_RESPONSABLE=USERS.ID where ID='.$clientid.'');
  61.  
  62.         foreach($array_action as $key){
  63.             echo 'Affaire suivi par '.$key->NAME;
  64.         }
  65.         ?>
  66.  
  67.     </div>
  68.     <div class='clear'></div>
  69.  
  70.  
  71.     <div class="modal-body">
  72.     <style>
  73.  
  74.  
  75.         #wrapper {
  76.  
  77.             margin:0 auto;
  78.         }
  79.         legend {
  80.             margin-top: 20px;
  81.         }
  82.         #attribution {
  83.             font-size:12px;
  84.             color:#999;
  85.             padding:20px;
  86.             margin:20px 0;
  87.             border-top:1px solid #ccc;
  88.         }
  89.         #O_o {
  90.             float:right;
  91.             margin-top: 10px;
  92.             width:33%;
  93.             text-align: right;
  94.         }
  95.         #O_o a:link, #O_o a:visited {
  96.             color: #b4c9dd;
  97.             border-bottom: #b4c9dd;
  98.             display: block;
  99.             padding: 8px;
  100.             text-decoration: none;
  101.         }
  102.         #O_o a:hover, #O_o a:active {
  103.             color: #fff;
  104.             border-bottom: #fff;
  105.             text-decoration: none;
  106.         }
  107.         @media only screen and (max-width: 620px), only screen and (max-device-width: 620px) {
  108.             #wrapper {
  109.                 width: 90%;
  110.             }
  111.             legend {
  112.                 font-size: 24px;
  113.                 font-weight: 500;
  114.             }
  115.         }
  116.     </style>
  117.     <!-- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> -->
  118.  
  119.     <script type="text/javascript">
  120.         // if Google is down, it looks to local file...
  121.         if (typeof jQuery == 'undefined') {
  122.             document.write(unescape("%3Cscript src='js/jquery-1.10.2.min.js' type='text/javascript'%3E%3C/script%3E"));
  123.         }
  124.     </script>
  125.  
  126.     <script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <!-- only added as a smoke test for js conflicts -->
  127.     <script type="text/javascript" src="js/clone-form-td.js"></script>
  128.  
  129.  
  130.  
  131.     <div id="O_o"></div>
  132.     <div class='clear'></div>
  133.     <div id="wrapper" class='wrap_modal'>
  134.  
  135.         <form action="calculate.php" method="post" id="sign-up_area" role="form" class="form-inline">
  136.             <div class='col-xs-4 block_box' style='float:right;margin-top: -163px;text-align: right;'>
  137.                 <?php
  138.                 $client_id=$_GET['id_client'];
  139.  
  140.                 $Mysql = new Mysql();
  141.                 $array_action = $Mysql->TabResSQL('SELECT * FROM 59_CLIENT inner join MAPS_VILLE ON 59_CLIENT.ID_COMMUNE=MAPS_VILLE.ID_VILLE WHERE ID_CLIENT='.$client_id.' ');
  142.  
  143.                 foreach($array_action as $key){
  144.                     ?>
  145.                     Client: <input type='text' value='<?php echo $key->DENOMINATION_SOCIAL ;?>' name='denomination' class='form-control'><br/>
  146.                     Adresse: <input type='text' value='<?php echo $key-> ADRESSE_CLIENT ;?>' name='addrs' class='form-control'><br/>
  147.                     CP Ville: <input type='text' value='<?php echo $key-> CODE_VILLE ;?>' name='code' class='form-control'><br/>
  148.                     Ville: <input type='text' value='<?php echo $key-> NOM_VILLE ;?>' name='nomville' class='form-control'><br/>
  149.  
  150.  
  151.                 <?php } ?>
  152.             </div>
  153.             <div class='col-xs-2' style="margin-top: -41px;position: absolute;width: 100%;text-align: center;">
  154.                 Date: <input type='text' name='fordate' id='fordate' class='form-control' value='<?php $date=new DateTime();echo $date->format('d-m-Y') ;?>' readonly>
  155.                 <select class="select_periode form-control" name="periode" id="periode" required>
  156.                     <option disabled>Période</option>
  157.                     <?php
  158.                     $Mysql = new Mysql();
  159.                     $array_action = $Mysql->TabResSQL('SELECT * FROM TYPE_PERIODE_ACCUEIL');
  160.  
  161.                     foreach($array_action as $key){
  162.  
  163.                         echo '<option value='.$key->ID_PERIODE.'>'.$key->PERIODE.'</option>';
  164.                     }
  165.                     ?>
  166.  
  167.                 </select>
  168.             </div>
  169.             <div id="entry1" class="clonedInput">
  170.                 <h2 id="reference" name="reference" class="heading-reference"></h2>
  171.                 <fieldset>
  172.  
  173.                     <!-- Select Basic -->
  174.  
  175.                     <?php
  176.                     $Mysql = new Mysql();
  177.  
  178.                     //affiche le select avec la liste des kits
  179.                     $NombreDeKits = $Mysql->TabResSQL("SELECT * FROM KIT
  180.                                                                                         LEFT OUTER JOIN LISTE_ANIMATION ON LISTE_ANIMATION.ID_LISTE_ANIMATION=KIT.ID_LISTE_ANIMATION WHERE DATE_CREATION >=  '2014-01-01'
  181.                                                                                                 ORDER BY CODE ASC");
  182.                     $listekit = "";
  183.                     /*
  184.                                                                                                                             </optgroup>
  185.                     */
  186.                     $temp = "";
  187.                     foreach($NombreDeKits as $key){
  188.                         $finlistekit = "";
  189.                         if ($temp <> $key->ID_LISTE_ANIMATION){
  190.                             $listekit .= '<optgroup label="'.$key->NOM_ANIMATION.'">';
  191.                             $temp  = $key->ID_LISTE_ANIMATION;
  192.                         }
  193.                         $selected="";
  194.                         if($_GET['KIT'] == $key->CODE)
  195.                             $selected="selected='selected'";
  196.                         $listekit .= '<option '.$selected.' value="'.$key->CODE.'">'.$key->CODE.'</option>';
  197.                         $listekit .= $finlistekit;
  198.                     }
  199.  
  200.                     ?>
  201.                     <div class="form-inline col-xs-2 smaller" >
  202.                         <label>Choix du kit:</label>
  203.  
  204.                         <?php
  205.                         echo '<select class="select_ttl form-control required" name="kit[]" id="kit" >
  206.                                                                                                                         <option value="0">choisissez un kit !</option>
  207.                                                                                                                         '.$listekit.'
  208.                                                                                                                 </select>';
  209.                         ?>
  210.  
  211.                     </div>
  212.                     <!-- Text input-->
  213.  
  214.                     <div class="form-group col-xs-2 smalleranim">
  215.                         <label>L'animation:</label>
  216.                         <input id="animation" name="animation[]" type="text" placeholder="nom animation" class="input_animation form-control required"  value='' readonly  />
  217.                         <input id="anim" name="anim[]" type="hidden" placeholder="anim" class="input_anim form-control"  value='' />
  218.                         <input id="clientid" name="clientid" type="hidden" class="input_clientid form-control"  value='<?php echo $_GET['id_client'];?>' />
  219.  
  220.                     </div>
  221.  
  222.                     <!-- Text input-->
  223.  
  224.                     <div class="form-group col-xs-2 smallerpuht">
  225.                         <label>PU HT:</label>
  226.                         <input  id="prix" name="prix[]" type="number" placeholder="PU_HT" class="input_prix form-control required" value='' min='1'>
  227.                         <input  name="single_pdv[]" type="hidden"  class="single_pdv">
  228.  
  229.                     </div>
  230.                     <!-- Text input-->
  231.  
  232.                     <div class="form-group col-xs-2 smallerrem">
  233.                         <label>Qtit&eacute;:</label>
  234.                         <input value="1.00" id="quantity" name="quantity[]" type="number" placeholder="qtité" class="input_qtite form-control required" min="1.00" max='99.00'>
  235.  
  236.                     </div>
  237.                     <div class="form-group col-xs-2 smallerrem">
  238.                         <label>TVA:</label>
  239.                         <input id="tva" name="tva[]" value="" type="text" placeholder="TVA" class="input_tva form-control "  disabled >
  240.                         <input id="tva" name="tva[]" value="" type="hidden" placeholder="TVA" class="input_tva form-control "   >
  241.                     </div>
  242.                     <div class="form-group col-xs-2 smallerrem">
  243.                         <label>REM:</label>
  244.                         <input id="rem" name="rem[]" value="0" type="number" placeholder="REM" class="input_rem form-control " max='99' min='0'>
  245.  
  246.                     </div>
  247.                     <div class="form-group col-xs-2 smaller">
  248.                         <label>Total TTC:</label>
  249.                         <input id="totaltt" name="totaltt[]" type="number" placeholder="Total TT" class="input_totaltt form-control"  readonly>
  250.                         <input id="totaltt_tva" name='totaltt_tva[]' type="hidden"  class="input_totaltt_tva form-control">
  251.                     </div>
  252.                     <!-- Multiple Checkboxes (inline) -->
  253.  
  254.  
  255.                     <!-- Multiple Radios -->
  256.  
  257.             </div><!-- end #entry1 -->
  258.             <!-- Button (Double) -->
  259.  
  260.             <!-- Textarea -->
  261.             <br/>
  262.             <p class='move'>
  263.                 <button type="button" id="btnAdd" name="btnAdd" class="btn btn-info">Ajouter une ligne</button>
  264.                 <button type="button" id="btnDel" name="btnDel" class="btn btn-danger">supprimer ligne</button>
  265.             </p>
  266.             <div class="form-group col-xs-2 fraiskilom" style="width:100%;">
  267.                 <br/>
  268.                 <br/>
  269.                 <label style='float: left;margin-top: -24px;'>frais kilometrique:</label>
  270.                 <input id="kilom" name="kilom" type="number" placeholder="Frais kilometrique" class="input_kilom form-control" value='0.00'  step='0.01' style='float:left;' required />
  271.                 <input id="kilomtot" name="kilomtot" type="hidden" class="input_kilomtot form-control"  value='' style='float:left;' />
  272.                 <div class="righter" style='float:left;'> <a href='http://fr.mappy.com/' target='_blank'>calculer</a></div><br/><br/><br/><br/>
  273.             </div>
  274.             <div class='clear'></div>
  275.             <div class="form-group col-xs-2 peage" style="width:100%;">
  276.                 <label style='float: left;margin-top: -24px;'>Péage:</label>
  277.                 <input id="peage" name="peage" type="number" placeholder="Péage" class="input_peage form-control" value='0.00'  style='float:left;' required />
  278.             </div>
  279.  
  280.             <div class="form-group col-xs-2 go_left " >
  281.                 <br/>
  282.  
  283.             </div>
  284.  
  285.             <br/><br/><br/>
  286.  
  287.  
  288.             <!-- Multiple Checkboxes (inline) -->
  289.  
  290.  
  291.             <!-- Button -->
  292.             <div class='clear'></div><br/>
  293.             <textarea id="notes" name="notes" placeholder='Commentaire'     class="form-control"></textarea>
  294.             </fieldset>
  295.             <div id="O_o">
  296.                 <label>Total:</label>
  297.                 <input name='totalwith' id='totalwith' type='text' class='totalwith form-control' readonly> &euro; <br/>
  298.                 <label>TVA:</label>
  299.                 <input name='tvatotal' id='tvatotal' type='text' class='tvatotal form-control' readonly> &euro; <br/>
  300.                 <label>Total TTC:</label>
  301.                 <input name='alltotal' id='alltotal' type='text' class='allTotal form-control' readonly> &euro; <br/>
  302.                 <p>
  303.                     <input type='submit' id="submit_button" value='Valider' name="submit_button" class="btn btn-primary"></button>
  304.                 </p>
  305.             </div>
  306.         </form>
  307.  
  308.     </div> <!-- end wrapper -->
  309.  
  310.     </div>
  311.     <div class="modal-footer">
  312.         <!--<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>-->
  313.         <!--  <button type="button" class="btn btn-primary">Save changes</button>-->
  314.     </div>
  315.     </div>
  316.     </div>
  317.     </div>
  318.     <div class="jarviswidget jarviswidget-color-darken" data-widget-editbutton="false">
  319.  
  320.         <button type='button' class='btn btn-primary btn-lg btn-mine' data-toggle='modal' data-target='#myModal'>
  321.             Passer une nouvelle commande
  322.         </button>
  323.         <header>
  324.             <span class="widget-icon"> <i class="fa fa-table"></i> </span>
  325.         </header>
  326.  
  327.         <div>
  328.             <div class="jarviswidget-editbox">
  329.             </div>
  330.  
  331.             <div class="widget-body no-padding" style="overflow-x:scroll; overflow-y:scroll; float: right; width: 83%;" >
  332.                 <table id="dt_basic" class="table table-striped table-bordered table-hover"  width="100%">
  333.                     <thead>
  334.                     <tr>
  335.                         <th data-hide="phone">Id fact</th>
  336.                         <th data-hide="phone">Id client</th>
  337.                         <th data-class="expand">Type</th>
  338.                         <th data-class="expand">Id user</th>
  339.                         <th data-class="expand">Date</th>
  340.                         <th data-class="expand">Id anims</th>
  341.                         <th data-class="expand">Prix</th>
  342.                         <th data-class="expand">Tva</th>
  343.                         <th data-class="expand">Quantite</th>
  344.                         <th data-class="expand">Remise</th>
  345.                         <th data-class="expand">Remise tot</th>
  346.                         <th data-class="expand">Texte</th>
  347.                         <th data-class="expand">Adresse</th>
  348.                         <th data-class="expand">Date proformat</th>
  349.                         <th data-class="expand">Date passage fact</th>
  350.                         <th data-class="expand">Date payement</th>
  351.                         <th data-class="expand">Date relance 1</th>
  352.                         <th data-class="expand">Date relance 2</th>
  353.                         <th data-class="expand">Date contentieux</th>
  354.                     </tr>
  355.                     </thead>
  356.                     <tbody>
  357.                     <?php
  358.                     $id_client = $_GET['id_client'];
  359.                     $Mysql = new Mysql();
  360.                     $array_action = $Mysql->TabResSQL('SELECT * FROM '.LOC.'_FACT
  361.                                                                                                                                                         WHERE ID_CLIENT = '.$id_client.'
  362.                                                                                                                                                 ');
  363.                     foreach($array_action as $key){
  364.                         ?>
  365.                         <tr>
  366.                             <td><a href="/<?php echo $key->CHEMIN; ?>" target="_blank"><?php echo $key->ID_FACT; ?></a></td>
  367.                             <td><?php echo $key->ID_CLIENT; ?></a></td>
  368.                             <td><?php echo $key->TYPE; ?></a></td>
  369.                             <td><?php echo $key->ID_USERS; ?></a></td>
  370.                             <td><?php echo $key->DATE; ?></a></td>
  371.                             <td><?php echo $key->ID_ANIMS; ?></a></td>
  372.                             <td><?php echo $key->PRIX; ?></a></td>
  373.                             <td><?php echo $key->TVA; ?></a></td>
  374.                             <td><?php echo $key->QUANTITE; ?></a></td>
  375.                             <td><?php echo $key->REMISE; ?></a></td>
  376.                             <td><?php echo $key->REMISE_TOT; ?></a></td>
  377.                             <td><?php echo $key->TEXTE; ?></a></td>
  378.                             <td><?php echo $key->ADRESSE; ?></a></td>
  379.                             <td><?php echo $key->DATE_PROFORMAT; ?></a></td>
  380.                             <td><?php echo $key->DATE_PASSAGE_FACT; ?></a></td>
  381.                             <td><?php echo $key->DATE_PAYEMENT; ?></a></td>
  382.                             <td><?php echo $key->DATE_RELANCE1; ?></a></td>
  383.                             <td><?php echo $key->DATE_RELANCE2; ?></a></td>
  384.                             <td><?php echo $key->DATE_CONTENTIEUX; ?></a></td>
  385.                         </tr>
  386.                     <?php
  387.                     }
  388.                     ?>
  389.                     </tbody>
  390.                 </table>
  391.             </div>
  392.         </div>
  393.     </div>
  394.  
  395.     </div>
  396.     <style type=''>
  397.         input[type='text'], textarea, select {
  398.             border: solid 1px #999;
  399.         }
  400.         input[type='text'].focus, textarea.focus, select.focus {
  401.             border-color: #000 !important;
  402.         }
  403.         input[type='text'].invalid, textarea.invalid, select.invalid {
  404.             border-color: red;
  405.         }
  406.         input[type='text'].inactive, textarea.inactive, select.inactive, option.inactive {
  407.             color: #999;
  408.             font-style: italic;
  409.         }
  410.         input[type='text'].required, textarea.required {
  411.             background: url(required-input.png) right 5px no-repeat;
  412.         }
  413.  
  414.  
  415.         input[type='number'], textarea, select {
  416.             border: solid 1px #999;
  417.         }
  418.         input[type='number'].focus, textarea.focus, select.focus {
  419.             border-color: #000 !important;
  420.         }
  421.         input[type='number'].invalid, textarea.invalid, select.invalid {
  422.             border-color: red;
  423.         }
  424.         input[type='number'].inactive, textarea.inactive, select.inactive, option.inactive {
  425.             color: #999;
  426.             font-style: italic;
  427.         }
  428.         input[type='number'].required, textarea.required {
  429.             background: url(required-input.png) right 5px no-repeat;
  430.         }
  431.  
  432.     </style>
  433.     <script type="text/javascript">
  434.  
  435.         $(document).ready(function() {
  436.  
  437.  
  438.             $("#sign-up_area").validVal();
  439.         });
  440.         function calculateTva() {
  441.  
  442.             var totalPDV = 0;
  443.             $('.clonedInput').each(function(i,e){
  444.                 var pdv       = $(e).find('#tva').val();
  445.                 var total     = $(e).find('#totaltt_tva').val()
  446.                 var singlePDV = (total*pdv)/100;
  447.                 totalPDV      += singlePDV;
  448.             });
  449.             $('#tvatotal').val(totalPDV);
  450.  
  451.  
  452.         }
  453.         var totaltva=0;
  454.  
  455.         function calculateSingle(referentniSelect) {
  456.             console.log('here');
  457.             var quantity = parseFloat(referentniSelect.parents('fieldset').find('input[name="quantity[]"]').val());
  458.             var price = parseFloat(referentniSelect.parents('fieldset').find('input[name="prix[]"]').val());
  459.             var reduction =parseFloat( referentniSelect.parents('fieldset').find('input[name="rem[]"]').val());
  460.             var pdv = parseFloat(referentniSelect.parents('fieldset').find('input[name="tva[]"]').val());
  461.             var kilom= $('.input_kilom').val();
  462.  
  463.             if($('.input_kilom').val()==""){
  464.                 kilom=0;
  465.             }
  466.             sumkilom=kilom*0.4;
  467.             //  console.log(quantity,price,reduction,pdv);
  468.             if (reduction !=0){
  469.                 reduction = reduction/100;
  470.  
  471.             }
  472.             sum = parseFloat(((price - ((reduction)*price)) * quantity )+(price*pdv)/100);
  473.             sum=sum.toFixed(2);
  474.  
  475.             return sum;
  476.  
  477.         }
  478.         $('body').on('keyup','.input_prix , .input_qtite , .input_tva , .input_rem , .input_kilom ', function(){
  479.  
  480.             referentniSelect = $(this).parents('fieldset').find('select');
  481.             referentniSelect.parents('fieldset').find('.input_totaltt').val(calculateSingle(referentniSelect));
  482.             calculateTotal();
  483.         });
  484.  
  485.         $('body').on('change','.select_ttl',function(e){
  486.  
  487.  
  488.             var kit=$(this).val();
  489.             var referentniSelect=$(this);
  490.             //console.log(" this : " +kit);
  491.  
  492.             $.getJSON('/getanimation.php?kit=' + kit, null,
  493.                 function(data)
  494.                 {
  495.                     console.log('here');
  496.                     console.log(data.animation);
  497.                     //  console.log("data  : " +data.prix);
  498.                     // $("#kit").this(data.kit);
  499.                     //  console.log(" this : " +$(this));
  500.                     //select.parent().next().find('input').first().val(data.kit);
  501.  
  502.                     referentniSelect.parents('fieldset').find('input[name="animation[]"]').val(data.animation);
  503.                     referentniSelect.parents('fieldset').find('input[name="prix[]"]').val(data.prix);
  504.                     referentniSelect.parents('fieldset').find('input[name="anim[]"]').val(data.anim);
  505.                     referentniSelect.parents('fieldset').find('input[name="tva[]"]').val(data.tva);
  506.                     referentniSelect.parents('fieldset').find('input[name="totaltt_tva[]"]').val(data.prix);
  507.                     console.log(data.anim);
  508.                     //price_all = price_all += price;
  509.                     //   $("#prix").this(data.prix);
  510.                     // console.log(referentniSelect);
  511.  
  512.                     referentniSelect.parents('fieldset').find('.input_totaltt').val(calculateSingle(referentniSelect));
  513.                     console.log(referentniSelect.parents('fieldset').find('.input_totaltt'),'total');
  514.                     console.log('calculate single' +calculateSingle(referentniSelect));
  515.                     calculateTva();
  516.                     calculateTotal();
  517.  
  518.                 });
  519.  
  520.         });
  521.     </script>
  522.     <script type="text/javascript">
  523.  
  524.  
  525.         function calculateTotal() {
  526.  
  527.             total = 0;
  528.  
  529.             $('.input_totaltt_tva').each(function(i,e){
  530.                 tempTotal=0;
  531.                 if($(e).val() != "") {
  532.                     tempTotal = $(e).val();
  533.                 }
  534.                 total += parseFloat(tempTotal);
  535.  
  536.             });
  537.             /*  if($('.input_kilom').val().length==0){
  538.              total=total;
  539.              }else{
  540.  
  541.              total=total+(0.4*parseFloat($('.input_kilom').val()));
  542.              }*/
  543.             fin=0;
  544.             vazi=0;
  545.             vazi=$('#tvatotal').val();
  546.             fin+= total + vazi;
  547.             console.log(fin);
  548.  
  549.  
  550.  
  551.             $('.totalwith').val((total).toFixed(2));
  552.             // $('.tvatotal').val((tvatotal).toFixed(2));
  553.             $('.allTotal').val((fin).toFixed(2));
  554.  
  555.  
  556.             /*  kmh=0;
  557.              kmh=parseFloat(0.4*($('.input_kilom').val()));
  558.  
  559.              $('.input_kilomtot').val((kmh).toFixed(2));*/
  560.         }
  561.  
  562.     </script>
  563. <?php // include page footer
  564. include ("inc/footer.php");
  565. ?>
  566.     <!-- END PAGE FOOTER -->
  567.  
  568.     <script type="text/javascript">
  569.  
  570.         // DO NOT REMOVE : GLOBAL FUNCTIONS!
  571.  
  572.         $(document).ready(function() {
  573.  
  574.             /* // DOM Position key index //
  575.  
  576.              l - Length changing (dropdown)
  577.              f - Filtering input (search)
  578.              t - The Table! (datatable)
  579.              i - Information (records)
  580.              p - Pagination (paging)
  581.              r - pRocessing
  582.              < and > - div elements
  583.              <"#id" and > - div with an id
  584.              <"class" and > - div with a class
  585.              <"#id.class" and > - div with an id and class
  586.  
  587.              Also see: http://legacy.datatables.net/usage/features
  588.              */
  589.  
  590.             /* BASIC ;*/
  591.             var responsiveHelper_dt_basic = undefined;
  592.             var responsiveHelper_datatable_fixed_column = undefined;
  593.             var responsiveHelper_datatable_col_reorder = undefined;
  594.             var responsiveHelper_datatable_tabletools = undefined;
  595.  
  596.             var breakpointDefinition = {
  597.                 tablet : 1024,
  598.                 phone : 480
  599.             };
  600.  
  601.             $('#dt_basic').dataTable({
  602.                 "sDom": "<'dt-toolbar'<'col-xs-12 col-sm-6'f><'col-sm-6 col-xs-12 hidden-xs'l>r>"+
  603.                     "t"+
  604.                     "<'dt-toolbar-footer'<'col-sm-6 col-xs-12 hidden-xs'i><'col-xs-12 col-sm-6'p>>",
  605.                 "autoWidth" : true,
  606.                 "preDrawCallback" : function() {
  607.                     // Initialize the responsive datatables helper once.
  608.                     if (!responsiveHelper_dt_basic) {
  609.                         responsiveHelper_dt_basic = new ResponsiveDatatablesHelper($('#dt_basic'), breakpointDefinition);
  610.                     }
  611.                 },
  612.                 "rowCallback" : function(nRow) {
  613.                     responsiveHelper_dt_basic.createExpandIcon(nRow);
  614.                 },
  615.                 "drawCallback" : function(oSettings) {
  616.                     responsiveHelper_dt_basic.respond();
  617.                 }
  618.             });
  619.  
  620.             /* END BASIC */
  621.  
  622.             /* COLUMN FILTER  */
  623.             var otable = $('#datatable_fixed_column').DataTable({
  624.                 //"bFilter": false,
  625.                 //"bInfo": false,
  626.                 //"bLengthChange": false
  627.                 //"bAutoWidth": false,
  628.                 //"bPaginate": false,
  629.                 //"bStateSave": true // saves sort state using localStorage
  630.                 "sDom": "<'dt-toolbar'<'col-xs-12 col-sm-6 hidden-xs'f><'col-sm-6 col-xs-12 hidden-xs'<'toolbar'>>r>"+
  631.                     "t"+
  632.                     "<'dt-toolbar-footer'<'col-sm-6 col-xs-12 hidden-xs'i><'col-xs-12 col-sm-6'p>>",
  633.                 "autoWidth" : true,
  634.                 "preDrawCallback" : function() {
  635.                     // Initialize the responsive datatables helper once.
  636.                     if (!responsiveHelper_datatable_fixed_column) {
  637.                         responsiveHelper_datatable_fixed_column = new ResponsiveDatatablesHelper($('#datatable_fixed_column'), breakpointDefinition);
  638.                     }
  639.                 },
  640.                 "rowCallback" : function(nRow) {
  641.                     responsiveHelper_datatable_fixed_column.createExpandIcon(nRow);
  642.                 },
  643.                 "drawCallback" : function(oSettings) {
  644.                     responsiveHelper_datatable_fixed_column.respond();
  645.                 }
  646.  
  647.             });
  648.  
  649.             // custom toolbar
  650.             $("div.toolbar").html('<div class="text-right"><img src="img/logo.png" alt="SmartAdmin" style="width: 111px; margin-top: 3px; margin-right: 10px;"></div>');
  651.  
  652.             // Apply the filter
  653.             $("#datatable_fixed_column thead th input[type=text]").on( 'keyup change', function () {
  654.  
  655.                 otable
  656.                     .column( $(this).parent().index()+':visible' )
  657.                     .search( this.value )
  658.                     .draw();
  659.  
  660.             } );
  661.             /* END COLUMN FILTER */
  662.  
  663.             /* COLUMN SHOW - HIDE */
  664.             $('#datatable_col_reorder').dataTable({
  665.                 "sDom": "<'dt-toolbar'<'col-xs-12 col-sm-6'f><'col-sm-6 col-xs-6 hidden-xs'C>r>"+
  666.                     "t"+
  667.                     "<'dt-toolbar-footer'<'col-sm-6 col-xs-12 hidden-xs'i><'col-sm-6 col-xs-12'p>>",
  668.                 "autoWidth" : true,
  669.                 "preDrawCallback" : function() {
  670.                     // Initialize the responsive datatables helper once.
  671.                     if (!responsiveHelper_datatable_col_reorder) {
  672.                         responsiveHelper_datatable_col_reorder = new ResponsiveDatatablesHelper($('#datatable_col_reorder'), breakpointDefinition);
  673.                     }
  674.                 },
  675.                 "rowCallback" : function(nRow) {
  676.                     responsiveHelper_datatable_col_reorder.createExpandIcon(nRow);
  677.                 },
  678.                 "drawCallback" : function(oSettings) {
  679.                     responsiveHelper_datatable_col_reorder.respond();
  680.                 }
  681.             });
  682.  
  683.             /* END COLUMN SHOW - HIDE */
  684.  
  685.             /* TABLETOOLS */
  686.             $('#datatable_tabletools').dataTable({
  687.  
  688.                 // Tabletools options:
  689.                 //   https://datatables.net/extensions/tabletools/button_options
  690.                 "sDom": "<'dt-toolbar'<'col-xs-12 col-sm-6'f><'col-sm-6 col-xs-6 hidden-xs'T>r>"+
  691.                     "t"+
  692.                     "<'dt-toolbar-footer'<'col-sm-6 col-xs-12 hidden-xs'i><'col-sm-6 col-xs-12'p>>",
  693.                 "oTableTools": {
  694.                     "aButtons": [
  695.                         "copy",
  696.                         "csv",
  697.                         "xls",
  698.                         {
  699.                             "sExtends": "pdf",
  700.                             "sTitle": "SmartAdmin_PDF",
  701.                             "sPdfMessage": "SmartAdmin PDF Export",
  702.                             "sPdfSize": "letter"
  703.                         },
  704.                         {
  705.                             "sExtends": "print",
  706.                             "sMessage": "Generated by SmartAdmin <i>(press Esc to close)</i>"
  707.                         }
  708.                     ],
  709.                     "sSwfPath": "js/plugin/datatables/swf/copy_csv_xls_pdf.swf"
  710.                 },
  711.                 "autoWidth" : true,
  712.                 "preDrawCallback" : function() {
  713.                     // Initialize the responsive datatables helper once.
  714.                     if (!responsiveHelper_datatable_tabletools) {
  715.                         responsiveHelper_datatable_tabletools = new ResponsiveDatatablesHelper($('#datatable_tabletools'), breakpointDefinition);
  716.                     }
  717.                 },
  718.                 "rowCallback" : function(nRow) {
  719.                     responsiveHelper_datatable_tabletools.createExpandIcon(nRow);
  720.                 },
  721.                 "drawCallback" : function(oSettings) {
  722.                     responsiveHelper_datatable_tabletools.respond();
  723.                 }
  724.             });
  725.  
  726.             /* END TABLETOOLS */
  727.  
  728.         })
  729.  
  730.     </script>
  731. <?php
  732.  
  733. include("inc/script1.php");
  734. ?>
  735.     <!-- PAGE RELATED PLUGIN(S) -->
  736.     <script src="<?php echo ASSETS_URL; ?>/js/plugin/datatables/jquery.dataTables.min.js"></script>
  737.     <script src="<?php echo ASSETS_URL; ?>/js/plugin/datatables/dataTables.colVis.min.js"></script>
  738.     <script src="<?php echo ASSETS_URL; ?>/js/plugin/datatables/dataTables.tableTools.min.js"></script>
  739.     <script src="<?php echo ASSETS_URL; ?>/js/plugin/datatables/dataTables.bootstrap.min.js"></script>
  740.     <script src="<?php echo ASSETS_URL; ?>/js/plugin/datatable-responsive/datatables.responsive.min.js"></script>
  741. <?php
  742. //include footer
  743. include ("inc/google-analytics.php");
  744. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement