<?php
session_start(); 
include_once('lib_main.php');

$recaptcha_v=2;


$ztcells=0;
$dom = new DOMDocument();
     $dom->encoding = 'utf-8';
     $dom->xmlVersion = '1.0';
     $dom->formatOutput = true;

$table=$dom->appendChild($dom->createElement("table"));
     $table->setAttribute("id","usernew1"); 
     $table->setAttribute("align","center"); 
     $table->setAttribute("border","0");
     $table->setAttribute("size120"," ");

     $trow=$table->appendChild($dom->createElement("tr"));
          $trow->setAttribute("style","height:4em;");
          $tcell=$trow->appendChild($dom->createElement("td","Resetea Clave"));
               $tcell->setAttribute("colspan","2");
               $tcell->setAttribute("bold"," ");
               $tcell->setAttribute("style","font-size:150%");


     $trow=$table->appendChild($dom->createElement("tr"));
          $trow->setAttribute("style","height:4em;");
          $tcell=$trow->appendChild($dom->createElement("td"));
               $tcell->setAttribute("align","center");

               $tcell->setAttribute("colspan","2");
               $zdom=$dom;$zele=$tcell;
               $zlabel='Usuario'; $zid='user'; $zobj=1; $zsize=1.5; $zalign="center"; $zplace='e-mail o celular'; $ztxt=4;
//                $zvalue=$_COOKIE['user_email'];
               $zplace='e-mail'; 
               include('ele_input.php'); 


     $trow=$table->appendChild($dom->createElement("tr"));
          $trow->setAttribute("style","height:4em;");
          $tcell=$trow->appendChild($dom->createElement("td"));
               $tcell->setAttribute("align","center");
               $tcell->setAttribute("colspan","2");
               $zdom=$dom;$zele=$tcell;
               $zonenter='{user_reset1();}';
               $zlabel='Contraseña'; $zid='pass'; $zobj=1; $zwidth=''; $zsize=1.5; $zalign="center"; $zplace='contraseña nueva'; $ztype='password'; include('ele_input.php');

     $trow=$table->appendChild($dom->createElement("tr"));
          $tcell=$trow->appendChild($dom->createElement("td"));
          $tcell->setAttribute("align","center");
          
        //   $trow->setAttribute("style","height:0.0em;");

          $idrecap=$tcell->appendChild($dom->createElement("div"));
               if($recaptcha_v==2)
               {
                    $idrecap->setAttribute("id","recaptcha");
                    $idrecap->setAttribute("class","g-recaptcha");
                    $idrecap->setAttribute("data-sitekey","6LdlxwkUAAAAAGwDMddcIOndxwcCEdbfF2Gh26R-");
                    
                    if($_SERVER['SERVER_NAME']=='www.ecuataxi.com')
                    {$idrecap->setAttribute("data-sitekey","6Ld1XzIkAAAAAC0bYbIxpuacjvElHDp-SPAKA0Y9");}
                    
                    // if($_SERVER['SERVER_NAME']=='ecuamedico.com')
                    // {$idrecap->setAttribute("data-sitekey","6Ld1XzIkAAAAAC0bYbIxpuacjvElHDp-SPAKA0Y9");}
                    
               }
               




     $trow=$table->appendChild($dom->createElement("tr"));
          $trow->setAttribute("style","height:4em;");
          $tcell=$trow->appendChild($dom->createElement("td"));
               $tcell->setAttribute("colspan","2");
               $zdom=$dom;$zele=$tcell;
               if($recaptcha_v==2)
               {$zonclick='{if(recaptcha()){user_reset1();}}';}
               if($recaptcha_v==3)
               {$zonclick='{if(recaptcha_v3("registro","user_reset1()")){alert(1);}}';}
               $zlabel='Aceptar'; $zwidth='100%'; $zsize=1.5; $zalign="center"; $zcolor=$empr0['empr_color1']; include('ele_button.php'); 


echo $dom->saveXML();
?>

<script>document.title="<?php echo 'Resetea Clave';?>"</script>

<?php if(empty($_SESSION['user_codigo']) and $recaptcha_v==2){?>  
<script src="https://www.google.com/recaptcha/api.js" async defer></script>    

<!--<script src="https://www.google.com/recaptcha/api.js?render=6LdXALciAAAAAF5nqI5k1YkgQtWDGfflBgG0Oil-"></script>-->
<script type="text/javascript">
  var onloadCallback = function() {console.log("grecaptcha is ready!");};
</script>
<script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script>
<?php } ?>

<?php if(empty($_SESSION['user_codigo']) and $recaptcha_v==3){?>  
<script src="https://www.google.com/recaptcha/api.js?render=6LdXALciAAAAAF5nqI5k1YkgQtWDGfflBgG0Oil-"></script>
<?php } ?>



<!-- <script src="https://www.google.com/recaptcha/api.js"></script> -->
<!-- <script> function onSubmit(token) {document.getElementById("demo-form").submit();} </script> -->
<!-- <script src="https://www.google.com/recaptcha/api.js?render=6LfT8vQUAAAAACBvlURjN_eHNCeVMq-Ja0tCxN4V"></script> -->



<script>
function onClick(e)
{
     e.preventDefault();
     grecaptcha.ready(function()
     {
          grecaptcha.execute('6LfT8vQUAAAAACBvlURjN_eHNCeVMq-Ja0tCxN4V', {action: 'submit'}).then(function(token) {
          // Add your logic to submit to your backend server here.
     });
     });
}
</script>

