Example #1
0
 public function Update()
 {
     global $obj, $model, $param1;
     include_once 'Model/user.php';
     $model = new User();
     $model->Id = $param1;
     if (isset($_POST['btnSubmit'])) {
         foreach ($_POST as $key => $value) {
             try {
                 $model->{$key} = $value;
             } catch (Exception $ex) {
             }
         }
         $model->Image = $_FILES['Image']['name'];
         if ($model->Update()) {
             if ($_FILES['Image']['name'] != "") {
                 $sp = $_FILES['Image']['tmp_name'];
                 $dp = "images/user_images/" . $model->Id . $_FILES['Image']['name'];
                 move_uploaded_file($sp, $dp);
             }
             print '<span class="success">User Updated</span>';
         } else {
             print '<span class="error">' . $model->Error . '</span>';
         }
     } else {
         $model->SelectById();
     }
     include_once 'View/User/update.php';
 }
require '../../' . $WEB_SITE . 'src/cdSession.php';
require '../../' . $WEB_SITE . 'src/cdUserInfo.php';
require '../../' . $WEB_SITE . 'src/cdGuardian.php';
$screen_module_name = "Usuário(s)";
if (isset($_POST["p_action"])) {
    $action = $_POST["p_action"];
    $message = "";
    if ($action == 1) {
        $user_id = $_POST["p_user_id"];
        $length = count($user_id);
        if ($length > 0) {
            for ($i = 0; $i < $length; $i++) {
                $user = new User();
                $user->SetDatabase($database);
                $user->SetId($user_id[$i]);
                $user->SelectById();
                $user->SetActive(1);
                $user->Update();
            }
            $message = $screen_module_name . " ativado(s) com sucesso.";
        } else {
            $message = "Não há usuários para serem ativados.";
        }
    }
}
?>

<html>
	<head>
		<title>Schifer's</title>
		<link rel="stylesheet" type="text/css" href="/schifers/css/schifers.css">
Example #3
0
    }
} else {
    print '<a href="User/Login">Login to Like</a>';
}
?>
    </h4>
    
    
    <p><span>0 like</span> <span> 0 Comments</span></p>
    
    
    <?php 
include_once "Model/user.php";
$usr = new User();
$usr->Id = $_SESSION['userid'];
$usr->SelectById();
include_once "Model/newscomments.php";
$nwc = new Newscomments();
if (isset($_POST['btnComments'])) {
    $nwc->NewsId = $model->Id;
    $nwc->UserId = $_SESSION['userid'];
    $nwc->Comments = $_POST['comments'];
    $nwc->Date = date('Y-m-d');
    if ($nwc->Insert()) {
        $nwc = new Newscomments();
    }
}
?>
    <div class="user_pic"><?php 
print '<img width="80" src="' . baseurl . 'images/user_images/' . $usr->Id . $usr->Image . '" />';
?>