?php

	// Load the initial configuration options. 
	require_once('datastore.php');
	require_once('complaint.php');
        
	// Instantiate the Smarty class object.
	$smarty  = new MySmarty(); 
        $ls      = new RRJ4TG();
        $mysql41 = new RRJ4TG();
        $smarty->assign("staticBody","");
        $thisAttr = NULL;

        if ($consul->appMode == "production") {
          $userRole = "end"; } else {
          $userRole = "admin";
	}

        function malIcon($uI) { global $consul;
	  if ($uI> 0)
	    return $consul->getMalIcon($consul->isUnAbsolved($uI),$consul->isPaid($uI));
          return "";
        }

        $smarty->register_function('malIcon', 'malIcon');

        function endUserMain() { global $consul, $smarty, $ls, $userRole, $mysql41;
       
	$smarty->assign("abuseForm","enabled");            

        if ($userRole  == "admin") 
            $smarty->assign("listTitle","

Probation Queue

"); $qualia = " WHERE bit_resign = 0 AND dt_created >= DATE_SUB(CURDATE(),INTERVAL " . RRJ4TG_PROBATIONDAYS . " DAY) ORDER BY dt_created DESC"; $newbies = array(); $nations = array(); $nthNewbie = 0; $totalB = 0; $totalP = 0; $totalT = 0; $smarty->assign("policing","community"); if ($consul->getAll("SELECT * FROM tblUsers",$qualia) != false) while($newbies[$nthNewbie] = mysql_fetch_assoc($consul->rs)) { if (!isset($nations[$newbies[$nthNewbie]['vc_country']])) { $code = $newbies[$nthNewbie]['vc_country']; $nations[$code] = array(); $nations[$code]['name'] = $ls->nationShortName($code); $nations[$code]['states'] = array(); } if (!isset($nations[$newbies[$nthNewbie]['vc_country']]['states'][$newbies[$nthNewbie]['vc_state']])) { if ($newbies[$nthNewbie]['vc_country'] != "CA" && $newbies[$nthNewbie]['vc_country'] != "US" ) { $code = $newbies[$nthNewbie]['vc_state']; $nations[$newbies[$nthNewbie]['vc_country']]['states'][$newbies[$nthNewbie]['vc_state']] = $ls->province($code); } else $nations[$newbies[$nthNewbie]['vc_country']]['states'][$newbies[$nthNewbie]['vc_state']] = $newbies[$nthNewbie]['vc_state']; } $sql = "SELECT * FROM tblUserPictures WHERE int_user_id = " . $newbies[$nthNewbie]['int_user_id'] ; //$consul->lf("s: " . count($mysql41->rs)); $newbies[$nthNewbie]['country'] = $nations[ $newbies[$nthNewbie]['vc_country'] ]['name']; $newbies[$nthNewbie]['province'] = $nations[ $newbies[$nthNewbie]['vc_country'] ]['states'][ $newbies[$nthNewbie]['vc_state'] ]; if ((($nthNewbie + 1) % 10) != 0) $newbies[$nthNewbie]['idx'] = "    "; else { $pad = ($nthNewbie < 100) ? "  " : " "; $newbies[$nthNewbie]['idx'] = "" . ($nthNewbie + 1) . "" . $pad; } $nthNewbie++; } else { $consul->getAll("SELECT * FROM tblUsers"," WHERE vc_username like '%urga%'"); $newbies[0] = mysql_fetch_assoc($consul->rs); $nthNewbie = 1; } $smarty->assign("blogs",$newbies); $smarty->assign("prescreened", $nthNewbie); $smarty->assign("userRole", $userRole); } function llcUserMain() { global $consul, $smarty, $ls, $userRole,$mysql41; switch($_REQUEST['jobStep']) { default: $qualia = " WHERE int_user_id IN (SELECT distinct userId from tblAttributes WHERE attrId = " . RRJ4TG_UNABSOLVED . ")"; $lt = "

Queue of Unresolved Complaints

"; $smarty->assign("moreParms",""); break; case 'locked': $lDays = 30; $qualia = " WHERE int_user_id IN (SELECT distinct userId from tblAttributes WHERE attrId = " . RRJ4TG_MARLOCKED . " AND DATEDIFF(NOW(),created) <= " . $lDays . " ORDER BY created)"; $lt = "

Accounts with Lock Actions Performed in Last " . $lDays . " Days

"; $smarty->assign("moreParms","&moreParmz=forLocked"); break; } $newbies = array(); $nations = array(); $nthNewbie = 0; $totalB = 0; $totalP = 0; $totalT = 0; $smarty->assign("policing","community"); $smarty->assign("listTitle",$lt); $smarty->assign("nullList",false); if ($consul->getAll("SELECT * FROM tblUsers",$qualia) != false) while($newbies[$nthNewbie] = mysql_fetch_assoc($consul->rs)) { if (!isset($nations[$newbies[$nthNewbie]['vc_country']])) { $code = $newbies[$nthNewbie]['vc_country']; $nations[$code] = array(); $nations[$code]['name'] = $ls->nationShortName($code); $nations[$code]['states'] = array(); } if (!isset($nations[$newbies[$nthNewbie]['vc_country']]['states'][$newbies[$nthNewbie]['vc_state']])) { if ($newbies[$nthNewbie]['vc_country'] != "CA" && $newbies[$nthNewbie]['vc_country'] != "US" ) { $code = $newbies[$nthNewbie]['vc_state']; $nations[$newbies[$nthNewbie]['vc_country']]['states'][$newbies[$nthNewbie]['vc_state']] = $ls->province($code); } else $nations[$newbies[$nthNewbie]['vc_country']]['states'][$newbies[$nthNewbie]['vc_state']] = $newbies[$nthNewbie]['vc_state']; } $sql = "SELECT * FROM tblUserPictures WHERE int_user_id = " . $newbies[$nthNewbie]['int_user_id'] ; //$consul->lf("s: " . count($mysql41->rs)); $newbies[$nthNewbie]['country'] = $nations[ $newbies[$nthNewbie]['vc_country'] ]['name']; $newbies[$nthNewbie]['province'] = $nations[ $newbies[$nthNewbie]['vc_country'] ]['states'][ $newbies[$nthNewbie]['vc_state'] ]; if ((($nthNewbie + 1) % 10) != 0) $newbies[$nthNewbie]['idx'] = "    "; else { $pad = ($nthNewbie < 100) ? "  " : " "; $newbies[$nthNewbie]['idx'] = "" . ($nthNewbie + 1) . "" . $pad; } $nthNewbie++; } else { $smarty->assign("nullList",true); // $consul->getAll("SELECT * FROM tblUsers"," WHERE vc_username like '%urga%'"); // $newbies[0] = mysql_fetch_assoc($consul->rs); // $nthNewbie = 1; } $smarty->assign("blogs",$newbies); $smarty->assign("prescreened", $nthNewbie); $smarty->assign("userRole", $userRole); $uow = new RRJ4TG(); } function doDups() { global $smarty; $uow = new RRJ4TG(); $totalError = ""; $ith; if (!isset($_REQUEST['totalAttrs'])) $totalError = "Parameter Error!"; else for($ith=0;$ith < $_REQUEST['totalAttrs'];$ith++) { $ithAttr = 'whichAttr' . $ith; $jthAttr = 'attr'. $ith; if ($_REQUEST[$ithAttr]) { $thisAttr = $_REQUEST[$jthAttr]; if ($uow->query("SELECT * FROM tblAttributes"," WHERE thisAttr = " . $thisAttr )) { $thisComplaint = new abuseComplaint(); $thisComplaint->Attr = $thisAttr; $thisComplaint->get($uow); $thisComplaint->notes .= "
" . date("m.d.y") . " " . gmstrftime ("%T", time ()) ; $uow1 = new RRJ4TG(); if ($uow1->query("SELECT * FROM tblUsers"," WHERE int_user_id = " . $_SESSION['member_id'])) { $thisComplaint->notes .= " (" . $uow1->row['vc_username'] . ") "; } $thisComplaint->notes .= ""; $thisComplaint->notes .= " Duplicate. " . "

" ; $thisComplaint->dispatch("Dup"); if ($thisComplaint->error != "") $totalError .= " " . $thisComplaint->error; } }} $smarty->assign("aMsg",$totalError); $smarty->assign("msgColor","darkred"); $smarty->assign("staticBody","done"); } function whichAttrSelected() { if (isset($_REQUEST['whichAttr'])) return $_REQUEST['whichAttr']; if (!isset($_REQUEST['totalAttrs'])) return NULL; else for($ith=0;$ith < $_REQUEST['totalAttrs'];$ith++) { $ithAttr = 'whichAttr' . $ith; $jthAttr = 'attr'. $ith; if ($_REQUEST[$ithAttr]) return $_REQUEST[$jthAttr];} return NULL; } if (isset($_REQUEST['jobStep'])) { $subType = NULL; if ($_REQUEST['jobStep'] == "manage") $dispatchValue = $_REQUEST['abuse_type']; else $dispatchValue = $_REQUEST['jobStep']; if ($dispatchValue != "Dup") $thisAttr = whichAttrSelected(); switch($dispatchValue) { case 'locked': case 'llc': llcUserMain(); break; case 'Dup': doDups(); break; case 'Unlock': $subType = "unlock"; case 'Tickle': case 'Kick': case 'Ban': case 'Lock': case 'Warn': case 'Absolve': $uow = new RRJ4TG(); $thisComplaint = new abuseComplaint($subType); if ($thisAttr != NULL) { $thisComplaint->Attr = $thisAttr; if ($uow->query("SELECT * FROM tblAttributes"," WHERE thisAttr = " . $thisAttr )) { if (isset($_REQUEST['note'])) { $thisComplaint->notes .= "
" . date("m.d.y") . " " . gmstrftime ("%T", time ()) ; $uow1 = new RRJ4TG(); if ($uow1->query("SELECT * FROM tblUsers"," WHERE int_user_id = " . $_SESSION['member_id'])) { $thisComplaint->notes .= " (" . $uow1->row['vc_username'] . ") "; } $thisComplaint->notes .= ""; $thisComplaint->notes .= $_REQUEST['note'] . "

" ; } if (isset($_REQUEST['supplement'])) $thisComplaint->ps = $_REQUEST['supplement'] ; $thisComplaint->dispatch($dispatchValue); } } else $thisComplaint->error = "No item selected!"; if ($thisComplaint->error != "") $smarty->assign("aMsg",$thisComplaint->error); $smarty->assign("msgColor","darkred"); $smarty->assign("staticBody","done"); break; case 'qcomplaint': $thisComplaint = new abuseComplaint(); $thisComplaint->open($_REQUEST['abuse_type'] , $_SESSION['member_id'] , $_REQUEST['complaint']); $smarty->assign("aMsg","Your report has been queued for GFM staff attention."); $smarty->assign("msgColor","darkred"); $smarty->assign("staticBody","complaintQueued"); break; case 'complain': header("Location: /members/form.php?formFrameApp=maliciousUser&jobStep=" . $_REQUEST['jobStep'] ); exit; } } else { if ($userRole == "end") $smarty->assign("abuseForm","enabled"); if ($consul->appMode != "production") endUserMain(); } $smarty->assign("backLink","Return To Abuse Report Page"); // Display the template page. $smarty->display('members/badGuys.tpl'); ?php