Beispiel #1
0
<?php

include S_SECTIONS . "/member/memberaccess.php";
if (!isset($inboxDelObj)) {
    include_once SITE_CLASS_APPLICATION . "class.UserDeletedInbox.php";
    $inboxDelObj = new UserDeletedInbox();
}
$val = $_POST['val'];
//Prints($_SESSION['SESS_B2B_USER_TYPE_SHORT']);exit;
$eUserType = $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_USER_TYPE_SHORT'];
$iUserId = $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_ID'];
if ($val != '') {
    $valArr = @explode(',', $val);
    foreach ($valArr as $key => $value) {
        $dmdtl = $inboxDelObj->getDetails('*', " AND iInboxId={$value} AND eUserType='{$eUserType}' AND iUserId={$iUserId} ");
        if (is_array($dmdtl) && count($dmdtl) > 0) {
            $Data = array('eViewed' => 'No');
            // $inboxDelObj->setAllVar($Data);
            // $vrfres = $inboxDelObj->insert();
            $vrfres = $inboxDelObj->updateData($Data, " iDelInboxId=" . $dmdtl[0]['iDelInboxId'] . " ");
        } else {
            $Data = array('iUserId' => $iUserId, 'eUserType' => $eUserType, 'iInboxId' => $value, 'eViewed' => 'No');
            $inboxDelObj->setAllVar($Data);
            $vrfres = $inboxDelObj->insert();
        }
    }
    if ($vrfres) {
        $msg = $smarty->get_template_vars('MSG_INBOX_MSG_DELETED_SUCC');
    } else {
        $msg = $smarty->get_template_vars('MSG_INBOX_MSG_DELETE_ERROR');
    }
Beispiel #2
0
}
//	  echo $where; exit;
$orderBy = " ORDER BY iVerifiedID DESC";
$limit = " LIMIT " . ($page - 1) * $REC_LIMIT_FRONT . ", " . $REC_LIMIT_FRONT . " ";
//print $where;
$sql_cnt = 'CALL GetInbox("' . $sessType . '","' . $where . '","","' . $orderBy . '","")';
// echo $sql_cnt; exit;
$cnt = $dbobj->Onlyquery($sql_cnt);
$sql_res = 'CALL GetInbox("' . $sessType . '"," ' . $where . '","","' . $orderBy . '","' . $limit . '")';
// echo $sql_res; exit;
$res = $dbobj->Onlyquery($sql_res);
$count = count($cnt);
if (!isset($pgajxobj)) {
    require_once SITE_CLASS_GEN . "class.paging-ajax.php";
}
$pgajxobj = new Paging($count, $page, "listgroup", $REC_LIMIT_FRONT);
$paging = $pgajxobj->getListPG($page);
$pgmsg = $pgajxobj->setMessage("Records");
//echo $paging; exit;
$readm = array();
$dmdtl = $inboxDelObj->getDetails('iInboxId', " AND eUserType='{$sessType}' AND iUserId={$sess_id} ");
for ($l = 0; $l < count($dmdtl); $l++) {
    $readm[] = $dmdtl[$l]['iInboxId'];
}
// prints($res); exit;
//$smarty->assign('orglist',$orglist);
$smarty->assign('curViewedInbox', $curViewedInbox);
$smarty->assign('activegroup', $res);
$smarty->assign('readm', $readm);
$smarty->assign('paging', $paging);
$smarty->assign('pgmsg', $pgmsg);
Beispiel #3
0
$where = " AND iVerifiedID={$id}";
/*if($sess_usertype_short != 'SM'){
   $where .= " AND iOrganizationId=$curORGID ";
}*/
$sql_res = 'CALL GetInbox("' . $sess_usertype_short . '","' . $where . '","","' . $orderBy . '","")';
$res = $dbobj->Onlyquery($sql_res);
$curViewedsess = isset($_SESSION['SESS_' . PRJ_CONST_PREFIX . '_INBOX_VIEWED']) ? $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_INBOX_VIEWED'] : '';
if (!@in_array($id, $curViewedsess)) {
    $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_INBOX_VIEWED'][] = $id;
}
// prints($res);exit;
// set as viewed
if (!isset($inboxDelObj)) {
    include_once SITE_CLASS_APPLICATION . "class.UserDeletedInbox.php";
    $inboxDelObj = new UserDeletedInbox();
}
$dmdtl = $inboxDelObj->getDetails('*', " AND iInboxId={$id} AND eUserType='{$sess_usertype_short}' AND iUserId={$sess_id} ");
if (is_array($dmdtl) && count($dmdtl) < 1) {
    $dtl = array('iUserId' => $sess_id, 'eUserType' => $sess_usertype_short, 'iInboxId' => $id, 'eViewed' => 'Yes');
    // prints($dtl); exit;
    $inboxDelObj->setAllVar($dtl);
    $vrfres = $inboxDelObj->insert();
}
if ($HAVE_HTACCESS == 'No') {
    // prints($res);
    // $res[0]['tMailContent_en'] = preg_replace('/\<a(.*)'.SITE_URL.'/$',SITE_URL_DUM,$res[0]['tMailContent_en']);
    $res[0]['tMailContent_en'] = str_replace(SITE_URL, SITE_URL_DUM, $res[0]['tMailContent_en']);
    $res[0]['tMailContent_fr'] = str_replace(SITE_URL, SITE_URL_DUM, $res[0]['tMailContent_fr']);
    $res[0]['tMailContent_fr'] = str_replace(SITE_URL, SITE_URL_DUM, $res[0]['tMailContent_fr']);
}
$smarty->assign('res', $res);