<?php // base path global $base_path; //save login after close browser if (isset($_COOKIE['login'])) { $is_login_before_close_browser = base64_decode($_COOKIE['login']); $is_login_before_close_browser = explode(SAVE_USERDATA_COOKIE_SEPARATER, $is_login_before_close_browser); // pr($is_login_before_close_browser); $user_obj = new User(); $info = $user_obj->user_load($is_login_before_close_browser[0], 1); // pr($info); if (@$info['id'] != 0) { $_SESSION['user'] = $info; } } //date_default_timezone_set('Asia/Jerusalem'); //set language to cookie if (isset($_POST['lang']) && !empty($_POST['lang'])) { setcookie("lang", $_POST['lang'], time() + 60 * 60 * 24 * 365, $base_path); // header("location: " . $_SERVER['REQUEST_URI']); } if (empty($_COOKIE['lang'])) { setcookie("lang", 'en', time() + 60 * 60 * 24 * 365, $base_path); // header("location: " . $_SERVER['REQUEST_URI']); } if (!isset($_COOKIE['lang'])) { setcookie("lang", 'en', time() + 60 * 60 * 24 * 365, $base_path); // header("location: " . $_SERVER['REQUEST_URI']); } //setcookie("lang", 'ar', time() + (60*60*24*365), $base_path);
//$ope_details = get_operator_details($op_id); $log_obj = new Payment(); $log_obj->update_log_del_status($uid, $del); $success_array = array(1); //sucuss if ($op_id == 1) { //jawwal $success_array = array(1); //sucuss } $fp = fopen("dlrs_repayment.txt", "a+"); fwrite($fp, $del . "\n"); fclose($fp); if (in_array($del, $success_array)) { $user_obj = new User(); $user_details = $user_obj->user_load($uid); $cid = $user_details->cid; $phone_details = $db_fuctions_obj->get_phone_details($phone, $cid); // pr($phone_details); $country_id = $ope_details[0]['country_id']; $end_date = $phone_details[0]['end_date']; //$uid = $phone_details[0]['uid']; $email = $phone_details[0]['email']; $now = time(); //with period and he want to add new payment if ($now < $end_date) { $start_date = $phone_details[0]['date_added']; $end_date += $period; $db_fuctions_obj->update_payment($uid, $start_date, $end_date); $db_fuctions_obj->reset_payment_count($uid); } else {
function deactive_active_user($uid) { $query = "UPDATE users set status = !status where id = '{$uid}'"; $result = $this->conn->db_query($query); $user_obj = new User(); $user_info = $user_obj->user_load($uid); echo $user_info->status; exit; }
/** * @Author: Taymoor Qanadilou * @Date created: 27/05/2013 * @Description: get all comments have bad words * @Param: * none * @Updated History: * none */ function disapproved_users_report() { $db_function_obj = new DbFunctions(); $user_obj = new User(); $helper_obj = new Helper(); $output = ""; //$approved_images = number_of_approved_images_report(STATUS_APPROVED); $disapproved_images = $db_function_obj->number_of_approved_images_report(STATUS_DISAPPROVED); //$approved_posts = number_of_approved_posts_report(STATUS_APPROVED); $disapproved_posts = $db_function_obj->number_of_approved_posts_report(STATUS_DISAPPROVED); while ($row = $this->conn->db_fetch_object($disapproved_images)) { $disapproved[$row->uid]['count_disapproved_image'] = $row->count; } while ($row = $this->conn->db_fetch_object($disapproved_posts)) { $disapproved[$row->uid]['count_disapproved_post'] = $row->count; } $output .= "<table border='1'>\n <tr><td colspan='3'>Disapproved Users Posts/Images</td></tr>\n <tr>\n <th>User Name</th>\n <th>Disapproved images</th>\n <th>Disapproved posts</th>\n </tr>\n "; if (is_array($disapproved)) { foreach ($disapproved as $key => $value) { $class = $helper_obj->table_row_class($i); $output .= "<tr class='{$class}'>\n <td>" . $user_obj->user_load($key)->name . "</td>\n <td>" . (@$value['count_disapproved_image'] + 0) . "</td>\n <td>" . (@$value["count_disapproved_post"] + 0) . "</td>\n </tr>"; } } $output .= "</table>"; return $output; }
<?php $id = mysqli_real_escape_string(db_connect(), $_GET['id']); $info = new User(); $user = $info->user_load($id); if (!empty($_POST)) { $email = $_POST['email']; $password = $_POST['password']; $role = $_POST['role']; new User(); User::user_save($id, '' . $email . '', '' . $password . '', '' . $role . ''); } ?> <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main"> <h1 class="page-header">User: <?php echo $user['email']; ?> </h1> <form class="form-horizontal" enctype="multipart/form-data" method="post" accept-charset="utf-8" action="<?php echo BASE_URL; ?> /admin/users/edit?id=<?php echo $id; ?> "> <div class="form-group"> <label for="email" class="col-sm-2 control-label">Email</label> <div class="col-sm-10"> <input type="email" class="form-control" id="email" name="email" placeholder="Email Address" value="<?php echo $user['email'];