-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathprod_ajax.php
34 lines (27 loc) · 890 Bytes
/
prod_ajax.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1');
if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1');
require 'config.php';
dol_include_once('/nomenclature/class/nomenclature.class.php');
$PDOdb = new TPDOdb;
if(GETPOST('action', 'alpha'))
{
$action = GETPOST('action', 'alpha');
if($action == 'idprod_change')
{
$fk_product= (int)GETPOST('fk_product', 'int');
$nomenclature = new TNomenclature();
$nomenclature->loadByObjectId($PDOdb, $fk_product, 'product');
if($nomenclature->iExist)
{
$data['result'] = 1;
}
else
{
$data['result'] = 0;
}
}
}
echo json_encode($data);