%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/pn/utils/
Upload File :
Create Path :
Current File : /var/www/pn/utils/edit-project.php

<?php
    require_once "config.php";
    require_once "classes/Viewer.php";
    $viewer = new Viewer();
    if(empty($_GET['id'])){
        die('Project not found');
    }

    $project = $viewer->getProjectById($_GET['id']);
?>
<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">

    <title>Project viewer | Editing project</title>
  </head>
  <body>
    <div class="container">

        <?php include('templates/main-menu.php'); ?>

        <div class="row">
            <div class="col">
                <?php if($project->approved == 1 ){ ?>
                    <span class="badge badge-success">approved</span>
                <?php }else{ ?>
                    <span class="badge badge-warning">Unapproved</span>
                <?php } ?>
                <h1>Edit ptoject</h1>                
                <?php if(!empty($project->post_id)){ ?>
                    <a href="<?php print get_edit_post_link($project->post_id); ?>" target="_blank" class="btn btn-primary btn-sm">Edit full data</a>
                <?php } ?>
                <hr>
            </div>
        </div>
        <div class="row">
            <div class="col">
                <form action="actions.php" method="POST">
                    <div class="form-group">
                        <label for="url">Url</label>
                        <input value="<?php print $project->url; ?>" type="text" class="form-control" id="url" name="url">
                    </div>
                    
                    <div class="form-group">
                        <label for="type">Project/Programme Name</label>
                        <input type="text" class="form-control" id="name" name="name" value="<?php print $project->name; ?>">
                    </div>

                    <div class="form-group">
                        <label for="status">Status of project</label>
                        <input type="text" class="form-control" id="status" name="status" value="<?php print $project->status; ?>">
                    </div>

                    <div class="form-group">
                        <label for="beneficiarySAI">Beneficiary SAI(s)</label>
                        <input type="text" class="form-control" id="beneficiarySAI" name="beneficiarySAI" value="<?php print $project->beneficiarySAI; ?>">
                    </div>  

                    <div class="form-group">
                        <label for="beneficiaryLevel">Beneficiary level</label>
                        <input type="text" class="form-control" id="beneficiaryLevel" name="beneficiaryLevel" value="<?php print $project->beneficiaryLevel; ?>">
                    </div>  

                    <div class="form-group">
                        <label for="intosaiRegion">INTOSAI region</label>
                        <input type="text" class="form-control" id="intosaiRegion" name="intosaiRegion" value="<?php print $project->intosaiRegion; ?>">
                    </div>

                    <div class="form-group">
                        <label for="description">Brief project description</label>
                        <textarea class="form-control" id="description" name="description" rows="6"><?php print $project->description; ?></textarea>
                    </div>

                    <div class="form-group">
                        <label for="implementingAgency">Implementing agency(s)</label>
                        <input type="text" class="form-control" id="implementingAgency" name="implementingAgency" value="<?php print $project->implementingAgency; ?>">
                    </div>  

                    <input type="hidden" name="id" value="<?php print $project->id; ?>">
                    <input type="hidden" name="post_id" value="<?php print $project->post_id; ?>">

                    <button type="submit" name="action" value="save" class="btn btn-primary">Save</button>
                    <button type="submit" name="action" value="deleted" class="btn btn-danger">Delete</button>
                    <?php if($project->	approved) { ?>
                    <button type="submit" name="action" value="unapproved" class="btn btn-warning">Unapprove</button>
                    <?php }else{ ?>
                        <button type="submit" name="action" value="approved" class="btn btn-success">Approve</button>
                    <?php } ?>
                    <br> <br> 
                </form>
            </div>        
        </div>
    </div>

    <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>

  </body>
</html>

Zerion Mini Shell 1.0