|
|
@@ -412,6 +412,16 @@ class Route_DealsSales extends RouteBase {
|
|
|
$id_telboxes = V::get('id_telboxes', '', $_REQUEST);
|
|
|
$id_companies = V::get('id_companies', '', $_REQUEST, 'int');
|
|
|
|
|
|
+ $idTelboxes = $id_telboxes;
|
|
|
+ if (!empty($idTelboxes)) {
|
|
|
+ if (!empty($idTelboxes)) {
|
|
|
+ if (false !== strpos($idTelboxes, ': ')) {
|
|
|
+ $parts = explode(': ', $idTelboxes, 2);
|
|
|
+ $idTelboxes = $parts[0];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
SE_Layout::menu();
|
|
|
|
|
|
Lib::loadClass('TypespecialVariable');
|
|
|
@@ -422,20 +432,12 @@ class Route_DealsSales extends RouteBase {
|
|
|
$obrotyByYear = array();
|
|
|
$marki = array();
|
|
|
$obrotyToMarki = array();
|
|
|
- if (!empty($id_telboxes) || $id_companies > 0) {
|
|
|
+ if (!empty($idTelboxes)) {
|
|
|
$db = DB::getDB();
|
|
|
$sqlWhere = array();
|
|
|
$sqlWhere[] = " o.`A_STATUS`!='DELETED' ";
|
|
|
- if (!empty($id_telboxes)) {
|
|
|
- if (false !== strpos($id_telboxes, ': ')) {
|
|
|
- $parts = explode(': ', $id_telboxes, 2);
|
|
|
- $sqlWhere[] = " o.`T_TELBOX_NEIGHBOUR_IN`='{$parts[0]}' ";
|
|
|
- // $sqlWhere[] = " o.`marka`='{$parts[1]}' ";
|
|
|
- } else {
|
|
|
- $sqlWhere[] = " o.`T_TELBOX_NEIGHBOUR_IN`='{$id_telboxes}' ";
|
|
|
- }
|
|
|
- }
|
|
|
- //if ($id_companies > 0) $sqlWhere[] = " d.`ID_BILLING_USERS`='{$id_companies}' ";
|
|
|
+ $sqlIdTelboxes = $db->_($idTelboxes);
|
|
|
+ $sqlWhere[] = " o.`T_TELBOX_NEIGHBOUR_IN`='{$sqlIdTelboxes}' ";
|
|
|
$sqlWhere = (!empty($sqlWhere))? implode(" and ", $sqlWhere) : '';
|
|
|
$sql = "select o.`ID`
|
|
|
-- , d.`T_TELBOX_NEIGHBOUR_IN`
|
|
|
@@ -1077,9 +1079,9 @@ class Route_DealsSales extends RouteBase {
|
|
|
|
|
|
jQuery(document).ready(function() {
|
|
|
jQuery('#dealsSalesByMonth').DealsSalesTable({
|
|
|
- url: 'index.php?_route=DealsSales&_task=getDataAjax&telbox=<?php echo $id_telboxes; ?>',
|
|
|
- urlInlineEdit: 'index.php?_route=DealsSales&_task=inlineEditAjax&telbox=<?php echo $id_telboxes; ?>',
|
|
|
- urlSaveInlineEdit: 'index.php?_route=DealsSales&_task=saveInlineAjax&telbox=<?php echo $id_telboxes; ?>',
|
|
|
+ url: 'index.php?_route=DealsSales&_task=getDataAjax&telbox=<?php echo $idTelboxes; ?>',
|
|
|
+ urlInlineEdit: 'index.php?_route=DealsSales&_task=inlineEditAjax&telbox=<?php echo $idTelboxes; ?>',
|
|
|
+ urlSaveInlineEdit: 'index.php?_route=DealsSales&_task=saveInlineAjax&telbox=<?php echo $idTelboxes; ?>',
|
|
|
initData: <?php echo json_encode($initData); ?>
|
|
|
});
|
|
|
});
|