siamon123 / warehouse-inventory-system

Open source inventory management system with php and mysql
http://www.oswapp.com
MIT License
379 stars 233 forks source link

Parameter in addsale.php #13

Closed gian123 closed 7 years ago

gian123 commented 8 years ago

Hi

In the file add_sale.php I can see this lines `

`

and I can see you send a parameter to ajax.php

`<?php // Auto suggetion $html = ''; if(isset($_POST['product_name']) && strlen($_POST['product_name'])) { $products = find_product_by_title($_POST['product_name']); if($products){ foreach ($products as $product): $html .= "<li class=\"list-group-item\">"; $html .= $product['name']; $html .= ""; endforeach; } else {

    $html .= '<li onClick=\"fill(\''.addslashes().'\')\" class=\"list-group-item\">';
    $html .= 'No encontrado';
    $html .= "</li>";

  }

  echo json_encode($html);

} ?>`

the problem is I want to change the parameter but I dont see the pamarameter called "product_name" from add_sale.php to ajax.php..can you explain me pleasee. I need this project for my school..=)

Wich is your logic, please let me know .

Is really interested your system.

Thanks

siamon123 commented 8 years ago

This function located in includes/sql.php

/--------------------------------------------------------------/ /* Function for Finding all product name /* Request coming from ajax.php for auto suggest /--------------------------------------------------------------/ function find_product_by_title($product_name){ global $db; $p_name = remove_junk($db->escape($product_name)); $sql = "SELECT name FROM products WHERE name like '%$p_name%' LIMIT 5"; $result = find_by_sql($sql); return $result; }

gian123 commented 8 years ago

Hi bro thank for your atenttion , I understant the fuction of the method called " find_product_by_title" but my dude is about how the file add_sale.php sends the parameter $_POST['product_name'] to ajax.php int the next form the parameter "product_name" doesn't exist. but this form send ti ajax.php this parameter. I will put in red.

*

<?php

Help me please,

Thank.

2016-06-07 15:36 GMT-05:00 Siamon Hasan notifications@github.com:

This function located in includes/sql.php

/--------------------------------------------------------------/ /* Function for Finding all product name /* Request coming from ajax.php for auto suggest /--------------------------------------------------------------/ function find_product_by_title($product_name){ global $db; $p_name = remove_junk($db->escape($product_name)); $sql = "SELECT name FROM products WHERE name like '%$p_name%' LIMIT 5"; $result = find_by_sql($sql); return $result; }

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/siamon123/warehouse-inventory-system/issues/13#issuecomment-224406100, or mute the thread https://github.com/notifications/unsubscribe/AEuDtawzTLV46VNzMHmvhfUiDHR5gVzJks5qJdZLgaJpZM4IwJ2n .

siamon123 commented 8 years ago

i'm retrieving data by jQuery, check out function.js file.

gian123 commented 8 years ago

Ok I understand, Thanks very much =)

2016-06-07 21:11 GMT-05:00 Siamon Hasan notifications@github.com:

i'm retrieving data by jQuery, check out function.js file.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/siamon123/warehouse-inventory-system/issues/13#issuecomment-224468789, or mute the thread https://github.com/notifications/unsubscribe/AEuDtQjvxH84qwTEbAJvPXld2UaboEIJks5qJiS5gaJpZM4IwJ2n .

siamon123 commented 8 years ago

No problem!

gian123 commented 8 years ago

Hi , the really I staying many hours in this example because I need to present this in my school this last week and please I need your help onlly in this part becase I start to develop recently and I dont know javascript in hight level.I need the next image in your source code.

[image: Imágenes integradas 1]

please help me only with this..

Thank you for your attention

Really thank you very much.

2016-06-07 23:12 GMT-05:00 Siamon Hasan notifications@github.com:

No problem!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/siamon123/warehouse-inventory-system/issues/13#issuecomment-224482657, or mute the thread https://github.com/notifications/unsubscribe/AEuDtUTbFf9l4VEW3u2vvrLeE-NjEAZsks5qJkFCgaJpZM4IwJ2n .

gian123 commented 8 years ago

Can you help me bro?..I need know if you can help me.

Thanks

2016-06-08 0:41 GMT-05:00 jeanfranco gutierrez < gianfrancogutierrez12@gmail.com>:

Hi , the really I staying many hours in this example because I need to present this in my school this last week and please I need your help onlly in this part becase I start to develop recently and I dont know javascript in hight level.I need the next image in your source code.

[image: Imágenes integradas 1]

please help me only with this..

Thank you for your attention

Really thank you very much.

2016-06-07 23:12 GMT-05:00 Siamon Hasan notifications@github.com:

No problem!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/siamon123/warehouse-inventory-system/issues/13#issuecomment-224482657, or mute the thread https://github.com/notifications/unsubscribe/AEuDtUTbFf9l4VEW3u2vvrLeE-NjEAZsks5qJkFCgaJpZM4IwJ2n .

siamon123 commented 8 years ago

you mean this code

`function suggetion() {

     $('#sug_input').keyup(function(e) {

         var formData = {
             'product_name' : $('input[name=title]').val()
         };

         if(formData['product_name'].length >= 1){

           // process the form
           $.ajax({
               type        : 'POST',
               url         : 'ajax.php',
               data        : formData,
               dataType    : 'son',

               encode      : true
           })
               .done(function(data) {
                   //console.log(data);
                   $('#result').html(data).fadeIn();
                   $('#result li').click(function() {

                     $('#sug_input').val($(this).text());
                     $('#result').fadeOut(500);

                   });

                   $("#sug_input").blur(function(){
                     $("#result").fadeOut(500);
                   });

               });

         } else {

           $("#result").hide();

         };

         e.preventDefault();
     });

 }`
gian123 commented 7 years ago

Closet en tu culo

2016-10-13 12:48 GMT-05:00 Siamon Hasan notifications@github.com:

Closed #13 https://github.com/siamon123/warehouse-inventory-system/issues/13.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/siamon123/warehouse-inventory-system/issues/13#event-822869597, or mute the thread https://github.com/notifications/unsubscribe-auth/AEuDtYJ14Q_vSLJcRjCNdms8zJcAv0nbks5qzm78gaJpZM4IwJ2n .