26 lines
573 B
PHP
26 lines
573 B
PHP
|
|
<?php
|
||
|
|
if($_REQUEST['code']!='' ){
|
||
|
|
|
||
|
|
$w = $GLOBALS['db']->query("select count(code) as c from ecmproducts where code='".$_REQUEST['code']."'");
|
||
|
|
$r = $GLOBALS['db']->fetchByAssoc($w);
|
||
|
|
|
||
|
|
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']){
|
||
|
|
|
||
|
|
} else {
|
||
|
|
echo 'Istnieje już produkt o podanym kodzie!';
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
echo 'Istnieje już produkt o podanym kodzie!';
|
||
|
|
}
|
||
|
|
}else {
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
?>
|