get($currentUserId);
if (!isset($user_view->agencyId)) {
$user_view->agencyId = $currentUserId;
$user_view->agencyName = $user_view->fio;
}
$agency_id = (int) $user_view->agencyId;
$funnelsDBO = mysql_query("select * from funnel WHERE agency_id = {$agency_id}");
$funnels = array();
while ($row = mysql_fetch_assoc($funnelsDBO)) {
$funnel = array();
$funnel['id'] = $row['id'];
$funnel['name'] = $row['name'];
$funnel['steps'] = array();
$funnelSteps = mysql_query("select * from funnel_steps WHERE funnel_id = " . $funnel['id']);
while ($row2 = mysql_fetch_assoc($funnelSteps)) {
/*if($_SESSION['id'] == 5238){
echo '*****************'.$row2['name'] .' '.$row2['id']; var_dump(json_decode(html_entity_decode($row2['pole_end_list']), ENT_QUOTES)); echo '
';
}*/
$a = array();
$a['id'] = $row2['id'];
$a['name'] = $row2['name'];
$a['fields'] = htmlspecialchars_decode($row2['pole_end_list']);
array_push($funnel['steps'], $a);
}
array_push($funnels, $funnel);
}
$get = clearInputData($_GET);
$statTableId = (int) $get['table_id'];
$table = mysql_fetch_assoc(mysql_query("SELECT * FROM `stat_tables` WHERE `id`=$statTableId"));
$table['json_funnel'] = json_decode(htmlspecialchars_decode($table['json_funnel']), true);
for ($i = 0; $i < count($table['json_funnel'][0]['steps']); $i++) {
$stepId = (int) $table['json_funnel'][0]['steps'][$i]['id'];
$stepDBO = mysql_query("SELECT name FROM `funnel_steps` WHERE `id`=$stepId");
while ($row2 = mysql_fetch_assoc($stepDBO)) {
$table['json_funnel'][0]['steps'][$i]['name'] = $row2['name'];
break;
}
}
$table['json_add'] = json_decode(htmlspecialchars_decode($table['json_add']), true);
$__funnelsText = json_encode($funnels);
$__statTableText = json_encode($table);
?>
Эл. почта
Телефон
Тип клиента
Роль клиента
Тип недвижимости
Объекты
Бюджет
Описание
Ответственный
Источник
Текущий этап
Сохранить