예제 #1
0
 public function markAsComplete($params)
 {
     $db = new Dbase();
     $project_name = $params['identifier']['project_name'];
     $q = "UPDATE projects SET completed = '1' WHERE name = '{$project_name}'";
     logger("COMPLETED Query is : " . print_r($q, true));
     $db->executeQuery($q);
 }
 public function update($fields)
 {
     //logger( print_r( $fields, true ) );
     logger("RiskMitigationPlan update function called.\nFields : " . print_r($fields, true));
     $db = new Dbase();
     $updateString = $db->createUpdateString($fields['result']);
     $q = "UPDATE RiskMitigationPlan SET " . $updateString . " WHERE id = {$this->id}";
     logger("Update query : " . print_r($q, true));
     $success = $db->executeQuery($q);
     return $success;
     // return status code, message instead of the above statement
 }
예제 #3
0
function getActiveProjects()
{
    require_once 'utils/Dbase.php';
    $q = "SELECT * FROM projects WHERE is_active = 1 ORDER BY id DESC";
    $db = new Dbase();
    $res = $db->executeQuery($q);
    $activeProjects = array();
    while ($row = $res->fetch_assoc()) {
        $activeProjects[] = $row;
    }
    return $activeProjects;
}
예제 #4
0
 public function getLineItemIds()
 {
     $q = "SELECT * FROM projects_lineitems_mapping WHERE project_id = {$this->id}";
     $db = new Dbase();
     $res = $db->executeQuery($q);
     $lineItemIDsArray = array();
     if ($res && $res->num_rows > 0) {
         while ($row = $res->fetch_assoc()) {
             $lineItemIDsArray[] = $row['lineitem_id'];
         }
     }
     $res->free();
     $this->lineItemIDs = $lineItemIDsArray;
 }
예제 #5
0
 public function __construct($id = -1)
 {
     parent::__construct();
     $q = "SELECT * FROM lineitems WHERE id = {$id}";
     $db = new Dbase();
     $res = $db->executeQuery($q);
     if ($res && $res->num_rows > 0) {
         while ($row = $res->fetch_assoc()) {
             $this->id = $row['id'];
             // put the not NULL checks on $row[<members>] before initializing the classes
             // $this->name = $row['name'];
             $this->name = $row['name'] == "_PROJECT_" ? "OVERALL PROJECT" : $row['name'];
             $this->BRDRequirementObject = new BRDRequirement($row['brdrequirements_id']);
             $this->TechDevNeedObject = new TechDevNeed($row['techdevneed_id']);
             $this->ContentNeedObject = new ContentNeed($row['contentneed_id']);
             $this->TrainingNCommunicationPlanObject = new TrainingNCommunicationPlan($row['trainingncommunicationplan_id']);
             $this->CapabilitiesEnhancementObject = new CapabilitiesEnhancement($row['capabilitiesenhancement_id']);
             $this->CostBenefitObject = new CostBenefit($row['costbenefit_id']);
             $this->RiskMitigationPlanObject = new RiskMitigationPlan($row['riskmitigationplan_id']);
             $this->GoLivePlanObject = new GoLivePlan($row['goliveplan_id']);
             $this->ClosureModelObject = new ClosureModel($row['closure_id']);
         }
     }
 }