fetch_all_by_uid_username($_GET['uid'], $_GET['username']); $lock = $myrepeat['lock']; $locknew = $lock ? 0 : 1; C::t('#myrepeats#myrepeats')->update_locked_by_uid_username($_GET['uid'], $_GET['username'], $locknew); ajaxshowheader(); echo $lock ? $Plang['normal'] : $Plang['lock']; ajaxshowfooter(); } elseif($_GET['op'] == 'delete') { C::t('#myrepeats#myrepeats')->delete_by_uid_usernames($_GET['uid'], $_GET['username']); ajaxshowheader(); echo $Plang['deleted']; ajaxshowfooter(); } $ppp = 100; $resultempty = FALSE; $srchadd = $searchtext = $extra = $srchuid = ''; $page = max(1, intval($_GET['page'])); if(!empty($_GET['srchuid'])) { $srchuid = intval($_GET['srchuid']); $srchadd = "AND uid='$srchuid'"; } elseif(!empty($_GET['srchusername'])) { $srchuid = C::t('common_member')->fetch_uid_by_username($_GET['srchusername']); if($srchuid) { $srchadd = "AND uid='$srchuid'"; } else { $resultempty = TRUE; } } elseif(!empty($_GET['srchrepeat'])) { $extra = '&srchrepeat='.rawurlencode($_GET['srchrepeat']); $srchadd = "AND username='".addslashes($_GET['srchrepeat'])."'"; $searchtext = $Plang['search'].' "'.$_GET['srchrepeat'].'" '.$Plang['repeats'].' '; } if($srchuid) { $extra = '&srchuid='.$srchuid; $member = getuserbyuid($srchuid); $searchtext = $Plang['search'].' "'.$member['username'].'" '.$Plang['repeatusers'].' '; } $statary = array(-1 => $Plang['status'], 0 => $Plang['normal'], 1 => $Plang['lock']); $status = isset($_GET['status']) ? intval($_GET['status']) : -1; if(isset($status) && $status >= 0) { $srchadd .= " AND locked='$status'"; $searchtext .= $Plang['search'].$statary[$status].$Plang['statuss']; } if($searchtext) { $searchtext = ''.$Plang['viewall'].' '.$searchtext; } loadcache('usergroups'); showtableheader(); showformheader('plugins&operation=config&do='.$pluginid.'&identifier=myrepeats&pmod=admincp', 'repeatsubmit'); showsubmit('repeatsubmit', $Plang['search'], $lang['username'].':   '.$Plang['repeat'].': ', $searchtext); showformfooter(); $statselect = ''; echo ''.$Plang['username'].''.$lang['usergroup'].''.$Plang['repeat'].''.$Plang['lastswitch'].''.$statselect.''; if(!$resultempty) { $count = C::t('#myrepeats#myrepeats')->count_by_search($srchadd); $myrepeats = C::t('#myrepeats#myrepeats')->fetch_all_by_search($srchadd, ($page - 1) * $ppp, $ppp); $uids = array(); foreach($myrepeats as $myrepeat) { $uids[] = $myrepeat['uid']; } $users = C::t('common_member')->fetch_all($uids); $i = 0; foreach($myrepeats as $myrepeat) { $myrepeat['lastswitch'] = $myrepeat['lastswitch'] ? dgmdate($myrepeat['lastswitch']) : ''; $myrepeat['usernameenc'] = rawurlencode($myrepeat['username']); $opstr = !$myrepeat['locked'] ? $Plang['normal'] : $Plang['lock']; $i++; echo ''.$users[$myrepeat['uid']]['username'].''. ''.$_G['cache']['usergroups'][$users[$myrepeat['uid']]['groupid']]['grouptitle'].''. ''.$myrepeat['username'].''.''. ''.($myrepeat['lastswitch'] ? $myrepeat['lastswitch'] : '').''. ''.$opstr.''. '['.$lang['delete'].']'; } } showtablefooter(); echo multi($count, $ppp, $page, ADMINSCRIPT."?action=plugins&operation=config&do=$pluginid&identifier=myrepeats&pmod=admincp$extra"); ?>