Update for BeWellWell my account en media_upload

This commit is contained in:
“VeLiTi”
2025-08-29 15:01:30 +02:00
parent 010b23b0e5
commit f8e089ffcd
20 changed files with 603 additions and 22 deletions

View File

@@ -55,7 +55,8 @@ if(isset($get_content) && $get_content!=''){
//Define Query
if(isset($criterias['totals']) && $criterias['totals'] ==''){
//Request for total rows
$sql = 'SELECT count(*) as count FROM dealers d '.$whereclause.'';
$sql = 'SELECT count(*) as count FROM dealers d '.$whereclause;
}
elseif (isset($criterias['list']) && $criterias['list'] ==''){
$sql = 'SELECT d.* FROM dealers d '.$whereclause;
@@ -64,6 +65,7 @@ else {
//SQL for Paging
$sql = 'SELECT d.*, m.full_path FROM dealers d LEFT JOIN media m ON d.dealer_media = m.rowID '.$whereclause.' LIMIT :page,:num_products';
}
$stmt = $pdo->prepare($sql);
//Bind to query
@@ -95,8 +97,18 @@ if (!empty($criterias)){
//Add paging details
if(isset($criterias['totals']) && $criterias['totals']==''){
$stmt->execute();
$messages = $stmt->fetch();
$messages = $stmt->fetch();
$messages = $messages[0];
//No further data transformation need
$messages = json_encode($messages, JSON_UNESCAPED_UNICODE);
//Send results
echo $messages;
//exit
exit();
}
elseif (isset($criterias['list']) && $criterias['list']==''){
//Excute Query
@@ -116,10 +128,20 @@ else {
}
//------------------------------------------
//CHANGE ROWID INTO UUID
//------------------------------------------
function updateRowID($row) {
$row['rowID'] = encodeUuid($row['rowID']);
return $row;
}
$updatedData = array_map('updateRowID', $messages);
//------------------------------------------
//JSON_ENCODE
//------------------------------------------
$messages = json_encode($messages, JSON_UNESCAPED_UNICODE);
$messages = json_encode($updatedData, JSON_UNESCAPED_UNICODE);
//Send results
echo $messages;