Guest User

Untitled

a guest
Nov 11th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 17.14 KB | None | 0 0
  1. <?php
  2. // *************************************************************************
  3. // *                                                                       *
  4. // * DEPRIXA -  Integrated Web system                                      *
  5. // * Copyright (c) JAOMWEB. All Rights Reserved                            *
  6. // *                                                                       *
  7. // *************************************************************************
  8. // *                                                                       *
  9. // * Email: osorio2380@yahoo.es                                            *
  10. // * Website: http://www.jaom.info                                         *
  11. // *                                                                       *
  12. // *************************************************************************
  13. // *                                                                       *
  14. // * This software is furnished under a license and may be used and copied *
  15. // * only  in  accordance  with  the  terms  of such  license and with the *
  16. // * inclusion of the above copyright notice.                              *
  17. // * If you Purchased from Codecanyon, Please read the full License from   *
  18. // * here- http://codecanyon.net/licenses/standard                         *
  19. // *                                                                       *
  20. // *************************************************************************
  21.  
  22. error_reporting(E_ERROR | E_WARNING | E_PARSE);
  23. require_once('../../database.php');
  24. require_once ('validaciones.php');
  25. require_once ('../../funciones.php');
  26. require '../../requirelanguage.php';
  27. require '../../css/GUMP/gump.class.php';
  28.            
  29.  
  30.     ## Validos los valores que llegan del formulario
  31.     $validator = new GUMP();
  32.  
  33.     // sanitizo la variable POST
  34.     $_POST = $validator->sanitize($_POST);
  35.  
  36.     // defino reglas y filtros
  37.     $validator->filter_rules( array(
  38.         'fname'         => 'trim|sanitize_string',
  39.         'lname'         => 'trim|sanitize_string',
  40.         'password'      => 'trim',
  41.         'email'         => 'trim|sanitize_email',
  42.         'phone'         => 'trim|sanitize_string',
  43.         'telefono'      => 'trim|sanitize_string',
  44.         'address'       => 'trim|sanitize_string',
  45.         'country'       => 'trim|sanitize_numbers',
  46.         'department'    => 'trim|sanitize_string',
  47.         'state'         => 'trim|sanitize_string',
  48.         'iso'           => 'trim|sanitize_string',
  49.         'zipcode'       => 'trim|sanitize_numbers',
  50.         'lang'          => 'trim|sanitize_string' ));
  51.  
  52.     $validator->validation_rules( array(
  53.         'fname'         => 'required|valid_name|min_len,3',
  54.         'lname'         => 'required|valid_name|min_len,3',
  55.         'password'      => 'required|min_len,6',
  56.         'email'         => 'required|valid_email',
  57.         'phone'         => 'required',
  58.         'address'       => 'required',
  59.         'country'       => 'required|integer|max_len,4',
  60.         'department'    => 'required',
  61.         'state'         => 'required',
  62.         'iso'           => 'required',
  63.         'zipcode'       => 'required',
  64.         'lang'          => 'required|alpha_dash'));
  65.  
  66.     // se realiza las validaciones
  67.     $validated_data = $validator->run($_POST);
  68.  
  69.     # si hubo errores lo informamos
  70.     if($validated_data === false) {
  71.         header ( "Location: ../../../signup.php?tipo=danger&mensaje=".$validator->get_readable_errors(true));
  72.     } else {
  73.         #
  74.         ## Obtengo los datos del formulario y los sanitizo medianamente
  75.         $locker         = $_POST['locker'];
  76.         $name           = $_POST['fname']." ".$_POST['lname'];
  77.         $cc             = $_POST['cc'];
  78.         $company        = $_POST['company'];
  79.         $email          = $_POST['email'];
  80.         $code_phone     = $_POST['code_phone'];
  81.         $phone          = $_POST['phone'];
  82.         $code_phone1    = $_POST['code_phone1'];
  83.         $telefono       = $_POST['telefono'];
  84.         $address        = $_POST['address'];
  85.         $country        = $_POST['country'];
  86.         $department     = $_POST['department'];
  87.         $state          = $_POST['state'];
  88.         $iso            = $_POST['iso'];
  89.         $zipcode        = $_POST['zipcode'];
  90.         $pass           = $_POST['password'];
  91.         $pwdmd5         = md5(PASS_SALT.$_POST['password']); #pass with salt
  92.         $lang           = $_POST['lang'];
  93.         //$imagen           = $_POST['imagen'];
  94.  
  95.         #
  96.         ## Cargo la imagen por defecto
  97.         //$tipo_imagen = "image/png";
  98.         //$url = APP_URL."/img/user_image.png";
  99.  
  100.         /*$imagen = imagecreatefromstring(file_get_contents($url));
  101.         imagealphablending($imagen, true);
  102.         imagesavealpha($imagen, true);
  103.  
  104.         ob_start();
  105.         imagepng($imagen);
  106.         $string = ob_get_contents();
  107.         ob_end_clean();*/
  108.        
  109.         $pa=mysqli_query($dbConn, "SELECT MAX(locker)as maximo FROM tbl_clients");             
  110.         if($row=mysqli_fetch_array($pa)){
  111.             if($row['maximo']==NULL){
  112.                 $locker='100001';
  113.             }else{
  114.                 $locker=$row['maximo']+1;
  115.             }
  116.         }
  117.        
  118.        
  119.         $sql1 =mysqli_query($dbConn, "SELECT email FROM tbl_clients WHERE email='$email'");
  120.             if($row=mysqli_fetch_array($sql1)){                        
  121.                  echo "<script type=\"text/javascript\">
  122.                         alert(\"$email $yaestaemail.\");
  123.                         window.location = \"../../../signup.php\"
  124.                     </script>";                            
  125.             }else{
  126.                
  127.                 $sql1="INSERT INTO tbl_clients (locker,name,cc,email,phone,telefono,address,password,country,department,state,iso,zipcode,lang,estado,company,date) VALUES  
  128.                 ('$dbConn','$locker','$name','$cc','$email','$code_phone$phone','$code_phone1$telefono','$address','$pwdmd5','$country','$department','$state','$iso','$zipcode','$lang',1,'$company',curdate())";
  129.             }
  130.         dbQuery($sql1);
  131.        
  132.         $result1 =  mysqli_query("SELECT * FROM company");
  133.         while($row = mysqli_fetch_array($result1)) {
  134.         $to  = $row["bemail"];
  135.         $address  = $row["caddress"];
  136.         $namecompanie  = $row["cname"];
  137.         $footer  = $row["footer_website"];
  138.         $web  = $row["website"];
  139.         $infolocker = $row["locker"];
  140.         $dirslocker = $row["dirlocker"];
  141.         //$url = APP_URL."/logo-image/image_logo.php?id=1'";
  142.         // subject
  143.        
  144.         $subject = ''.$welcometo.' '.$row["cname"].'';
  145.         $from = $row["bemail"];
  146.        
  147.         $message  = "<html><body>";
  148.         $message .= "<div style='font-family:HelveticaNeue-Light,Arial,sans-serif;background-color:#eeeeee'>
  149.                     <table align='center' width='100%' border='0' cellspacing='0' cellpadding='0' bgcolor='#eeeeee'>
  150.                         <tbody>
  151.                             <tr>
  152.                                 <td>
  153.                                     <table align='center' width='750px' border='0' cellspacing='0' cellpadding='0' bgcolor='#eeeeee' style='width:750px!important'>
  154.                                     <tbody>
  155.                                         <tr>
  156.                                             <td>
  157.                                                 <table width='690' align='center' border='0' cellspacing='0' cellpadding='0' bgcolor='#eeeeee'>
  158.                                                 <tbody>
  159.                                                     <tr>
  160.                                                         <td colspan='3' height='80' align='center' border='0' cellspacing='0' cellpadding='0' bgcolor='#eeeeee' style='padding:0;margin:0;font-size:0;line-height:0'>
  161.                                                             <table width='690' align='center' border='0' cellspacing='0' cellpadding='0'>
  162.                                                             <tbody>
  163.                                                                 <tr>
  164.                                                                     <td width='30'></td>
  165.                                                                     <td align='left' valign='middle' style='padding:0;margin:0;font-size:0;line-height:0'><a href='$web' target='_blank'><img src='$url' alt='DEPRIXA' ></a></td>
  166.                                                                     <td width='30'></td>
  167.                                                                 </tr>
  168.                                                             </tbody>
  169.                                                             </table>
  170.                                                         </td>
  171.                                                     </tr>
  172.                                                     <tr>
  173.                                                         <td colspan='3' align='center'>
  174.                                                             <table width='630' align='center' border='0' cellspacing='0' cellpadding='0'>
  175.                                                             <tbody>
  176.                                                                 <tr>
  177.                                                                     <td colspan='3' height='60'></td></tr><tr><td width='25'></td>
  178.                                                                     <td align='center'>
  179.                                                                         <h1 style='font-family:HelveticaNeue-Light,arial,sans-serif;font-size:40px;color:#404040;line-height:40px;font-weight:bold;margin:0;padding:0'>$welcometo $namecompanie</h1>
  180.                                                                     </td>
  181.                                                                     <td width='25'></td>
  182.                                                                 </tr>
  183.                                                                 <tr>
  184.                                                                     <td colspan='3' height='40'></td></tr><tr><td colspan='5' align='center'>
  185.                                                                         <p style='color:#404040;font-size:16px;line-height:24px;font-weight:lighter;padding:0;margin:0'>$hola <strong>$name</strong></p><br>
  186.                                                                         <p style='color:#404040;font-size:16px;line-height:22px;font-weight:lighter;padding:0;margin:0'>
  187.                                                                         $calidawelcome</p>
  188.                                                                     </td>
  189.                                                                 </tr>
  190.                                                                 <tr>
  191.                                                             </tr>
  192.                                                             <tr><td colspan='3' height='30'></td></tr>
  193.                                                         </tbody>
  194.                                                         </table>
  195.                                                     </td>
  196.                                                 </tr>
  197.                                                
  198.                                                 <tr bgcolor='#ffffff'>
  199.                                                     <td width='30' bgcolor='#eeeeee'></td>
  200.                                                     <td>
  201.                                                         <table width='570' align='center' border='0' cellspacing='0' cellpadding='0'>
  202.                                                         <tbody>
  203.                                                            
  204.                                                             <tr>
  205.                                                                 <td colspan='4' align='center'>&nbsp;</td>
  206.                                                             </tr>
  207.                                                             <tr>
  208.                                                                 <td colspan='4' align='center'><h2 style='font-size:24px'>Información de Casillero</h2></td>
  209.                                                             </tr>
  210.                                                            
  211.                                                             <tr>
  212.                                                                 <td width='120' align='right' valign='top'><img src='http://deprixapro.jaom.info/casillero.png' alt='tool' width='84' height='140'></td>
  213.                                                                 <td width='30'></td>
  214.                                                                 <td align='left' valign='middle'>
  215.                                                                     <h3 style='color:#404040;font-size:18px;line-height:24px;padding:0;margin:0'>$infolocker</h3>
  216.                                                                     <div style='line-height:5px;padding:0;margin:0'>&nbsp;</div>
  217.                                                                     </br>
  218.                                                                     <div style='color:#FF4D4D;font-size:16px;line-height:22px;font-weight:lighter;padding:0;margin:0'><strong>$dirslocker</strong></div>
  219.                                                                     <div style='line-height:10px;padding:0;margin:0'>&nbsp;</div>
  220.                                                                 </td>
  221.                                                                 <td width='30'></td>
  222.                                                             </tr>
  223.                                                             </br>
  224.                                                             <tr>
  225.                                                                 <td colspan='4' align='center'>&nbsp;</td>
  226.                                                             </tr>
  227.                                                             <tr>
  228.                                                                 <td colspan='4' align='center'><h2 style='font-size:24px'>$infoclientee</h2></td>
  229.                                                             </tr>
  230.                                                             <tr>
  231.                                                                 <td colspan='4'>&nbsp;</td>
  232.                                                             </tr>
  233.                                                             <tr>
  234.                                                                 <td width='120' align='right' valign='top'><img src='http://deprixapro.jaom.info/customer.png' alt='tool' width='59' height='108'></td>
  235.                                                                 <td width='30'></td>
  236.                                                                 <td align='left' valign='middle'>
  237.                                                                     <h3 style='color:#404040;font-size:18px;line-height:24px;font-weight:bold;padding:0;margin:0'>$namecustomers:</h3>
  238.                                                                     <div style='line-height:5px;padding:0;margin:0'>&nbsp;</div>
  239.                                                                     <div style='color:#404040;font-size:16px;line-height:22px;font-weight:lighter;padding:0;margin:0'><strong>$name</strong></div>
  240.                                                                     <div style='line-height:10px;padding:0;margin:0'>&nbsp;</div>
  241.                                                                 </td>
  242.                                                                 <td align='left' valign='middle'>
  243.                                                                     <h3 style='color:#404040;font-size:18px;line-height:24px;font-weight:bold;padding:0;margin:0'>$lockerid:</h3>
  244.                                                                     <div style='line-height:5px;padding:0;margin:0'>&nbsp;</div>
  245.                                                                     <div style='color:#404040;font-size:16px;line-height:22px;font-weight:lighter;padding:0;margin:0'><strong>$locker</strong></div>
  246.                                                                     <div style='line-height:10px;padding:0;margin:0'>&nbsp;</div>
  247.                                                                 </td>
  248.                                                                 <td width='30'></td>
  249.                                                             </tr>
  250.                                                             <tr>
  251.                                                                 <td colspan='5' height='40' style='padding:0;margin:0;font-size:0;line-height:0'></td>
  252.                                                             </tr>
  253.                                                             <tr>
  254.                                                                 <td width='120' align='right' valign='top'><img src='http://deprixapro.jaom.info/username.png' alt='no fees' width='46' height='45'></td>
  255.                                                                 <td width='30'></td>
  256.                                                                 <td align='left' valign='middle'>
  257.                                                                     <h3 style='color:#404040;font-size:18px;line-height:24px;font-weight:bold;padding:0;margin:0'>$placeuser:</h3>
  258.                                                                     <div style='line-height:5px;padding:0;margin:0'>&nbsp;</div>
  259.                                                                     <div style='color:#404040;font-size:16px;line-height:22px;font-weight:lighter;padding:0;margin:0'><strong>$email</strong></div>
  260.                                                                     <div style='line-height:10px;padding:0;margin:0'>&nbsp;</div>
  261.                                                                 </td>
  262.                                                                 <td width='30'></td>
  263.                                                             </tr>
  264.                                                             <tr>
  265.                                                                 <td colspan='5' height='40' style='padding:0;margin:0;font-size:0;line-height:0'></td>
  266.                                                             </tr>
  267.                                                             <tr>
  268.                                                                 <td width='120' align='right' valign='top'><img src='http://deprixapro.jaom.info/password.png' alt='creditibility' width='46' height='45' class='CToWUd'></td>
  269.                                                                 <td width='30'></td>
  270.                                                                 <td align='left' valign='middle'>
  271.                                                                     <h3 style='color:#404040;font-size:18px;line-height:24px;font-weight:bold;padding:0;margin:0'>$password:</h3>
  272.                                                                     <div style='line-height:5px;padding:0;margin:0'>&nbsp;</div>
  273.                                                                     <div style='color:#404040;font-size:16px;line-height:22px;font-weight:lighter;padding:0;margin:0'><strong>$pass</strong></div>
  274.                                                                     <div style='line-height:10px;padding:0;margin:0'>&nbsp;</div>
  275.                                                                 </td>
  276.                                                                 <td width='30'></td>
  277.                                                             </tr>
  278.                                                             <tr>
  279.                                                                 <td colspan='4'>&nbsp;</td>
  280.                                                             </tr>
  281.                                                         </tbody>
  282.                                                         </table>
  283.                                                         <table width='570' align='center' border='0' cellspacing='0' cellpadding='0'>
  284.                                                             <tbody>                                    
  285.                                                                 <tr>
  286.                                                                     <td align='center'>
  287.                                                                         <div style='text-align:center;width:100%;padding:40px 0'>
  288.                                                                             <table align='center' cellpadding='0' cellspacing='0' style='margin:0 auto;padding:0'>
  289.                                                                             <tbody>
  290.                                                                                 <tr>
  291.                                                                                     <td align='center' style='margin:0;text-align:center'><a href='$web' style='font-size:18px;font-family:HelveticaNeue-Light,Arial,sans-serif;line-height:22px;text-decoration:none;color:#ffffff;font-weight:bold;border-radius:2px;background-color:#00a3df;padding:14px 40px;display:block' target='_blank'>$L_clientsntry</a></td>
  292.                                                                                 </tr>
  293.                                                                             </tbody>
  294.                                                                             </table>
  295.                                                                         </div>
  296.                                                                     </td>
  297.                                                               </tr>
  298.                                                               <tr><td>&nbsp;</td>
  299.                                                               </tr>
  300.                                                               <tr>
  301.                                                                 <td>
  302.                                                                     <h2 style='color:#404040;font-size:22px;font-weight:bold;line-height:26px;padding:0;margin:0'>&nbsp;</h2>
  303.                                                                     <div style='color:#404040;font-size:16px;line-height:22px;font-weight:lighter;padding:0;margin:0'>$hola $name $estaes <br /><br /> <strong> $address $porfavor</div>
  304.                                                                 </td>
  305.                                                             </tr>
  306.                                                             <tr><td>&nbsp;</td>
  307.                                                             </tbody>
  308.                                                         </table>
  309.                                                     </td>
  310.                                                     <td width='30' bgcolor='#eeeeee'></td>
  311.                                                 </tr>
  312.                                                 </tbody>
  313.                                                 </table>
  314.                                                 <table align='center' width='750px' border='0' cellspacing='0' cellpadding='0' bgcolor='#eeeeee' style='width:750px!important'>
  315.                                                 <tbody>
  316.                                                     <tr>
  317.                                                         <td>
  318.                                                             <table width='630' align='center' border='0' cellspacing='0' cellpadding='0' bgcolor='#eeeeee'>
  319.                                                             <tbody>
  320.                                                                 <tr><td colspan='2' height='30'></td></tr>
  321.                                                                 <tr>
  322.                                                                     <td width='360' valign='top'>
  323.                                                                         <div style='color:#a3a3a3;font-size:12px;line-height:12px;padding:0;margin:0'>$footer</div>
  324.                                                                         <div style='line-height:5px;padding:0;margin:0'>&nbsp;</div>
  325.                                                                         <div style='color:#a3a3a3;font-size:12px;line-height:12px;padding:0;margin:0'>$namecompany</div>
  326.                                                                     </td>
  327.                                                                     <td align='right' valign='top'>
  328.                                                                         <span style='line-height:20px;font-size:10px'><a href='' target='_blank'><img src='http://i.imgbox.com/BggPYqAh.png' alt='fb'></a>&nbsp;</span>
  329.                                                                         <span style='line-height:20px;font-size:10px'><a href='' target='_blank'><img src='http://i.imgbox.com/j3NsGLak.png' alt='twit'></a>&nbsp;</span>
  330.                                                                         <span style='line-height:20px;font-size:10px'><a href='' target='_blank'><img src='http://i.imgbox.com/wFyxXQyf.png' alt='g'></a>&nbsp;</span>
  331.                                                                     </td>
  332.                                                                 </tr>
  333.                                                                 <tr><td colspan='2' height='5'></td></tr>
  334.                                                                
  335.                                                             </tbody>
  336.                                                             </table>
  337.                                                         </td>
  338.                                                     </tr>
  339.                                                 </tbody>
  340.                                                 </table>
  341.                                             </td>
  342.                                         </tr>
  343.                                     </tbody>
  344.                                     </table>
  345.                                 </td>
  346.                             </tr>
  347.                         </tbody>
  348.                         </table>
  349.                     </div>";               
  350.                     $message .= "</body></html>";  
  351.  
  352.                 // To send HTML mail, the Content-type header must be set
  353.  
  354.                 $headers = "MIME-Version: 1.0" . "\r\n";
  355.                 $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
  356.                // Additional headers
  357.                 $headers .= 'From: '.$from."\r\n";
  358.                 // this line checks that we have a valid email address
  359.                 mail($email, $subject, $message, $headers); //This method sends the mail.
  360.                 mail($to, $subject, $message, $headers); //This method sends the mail.
  361.                
  362.                 echo "<script type=\"text/javascript\">
  363.                     alert(\"$graciasregistro.\");
  364.                     window.location = \"../../../login.php\"
  365.                 </script>";
  366.             }
  367.            
  368.     }
  369.    
  370.  
  371.    ?>
Add Comment
Please, Sign In to add comment