Exemplo n.º 1
0
function listPropertiesStep1()
{
    global $debug, $message, $success, $Dbc, $returnThis;
    $output = '';
    try {
        if (empty($_POST['listId'])) {
            throw new Adrlist_CustomException('', '$_POST[\'listId\'] is empty.');
        }
        $_POST['listId'] = intval($_POST['listId']);
        //Get the listname, frId, and folderId.
        $listInfo = getListInfo($_SESSION['userId'], $_POST['listId']);
        if ($listInfo === false || $listInfo['listRoleId'] < 3) {
            throw new Adrlist_CustomException('Your role does not allow you to change the properties of this list.', '');
        }
        //Get the folders for which the user is an owner (4). This allows the user to move the list into a folder.
        $userFoldersStmt = $Dbc->prepare("SELECT\n\tfolders.folderId AS 'folderId',\n\tfolders.folderName AS 'folderName',\n\tuserFolderSettings.folderRoleId AS 'folderRoleId'\nFROM\n\tuserFolderSettings\nJOIN\n\tfolders ON folders.folderId = userFolderSettings.folderId\nWHERE\n\tuserFolderSettings.userId = ? AND\n\tuserFolderSettings.folderRoleId = ?");
        $params = array($_SESSION['userId'], 4);
        $userFoldersStmt->execute($params);
        $selectFolder = '';
        while ($row = $userFoldersStmt->fetch(PDO::FETCH_ASSOC)) {
            if (!empty($listInfo['folderId']) && $row['folderId'] == $listInfo['folderId']) {
                $selectFolder .= '	<option value="' . $row['folderId'] . '" selected="selected">' . $row['folderName'] . '</option>
';
            } else {
                $selectFolder .= '	<option value="' . $row['folderId'] . '">' . $row['folderName'] . '</option>
';
            }
        }
        //Build the framerate list.
        $frameratesArray = getFramerates();
        $frameRateOutput = '<div class="ui-field-contain">
	<label for="listPropertyFramerate">Framerate</label>
		<select id="listPropertyFramerate" goswitch="listPropertiesStep2">';
        foreach ($frameratesArray as $frId => $framerate) {
            $frameRateOutput .= '<option value="' . $frId . '"';
            $frameRateOutput .= $frId == $listInfo['frId'] ? ' selected="selected"' : '';
            $frameRateOutput .= '>' . $framerate . '</option>';
        }
        $frameRateOutput .= '</select>
	</div>';
        //Build the output.
        $output .= '<div class="myAccountTitle">
	List Properties
</div>
<div class="ui-field-contain">
	<label for="listPropertyName">List Name</label>
	<input autocapitalize="on" autocorrect="off" data-wrapper-class="true" id="listPropertyName" goswitch="listPropertiesStep2" name="listPropertyName" placeholder="" value="' . $listInfo['listName'] . '" type="text">
</div>';
        if (!empty($selectFolder)) {
            $output .= '<div class="ui-field-contain">
	<label for="newFolderId">in folder</label>
	<select id="newFolderId" goswitch="listPropertiesStep2">
		<option value="0">(no folder)</option>
' . $selectFolder . '</select>
</div>
<div class="red">
	Note: By changing the folder of this list, all users with a role for this list will automatically be given a role for the selected folder.' . faqLink(24) . '
</div>
';
        }
        $output .= $frameRateOutput . '
<button class="ui-btn ui-btn-inline ui-shadow ui-corner-all ui-btn-icon-left ui-icon-heart" id="listPropertiesStep2" listId="' . $_POST['listId'] . '">Save</button>' . cancelButton();
        $returnThis['listPropertiesStep1'] = $output;
        $success = MODE == 'listPropertiesStep1' ? true : $success;
    } catch (Adrlist_CustomException $e) {
    } catch (PDOException $e) {
        error(__LINE__, '', '<pre>' . $e . '</pre>');
    }
    if (MODE == 'listPropertiesStep1') {
        returnData();
    }
}
Exemplo n.º 2
0
function buildUMLists()
{
    //Build the user management lists section.
    global $debug, $message, $success, $Dbc;
    $message = '';
    try {
        //Get the framerate values.
        $frameratesArray = getFramerates();
        //Get the user's lists and folders with lists.
        //Lists not in folders.
        $buildListsQueryStart = "SELECT\n\tlists.listId AS 'listId',\n\tlists.listName AS 'listName',\n\tlists.frId AS 'frId',\n\tlists.created AS 'listCreated',\n\tlists.modified AS 'listModified'\nFROM\n\tlists";
        //Folders.
        $buildFoldersQueryStart = "SELECT\n\tfolders.folderId AS 'folderId',\n\tfolders.folderName AS 'folderName',\n\tfolders.created AS 'folderCreated',\n\tfolders.modified AS 'folderModified',\n\tDATE_FORMAT(expires, '%M %D, %Y') AS 'expires'\nFROM\n\tfolders";
        if (empty($_POST['searchVal']) && empty($_POST['letters'])) {
            //Search for specific user(s).
            $success = true;
            //Will reset to show no users.
        } else {
            if (empty($_POST['searchVal']) && !empty($_POST['letters'])) {
                $search = false;
                $_POST['letters'] = trim($_POST['letters']);
                $buildListsQuery = $buildListsQueryStart . "\nWHERE\n\tfolderId IS NULL AND\n\tlistName RLIKE ?\nORDER BY\n\tlistName";
                $buildFoldersQuery = $buildFoldersQueryStart . "\nWHERE\n\tfolderName RLIKE ?\nORDER BY\n\tfolderName";
                $listStmt = $Dbc->prepare($buildListsQuery);
                $listParams = array('^[' . $_POST['letters'] . ']');
                $folderStmt = $Dbc->prepare($buildFoldersQuery);
                $folderParams = array('^[' . $_POST['letters'] . ']');
            } elseif (!empty($_POST['searchVal'])) {
                //Search for specific user(s).
                $search = true;
                $searchVal = '%' . trim($_POST['searchVal']) . '%';
                $debug->add('$searchval: ' . $searchVal);
                $buildListsQuery = $buildListsQueryStart . "\nWHERE\n\tfolderId IS NULL AND\n\tlistName LIKE ?\nORDER BY\n\tlistName";
                $buildFoldersQuery = $buildFoldersQueryStart . "\nWHERE\n\tfolderName LIKE ?\nORDER BY\n\tfolderName";
                $listStmt = $Dbc->prepare($buildListsQuery);
                $listParams = array($searchVal);
                $folderStmt = $Dbc->prepare($buildFoldersQuery);
                $folderParams = array($searchVal);
            }
            $listStmt->execute($listParams);
            $folderStmt->execute($folderParams);
            $output = '<div class="sectionTitle textCenter">Lists</div>
<div>
	<span class="textLeft" id="addFolderStep1" onClick=""><img alt="" class="linkPadding middle" src="' . LINKIMAGES . '/addFolder.png" style="height:15px;width:15px;"><span class="link middle">Add Folder</span></span>' . faqLink(30) . '
	<span class="textLeft" id="addListStep1" onClick=""><img alt="" class="linkPadding middle" src="' . LINKIMAGES . '/add.png" style="height:15px;width:15px;"><span class="link middle">Add List</span></span>
</div>
<div class="textLeft">
';
            $output .= '
	<div class="rowTitle" style="min-width:100px;width:30%">
		<div class="row textLeft" style="width:40px;padding:0 0 0 5px;">
			Type
		</div>
		Name
	</div>
	<div class="rowTitle" style="min-width:3em;width:8%">Framerate</div>
	<div class="rowTitle" style="min-width:5em;width:8%">Role' . faqLink(24) . '</div>
	<div class="rowTitle" style="min-width:5em;width:15%">Created</div>
	<div class="rowTitle" style="min-width:5em;width:15%">Modified</div>
	<div class="rowTitle" style="min-width:5em;width:24%"><div class="textRight">Actions' . faqLink(35) . '</div></div>
	<div class="hr2"></div>
';
            $class = 'rowWhite';
            $foundLists = false;
            $foundFolders = false;
            $lists = array();
            while ($row = $listStmt->fetch(PDO::FETCH_ASSOC)) {
                $foundLists = true;
                if (!array_key_exists($row['listId'], $lists)) {
                    $lists[$row['listId']] = array('listName' => $row['listName'], 'frId' => $row['frId'], 'created' => $row['listCreated'], 'modified' => $row['listModified']);
                }
            }
            $folders = array();
            if (empty($searchVal)) {
                while ($foldersRow = $folderStmt->fetch(PDO::FETCH_ASSOC)) {
                    $foundFolders = true;
                    //Get the lists inside the folders.
                    $listsInFoldersStmt = $Dbc->prepare("SELECT\n\tlists.listId AS 'listId',\n\tlists.listName AS 'listName',\n\tlists.frId AS 'frId',\n\tlists.created AS 'listCreated',\n\tlists.modified AS 'listModified'\nFROM\n\tlists\nJOIN\n\tfolders ON folders.folderId = lists.folderId AND\n\tfolders.folderId = ?");
                    $listsInFoldersParams = array($foldersRow['folderId']);
                    $listsInFoldersStmt->execute($listsInFoldersParams);
                    if (!array_key_exists($foldersRow['folderId'], $folders)) {
                        $folders[$foldersRow['folderId']] = array('folderName' => $foldersRow['folderName'], 'created' => $foldersRow['folderCreated'], 'modified' => $foldersRow['folderModified']);
                    }
                    while ($listsInFoldersRow = $listsInFoldersStmt->fetch(PDO::FETCH_ASSOC)) {
                        $foundListsInFolders = true;
                        $folders[$foldersRow['folderId']]['lists'][$listsInFoldersRow['listId']] = array('listName' => $listsInFoldersRow['listName'], 'frId' => $listsInFoldersRow['frId'], 'created' => $listsInFoldersRow['listCreated'], 'modified' => $listsInFoldersRow['listModified']);
                    }
                }
            } else {
                //When searching, if the term is not found in a folder name, then the folder and it's lists will not be included. This prevents lists matching the search term from appearing. We must therefore create an entirely separate query to search for terms in lists inside of folders.
                $listsInFoldersSearchStmt = $Dbc->prepare("SELECT\n\tlists.listId AS 'listId',\n\tlists.listName AS 'listName',\n\tlists.frId AS 'frId',\n\tlists.created AS 'listCreated',\n\tlists.modified AS 'listModified',\n\tfolders.folderId AS 'folderId',\n\tfolders.folderName AS 'folderName',\n\tfolders.created AS 'folderCreated',\n\tfolders.modified AS 'folderModified'\nFROM\n\tlists\nJOIN\n\tfolders ON folders.folderId = lists.folderId AND\n\tlists.listName LIKE ?");
                $debug->add('searching lists in folders.');
                $listsInFoldersSearchParams = array($searchVal);
                $listsInFoldersSearchStmt->execute($listsInFoldersSearchParams);
                while ($listsInFoldersSearchRow = $listsInFoldersSearchStmt->fetch(PDO::FETCH_ASSOC)) {
                    $foundFolders = true;
                    if (!array_key_exists($listsInFoldersSearchRow['folderId'], $folders)) {
                        $folders[$listsInFoldersSearchRow['folderId']] = array('folderName' => $listsInFoldersSearchRow['folderName'], 'folderRoleId' => $listsInFoldersSearchRow['folderRoleId'], 'created' => $listsInFoldersSearchRow['folderCreated'], 'modified' => $listsInFoldersSearchRow['folderModified']);
                    }
                    $folders[$listsInFoldersSearchRow['folderId']]['lists'][$listsInFoldersSearchRow['listId']] = array('listName' => $listsInFoldersSearchRow['listName'], 'listRoleId' => $listsInFoldersSearchRow['listRoleId'], 'frId' => $listsInFoldersSearchRow['frId'], 'created' => $listsInFoldersSearchRow['listCreated'], 'modified' => $listsInFoldersSearchRow['listModified']);
                }
            }
            //$debug->printArray($lists,'$lists');
            $debug->printArray($folders, '$folders');
            /*An nest of arrays:
            			Array $folders:
            array (
              2 => 
              array (
            	'folderName' => 'Junk Food',
            	'folderRoleId' => '3',
            	'modified' => '2012-02-25 11:26:45',
            	'lists' => 
            	array (
            	  9 => 
            	  array (
            		'listName' => '\'63 Comet',
            		'listRoleId' => '3',
            		'modified' => '2012-02-17 13:51:17',
            	  ),
            	  12 => 
            	  array (
            		'listName' => 'The Awesome List2',
            		'listRoleId' => '2',
            		'modified' => '2012-02-25 07:49:32',
            	  ),
            	),
              ),
              14 => 
              array (
            	'folderName' => 'My Super Awesome Folder',
            	'folderRoleId' => '1',
            	'modified' => NULL,
            	'lists' => 
            	array (
            	  '' => 
            	  array (
            		'listName' => NULL,
            		'listRoleId' => NULL,
            		'modified' => NULL,
            	  ),
            	),
              ),
              1 => 
              array (
            	'folderName' => 'Scizors',
            	'folderRoleId' => '1',
            	'modified' => NULL,
            	'lists' => 
            	array (
            	  1 => 
            	  array (
            		'listName' => 'River of Sorrow',
            		'listRoleId' => '2',
            		'modified' => '2011-04-22 07:33:44',
            	  ),
            	  6 => 
            	  array (
            		'listName' => 'Hit List',
            		'listRoleId' => '2',
            		'modified' => '2011-10-04 06:20:19',
            	  ),
            	  4 => 
            	  array (
            		'listName' => 'I AM',
            		'listRoleId' => '2',
            		'modified' => '2010-06-18 23:51:11',
            	  ),
            	  2 => 
            	  array (
            		'listName' => 'Norman',
            		'listRoleId' => '2',
            		'modified' => '2009-08-03 23:12:36',
            	  ),
            	  8 => 
            	  array (
            		'listName' => 'Thunderballs S1E1',
            		'listRoleId' => '2',
            		'modified' => '2011-06-28 20:44:14',
            	  ),
            	  5 => 
            	  array (
            		'listName' => 'Locked Down',
            		'listRoleId' => '2',
            		'modified' => '2012-01-25 09:48:27',
            	  ),
            	  3 => 
            	  array (
            		'listName' => 'Wrong Turn At Tahoe',
            		'listRoleId' => '2',
            		'modified' => '2009-07-27 05:31:23',
            	  ),
            	),
              ),
            )
            		*/
            //Build the lists not in folders.
            foreach ($lists as $listId => $listValues) {
                if ($class == 'rowWhite') {
                    $class = 'rowAlt';
                } else {
                    $class = 'rowWhite';
                }
                $output .= '	<div class="overflowauto relative ' . $class . '">
		<div class="row textLeft" style="min-width:100px;width:30%">
			<div class="row textLeft" style="width:40px;padding:0 0 0 5px;">
				<img alt="" src="' . LINKIMAGES . '/list.png" style="height:15px;width:15px">
			</div>
			<span id="listName' . $listId . '">' . $listValues['listName'] . '</span>
		</div>
		<div class="row" style="min-width:3em;width:8%">' . $frameratesArray[$listValues['frId']] . '</div>
		<div class="row textSmall" style="min-width:5em;width:15%">
			';
                if (empty($listValues['created'])) {
                    $output .= 'n/a';
                } else {
                    $output .= Adrlist_Time::utcToLocal($listValues['created']);
                }
                $output .= '		</div>
		<div class="row textSmall" style="min-width:5em;width:15%">
			';
                if (empty($listValues['modified'])) {
                    $output .= 'n/a';
                } else {
                    $output .= Adrlist_Time::utcToLocal($listValues['modified']);
                }
                $output .= '		</div>
			<div class="bold hand row" id="rowActionsButtonList' . $listId . '" uniqueId="List' . $listId . '" style="min-width:5em;width:24%" onClick="">
				<div class="textRight">
					List Actions <img alt="" class="middle" src="' . LINKIMAGES . '/greenArrowRight.png" style="height:12px;width:12px">
				</div>
			</div>
';
                //The rowActions for lists not in folders.
                $output .= '<div class="hide right" id="rowActionsHolderList' . $listId . '" listId="' . $listId . '" style="background-color:inherit">
			<ul class="textLeft" style="list-style:none;margin:5px 0px">
				<li class="actions" id="editList' . $listId . '" listId="' . $listId . '" onClick="">
					<img alt="" class="middle" src="' . LINKIMAGES . '/edit.png" style="height:20px;width:20px;"><span class="linkPadding">Edit</span>
				</li>
				<li class="actions" id="listPropertiesStep1' . $listId . '" listId="' . $listId . '" onClick="">
					<img alt="" class="middle" src="' . LINKIMAGES . '/tools.png" style="height:20px;width:20px;"><span class="linkPadding">Properties</span>
				</li>
				<li class="actions" id="buildListUsers' . $listId . '" listId="' . $listId . '" onClick="">
					<img alt="" class="middle" src="' . LINKIMAGES . '/charSearch.png" style="height:20px;width:20px;"><span class="linkPadding">Manage Users</span>
				</li>
				<li class="actions" id="transferList' . $listId . '" listId="' . $listId . '" onClick="">
					<img alt="" class="middle" src="' . LINKIMAGES . '/transfer.png" style="height:20px;width:20px;"><span class="linkPadding">Transfer</span>
				</li>
				<li class="actions" id="lockListStep1' . $listId . '" listId="' . $listId . '" onClick="">
					<img alt="" class="middle" src="' . LINKIMAGES . '/lock.png"  style="height:20px;width:20px;"><span class="linkPadding">Lock</span>
				</li>
				<li class="actions" id="deleteListStep1' . $listId . '" listId="' . $listId . '" onClick="">
					<img alt="" class="middle" src="' . LINKIMAGES . '/trash.png"  style="height:20px;width:20px;"><span class="linkPadding">Delete</span>
				</li>
			</ul>
		</div>
	</div>
';
                //End rowActions.
            }
            //End lists not in folders.
            //Build folders.
            foreach ($folders as $folderId => $folderValues) {
                $output .= '	<div class="folderRow" id="rowActionsFolder' . $folderId . '">
		<div class="hand row textLeft" id="toggleFolderLists' . $folderId . '" folderid="' . $folderId . '" onClick="" style="min-width:100px;width:30%">
			<div class="row textLeft" style="width:40px;padding:0 0 0 5px;">
				<img alt="" src="' . LINKIMAGES . '/folder.png" style="height:20px;width:20px"><span><img id="folderListsImg' . $folderId . '" thing="Lists" src="' . LINKIMAGES . '/bulletArrow';
                $output .= $search ? 'Down' : 'Right';
                $output .= '.png" style="height:20px;width:20px;"></span>
			</div>
			<span id="folderName' . $folderId . '">' . $folderValues['folderName'] . '</span>
		</div>
		<div class="row" style="min-width:3em;width:8%"></div>
		<div class="row textSmall" style="min-width:5em;width:15%">
			';
                if (empty($folderValues['created'])) {
                    $output .= 'n/a';
                } else {
                    $output .= Adrlist_Time::utcToLocal($folderValues['created']);
                }
                $output .= '		</div>
		<div class="row textSmall" style="min-width:5em;width:15%">
			';
                if (empty($folderValues['modified'])) {
                    $output .= 'n/a';
                } else {
                    $output .= Adrlist_Time::utcToLocal($folderValues['modified']);
                }
                $output .= '		</div>
			<div class="bold hand row" id="rowActionsButtonFolder' . $folderId . '" onClick="" uniqueId="Folder' . $folderId . '" style="min-width:5em;width:24%">
				<div class="textRight">
					Folder Actions <img alt="" class="middle" id="folderActionsImg' . $folderId . '" src="' . LINKIMAGES . '/greenArrowRight.png" style="height:12px;width:12px"">
				</div>
			</div>
';
                //The folder rowActions.
                $output .= '			<div class="hide right" id="rowActionsHolderFolder' . $folderId . '" style="background-color:inherit">
				<ul class="textLeft" style="list-style:none;margin:5px 0px">
					<li class="actions" id="renameFolderStep1' . $folderId . '" folderid="' . $folderId . '" folderName="' . $folderValues['folderName'] . '" onClick="">
						<img alt="" class="middle" src="' . LINKIMAGES . '/pencil.png" style="height:1.6em;width:1.6em"><span class="linkPadding">Rename</span>
					</li>
					<li class="actions" id="buildFolderUsers' . $folderId . '" folderid="' . $folderId . '" onClick="">
						<img alt="" class="middle" src="' . LINKIMAGES . '/charSearch.png" style="height:1.6em;width:1.6em"><span class="linkPadding">Manage Users</span>
					</li>
					<li class="actions" id="deleteFolder' . $folderId . '" folderid="' . $folderId . '" folderName="' . $folderValues['folderName'] . '" onClick="">
						<img alt="" class="middle" src="' . LINKIMAGES . '/trash.png" style="height:1.6em;width:1.6em"><span class="linkPadding">Delete</span>
					</li>
				</ul>
			</div>
		<div';
                $output .= $search ? '' : ' class="hide"';
                $output .= ' id="folderListsHolder' . $folderId . '">
';
                //The lists in the folder.
                $listCount = 0;
                if (empty($folderValues['lists'])) {
                    $output .= '<div class="break textCenter">There are no lists in this folder.</div>';
                }
                if (array_key_exists('lists', $folderValues)) {
                    foreach ($folderValues['lists'] as $listId => $listValues) {
                        if ($class == 'rowWhite') {
                            $class = 'rowAlt';
                        } else {
                            $class = 'rowWhite';
                        }
                        $output .= '			<div class=" ' . $class . '" id="rowActionsList' . $listId . '">
				<div class="row textLeft" style="min-height:21px;min-width:170px;width:30%">
					<div class="row textLeft" style="width:40px;padding:0 0 0 5px;">
						<img alt="" src="' . LINKIMAGES . '/list.png" style="height:15px;left:5px;width:15px">
					</div>
					<span id="listName' . $listId . '">' . $listValues['listName'] . '</span>
				</div>
				<div class="row" style="min-width:3em;width:8%">' . $frameratesArray[$listValues['frId']] . '</div>
				<div class="row textSmall" style="min-width:5em;width:15%">
			';
                        if (empty($listValues['created'])) {
                            $output .= 'n/a';
                        } else {
                            $output .= Adrlist_Time::utcToLocal($listValues['created']);
                        }
                        $output .= '				</div>
				<div class="row textSmall" style="min-width:5em;width:15%">
			';
                        if (empty($listValues['modified'])) {
                            $output .= 'n/a';
                        } else {
                            $output .= Adrlist_Time::utcToLocal($listValues['modified']);
                        }
                        $output .= '				</div>
				<div class="bold hand row" id="rowActionsButtonList' . $listId . '" uniqueId="List' . $listId . '" style="min-width:5em;width:24%">
					<div class="textRight">
						List Actions <img alt="" class="middle" src="' . LINKIMAGES . '/greenArrowRight.png" style="height:12px;width:12px">
					</div>
				</div>
';
                        //The rowActions for lists in folders.
                        $output .= '<div class="hide right" id="rowActionsHolderList' . $listId . '" style="background-color:inherit">
			<ul class="textLeft" style="list-style:none;margin:5px 0px">
				<li class="actions" id="editList' . $listId . '" listId="' . $listId . '" onClick="">
					<img alt="" class="middle" src="' . LINKIMAGES . '/edit.png" style="height:1.6em;width:1.6em;"><span class="linkPadding">Edit</span>
				</li>
				<li class="actions" id="listPropertiesStep1' . $listId . '" listId="' . $listId . '" onClick="">
					<img alt="" class="middle" src="' . LINKIMAGES . '/tools.png" style="height:20px;width:20px;"><span class="linkPadding">Properties</span>
				</li>
				<li class="actions" id="buildListUsers' . $listId . '" listId="' . $listId . '" onClick="">
					<img alt="" class="middle" src="' . LINKIMAGES . '/charSearch.png" style="height:1.6em;width:1.6em;"><span class="linkPadding">Manage Users</span>
				</li>
				<li class="actions" id="transferListStep1' . $listId . '" listId="' . $listId . '" onClick="">
					<img alt="" class="middle" src="' . LINKIMAGES . '/transfer.png" style="height:1.6em;width:1.6em;"><span class="linkPadding">Transfer</span>
				</li>
				<li class="actions" id="lockListStep1' . $listId . '" onClick="">
					<img alt="" class="middle" src="' . LINKIMAGES . '/lock.png"  style="height:1.6em;width:1.6em;"><span class="linkPadding">Lock</span>
				</li>
				<li class="actions" id="deleteListStep1' . $listId . '" listId="' . $listId . '" onClick="">
					<img alt="" class="middle" src="' . LINKIMAGES . '/trash.png"  style="height:1.6em;width:1.6em;"><span class="linkPadding">Delete</span>
				</li>
			</ul>
		</div>
	</div>
';
                        //End lists in folders.
                    }
                }
                $output .= '		</div>
	</div>
';
                //End folders.
            }
            if (!$foundLists && !$foundFolders) {
                if ($search) {
                    $output .= '<div class="red textCenter" style="padding:5px 0px 10px 0px;">There are no matches for "' . $_POST['searchVal'] . '".</div>';
                } else {
                    $output .= '<div class="textCenter" style="padding:5px 0px 10px 0px;">You are not associated with any folders or lists.</div>';
                }
                pdoError(__LINE__, $listStmt, $listParams, true);
                pdoError(__LINE__, $folderStmt, $folderParams, true);
                if (isset($listsInFoldersStmt)) {
                    pdoError(__LINE__, $listsInFoldersStmt, $listsInFoldersParams, true);
                }
                if (!empty($listsInFoldersSearchStmt)) {
                    pdoError(__LINE__, $listsInFoldersSearchStmt, $listsInFoldersSearchParams, true);
                }
            }
            $output .= '</div>
';
            $success = true;
            $returnThis['buildUMLists'] = $output;
        }
    } catch (PDOException $e) {
        error(__LINE__, '', '<pre>' . $e . '</pre>');
    }
    if (MODE == 'buildUMLists') {
        returnData();
    } else {
        return $output;
    }
}