?php
	// Load the initial configuration options.

	require_once('datastore.php');    
	require_once('../forms/forms.php');
	require_once('complaint.php');
    
/*
 * Create a form object 
 * Create the Smarty engine object to process the form template first 
 *
 * NOTE: the form template needs to be processed separately from any other
 * page templates to prevent that the form prefilter interferes with the
 * normal processing of the other templates
 */
	$form   = new form_class;
	$form->debug="";

/*
 * Define a warning message to display by Javascript code when the user
 * attempts to submit the this form again from the same page.
 */
	$form->ResubmitConfirmMessage="Are you sure you want to submit this form again?";

/*
 * Output previously set password values
 */
	$form->OutputPasswordValues=1;

/*
 * Output multiple select options values separated by line breaks
 */
	$form->OptionsSeparator="
\n"; /* * Output all validation errors at once. */ $form->ShowAllErrors=1; /* * CSS class to apply to all invalid inputs. * Set to a non-empty string to specify the invalid input CSS class */ $form->InvalidCLASS=''; $form->NAME="police"; $form->METHOD="POST"; switch($_REQUEST['jobStep']) { case 'manage': $defendant = $_REQUEST['u']; $sql ="SELECT * FROM tblUsers WHERE int_user_id = " . $_REQUEST['u']; if ($consul->query($sql)) { $perp = $consul->row['vc_username']; } else { $perp = "Unknown"; } if (isset($_REQUEST['moreParmz'])) { $qualia = " AND attrId in ( " . RRJ4TG_MARLOCKED . " , " . RRJ4TG_MARKICKED . " , " . RRJ4TG_MARBANNED . ")"; $subType = "unlock"; } else { $subType = NULL; $qualia = " AND (attrId >= " . RRJ4TG_UNABSOLVED . " AND attrId <= " . RRJ4TG_ABSOLVED . ")"; } if ($perp != "Unknown") { global $complaints; $nth = 0; $uow = new RRJ4TG(); $complaints = array(); if (isset($_REQUEST['u'])) { if ($uow->getAll("SELECT * FROM tblAttributes " , " WHERE userId = " . $_REQUEST['u'] . $qualia )) { $nComplaints = mysql_num_rows( $uow->rs ); while($uow->row = mysql_fetch_assoc( $uow->rs )) { $nthComplaint = new abuseComplaint($subType); $nthComplaint->get( $uow ); if ($nComplaints > 1) { $nthComplaint->selectBox = ""; } else $nthComplaint->selectBox = ""; $complaints[$nth++] = $nthComplaint; } } $totalAttrs = ""; } } $form->ACTION="/members/badGuys.php?jobStep=manage"; /* * Define the form field properties even if they may not be displayed. */ $form->AddInput(array( "TYPE"=>"radio", "NAME"=>"abuse_type", "VALUE"=>"Absolve", "ID"=>"no_abuse", "ValidateAsSet"=>1, "TITLE"=>"Dismiss a complaint, no message will be sent.", "ValidateAsSetErrorMessage"=>"No response type specified.", "LABEL"=>"Absolve", "ACCESSKEY"=>"A", "ReadOnlyMark"=>"[X]" )); $form->AddInput(array( "TYPE"=>"radio", "NAME"=>"abuse_type", "VALUE"=>"Tickle", "TITLE"=>"Shill a user. Use this to process Freeloader flirt complaints", "ID"=>"tickle_abuse", "ValidateAsSet"=>1, "ValidateAsSetErrorMessage"=>"No response type specified.", "LABEL"=>"Tickle", "ACCESSKEY"=>"T", "ReadOnlyMark"=>"[X]" )); $form->AddInput(array( "TYPE"=>"radio", "NAME"=>"abuse_type", "VALUE"=>"Warn", "TITLE"=>"Warn a user. Use this to process Freeloader violation of terms of service complaints", "ID"=>"warn_abuse", "ValidateAsSet"=>1, "ValidateAsSetErrorMessage"=>"No response type specified.", "LABEL"=>"Warn", "ACCESSKEY"=>"W", "ReadOnlyMark"=>"[X]" )); $form->AddInput(array( "TYPE"=>"radio", "NAME"=>"abuse_type", "VALUE"=>"Kick", "ID"=>"kick_abuse", "TITLE"=>"Kick user off system. No message will be sent. IP will be blocked.", "ValidateAsSet"=>1, "ValidateAsSetErrorMessage"=>"No response type specified.", "LABEL"=>"Kick", "ACCESSKEY"=>"K", "ReadOnlyMark"=>"[X]" )); $form->AddInput(array( "TYPE"=>"radio", "NAME"=>"abuse_type", "VALUE"=>"Dup", "ID"=>"dup_abuse", "TITLE"=>"Close AR line item(s). Only option valid with multiple items.", "ValidateAsSet"=>1, "ValidateAsSetErrorMessage"=>"No response type specified.", "LABEL"=>"Dup", "ACCESSKEY"=>"D", "ReadOnlyMark"=>"[X]" )); $form->AddInput(array( "TYPE"=>"radio", "NAME"=>"abuse_type", "VALUE"=>"Lock", "ID"=>"lock_abuse", "TITLE"=>"Lock Account. It can be unlocked later. No message will be sent.", "ValidateAsSet"=>1, "ValidateAsSetErrorMessage"=>"No response type specified.", "LABEL"=>"Lock", "ACCESSKEY"=>"L", "ReadOnlyMark"=>"[X]" )); $form->AddInput(array( "TYPE"=>"radio", "NAME"=>"abuse_type", "VALUE"=>"Ban", "ID"=>"ban_abuse", "TITLE"=>"Lock account and send accused notice they are banned.", "ValidateAsSet"=>1, "ValidateAsSetErrorMessage"=>"No response type specified.", "LABEL"=>"Ban", "ACCESSKEY"=>"B", "ReadOnlyMark"=>"[X]" )); $form->AddInput(array( "TYPE"=>"radio", "NAME"=>"abuse_type", "VALUE"=>"Unlock", "ID"=>"unlock_abuse", "TITLE"=>"Unlock account, send accused msg they're unbanned. Use only w. a LOCKED status item.", "ValidateAsSet"=>1, "ValidateAsSetErrorMessage"=>"No response type specified.", "LABEL"=>"Unlock", "ACCESSKEY"=>"U", "ReadOnlyMark"=>"[X]" )); $form->AddInput(array( "TYPE"=>"textarea", "NAME"=>"supplement", "TITLE"=>"Optional supplement to message sent to accused, if any.", "ID"=>"supplement", "ROWS"=>4, "COLS"=>80, "LABEL"=>"Custom Message Supplement To Accused User", "ACCESSKEY"=>"C" )); $rc="AddInput: " . $form->AddInput(array( "TITLE"=>"Optional note to add to permanent record/audit trail for the accused.", "TYPE"=>"textarea", "NAME"=>"note", "ID"=>"note", "ROWS"=>4, "COLS"=>80, "LABEL"=>"Notes for Audit Trail", "ACCESSKEY"=>"N" )); $form->AddInput(array( "TYPE"=>"submit", "ID"=>"button_subscribe", "VALUE"=>"Do It", "ACCESSKEY"=>"u" )); $form->AddInput(array( "TYPE"=>"image", "ID"=>"image_subscribe", "SRC"=>"http://www.phpclasses.org/graphics/add.gif", "ALT"=>"Submit Report", "STYLE"=>"border-width: 0px;" )); $form->AddInput(array( "TYPE"=>"hidden", "NAME"=>"doit", "VALUE"=>1 )); $form->AddInput(array( "TYPE"=>"hidden", "NAME"=>"u", "VALUE"=>$_REQUEST['u'] )); $form->AddInput(array( "TYPE"=>"hidden", "NAME"=>"jobStep", "ID"=>"jobStep", "VALUE"=>"manage" )); $form->AddInput(array( "TYPE"=>"hidden", "NAME"=>"user_track", "VALUE"=>"0", "ValidateAsInteger"=>1, "DiscardInvalidValues"=>1 )); break; case 'community': $perp = "Unknown"; $perpId = 0; if (!is_numeric($_REQUEST['u'])) { $sql ="SELECT * FROM tblUsers WHERE vc_username = '" . $_REQUEST['u'] . "'"; if ($consul->query($sql)) { $perp = $_REQUEST['u']; $perpId = $consul->row['int_user_id']; } } else { $sql ="SELECT * FROM tblUsers WHERE int_user_id = " . $_REQUEST['u']; if ($consul->query($sql)) { $perp = $consul->row['vc_username']; $perpId = $_REQUEST['u']; } } $form->ACTION="/members/badGuys.php?jobStep=qcomplaint&u=" . $perpId; /* * Define the form field properties even if they may not be displayed. */ $form->AddInput(array( "TYPE"=>"radio", "NAME"=>"abuse_type", "VALUE"=>"Freeloader", "TITLE"=>"Freebie sending you flirts, on your behalf we politely ask them to upgrade.", "ID"=>"account_abuse", "ValidateAsSet"=>1, "ValidateAsSetErrorMessage"=>"No complaint type specified.", "LABEL"=>"Freeloader", "ACCESSKEY"=>"F", "ReadOnlyMark"=>"[X]" )); $form->AddInput(array( "TYPE"=>"radio", "NAME"=>"abuse_type", "VALUE"=>"Male", "TITLE"=>"Use this if you are SURE a member is born male.", "ID"=>"gender_abuse", "ValidateAsSet"=>1, "ValidateAsSetErrorMessage"=>"No complaint type specified.", "LABEL"=>"Male", "ACCESSKEY"=>"M", "ReadOnlyMark"=>"[X]" )); $form->AddInput(array( "TYPE"=>"radio", "NAME"=>"abuse_type", "VALUE"=>"Scammer", "TITLE"=>"Use this for Phishers and other common scams.", "ID"=>"use_abuse", "ValidateAsSet"=>1, "ValidateAsSetErrorMessage"=>"No complaint type specified.", "LABEL"=>"Scammer", "ACCESSKEY"=>"S", "ReadOnlyMark"=>"[X]" )); $form->AddInput(array( "TYPE"=>"radio", "NAME"=>"abuse_type", "VALUE"=>"Other", "TITLE"=>"Use this for other complaint (You must give a description if you select this).", "ID"=>"other_abuse", "ValidateAsSet"=>1, "ValidateAsSetErrorMessage"=>"No complaint type specified.", "LABEL"=>"Other", "ACCESSKEY"=>"O", "ReadOnlyMark"=>"[X]" )); $form->AddInput(array( "TYPE"=>"textarea", "NAME"=>"complaint", "ID"=>"complaint", "ROWS"=>4, "COLS"=>80, "LABEL"=>"Other Complaint", "ACCESSKEY"=>"C" )); $form->AddInput(array( "TYPE"=>"submit", "ID"=>"button_subscribe", "VALUE"=>"Add Your Report", "ACCESSKEY"=>"u" )); $form->AddInput(array( "TYPE"=>"image", "ID"=>"image_subscribe", "SRC"=>"http://www.phpclasses.org/graphics/add.gif", "ALT"=>"Submit Report", "STYLE"=>"border-width: 0px;" )); $form->AddInput(array( "TYPE"=>"hidden", "NAME"=>"doit", "VALUE"=>1 )); $form->AddInput(array( "TYPE"=>"hidden", "NAME"=>"u", "VALUE"=>$_REQUEST['u'] )); $form->AddInput(array( "TYPE"=>"hidden", "NAME"=>"user_track", "VALUE"=>"0", "ValidateAsInteger"=>1, "DiscardInvalidValues"=>1 )); break; } /* * Load form input values eventually from the submitted form. */ $form->LoadInputValues($form->WasSubmitted("doit")); /* * Empty the array that will list the values with invalid field after validation. */ $verify=array(); /* * Check if the global array variable corresponding to hidden input field is * defined, meaning that the form was submitted as opposed to being displayed * for the first time. */ if($form->WasSubmitted("doit")) { /* * Therefore we need to validate the submitted form values. */ if(($error_message=$form->Validate($verify))=="") { /* * It's valid, set the $doit flag variable to 1 to tell the form is ready to * processed. */ $doit=1; } else { /* * It's invalid, set the $doit flag to 0 and encode the returned error message * to escape any non-ASCII ISO-latin 1 characters and HTML special characters. */ $doit=0; $error_message=HtmlEntities($error_message); } } else { /* * The form is being displayed for the first time, so it is not ready to be processed * and there is no error message to display. */ $error_message=""; $doit=0; } if($doit) { /* * The form is ready to be processed, just output it again as read only to * display the submitted values. A real form processing script usually may * do something else like storing the form values in a database. */ $form->ReadOnly=1; $_SESSION['abuse_type'] = $_REQUEST['abuse_type']; } /* * If the form was not submitted or was not valid, make the page ONLOAD * event give the focus to the first form field or the first invalid field. */ if(!$doit) { if(strlen($error_message)) { /* * If there is at least one field with invalid values, get the name of the * first field in error to make it get the input focus when the page is * loaded. */ Reset($verify); $focus=Key($verify); } else { /* * Make the 1st field get the input focus when the page is loaded * if there was no previous validation error. */ $focus='complaint'; } /* * Connect the form to the field to get the input focus when the page * loads. */ $form->ConnectFormToInput($focus, 'ONLOAD', 'Focus', array()); } $onload = HtmlSpecialChars($form->PageLoad()); ?> ?php /* * Compose the form output by including a HTML form template with PHP code * interleaaved with calls to insert form input field * parts in the layout HTML. */ $form->StartLayoutCapture(); switch($_REQUEST['jobStep']) { default: $title="User Abuse Report"; $body_template="../forms/templates/policeBody.html.php"; break; case 'manage': $title="Manage User Abuse Complaint"; $body_template="../forms/templates/complaintBody.html.php"; break; } require("../forms/templates/policeFrame.html.php"); $form->EndLayoutCapture(); /* * Output the form using the function named Output. */ $form->DisplayOutput(); ?php