public function usersearch($data = Null)
 {
     $inputs = Input::get();
     $groupmemberid = groupmemberModel::where('group_id', $data)->get()->lists('user_id');
     $groupmemberuserid = ProfileModel::whereNotIn('user.ID', $groupmemberid)->lists('ID');
     $searcheduser = Input::get('usersearch');
     $groupmemberuseridlist = ProfileModel::select('profilepicture', 'firstname', 'lastname', 'username', 'ID')->where('username', 'like', '%' . $searcheduser . '%')->whereIn('user.ID', $groupmemberuserid)->Orwhere('firstname', 'like', '%' . $searcheduser . '%')->whereIn('user.ID', $groupmemberuserid)->where('user.status', 1)->get();
     return View::make('user/view/registermember')->with('group_id', $data)->with('searcheduser', $searcheduser)->with('savegroupmembers', $groupmemberuseridlist);
 }
Exemple #2
0
                        <th>Email id</th>
                        <th>Mobile</th>
                        <th>contest</th>
                        <th>Active/Inactive</th>
                        <th class="tr_wid_button1" align="center"><span class="txt_view">View</span></th>
                        <th class="tr_wid_button1" align="center"><span class="txt_edit">Edit</span></th>
                        <th class="tr_wid_edit"><span class="txt_delete">Delete<span></th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                        <?php 
$user_id = Auth::user()->ID;
if ($searcheduser != '') {
    $userlist = ProfileModel::select('profilepicture', 'firstname', 'lastname', 'username', 'ID', 'email', 'mobile', 'status')->where('username', 'like', '%' . $searcheduser . '%')->Orwhere('firstname', 'like', '%' . $searcheduser . '%')->whereNotIn('ID', array(1))->get();
} else {
    $userlist = ProfileModel::select('profilepicture', 'firstname', 'lastname', 'username', 'ID', 'email', 'mobile', 'status')->whereNotIn('ID', array(1))->get();
}
//echo count($userlist);
for ($i = 0; $i < count($userlist); $i++) {
    if ($userlist[$i]['ID'] != 1) {
        ?>
                                                <tr>
                                                    <td>{{ $i+1; }} </td>
                                                    <td class="tr_wid_id">{{ $userlist[$i]['firstname'].' '.$userlist[$i]['lastname'] }}</td>
                                                    <td >{{ $userlist[$i]['username'] }}</td>
                                                    <td align="center"><img src="{{ ($userlist[$i]['profilepicture']!='')?(URL::to('public/assets/upload/profile/'.$userlist[$i]['profilepicture'])):(URL::to('assets/inner/images/avator.png')) }}" width="50" height="50"></td>
                                                    <td>{{$userlist[$i]['email']}}</td>
                                                    <td>{{$userlist[$i]['mobile']}}</td>
                                                    <td align="center"><a href="<?php 
        echo url();
        ?>
 public function searchmember()
 {
     $searcheduser = Input::get('searchkey');
     $data = Input::get('group_id');
     //$userdetails = ProfileModel::where('')->get();
     $groupmemberid = groupmemberModel::where('group_id', $data)->get()->lists('user_id');
     $groupmemberuserid = ProfileModel::whereNotIn('user.ID', $groupmemberid)->lists('ID');
     $userdetails = ProfileModel::select('profilepicture', 'firstname', 'lastname', 'username', 'ID')->where('username', 'like', '%' . $searcheduser . '%')->where('status', 1)->whereIn('user.ID', $groupmemberuserid)->Orwhere('firstname', 'like', '%' . $searcheduser . '%')->whereIn('user.ID', $groupmemberuserid)->get();
     //$userdetails=ProfileModel::select('profilepicture','firstname','lastname','username','ID')->where('username','like','%'.$searchkey.'%')->where('status',1)->Orwhere('firstname','like','%'.$searchkey.'%')->get();
     for ($i = 0; $i < count($userdetails); $i++) {
         if ($userdetails[$i]['profilepicture'] != '') {
             $userdetails[$i]['profilepicture'] = url() . '/public/assets/upload/profile/' . $userdetails[$i]['profilepicture'];
         }
         if ($userdetails[$i]['firstname'] != '') {
             $userdetails[$i]['name'] = $userdetails[$i]['firstname'] . ' ' . $userdetails[$i]['lastname'];
         } else {
             $userdetails[$i]['name'] = $userdetails[$i]['username'];
         }
     }
     if (count($userdetails) > 0) {
         $Response = array('success' => '1', 'message' => 'User details fetched successfully', 'msgcode' => "c188");
         $final = array("response" => $Response, "userdetails" => $userdetails);
         return json_encode($final);
     } else {
         $Response = array('success' => '0', 'message' => 'No data avialable', 'msgcode' => "c181");
         $final = array("response" => $Response, "userdetails" => $userdetails);
         return json_encode($final);
     }
 }
    public function activegroup()
    {
        $groupid = $_GET['groupid'];
        $checkstatus = groupModel::where('ID', $groupid)->where('status', 1)->count();
        $savegroup = groupModel::select('grouptype', 'groupname', 'createdby', 'grouptype', 'status', 'groupimage')->where('ID', $groupid)->get();
        $groupowneruserid = $savegroup[0]['createdby'];
        $getcreateduserdetails = ProfileModel::select('email', 'firstname', 'lastname', 'username')->where('ID', $groupowneruserid)->get();
        $email = $getcreateduserdetails[0]['email'];
        if ($getcreateduserdetails[0]['firstname'] != '') {
            $groupownername = $getcreateduserdetails[0]['firstname'] . ' ' . $getcreateduserdetails[0]['lastname'];
        } else {
            $groupownername = $getcreateduserdetails[0]['username'];
        }
        $groupname = $savegroup[0]['groupname'];
        ///// Group member details ///////////
        if ($savegroup[0]['status'] == 1) {
            $status = "Active";
        } else {
            $status = "Inactive";
        }
        $groupdetailsactive = '<div style="font-size:12px;	color: #000000;	float:left;padding:10px 2px;width:100%;margin:15px;">Your group <b>"' . $groupname . '"</b> is activated by admin  </div><div styel"float:left;">
						<table width="180" height="95" border="0" style="margin-bottom:10px;float:left;font-family:Helvetica Neue, Helvetica, Arial, sans-serif;">
					  <tr>
						<td style="font-size:12px;color: #3BBA00;font-weight:bold;">Group Name:</td>
						<td style="font-size:12px;color: #5d5d5d;font-weight:bold;">' . $groupname . '</td>
					  </tr>
					  <tr>
						<td style="font-size:12px;color: #3BBA00;font-weight:bold;">Group Type:</td>
						<td style="font-size:12px;color: #5d5d5d;font-weight:bold;">' . $savegroup[0]['grouptype'] . '</td>
					  </tr>
					   <tr>
						<td style="font-size:12px;color: #3BBA00;font-weight:bold;">Group status </td>
						<td style="font-size:12px;color: #5d5d5d;font-weight:bold;">Active</td>
					  </tr>
					  
					  <tr style="border-radius:6px;-webkit-border-radius: 5px; -moz-border-radius: 5px;">
						<td colspan="2" style="vertical-align: text-middle;" >
							<span><a href="' . URL::to('viewgroupmember/' . $groupowneruserid) . '" style="text-decoration:none;><img src="' . URL::to('assets/inner/images/vist_dingdatt.png') . '/assets/inner/images/vist_dingdatt.png" width="120" height="30" /></a></span>
						</td>
					  </tr>	
					</table>
					</div>';
        $groupdetailsdeactive = '<div style="font-size:12px;	color: #000000;	float:left;padding:10px 2px;width:100%;margin:15px;">Your group <b>"' . $groupname . '"</b> is deactivated by admin  </div><div styel"float:left;">
						<table width="180" height="95" border="0" style="margin-bottom:10px;float:left;font-family:Helvetica Neue, Helvetica, Arial, sans-serif;">
					  <tr>
						<td style="font-size:12px;color: #3BBA00;font-weight:bold;">Group Name:</td>
						<td style="font-size:12px;color: #5d5d5d;font-weight:bold;">' . $groupname . '</td>
					  </tr>
					  <tr>
						<td style="font-size:12px;color: #3BBA00;font-weight:bold;">Group Type:</td>
						<td style="font-size:12px;color: #5d5d5d;font-weight:bold;">' . $savegroup[0]['grouptype'] . '</td>
					  </tr>
					   <tr>
						<td style="font-size:12px;color: #3BBA00;font-weight:bold;">Group status </td>
						<td style="font-size:12px;color: #5d5d5d;font-weight:bold;">Inactive</td>
					  </tr>
					  
					  <tr style="border-radius:6px;-webkit-border-radius: 5px; -moz-border-radius: 5px;">
						<td colspan="2" style="vertical-align: text-middle;" >
							<span><a href="' . URL::to('viewgroupmember/' . $groupowneruserid) . '" style="text-decoration:none;><img src="' . URL::to('assets/inner/images/vist_dingdatt.png') . '/assets/inner/images/vist_dingdatt.png" width="120" height="30" /></a></span>
						</td>
					  </tr>	
					</table>
					</div>';
        if ($checkstatus == 1) {
            ///Inactive process /////
            $updatedetails['status'] = 0;
            $affectedRows = groupModel::where('ID', $groupid)->update($updatedetails);
            //$details = "Your contest ".$contestname." is deactivated by admin.";
            $this->adminmailtogroupownerdelete($email, $groupownername, $groupname, $groupownername, $groupid, $groupdetailsdeactive);
            if ($affectedRows) {
                return 0;
            }
        } else {
            ///Active process /////
            $updatedetails['status'] = 1;
            $affectedRows = groupModel::where('ID', $groupid)->update($updatedetails);
            //$details = "Your contest ".$contestname." is activated by admin.";
            $this->adminmailtogroupowner($email, $groupownername, $groupname, $groupownername, $groupid, $groupdetailsactive);
            if ($affectedRows) {
                return 1;
            }
        }
    }
 public function memberequeattogroup()
 {
     $userid = Input::get('userid');
     $group_id = Input::get('group_id');
     $groupdetails = groupModel::select('grouptype', 'groupname')->where('id', $group_id)->get();
     $grouptype = $groupdetails[0]['grouptype'];
     $curdate = date('Y-m-d h:i:s');
     $inputdetails['user_id'] = $userid;
     $inputdetails['group_id'] = $group_id;
     $inputdetails['createddate'] = $curdate;
     $inputdetails['invitetype'] = 'u';
     if ($grouptype == 'open') {
         $validation = Validator::make($inputdetails, groupmemberModel::$rules);
         if ($validation->passes()) {
             $savegroupmembers = groupmemberModel::create($inputdetails);
             if ($savegroupmembers) {
                 $Response = array('success' => '1', 'message' => 'Group Members saved successfully');
                 $final = array("response" => $Response);
                 return json_encode($final);
             }
         }
     } else {
         $invite = invitememberforgroupModel::create($inputdetails);
         if ($invite) {
             $getcreateduserdetails = ProfileModel::select('email', 'firstname', 'lastname')->where('ID', $userid)->get();
             $email = $getcreateduserdetails[0]['email'];
             $name = $getcreateduserdetails[0]['firstname'] . ' ' . $getcreateduserdetails[0]['lastname'];
             $groupname = $groupdetails[0]['groupname'];
             /* Here Set the Notification for send to Group admin */
             $Response = array('success' => '1', 'message' => 'Your request sent to Group admin');
             $final = array("response" => $Response);
             return json_encode($final);
         }
     }
 }
                        <th>Action taken</th>
                        <th>Reported data</th>
                        <th>Contest name</th>
                        <th>Reported by</th>
                        <th>Posted by</th>
                        <th>Media</th> 
                        <th>View</th> 

                    </tr>
                </thead>
                <tbody>
                    <?php 
$reportdetails = reportflagModel::select('reportflag.contest_id', 'contestparticipant.dropbox_path', 'contestparticipant.uploadtopic', 'contestparticipant.user_id as participantuserid', 'contest.contesttype', 'reportflag.report_userid', 'contest.ID as contestid', 'reportflag.contest_participant_id', 'reportflag.ID as reportflagprimaryid', 'reportflag.action_taken', 'reportflag.postedby_userid', 'reportflag.report_description', 'contestparticipant.ID as contestpartipantid', 'contestparticipant.uploadfile')->LeftJoin('contestparticipant', 'contestparticipant.ID', '=', 'reportflag.contest_participant_id')->LeftJoin('contest', 'contest.ID', '=', 'contestparticipant.contest_id')->get();
for ($i = 0; $i < count($reportdetails); $i++) {
    $participantdetails = ProfileModel::select('firstname', 'lastname', 'username')->where('ID', $reportdetails[$i]['postedby_userid'])->get()->first();
    $reporteduserdetails = ProfileModel::select('firstname', 'lastname', 'username')->where('ID', $reportdetails[$i]['report_userid'])->get()->first();
    $contestname = contestModel::select('contest_name')->where('ID', $reportdetails[$i]['contest_id'])->first();
    ?>
                        <tr>
                            <td><input type="checkbox" id="action_<?php 
    echo $reportdetails[$i]['contest_participant_id'];
    ?>
" name="action" onclick="action('<?php 
    echo $reportdetails[$i]['contest_participant_id'];
    ?>
', '<?php 
    echo $reportdetails[$i]['reportflagprimaryid'];
    ?>
', '<?php 
    echo $reportdetails[$i]['contest_id'];
    ?>