Closed gian123 closed 7 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; }
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.
<div class="form-group">*
<div class="input-group">*
<span class="input-group-btn">*
<button type="submit" class="btn
btn-primary">Buscar*
</span>*
<input type="text" id="sug_input" class="form-control"
name="title" placeholder="Buscar por nombre de producto">*
</div>*
<div id="result" class="list-group"></div>*
</div>*
<?php
$products = find_product_by_title($_POST['product_name']);*
if($products){*
foreach ($products as $product):*
$html .= "<li class=\"list-group-item\">";*
$html .= $product['name'];*
$html .= "</li>";*
endforeach;*
} else {*
$html .= '<li onClick=\"fill(\''.addslashes().'\')\"
class=\"list-group-item\">';*
$html .= 'No encontrado';*
$html .= "</li>";*
}*
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 .
i'm retrieving data by jQuery, check out function.js file.
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 .
No problem!
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 .
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 .
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();
});
}`
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 .
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 {
} ?>`
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