Example #1
0
require_once "includes/cookie.php";
require_once "includes/template.php";
$body = new Template();
$cookie = new CookieInfo("CMS");
if ($cookie->check()) {
    $cookie->getcookies();
    if ($cookie->array['usertype'] == 2) {
        header("Location: tl.php");
    } else {
        if ($cookie->array['usertype'] == 3) {
            header("Location: dc.php");
        } else {
            if ($cookie->array['usertype'] == 4) {
                header("Location: agent.php");
            } else {
                if ($cookie->array['usertype'] == 5) {
                    header("Location: it.php");
                } else {
                    if ($cookie->array['usertype'] == 1) {
                        header("Location: agent.php");
                    }
                }
            }
        }
    }
    exit;
}
$body->set_template("templates/index.html");
$body->add_key('errmsg', '');
echo $body->create();
Example #2
0
}
if (isset($_REQUEST['referalname'])) {
    require_once "../../includes/settings.php";
    require_once "../../includes/dbase.php";
    $referalname = $_REQUEST['referalname'];
    $referalcontact = $_REQUEST['referalcontact'];
    $curdatetime = Date("Y-m-d H:i:s");
    $db = new dbconnection();
    $db->dbconnect();
    $db->query = "\n    insert into " . TABLE_CLIENTS . "\n      (completename,phone,disposition,dateuploaded,tagdate,dateexpires,listid,opener,agent,referencecode)\n      values\n      ('{$referalname}','{$referalcontact}','Referal',curdate(),'{$curdatetime}',CURDATE() + INTERVAL 30 DAY,2,{$userid},{$userid},'{$leadid}')\n    ";
    $db->execute();
    $db->query = "\n    select leadid from " . TABLE_CLIENTS . "\n    where agent={$userid} and disposition='Referal' and tagdate='{$curdatetime}'\n    ";
    $db->execute();
    if ($db->rowcount() == 1) {
        $row = $db->fetchrow(0);
        $db->query = "insert into " . TABLE_CLIENTINFO . " (leadid) values (" . $row['leadid'] . ")";
        $db->execute();
        $db->query = "insert into " . TABLE_CARDS . " (leadid) values (" . $row['leadid'] . ")";
        $db->execute();
    } else {
        //temporary error handler
        $db->query = "update " . TABLE_CLIENTS . " set disposition='ERROR' where agent={$userid} and disposition='Referal' and tagdate='{$curdatetime}'";
        $db->execute();
    }
}
$body = new Template();
$body->set_template("../../templates/agent/referal.html");
$body->add_key('cname', $cname);
$body->add_key('userid', $userid);
$body->add_key('leadid', $leadid);
echo $body->create();
Example #3
0
require_once "../../includes/settings.php";
require_once "../../includes/dbase.php";
require_once "../../includes/template.php";
if (isset($_REQUEST['leadid'])) {
    $leadid = $_REQUEST['leadid'];
} else {
    exit;
}
if (isset($_REQUEST['cname'])) {
    $cname = $_REQUEST['cname'];
} else {
    exit;
}
$db = new dbconnection();
$db->dbconnect();
$db->query = "\n  select * from " . TABLE_HISTORY . " a\n  inner join " . TABLE_USERS . " b on (a.agent=b.userid)\n  where leadid={$leadid} order by tagdate desc\n  ";
$db->execute();
$history = array();
$rowcount = $db->rowcount();
if ($rowcount > 0) {
    for ($x = 0; $x < $rowcount; $x++) {
        $row = $db->fetchrow($x);
        $history[$x] = $row;
    }
}
$body = new Template();
$body->set_template("../../templates/agent/callhistory.html");
$body->add_key('cname', $cname);
$body->template_loop('history', $history);
echo $body->create();
Example #4
0
        $cookie->addkey("lastname", $row['lastname']);
        $cookie->addkey("extension", $row['extension']);
        $cookie->addkey("hostaddress", $row['hostaddress']);
        $cookie->addkey("teamid", $row['teamid']);
        $cookie->addkey("usertype", $row['usertype']);
        $cookie->setcookies();
        if ($cookie->array['usertype'] == 1) {
            header("Location: agent.php");
        } else {
            if ($cookie->array['usertype'] == 2) {
                header("Location: tl.php");
            } else {
                if ($cookie->array['usertype'] == 3) {
                    header("Location: dc.php");
                } else {
                    if ($cookie->array['usertype'] == 4) {
                        header("Location: gh.php");
                    } else {
                        if ($cookie->array['usertype'] == 5) {
                            header("Location: it.php");
                        }
                    }
                }
            }
        }
        exit;
    }
}
$body->set_template("templates/index.html");
$body->add_key("errmsg", $errmsg);
echo $body->create();
Example #5
0
<?php

require_once "includes/cookie.php";
require_once "includes/template.php";
$body = new Template();
$cookie = new CookieInfo("CMS1");
// check existing credentials before proceeding with tha application
// redirect to login if no valid credentials found
if ($cookie->check()) {
    $cookie->getcookies();
    $userid = $cookie->array['userid'];
    $teamid = $cookie->array['teamid'];
    $extension = $cookie->array['extension'];
    $hostaddress = $cookie->array['hostaddress'];
    $body->add_key('userid', $userid);
    $body->add_key('firstname', $cookie->array['firstname']);
    $body->add_key('lastname', $cookie->array['lastname']);
    $body->add_key('extension', $extension);
    $body->add_key('hostaddress', $hostaddress);
    $body->add_key('teamid', $teamid);
} else {
    header('Location: index.php');
}
// set the header menu
$body->set_template("templates/agent/header.html");
echo $body->create();
//set the main content
$page = isset($_REQUEST['show']) ? strtolower(str_replace("'", "", $_REQUEST['show'])) : 'dashboard';
$body->add_key('mainpage', $_SERVER['SCRIPT_NAME']);
$body->add_key('workingfolder', $page);
switch ($page) {
Example #6
0
<?php

require_once "includes/cookie.php";
require_once "includes/template.php";
$body = new Template("templates/admin.html");
$cookie = new CookieInfo("CMS");
if ($cookie->check()) {
    $cookie->getcookies();
    $body->add_key('firstname', $cookie->array['firstname']);
    $body->add_key('lastname', $cookie->array['lastname']);
}
if (isset($_REQUEST['show'])) {
    $show = $_REQUEST['show'];
    if (isset($_REQUEST['act'])) {
        $act = $_REQUEST['act'];
    } else {
        $act = '';
    }
    switch ($show) {
        case 'users':
            switch ($act) {
                case 'add':
                    $content = new Template('templates/admin/adduser.html');
                    $body->add_key('content', $content->create());
                    break;
                case 'edit':
                    break;
                case 'delete':
                    break;
                case 'search':
                    break;