Add php files
This commit is contained in:
33
modules/EcmProducts/checkcode.php
Executable file
33
modules/EcmProducts/checkcode.php
Executable file
@@ -0,0 +1,33 @@
|
||||
<?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);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user