Files

33 lines
747 B
PHP
Raw Permalink Normal View History

2025-05-12 15:44:39 +00:00
<?php
if($_REQUEST['code']!='' ){
$w = $GLOBALS['db']->query("select count(code) as c from ecmproducts where code='".$_REQUEST['code']."'");
$r = $GLOBALS['db']->fetchByAssoc($w);
$data=array();
if($r['c']>0){
if($_REQUEST['record']!=''){
$w2 = $GLOBALS['db']->query("select code as c from ecmproducts where id='".$_REQUEST['record']."'");
$r2 = $GLOBALS['db']->fetchByAssoc($w2);
if($_REQUEST['code']==$r2['c']){
$data['error']=0;
echo json_encode($data);
} else {
$data['error']=1;
echo json_encode($data);
}
} else {
$data['error']=1;
echo json_encode($data);
}
}else {
$data['error']=0;
echo json_encode($data);
}
} else {
$data['error']=1;
echo json_encode($data);
}
?>