Joywork/ajax/funnel_step_close.php
2026-05-22 21:21:54 +03:00

40 lines
1.3 KiB
PHP

<?php
require_once($_SERVER['DOCUMENT_ROOT']."/ajax/vue_php_function.php");
if(isset($_POST['step'])){
$res = array();
$id = (int)$_POST['step'];
$step = mysql_query(
"SELECT
funnel_steps.*,
cs.`status` AS complex_status_type
FROM funnel_steps
LEFT JOIN `complex_status` AS cs ON cs.`id` = funnel_steps.`complex_status_id`
WHERE funnel_steps.`id` = $id
AND deleted = 0
");
if(mysql_num_rows($step) > 0){
$row = mysql_fetch_assoc($step);
$res = deClearInputElements($row);
$sql_file = "SELECT * FROM funnel_files WHERE etap_id = '".$row['id']."' AND funnel_id = ".$row['funnel_id'];
$q_file = mysql_query($sql_file);
$files = array();
while($file_r = mysql_fetch_assoc($q_file)){
$path = "https://uf.joywork.ru/upload/funnels/".$row['funnel_id']."/".$file_r['guid'].".".$file_r['type'];
$files[] = array('guid' => $file_r['guid'],'isUpload' => true, 'uploads' => false, 'name' => $file_r['name'], 'path' => $path);
}
$res['files'] = $files;
}
echo json_encode($res, JSON_UNESCAPED_UNICODE);
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/