primeidc/module/shop/ajax.good.php
2021-10-26 18:26:49 +09:00

44 lines
826 B
PHP

<?
include $_SERVER[DOCUMENT_ROOT] . "/common/conf/config.inc.php";
include $_SERVER[DOCUMENT_ROOT] . "/module/category/category.lib.php";
include $_SERVER[DOCUMENT_ROOT] . "/module/shop/shop.lib.php";
$cat = $_POST["cat"];
$mode = $_POST["mode"];
//DB연결
$dblink = SetConn($_conf_db["main_db"]);
switch ($mode) {
case "getproduct":
if (strlen(trim($cat))) {
//카테고리 목록
$arrList = getGoodListBaseNFileFromCat($cat, "", "" ,"" ,"0" ,"");
$list = array();
for($i=0;$i<$arrList["total"];$i++){
$list[] = $arrList['list'][$i];
}
$return = array(
"success" => true,
"result" => $list,
);
} else {
$return = array(
"success" => false,
"result" => $list,
);
}
break;
}
//DB해제
SetDisConn($dblink);
echo json_encode($return);
exit;
?>