Пример #1
0
}
/*****************************************************************************************************/
if ($_REQUEST['FLAG'] == 'FORGOT_PWD') {
    if (isset($_REQUEST['email']) && $_REQUEST['email'] != '') {
        if (!filter_var($_REQUEST['email'], FILTER_VALIDATE_EMAIL)) {
            $error = 'danger';
            $_SESSION['msg'] = 'Please fill valid email.';
            $url = ADMIN_URL . "/login.php";
            $general->redirectUrl($url, $error);
            exit;
        }
        $query = "SELECT * FROM `admins` where email='" . $_REQUEST['email'] . "'";
        if (!$dbBean->Query($query)) {
            $dbBean->Kill();
        }
        if ($dbBean->RowCount() > 0) {
            $email_data = $dbBean->RowArray(null, MYSQLI_ASSOC);
            $new_password = $general->create_password(12);
            $cond = array("id" => $email_data['id']);
            $fieldvalues = array('password' => md5($new_password));
            $updated = $dbBean->UpdateRows("admins", $fieldvalues, $cond);
            if ($updated) {
                $mail = new PHPMailer();
                $mail->IsSMTP();
                // telling the class to use SMTP
                $mail->Host = "smtp.gmail.com";
                // SMTP server
                $mail->SMTPDebug = 1;
                $mail->SMTPAuth = true;
                $mail->Port = 587;
                $mail->SMTPSecure = 'tls';
Пример #2
0
                                <th>Name</th>
                                <th>Email</th>
                                <th>Action</th>
							</tr>
							</thead>
							<tbody>
                    <?php 
if ($_SESSION['adm_user_id'] == 1 || $_SESSION['adm_status'] == 'Level4') {
    $query = "SELECT id, username, email, CONCAT(first_name ,' ',last_name) as name, status FROM admins ORDER BY id";
} else {
    $query = "SELECT id, username, email, CONCAT(first_name ,' ',last_name) as name, status FROM admins where id='" . $_SESSION['adm_user_id'] . "'ORDER BY id";
}
if (!$dbBean->Query($query)) {
    $dbBean->Kill();
}
if ($dbBean->RowCount() > 0) {
    for ($index = 0; $index < $dbBean->RowCount(); $index++) {
        $rows = $dbBean->RowArray($index);
        ?>
                                        <tr class="<?php 
        echo ($index + 1) % 2 == 0 ? 'even' : 'odd';
        ?>
 gradeX">
                                            <td> <input  name="delete[]" type="checkbox" id="delete[]" value="<?php 
        echo $rows['id'];
        ?>
" class="checkboxes" /> </td>
                                            <td><?php 
        echo $rows['username'];
        ?>
</td>