elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: (TUTORIAL) Aprende a emular Sentinel Dongle By Yapis


  Mostrar Temas
Páginas: 1 2 [3] 4 5 6
21  Programación / PHP / Cotizador, error al enviar correo en: 16 Julio 2017, 06:21 am
Hola, buenas. Tengo un problema, pensé que lo había resuelto pero no. Hace poco me descargué este sistema de cotizaciones: http://obedalvarado.pw/blog/cotizador-web-camisetas-php/
Está sencillo y es simple pero requiere tener un servidor de correos configurado para el envío de correo electrónico de notificación. Aquí está mi problema, no sé si lo que pide es hacer lo que me muestra en este tutorial: https://www.youtube.com/watch?v=FnNdSa9Q4Qs
Lo seguí al pie de la letra y ya configuré mi correo previamente creado en mi servidor. Pero me envía el error: Error al enviar mensaje: Could not execute: /usr/sbin/sendmail
No se si sea porque hago las pruebas desde mi localhost, debo subir el sistema a mi servidor web para que funcione?, o lo que hice en ese tutorial no es lo que se necesita??, alguien me puede dar una explicación??

Gracias de antemano, saludos !!!
22  Comunicaciones / Redes / Servidor de Correos Configurado en: 13 Julio 2017, 20:13 pm
Resuelto.
23  Programación / PHP / Añadir otro sistema dentro de mi webhosting en: 10 Julio 2017, 19:19 pm
Hola, buenas. Cuento con un sitio web con dominio propio y en él cuento con un sistema, quisiera saber cómo hago para que en el menú, al presionar un botón de ejemplo "Cotización" me mande al otro sistema de cotizaciones?, me habían comentado que se podía con un subdominio o en una carpeta, por ejemplo, y que dicho botón se dirija ahí pero cómo hago eso??

Gracias de antemano. Saludos.
24  Programación / PHP / Cambiar los tipos de archivos permitidos en: 28 Mayo 2017, 08:12 am
Hola, buenas. Tengo un código para subir archivos a una plataforma con extensión "jpg, rar, txt y zip" y quisiera saber cómo hago para cambiar esas extensiones permitidas por las siguientes: "mp4, mpeg, mwv", el código es el siguiente:
Código
  1.  <!-- ### FORM POST ### -->
  2.          <div class="box box-info">
  3.            <!-- form start -->
  4.            <form id="poster" class="form-horizontal">
  5.              <div class="box-body">
  6.                 <textarea id="thetextpost" name="posttext" class="form-control" rows="3"></textarea>
  7.              </div>
  8.              <!-- /.box-body -->
  9.            </form>
  10.  
  11.              <div class="box-footer">
  12.                <button class="btn btn-danger btn-sm pull-left" data-toggle="modal" data-target="#ModalDocumment"> <i class="fa fa-file-archive-o" aria-hidden="true"></i> Archivo</button>
  13.                <button class="posterbtn btn btn-info btn-sm pull-right"><i class="fa fa-pencil"></i> Publicar</button>
  14.              </div>
  15.              <!-- /.box-footer -->
  16.          </div>          
  17.          <!-- ### FORM POST ### -->
  18.  
  19.  
  20.  
  21.          <!-- ### COMMENT ### -->
  22.          <div id="timeliner">
  23.  
  24.          <?php takemylast6post(); ?>          
  25.  
  26.          </div>
  27.          <!-- ### COMMENT ### -->
  28.          <div id="loaderlinetime" class="col-sm-12 text-center">
  29.            <div class="loader-inner ball-pulse-sync"><div></div><div></div><div></div></div>
  30.          </div>
  31.  
  32.  
  33.  
  34.       </div>
  35.       <div id="sidebar" class="col-sm-3">
  36.           <?php include 'includes/adsense.html'; ?>
  37.       </div>
  38.     </div>
  39.     <!-- container -->
  40.  
  41.  
  42.     <!-- Modal -->
  43.     <div class="modal fade" id="ModalDocumment" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  44.       <div class="modal-dialog" role="document">
  45.         <div class="modal-content">
  46.           <div class="modal-header">
  47.             <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  48.             <h4 class="modal-title" id="myModalLabel"><i class="fa fa-upload" aria-hidden="true"></i> Subir Archivo</h4>
  49.           </div>
  50.           <div class="modal-body">
  51.  
  52.  
  53.              <div id="thefilattch" class="col-sm-12">
  54.                <form id="attachmentfrm">
  55.                  <label>Descripción:</label>
  56.                  <textarea class="form-control" name="descripcion" rows="3"></textarea>
  57.                  <label>Archivo:</label>
  58.                  <input type="file" name="archivo" class="form-control">
  59.                </form>
  60.  
  61.                <p></p>
  62.                <p>Solo se aceptan archivos con la extension: <?php validextlist(); ?></p>
  63.  
  64.              </div>
  65.              <!-- progress -->
  66.              <div id="loadeingarchive" class="progress active">
  67.                <div class="progress-bar progress-bar-primary progress-bar-striped" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%">
  68.                </div>
  69.              </div>
  70.              <!-- progress -->
  71.              <button type="button" class="uploadarchive btn btn-primary pull-right">Subir Archivo</button>
  72.  
  73.           </div>
  74.         </div>
  75.       </div>
  76.     </div>


Código
  1. // Sacamos las extensiones permitidas para los archivos que se suben
  2. function gettheextattachment(){
  3.  
  4.    // conexion de base de datos
  5.    $conexion = Conexion::singleton_conexion();
  6.  
  7.    $SQL = 'SELECT archiveextensions FROM '.SSPREFIX.'socialconfig WHERE id = 1';
  8.    $stn = $conexion -> prepare($SQL);
  9.    $stn -> execute();
  10.    $rstl = $stn -> fetchAll();
  11.    if (empty($rstl)){
  12.    }else{
  13.      foreach ($rstl as $key){
  14.        $fileext = $key['archiveextensions'];
  15.        return $fileext;
  16.      }
  17.    }
  18. }
  19.  
  20.  
  21. function validextlist(){
  22.  
  23.    // conexion de base de datos
  24.    $conexion = Conexion::singleton_conexion();
  25.  
  26.    $SQL = 'SELECT archiveextensions FROM '.SSPREFIX.'socialconfig WHERE id = 1';
  27.    $stn = $conexion -> prepare($SQL);
  28.    $stn -> execute();
  29.    $rstl = $stn -> fetchAll();
  30.    if (empty($rstl)){
  31.    }else{
  32.      foreach ($rstl as $key){
  33.         echo '<b>'.str_replace('|', ' / ', $key['archiveextensions']).'</b>';
  34.      }
  35.    }
  36.  
  37. }
  38.  
  39.  
  40. function formatSizeUnits($bytes){
  41.        if ($bytes >= 1073741824)
  42.        {
  43.            $bytes = number_format($bytes / 1073741824, 2) . ' GB';
  44.        }
  45.        elseif ($bytes >= 1048576)
  46.        {
  47.            $bytes = number_format($bytes / 1048576, 2) . ' MB';
  48.        }
  49.        elseif ($bytes >= 1024)
  50.        {
  51.            $bytes = number_format($bytes / 1024, 2) . ' kB';
  52.        }
  53.        elseif ($bytes > 1)
  54.        {
  55.            $bytes = $bytes . ' bytes';
  56.        }
  57.        elseif ($bytes == 1)
  58.        {
  59.            $bytes = $bytes . ' byte';
  60.        }
  61.        else
  62.        {
  63.            $bytes = '0 bytes';
  64.        }
  65.  
  66.        return $bytes;
  67. }
  68.  
  69.  
  70. // Para subir un archivo
  71. function attachmentfiles($file,$description){
  72.  
  73.    // conexion de base de datos
  74.    $conexion = Conexion::singleton_conexion();
  75.  
  76.    // Primero el Año
  77.    $theyear = date('Y');
  78.  
  79.    // Ahora el Mes
  80.    $themonth = date ('m');
  81.  
  82.    // Ahora usamos la sesion del usuario para su respectiva carpeta
  83.    $theuser = $_SESSION['ssid'];
  84.  
  85.    // Creamos un alfanumerico aleatorio.
  86.    $characters = 'abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  87.    $string = '';
  88.    for ($i = 0; $i < 60; $i++) {
  89.     $string .= $characters[rand(0, strlen($characters) - 1)];
  90.    }
  91.  
  92.    // Tomamos la fecha y hora con segundos
  93.    $fechaseconds = date('Y-m-d h:i:s');
  94.    $fechanormal =  date('Y-m-d');
  95.  
  96.    // Nuevo nombre del Archivo
  97.    $thenewname = sha1($fechaseconds.$theuser.$string);
  98.  
  99.    // Obtenemos la extension
  100.    $fileext = new SplFileInfo($file);
  101.    $getextension = $fileext->getExtension();
  102.  
  103.    // convertimos extension a minusculas
  104.    $extension = strtolower($getextension);
  105.  
  106.    //comprobamos si el archivo ha subido y lo movemos a una su respectiva ruta
  107.    if ($file && move_uploaded_file($_FILES['archivo']['tmp_name'],"../attachments/".$theuser."/".$theyear."/".$themonth."/".$thenewname.".".$extension)){
  108.    }  
  109.  
  110.    // Creamos ruta del temporal
  111.    $temporal = "../attachments/".$theuser."/".$theyear."/".$themonth."/".$thenewname.".".$extension;
  112.  
  113.  
  114.    // Creamos el permalink de la publicacion
  115.    $permalink = sha1($string.$fechaseconds);
  116.  
  117.  
  118.    // Limitamos las publicaciones a tan solo 1000 caracteres
  119.    $postparse = substr($description, 0,1000);
  120.  
  121.    // Filtramos para evitar XSS Injection
  122.    $filtro = new InputFilter();
  123.    $finalpost = $filtro->process($postparse);
  124.  
  125.    // Tamaño del archivo
  126.    $filesize = $_FILES['archivo']['size'];
  127.  
  128.    // Nombre del Archivo
  129.    $filename = $_FILES['archivo']['name'];
  130.  
  131.    // Revisamos si el resultado es vacio para no tener que postearlo
  132.    if (empty($finalpost)){
  133.       exit();
  134.    }
  135.  
  136.    if (is_null($finalpost)){
  137.       exit();
  138.    }
  139.  
  140.    // Hacemos el registro del Archivo
  141.    $FileAttch = 'INSERT INTO '.SSPREFIX.'attachment (ruta, nombre, usuario, fecha, ext, peso, permalink) VALUES (:ruta, :nombre, :usuario, :fecha, :ext, :peso, :permalink)';
  142.    $stnfile = $conexion -> prepare($FileAttch);
  143.    $stnfile -> bindParam(':ruta', $temporal ,PDO::PARAM_STR);
  144.    $stnfile -> bindParam(':usuario', $_SESSION['ssid'] ,PDO::PARAM_STR);
  145.    $stnfile -> bindParam(':nombre', $filename ,PDO::PARAM_INT);
  146.    $stnfile -> bindParam(':fecha', $fechaseconds ,PDO::PARAM_STR);
  147.    $stnfile -> bindParam(':ext', $extension ,PDO::PARAM_STR);
  148.    $stnfile -> bindParam(':peso', $filesize ,PDO::PARAM_STR);
  149.    $stnfile -> bindParam(':permalink', $thenewname ,PDO::PARAM_STR);
  150.    $stnfile -> execute();
  151.    $lastidfile = $conexion -> lastInsertId();
  152.  
  153.    // Post con archivo
  154.    $thepostpostarchive = $lastidfile.'|'.$finalpost;
  155.  
  156.    // Como es un post de archivo es 4
  157.    $tipo = 4;
  158.  
  159.    $SQL = 'INSERT INTO '.SSPREFIX.'posts (post, usuario, permalink, fecha, tipo) VALUES (:post, :usuario, :permalink, :fecha, :tipo)';
  160.    $stn = $conexion -> prepare($SQL);
  161.    $stn -> bindParam(':post', $thepostpostarchive ,PDO::PARAM_STR);
  162.    $stn -> bindParam(':usuario', $_SESSION['ssid'] ,PDO::PARAM_INT);
  163.    $stn -> bindParam(':permalink', $permalink ,PDO::PARAM_STR);
  164.    $stn -> bindParam(':fecha', $fechaseconds ,PDO::PARAM_STR);
  165.    $stn -> bindParam(':tipo', $tipo ,PDO::PARAM_INT);
  166.    $stn -> execute();
  167.    $lastid = $conexion -> lastInsertId();
  168.  
  169.    // imagen de perfil
  170.    $profileimg = userprofile($_SESSION['ssid']);
  171.  
  172.    // Fecha
  173.    $fechastronger = fechastring($fechanormal,$permalink);
  174.  
  175.    echo'
  176.        <div id="post-public'.$lastid.'" class="box box-widget">
  177.            <div class="box-header with-border">
  178.              <div class="user-block">
  179.                <img class="img-circle" src="'.$profileimg.'" alt="'.gettheusernamepost().'">
  180.                <span class="username"><a href="profile.php?leanserwebmaster">'.gettheusernamepost().'</a></span>
  181.                '.$fechastronger.'
  182.              </div>
  183.              <!-- /.user-block -->
  184.              <div class="box-tools">
  185.                <button data-post="'.$lastid.'" class="eliminarthispost btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
  186.              </div>
  187.              <!-- /.box-tools -->
  188.            </div>
  189.            <!-- /.box-header -->
  190.            <div class="box-body">
  191.              <!-- post text -->';
  192.  
  193.                $postexplode = explode('|', $thepostpostarchive);
  194.                getattachblock($postexplode[0],$postexplode[1]);
  195.  
  196.         echo'<!-- Social sharing buttons -->
  197.              <button id="liker'.$lastid.'" type="button" data-target="'.$lastid.'" onclick="thelikeloadtimeclick('.$lastid.');" class="btn btn-default btn-xs"><i class="fa fa-thumbs-o-up"></i> Me gusta</button>
  198.              <span id="likecomment'.$lastid.'" class="pull-right text-muted">
  199.  
  200.              </span>
  201.            </div>
  202.  
  203.            <!-- /.box-footer -->
  204.            <div class="box-footer">
  205.              <form class="commentfrm" data-form="'.$lastid.'" id="commentfrm'.$lastid.'">
  206.                <img  id="mypiccomment" class="img-responsive img-circle img-sm" src="'.$profileimg.'">
  207.                <!-- .img-push is used to add margin to elements next to floating images -->
  208.                <div class="img-push">
  209.                  <input type="text" class="form-control input-sm" name="comentario" placeholder="Comentar...">
  210.                </div>
  211.              </form>
  212.            </div>
  213.            <!-- /.box-footer -->
  214.  
  215.            <!-- /.box-body -->
  216.            <div id="box-commets-body-'.$lastid.'" class="box-footer box-comments">
  217.  
  218.            </div>
  219.  
  220.          </div>
  221.    ';
  222.  
  223.  
  224.    $conexion = '';
  225.  
  226.  
  227.  
  228. }
  229.  
  230.  
  231.  
  232. function downloadarchive($permalink){
  233.  
  234.     // conexion de base de datos
  235.     $conexion = Conexion::singleton_conexion();
  236.  
  237.     $SQL = 'SELECT * FROM '.SSPREFIX.'attachment WHERE permalink = :permalink LIMIT 1';
  238.     $stn = $conexion -> prepare($SQL);
  239.     $stn -> bindParam(':permalink', $permalink ,PDO::PARAM_STR);
  240.     $stn -> execute();
  241.     $rstl = $stn -> fetchAll();
  242.     if (empty($rstl)){
  243.       header('Location: 404.php');
  244.     }else{
  245.       foreach ($rstl as $key){
  246.          $ruta = str_replace('../', '', $key['ruta']);
  247.          $nombre = $key['nombre'];
  248.       }
  249.     }
  250.  
  251.     header("Content-type: application/octet-stream");
  252.     header("Content-Type: application/force-download");
  253.     header("Content-Disposition: attachment; filename=\"$nombre\"\n"); readfile($ruta);
  254.  
  255.  
  256. }
  257.  
  258.  
  259.  
  260.  
  261.  
  262. // Tomamos los ultimos 6 post
  263. function takepostperpermalink($permalink){
  264.  
  265.    // conexion de base de datos
  266.    $conexion = Conexion::singleton_conexion();
  267.  
  268.  
  269.    $SQL = 'SELECT '.SSPREFIX.'usuarios.id AS userid, '.SSPREFIX.'posts.tipo AS posttipo, '.SSPREFIX.'posts.id AS postingid, '.SSPREFIX.'posts.post, '.SSPREFIX.'posts.permalink, '.SSPREFIX.'posts.fecha, '.SSPREFIX.'usuarios.nombre, '.SSPREFIX.'usuarios.apellido, '.SSPREFIX.'usuarios.permalink AS userperma FROM '.SSPREFIX.'posts INNER JOIN '.SSPREFIX.'usuarios ON '.SSPREFIX.'usuarios.id = '.SSPREFIX.'posts.usuario WHERE '.SSPREFIX.'posts.permalink = :permalink ORDER BY '.SSPREFIX.'posts.fecha DESC LIMIT 1';
  270.    $stn = $conexion -> prepare($SQL);
  271.    $stn -> bindParam(':permalink' , $permalink, PDO::PARAM_INT);
  272.    $stn -> execute();
  273.    $rstl = $stn -> fetchAll();
  274.    if (empty($rstl)){
  275.      # code...
  276.    }else{
  277.      foreach ($rstl as $key){
  278.  
  279.  
  280.        // imagen de perfil
  281.        $profileimg = userprofile($key['userid']);
  282.  
  283.        // Fecha
  284.        $fecha = fechastring($key['fecha'],$key['permalink']);
  285.  
  286.        // Imagen de perfil en el post
  287.        $perfilactual = userprofile($_SESSION['ssid']);
  288.  
  289.  
  290.        echo'
  291.  
  292.        <div id="post-public'.$key['postingid'].'" class="box box-widget">
  293.            <div class="box-header with-border">
  294.              <div class="user-block">
  295.                <img class="img-circle" src="'.$profileimg.'" alt="'.$key['nombre'].' '.$key['apellido'].'">
  296.                <span class="username"><a href="profile.php?'.$key['userperma'].'">'.$key['nombre'].' '.$key['apellido'].'</a></span>
  297.                '.$fecha.'
  298.              </div>
  299.              <!-- /.user-block -->
  300.            </div>
  301.            <!-- /.box-header -->
  302.            <div class="box-body">
  303.              <!-- post text -->';
  304.  
  305.              if ($key['posttipo'] == 1){
  306.                profileimageposttake($key['post']);
  307.              }elseif ($key['posttipo'] == 3) {
  308.                portadaimageposttake($key['post']);
  309.              }elseif ($key['posttipo'] == 4) {
  310.  
  311.                $postexplode = explode('|', $key['post']);
  312.                getattachblock($postexplode[0],$postexplode[1]);
  313.  
  314.              }else{
  315.                echo'<p>'.emoticons($key['post']).'</p>';
  316.              }
  317.  
  318.              echo'<!-- Social sharing buttons -->
  319.              ';
  320.  
  321.              checklike($key['postingid']);
  322.  
  323.              echo'
  324.  
  325.              <span id="likecomment'.$key['postingid'].'" class="pull-right text-muted">
  326.                 ';
  327.  
  328.                      checklikeandcomments($key['postingid']);
  329.  
  330.                 echo'
  331.              </span>
  332.            </div>
  333.  
  334.            <!-- /.box-footer -->
  335.            <div class="box-footer">
  336.              <form class="commentfrm" data-form="'.$key['postingid'].'" id="commentfrm'.$key['postingid'].'">
  337.                <img  id="mypiccomment" class="img-responsive img-circle img-sm" src="'.$perfilactual.'">
  338.                <!-- .img-push is used to add margin to elements next to floating images -->
  339.                <div class="img-push">
  340.                  <input type="text" class="form-control input-sm" name="comentario" placeholder="Comentar...">
  341.                </div>
  342.              </form>
  343.            </div>
  344.            <!-- /.box-footer -->
  345.  
  346.            <!-- /.box-body -->
  347.            <div id="box-commets-body-'.$key['postingid'].'" class="box-footer box-comments">';
  348.  
  349.               commentsajx($key['postingid'],$key['permalink']);
  350.  
  351.             echo'</div>
  352.          </div>
  353.  
  354.        ';
  355.  
  356.      }
  357.    }
  358.  
  359.  
  360.    $conexion = '';
  361.  
  362. }

Gracias de antemano, saludos !!
25  Programación / PHP / Descontar Cantidad en Utilidad en: 14 Mayo 2017, 06:30 am
Hola, buenas. Tengo un sistema de inventario que no fue creado por mi pero estoy intentando modificarle algunas cosas. Hay una opción que se llama "Utilidades" dentro del sistema, es la suma de comisiones de cada vendedor, lo que yo quisiera saber es cómo hago para descontarle x cantidad a ese número, osea, tener la opción de poder descontar ese número:


Se utiliza este código en esa parte:
Código:
<?php
$u = null;
if( Session::getUID() != "" && !empty( $_GET["id"] ) ):

$u = UserData::getById( Session::getUID() );
    $user = $u->name." ".$u->lastname;
    $client_id = $_GET["id"];
    $client = ClientData::getById( $client_id );
    $cliente = false;
elseif( Session::getUID() != "" && empty( $_GET["id"] ) ):

$u = UserData::getById( Session::getUID() );
    $user = $u->name." ".$u->lastname;
    
    $client = ClientData::getByIdUser( $u->id );
    $client_id = $client->id;
    $cliente = true;
else:

print "<script>window.location='index.php';</script>";
endif;
?>
<div class="row">
<div class="col-md-12">
<h1><i class='fa fa-clock-o'></i> <?php echo $client->name." ".$client->lastname; ?> </h1>
<br>

<?php
$products = array();
if(isset($_GET["start_at"]) && $_GET["start_at"]!="" && isset($_GET["finish_at"]) && $_GET["finish_at"]!=""){

if($_GET["start_at"]<$_GET["finish_at"]){

$products = OperationData::getAllByClientIdAndRange( $client->id,$_GET["start_at"], $_GET["finish_at"] );
}
}
else{

$products = OperationData::getAllByClientId( $client->id );
}
$comision_total = 0;
if( count( $products ) > 0 ){
?>
<br>
<table class="table table-bordered table-hover ">
<thead>
<th>Clave</th>
<th>Precio de Venta</th>
<th>Precio de Costo</th>
<th>Fecha del pedido</th>
<th>Comisión</th>
<?
                 if( $u->is_admin == 1 ):?>
<th></th>
<?
endif;?>
</thead>
<?php
#echo "<pre>";print_r( $products );echo "</pre>";
foreach($products as $sell):


#$item = $sell->getItem();
$book = BookData::getById( $sell->book_id );
?>
<tr>
<td>
<?php echo $book->isbn; ?>
</td>
<td><?php echo $book->cantidad; ?></td>
<td><?php echo $book->precio_costo; ?></td>
<td><?php echo $sell->start_at; ?></td>
<td>
<?
$comision = $book->cantidad - $book->precio_costo;
if( $comision >= 80 ){

echo '$40';
$comision_total = 40 + $comision_total;
}
else{

echo '$20';
$comision_total = 20 + $comision_total;
}
?>
</td>
<?
                 if( $u->is_admin == 1 ):?>
<td>
<a href="index.php?action=delorder&id=<?php echo $sell->id;?>" class="btn btn-danger btn-xs">Eliminar</a>
</td>
<?
endif;?>
</tr>
<?php
endforeach; ?>
</table>

<div class="clearfix"></div>
<?php
}
else{
?>
<p class="alert alert-danger">No hay pedidos.</p>
<?php
}
$inventario = OperationData::getInventory( $client->id );
$list_inventario = OperationData::Discount_list( $client->id );
$inventario_sum = OperationData::Discount_sum( $client->id );
$initial_vendedor = ClientData::getById( $client->id );
?>
<div class="row">
<div class="col-lg-3">
Inventario Inicial<br>
<?
if( !$cliente ):?>
<form action="index.php?action=updateinventory" method="post">
<input id="vendedor" type="hidden" name="vendedor" value="<?= $client->id ?>">
<input required id="invetory_initial" type="text" name="invetory_initial" value="<?= $initial_vendedor->initial_inventory ?>">
<button type="submit" class="btn btn-success">Editar</button>
</form>
<?
else:?>
<h3>$<?= $initial_vendedor->initial_inventory ?></h3>
<?
endif;?>
</div>
<div class="col-lg-2">
Pedidos Realizados: <h3> $<?= ( empty( $inventario[0]->total ) ) ? 0 : $inventario[0]->total ?></h3>
</div>
<div class="col-lg-2">
Abonos: <h3> $<?= ( empty( $inventario_sum[0]->total ) ) ? 0 : $inventario_sum[0]->total ?></h3>
</div>
<div class="col-lg-2">
Deuda Total: <h3>$<?= ( ( $initial_vendedor->initial_inventory + $inventario[0]->total ) - $inventario_sum[0]->total ) ?></h3>
</div>
<div class="col-lg-2">
<label><font color='red'>Utilidades:</font></label> <font color='red'><h3> $<?= $comision_total ?></h3></font>
</div><br>
</div>
<?
if( count( $list_inventario ) > 0 ){?>
<div class="row">
<h3 class="col-lg-4 col-lg-offset-4">Lista de Abonos:</h3><br>
<?
if( count( $list_inventario ) > 0 ){
?>
<br>
<table align="center" class="table table-bordered table-hover">
<thead>
<th>Abono:</th>
<th>Fecha del Abono:</th>
</thead>
<?php
foreach($list_inventario as $list_inventario):
?>
<tr>
<td>
<?php echo $list_inventario->discount_valor; ?>
</td>
<td>
<?php echo $list_inventario->discount_date; ?>
</td>
</tr>
<?php
endforeach; ?>
</table>
<?php
}?>
</div>
<?
}
if( !$cliente ):?>
<div>
<form action="index.php?action=addiscount" method="post">
<input id="cliente" name="cliente" type="hidden" value="<?= $client->id ?>">
<label>Abono: </label>
<input required id="discount_n" type="text" name="discount_n">
<button type="submit" class="btn btn-success">Abonar</button>
</form>
</div>
<?
endif;?>
<div class="clearfix"></div>
<br><br><br><br><br><br><br><br><br><br>
</div>
</div>

La utilidad se obtiene sumando la comisión de los productos. Ahora, cuando se paga esa utilidad a los vendedores es cuando ese número debe descontarse (la cantidad que se pague). Como mencioné, es un sistema gratuito que encontré en internet y que estoy modificando pero ya no encuentro la forma de aplicar esto. Les muestro el sistema y la base de datos actual: https://mega.nz/#!7chmSLwC!hr30QNhit...lJuVWdAqs9si68

Se los envío para que se den una idea más detallada de dónde está lo que intento hacer, no pido que resuelvan mi problema haciéndolo, sólo que me ayuden a saber qué debo hacer para realizar lo que pregunto..

Espero puedan apoyarme, saludos!

MOD: Imagen adaptada lo permitido.
26  Programación / PHP / No me permite eliminar un elemento en: 13 Abril 2017, 00:32 am
Hola, buenas. Tengo un sistema de inventario, cuando intento eliminar un producto del historial de ventas y presiono "Eliminar" no ocurre nada, me recarga la página con el mismo producto intacto:

Esta es la línea para ese botón:


Ahora, me meto al archivo donde tengo los errores y me marca el siguiente:


Entro a esa carpeta, en esa línea y no encuentro el error:


A que se debe que no se elimine el elemento??
Gracias de antemano, saludos !!


Mod: Resolución máxima de las imágenes en el foro 800x600.
27  Media / Multimedia / El video se mira lento una vez exportado en: 21 Marzo 2017, 01:47 am
Hola, buenas. Estoy intentando editar un logo para una campaña de gimnasio, el problema es que al terminar y exportarlo como .avi cuando intento reproducirlo en mi computadora se mira muy lento, como que dura para cargar y se traba cosa que en After Effects no sucede.

Así es como lo exporto:




Cuando lo reproduzco dentro del After Effects corre bien, no se traba, pero cuando abro el archivo avi en distintos reproductores todo se miran igual, lento, como con pausas. Quiero saber si es problema de mi computadora o algo estoy haciendo mal al momento de exportarlo, qué creen que sea el problema??

Gracias de antemano !!
28  Media / Diseño Gráfico / Que software puedo usar para crear anuncios en movimiento? en: 10 Febrero 2017, 03:21 am
Hola, buenas. Quisiera saber si conocen algún software gratuito que me sirva para crear anuncios de texto con movimiento, por ejemplo un anuncio indicando "Funciones Agotadas" y que vayan pasando las funciones de derecha a izquierda. Y que se pueda exportar, osea, que se pueda ver en una pantalla...

Saludos
29  Informática / Software / Cómo abro un archivo tfu? en: 4 Febrero 2017, 18:17 pm
Hola, acabo de hacer un letrero LED con la aplicación "Power Led" pero el archivo que exporta es .tfu , no he podido abrirlo con ningún programa para ver el resultado en pantalla, cómo puedo abrirlo??
Saludos !
30  Programación / PHP / Colocar cuadro para justificar acción en: 2 Febrero 2017, 20:38 pm
Hola, buenas. Unos compañeros y yo estamos trabajando en un proyecto de la universidad y me ha tocado crear un cuadro de justificación cuando el comprobando que se envía al sistema no es válido, me explico con esta imagen:


Como ven, hay dos opciones, aceptar el comprobante o NO aceptarlo, lo que quiero hacer es que al momento de dar click sobre "Comprobante No válido" me aparezca un cuadro aún lado donde se explique la razón por la cual no fue aceptado, cómo lo puedo hacer?, les dejo el código de esa sección:
Código:
<?php
$id = $_POST["id"];
$verificacion = $_POST["verificacion"];
$fecha=$_POST["fecha"];

include 'conexion.php';

//**************************************** Verificacion 1 ok, 2 no aprobado, 0 espera de verificacion, 4 sin movimientos  ****************************

//echo '<script language="javascript">alert("El valor de id es = '.$id.' ");</script>';


if($verificacion==3){
    //$tabla=$mysqli->query("update asistente set verificacion=".$verificacion." where id=".$id);
   
    $tabla=$mysqli->query("select c.idCurso, c.cupo, c.nombreCurso, c.claveCurso from curso c inner join curso_asistente ca
        on c.idCurso=ca.idCurso where ca.idUsuario='".$id."'");
    //checar cupo del grupo!!!
    $cursosLlenos ="";
    $cursosIns ="";   
    //agregar asistente al curso!!!
   
    while($row = $tabla->fetch_array()) {

        //Versiòn 2: Se calcula la capacidad
        /*$inscritos = $mysqli->query("select verificacion from asistente inner join curso_asistente on curso_asistente.idUsuario = asistente.folio && curso_asistente.idCurso = '".$row[0]."' && asistente.verificacion=3");*/

        $inscritos = $mysqli->query("select inscrito from curso_asistente where idCurso = '".$row[0]."' && inscrito=1 ");


        $NumInscritos = mysqli_num_rows($inscritos);
        $capacidad = $row[1] - $NumInscritos; //cupo menos inscritos

        if($capacidad>0){
            $inscribir = $mysqli->query("update curso_asistente set inscrito=1 where (idUsuario='".$id."' && idCurso='".$row[0]."')");
            $cursosIns .= " + ".htmlentities($row[2])."<br>";
        }else{

            $cursosLlenos .= " - ".htmlentities($row[2])."<br>";
            //$mysqli->query("delete from curso_asistente where nomCurso='".$row[0]."' and idUsuario='".$id."'");
            /*$mysqli->query("update curso set claveCurso='".$row[3]."_X' where
                claveCurso='".$row[3]."' and year ='".$fecha."'");*/
               
        }
       
    }

    $tabla=$mysqli->query("update asistente set verificacion=".$verificacion." where folio='".$id."'");
    $tabla=$mysqli->query("update factura set verificacion=1 where idUsuario='".$id."'");

    session_start();

    $nombreUser = $_SESSION["nombreU"];
    $tabla=$mysqli->query("update asistente set verificadoPor='".$nombreUser."' where folio='".$id."'");

}else if($verificacion==2){ //SI ES RECHAZADO
    $tabla3=$mysqli->query("update asistente set verificacion=".$verificacion." where folio='".$id."'");
    $tabla3=$mysqli->query("update factura set verificacion=0 where idUsuario='".$id."'");

    session_start();

    $nombreUser = $_SESSION["nombreU"];
    $tabla=$mysqli->query("update asistente set verificadoPor='".$nombreUser."' where folio='".$id."'");
}



    //////////////////Se agrega nuevo codigo para enviar correo electronico de confirmacion
    include "config.php";
    require 'class.phpmailer.php'; 
    $mail = new PHPMailer();
    //Luego tenemos que iniciar la validaci&oacute;n por SMTP:
    $mail->IsSMTP();
    $mail->SMTPAuth = true;
    $mail->Host = $host; // SMTP a utilizar. Por ej. smtp.elserver.com
    $mail->Username = $Username; // Correo completo a utilizar
    $mail->Password = $password; // Contrase&ntilde;a
    $mail->Port = $port; // Puerto a utilizar
    $mail->SMTPSecure = $smtpSecure;
    //Con estas pocas l&iacute;neas iniciamos una conexi&oacute;n con el SMTP. Lo que ahora deber&iacute;amos
    //hacer, es configurar el mensaje a enviar, el //From, etc.
    //$mail->From = "adan.sandez21@live.com.mx"; // Desde donde enviamos (Para mostrar)
    $mail->FromName = $fromName;
    //$tabla=$mysqli->query("Select * from asistente where id='".$id."'");
    $tabla=$mysqli->query("Select * from asistente where folio='".$id."'");
    //Estas dos l&iacute;neas, cumplir&iacute;an la funci&oacute;n de encabezado (En mail() usado de esta forma: “From: Nombre <correo@dominio.com>”) de //correo.

    while($row = $tabla->fetch_array()){

        $mail->AddAddress($row[6]); // Esta es la direcci&oacute;n a donde enviamos //SE cambio row 7 por row 6.
        $mail->AddBCC("adrianvo@mat.uson.mx", $name = "Adrian Vazquez");  // Esta es la copia oculta que se envia.
        $mail->IsHTML(true); // El correo se env&iacute;a como HTML
        $mail->Subject = "Inscripcion CONFIRMADA a la SNIDM - Universidad de Sonora"; // Este es el titulo del email.

        if($verificacion==3){
            $body = "<strong> Hola ".$row[0].",<br><br>
            Este correo es para confirmar que tu inscripci&oacute;n a la Semana Nacional de Investigaci&oacute;n y
            Docencia en Matem&aacute;ticas ha sido registrada EXITOSAMENTE. </strong><br><br>";
        }else if($verificacion==2 && $row[10]==0 ){ //si NO es becado
            $mail->Subject = "Inscripcion DENEGADA a la SNIDM - Universidad de Sonora"; // Este es el titulo del email.           
            $body = "<strong> Hola ".$row[0].",<br><br>
            Este correo es para informar que tu inscripci&oacute;n a la Semana Nacional de Investigaci&oacute;n y
            Docencia en Matem&aacute;ticas NO est&aacute; COMPLETA. Lamentablemente no se pudo visualizar bien la imagen del comprobante de pago. Te invitamos a que realices de nueva cuenta la inscripci&oacute;n.  </strong><br><br>";

 
        }else if($verificacion==2 && $row[10]==1){//si es becado
            $mail->Subject = "Inscripcion DENEGADA a la SNIDM - Universidad de Sonora"; // Este es el titulo del email.
             $body = "<strong> Hola ".$row[0].",<br><br>
            Este correo es para informar que tu inscripci&oacute;n a la Semana Nacional de Investigaci&oacute;n y
            Docencia en Matem&aacute;ticas NO est&aacute; COMPLETA. Lamentablemente no se pudo visualizar bien la imagen de tu credencial. Te invitamos a que realices de nueva cuenta la inscripci&oacute;n. </strong><br><br>";
       
        }
Páginas: 1 2 [3] 4 5 6
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines