Пример #1
0
function preload_lists()
{
    $db = new dbconnection();
    $db->dbconnect();
    $db->query = "select listid,listname from " . TABLE_LISTS . " where active=1";
    $db->execute();
    $rowcount = $db->rowcount();
    if ($rowcount > 0) {
        for ($x = 0; $x < $rowcount; $x++) {
            $row = $db->fetchrow($x);
            $list[$x] = $row;
        }
    }
    return $list;
}
Пример #2
0
 function changepassword($userid, $oldpass, $newpass, $newpassrepeat)
 {
     if ($newpass == $newpassrepeat) {
         $enc = new Encryption();
         $db = new dbconnection();
         $db->dbconnect();
         //check oldpass, update password if ok, send message if not
         $password = $enc->oneway_encode($oldpass);
         $db->query = "select userid from " . TABLE_USERS . " where userid={$userid} and password='******'";
         $db->execute();
         if ($db->rowcount() > 0) {
             $newpass = $enc->oneway_encode($newpass);
             $db->query = "update " . TABLE_USERS . " set password='******' where userid={$userid}";
             $db->execute();
             $msg = 'Password updated.';
         } else {
             $msg = 'Incorrect old password.';
         }
     } else {
         $msg = 'New password does not match.';
     }
     return $msg;
 }
Пример #3
0
.col3_mbclient_yes{margin-left:15px;}
.col3_mbclient_no{margin-left:5px;}
.col3txt_branchremarks {border:0px;border-bottom:1px solid black;margin-left:5px;}
				</style>
		<title>Metrobank Application Form</title>
    </head>
<?php 
if (isset($_REQUEST['leadid'])) {
    $leadid = $_REQUEST['leadid'];
    require_once '../../includes/dbase.php';
    require_once '../../includes/settings.php';
    $db = new dbconnection();
    $db->dbconnect();
    $db->query = "select * from " . TABLE_CLIENTS . " a left join " . TABLE_CLIENTINFO . " b on (a.leadid=b.leadid) where a.leadid={$leadid}";
    $db->execute();
    if ($db->rowcount() > 0) {
        $row = $db->fetchrow(0);
    }
}
?>
<body>
    
    <div id="main">
	
        <div class="column1">
            <h3>ALL FIELDS ARE MANDATORY AND MUST BE FILLED UP.</h3><br>
			
			<b>MY CHOICE OF A METROBANK CREDIT CARD</b><br>
			
			<?php 
switch (strtoupper($row['mccardtype'])) {
Пример #4
0
    } else {
        $appliedcard = $_REQUEST['appliedcard'];
    }
} else {
    $appliedcard = '';
}
if (isset($_REQUEST['applied'])) {
    $checked = $_REQUEST['applied'];
} else {
    $checked = '';
}
//actual query
if ($appliedcard != '') {
    $db->query = "\n      select * from " . TABLE_CLIENTS . " a\n      inner join " . TABLE_LISTS . " b on (a.listid=b.listid)\n      inner join " . TABLE_USERS . " c on (a.agent=c.userid)\n      inner join " . TABLE_CARDS . " d on (a.leadid=d.leadid)\n      where disposition='{$dispo}' and teamid={$teamid} {$listid} and {$appliedcard}='{$checked}' order by {$sort} limit {$start}, {$end}\n    ";
    $db->execute();
} else {
    $db->query = "\n      select * from " . TABLE_CLIENTS . " a\n      inner join " . TABLE_LISTS . " b on (a.listid=b.listid)\n      inner join " . TABLE_USERS . " c on (a.agent=c.userid)\n      where disposition='{$dispo}' and teamid={$teamid} {$listid} order by {$sort} limit {$start}, {$end}";
    $db->execute();
}
$gridvalues = array();
$tablebody = "";
$rowcount = $db->rowcount();
for ($x = 0; $x < $rowcount; $x++) {
    $row = $db->fetchrow($x);
    $gridvalues[$x] = $row;
}
$body->template_loop('gridvalues', $gridvalues);
$body->add_key('prev', $start - 10);
$body->add_key('next', $start + 10);
$activelist = preload_lists();
$body->template_loop('list', $activelist);
Пример #5
0
} else {
    exit;
}
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);
Пример #6
0
}
$db = new dbconnection();
$db->dbconnect();
//masterfile
$concatname = str_replace(' ', '', $clfirstname . $clmiddlename . $cllastname);
$db->query = "\n  update " . TABLE_CLIENTS . "\n  set agent={$agent},disposition='{$disposition}',tagdate=now(),remarks='{$remarks}',concatname='{$concatname}'\n  where leadid={$leadid}\n  ";
$db->execute();
//clientinfo
$db->query = "\n  update " . TABLE_CLIENTINFO . "\n  set \n    {$setfields}\n    leadid={$leadid}\n  where leadid={$leadid}\n  ";
$db->execute();
//verifications
if (strtoupper($disposition) == 'VERIFIED') {
    $now = Date("Y-m-d");
    $db->query = "\n    select tagdate from " . TABLE_VER . "\n    where leadid={$leadid} and tagdate='{$now}'\n    ";
    $db->execute();
    if ($db->rowcount() == 0) {
        $db->query = "\n      insert into " . TABLE_VER . "\n        (leadid,agent,disposition,tagdate)\n        values\n        ({$leadid},{$agent},'{$disposition}','{$now}') \n      ";
        $db->execute();
    } else {
        $db->query = "\n      update " . TABLE_VER . "\n        set agent={$agent},disposition='{$disposition}',tagdate='{$now}'\n        where leadid={$leadid} \n      ";
        $db->execute();
    }
    $db->query = "\n  insert into " . TABLE_FILES . "\n    (leadid,filename,dateuploaded,agent)\n    values\n    ({$leadid},'','0000-00-00',0)\n    on duplicate key update\n    leadid={$leadid} \n  ";
    $db->execute();
}
//phonenumbers
$db->query = "select leadid,phonenumber from " . TABLE_PHONES . " where leadid={$leadid}";
$db->execute();
$queries = array();
$rowcount = $db->rowcount();
for ($x = 0; $x < $rowcount; $x++) {