/**
  * Constructor.
  *
  * @param int $bpCopyId ID of the blueprint being copied
  * @param int $copyQuantity the number of copies being made
  * @param int $outputRuns the number of runs per copy
  * @param int $copyTime the time the copy process takes
  * @param float $processCost the cost of performing this reseach process
  * @param int $solarSystemId ID of the SolarSystem the research is performed
  * @param int $assemblyLineId ID of the AssemblyLine where the research is being performed
  */
 public function __construct($bpCopyId, $copyQuantity, $outputRuns, $copyTime, $processCost, $solarSystemId, $assemblyLineId)
 {
     parent::__construct($bpCopyId, $copyQuantity, $copyTime, $processCost);
     $this->outputRuns = (int) $outputRuns;
     $this->solarSystemId = (int) $solarSystemId;
     $this->assemblyLineId = (int) $assemblyLineId;
 }
 /**
  * Constructor.
  *
  * @param int $researchedBpId of the Blueprint being researched
  * @param int $researchTime the time the process takes
  * @param float $processCost the cost of performing this reseach process
  * @param int $startMELevel the initial ME level of the Blueprint
  * @param int $endMELevel the ME level of the Blueprint after the research
  * @param int $solarSystemId ID of the SolarSystem the research is performed
  * @param int $assemblyLineId ID of the AssemblyLine where the research is being performed
  */
 public function __construct($researchedBpId, $researchTime, $processCost, $startMELevel, $endMELevel, $solarSystemId, $assemblyLineId)
 {
     parent::__construct($researchedBpId, 1, $researchTime, $processCost);
     $this->startMELevel = (int) $startMELevel;
     $this->endMELevel = (int) $endMELevel;
     $this->solarSystemId = (int) $solarSystemId;
     $this->assemblyLineId = (int) $assemblyLineId;
 }
 /**
  * Constructor.
  *
  * @param int $producesTypeId typeId of the item manufactured in this process
  * @param int $producesQuantity the number of produces items
  * @param int $processTime the time this process takes in seconds
  * @param float $processCost the cost of performing this reseach process
  * @param int $bpMeLevel the ME level of the blueprint used in this process
  * @param int $bpTeLevel the TE level of the blueprint used in this process
  * @param int $solarSystemId ID of the SolarSystem the research is performed
  * @param int $assemblyLineId ID of the AssemblyLine where the research is being performed
  */
 public function __construct($producesTypeId, $producesQuantity, $processTime, $processCost, $bpMeLevel, $bpTeLevel, $solarSystemId, $assemblyLineId)
 {
     parent::__construct($producesTypeId, $producesQuantity, $processTime, $processCost);
     $this->bpMeLevel = (int) $bpMeLevel;
     $this->bpTeLevel = (int) $bpTeLevel;
     $this->solarSystemId = (int) $solarSystemId;
     $this->assemblyLineId = (int) $assemblyLineId;
 }
 /**
  * Constructor.
  *
  * @param int $inventedBpId typeId of the invented blueprint
  * @param int $inventTime the invention takes in seconds
  * @param float $processCost the cost of performing this reseach process
  * @param float $probability  chance of success for invention
  * @param int $resultRuns the number of runs on the resulting T2 BPC if invention is successful
  * @param int $resultME the ME level on the resulting T2 BPC if invention is successful
  * @param int $resultTE the TE level on the resulting T2 BPC if invention is successful
  * @param int $solarSystemId ID of the SolarSystem the research is performed
  * @param int $assemblyLineId ID of the AssemblyLine where the research is being performed
  */
 public function __construct($inventedBpId, $inventTime, $processCost, $probability, $resultRuns, $resultME, $resultTE, $solarSystemId, $assemblyLineId)
 {
     parent::__construct($inventedBpId, 1, $inventTime, $processCost);
     $this->probability = (double) $probability;
     $this->resultRuns = (int) $resultRuns;
     $this->resultME = (int) $resultME;
     $this->resultTE = (int) $resultTE;
     $this->solarSystemId = (int) $solarSystemId;
     $this->assemblyLineId = (int) $assemblyLineId;
 }
 /**
  * Constructor
  * 
  * @param int $bpCopyID typeID of the blueprint being copied
  * @param int $copyQuantity the number of copies being made
  * @param int $outputRuns the number of runs per copy
  * @param int $copyTime the time the copy process takes
  * @param float $processCost the cost of performing this reseach process
  * @param int $solarSystemID ID of the SolarSystem the research is performed
  * @param int $assemblyLineID ID of the AssemblyLine where the research is being performed
  * @param int $teamID the ID of the Team being used, if at all
  * 
  * @return \iveeCore\CopyProcessData
  */
 public function __construct($bpCopyID, $copyQuantity, $outputRuns, $copyTime, $processCost, $solarSystemID, $assemblyLineID, $teamID = null)
 {
     parent::__construct($bpCopyID, $copyQuantity, $copyTime, $processCost);
     $this->outputRuns = (int) $outputRuns;
     $this->solarSystemID = (int) $solarSystemID;
     $this->assemblyLineID = (int) $assemblyLineID;
     if (isset($teamID)) {
         $this->teamID = (int) $teamID;
     }
 }
 /**
  * Constructor
  *
  * @param int $researchedBpID of the Blueprint being researched
  * @param int $researchTime the time the process takes
  * @param float $processCost the cost of performing this reseach process
  * @param int $startTELevel the initial TE level of the Blueprint
  * @param int $endTELevel the TE level of the Blueprint after the research
  * @param int $solarSystemID ID of the SolarSystem the research is performed
  * @param int $assemblyLineID ID of the AssemblyLine where the research is being performed
  * @param int $teamID the ID of the Team being used, if at all
  *
  * @return \iveeCore\ResearchTEProcessData
  */
 public function __construct($researchedBpID, $researchTime, $processCost, $startTELevel, $endTELevel, $solarSystemID, $assemblyLineID, $teamID = null)
 {
     parent::__construct($researchedBpID, 1, $researchTime, $processCost);
     $this->startTELevel = (int) $startTELevel;
     $this->endTELevel = (int) $endTELevel;
     $this->solarSystemID = (int) $solarSystemID;
     $this->assemblyLineID = (int) $assemblyLineID;
     if (isset($teamID)) {
         $this->teamID = (int) $teamID;
     }
 }
 /**
  * Constructor.
  * 
  * @param int $producesTypeID typeID of the item manufactured in this process
  * @param int $producesQuantity the number of produces items
  * @param int $processTime the time this process takes in seconds
  * @param float $processCost the cost of performing this reseach process
  * @param int $bpMeLevel the ME level of the blueprint used in this process
  * @param int $bpTeLevel the TE level of the blueprint used in this process
  * @param int $solarSystemID ID of the SolarSystem the research is performed
  * @param int $assemblyLineID ID of the AssemblyLine where the research is being performed
  * @param int $teamID the ID of the Team being used, if at all
  * 
  * @return ProcessData
  */
 public function __construct($producesTypeID, $producesQuantity, $processTime, $processCost, $bpMeLevel, $bpTeLevel, $solarSystemID, $assemblyLineID, $teamID = null)
 {
     parent::__construct($producesTypeID, $producesQuantity, $processTime, $processCost);
     $this->bpMeLevel = (int) $bpMeLevel;
     $this->bpTeLevel = (int) $bpTeLevel;
     $this->solarSystemID = (int) $solarSystemID;
     $this->assemblyLineID = (int) $assemblyLineID;
     if (isset($teamID)) {
         $this->teamID = (int) $teamID;
     }
 }
 /**
  * Constructor.
  * 
  * @param int $inventedBpID typeID of the invented blueprint
  * @param int $inventTime the invention takes in seconds
  * @param float $processCost the cost of performing this reseach process
  * @param float $inventionChance  chance of success for invention
  * @param int $resultRuns the number of runs on the resulting T2 BPC if invention is successful
  * @param int $resultME the ME level on the resulting T2 BPC if invention is successful
  * @param int $resultTE the TE level on the resulting T2 BPC if invention is successful
  * @param int $solarSystemID ID of the SolarSystem the research is performed
  * @param int $assemblyLineID ID of the AssemblyLine where the research is being performed
  * @param int $teamID the ID of the Team being used, if at all
  * 
  * @return InventionProcessData
  */
 public function __construct($inventedBpID, $inventTime, $processCost, $inventionChance, $resultRuns, $resultME, $resultTE, $solarSystemID, $assemblyLineID, $teamID = null)
 {
     parent::__construct($inventedBpID, 1, $inventTime, $processCost);
     $this->probability = (double) $inventionChance;
     $this->resultRuns = (int) $resultRuns;
     $this->resultME = (int) $resultME;
     $this->resultTE = (int) $resultTE;
     $this->solarSystemID = (int) $solarSystemID;
     $this->assemblyLineID = (int) $assemblyLineID;
     if (isset($teamID)) {
         $this->teamID = (int) $teamID;
     }
 }
Beispiel #9
0
 /**
  * Computes and adds the material requirements for a process to a ProcessData object.
  *
  * @param IndustryModifier $iMod the object that holds all the information about skills, implants, system industry
  * indices, tax and assemblyLines
  * @param ProcessData $pdata to which materials shall be added
  * @param int $activityId of the activity
  * @param float $materialFactor the IndustryModifier and Blueprint ME level dependant ME bonus factor
  * @param float $numPortions the number of portions being built or researched. Note that passing a fraction will
  * make the method not use the rounding for the resulting required amounts.
  * @param int $manuRecursionDepth defines if and how deep used materials should be manufactured recursively
  * @param int $reactionRecursionDepth defines if and how deep used materials should be gained through reaction
  * recursively
  *
  * @return void
  */
 protected function addActivityMaterials(IndustryModifier $iMod, ProcessData $pdata, $activityId, $materialFactor, $numPortions, $manuRecursionDepth, $reactionRecursionDepth)
 {
     foreach ($this->getMaterialsForActivity($activityId) as $matId => $rawAmount) {
         $mat = Type::getById($matId);
         $amount = $rawAmount * $materialFactor * $numPortions;
         //calculate total quantity needed, applying all modifiers
         //if number of portions is a fraction, don't ceil() amounts
         if (fmod($numPortions, 1.0) > 1.0E-9) {
             $totalNeeded = $amount;
         } else {
             //fix float precision problems
             if (fmod($amount, 1.0) < 1.0E-9) {
                 $totalNeeded = round($amount);
             } else {
                 $totalNeeded = ceil($amount);
             }
         }
         //at least one unit of material is required per portion
         if ($totalNeeded < $numPortions) {
             $totalNeeded = $numPortions;
         }
         //if using recursive building and material is manufacturable, recurse!
         if ($manuRecursionDepth > 0 and $mat instanceof Manufacturable) {
             $pdata->addSubProcessData($mat->getBlueprint()->manufacture($iMod, $totalNeeded, null, null, $manuRecursionDepth - 1, $reactionRecursionDepth));
         } elseif ($reactionRecursionDepth > 0 and $mat instanceof ReactionProduct) {
             $pdata->addSubProcessData($mat->doBestReaction($iMod, $totalNeeded, $reactionRecursionDepth - 1));
         } else {
             $pdata->addMaterial($matId, $totalNeeded);
         }
     }
 }
Beispiel #10
0
 /**
  * Computes and adds the material requirements for a process to a ProcessData object.
  * 
  * 
  * @param IndustryModifier $iMod the object that holds all the information about skills, implants, system industry
  * indices, teams, tax and assemblyLines
  * @param ProcessData $pdata to which materials shall be added
  * @param int $activityId of the activity
  * @param float $materialFactor the IndustryModifier and Blueprint ME level dependant ME bonus factor
  * @param float $numPortions the number of portions being built or researched. Note that passing a fraction will
  * make the method not use the rounding for the resulting required amounts.
  * @param bool $recursive defines if used materials should be manufactured recursively
  * 
  * @return void
  */
 protected function addActivityMaterials(IndustryModifier $iMod, ProcessData $pdata, $activityId, $materialFactor, $numPortions, $recursive)
 {
     foreach ($this->getMaterialsForActivity($activityId) as $matID => $matData) {
         //if consume flag is set to 0, add to needed mats with quantity 0
         if (isset($matData['c']) and $matData['c'] == 0) {
             $pdata->addMaterial($matID, 0);
             continue;
         }
         $mat = Type::getById($matID);
         //calculate total quantity needed, applying all modifiers
         //if number of portions is a fraction, don't ceil() amounts
         if (fmod($numPortions, 1.0) > 0.0) {
             $totalNeeded = $matData['q'] * $materialFactor * $numPortions;
         } else {
             $totalNeeded = ceil($matData['q'] * $materialFactor * $numPortions);
         }
         //at least one unit of material is required per portion
         if ($totalNeeded < $numPortions) {
             $totalNeeded = $numPortions;
         }
         //if using recursive building and material is manufacturable, recurse!
         if ($recursive and $mat instanceof Manufacturable) {
             $pdata->addSubProcessData($mat->getBlueprint()->manufacture($iMod, $totalNeeded));
         } else {
             $pdata->addMaterial($matID, $totalNeeded);
         }
     }
 }
Beispiel #11
0
}
require 'library/twilio-php/Services/Twilio.php';
require_once 'resources/db_connection.php';
require 'db_functions.php';
require 'process_data.php';
if (!isset($_SESSION['token'])) {
    $_SESSION['token'] = md5(uniqid(rand(), true));
}
$token = $_SESSION['token'];
// check if profile photo's file name is present in the session
if (!isset($_SESSION['photo'])) {
    $photo = '';
}
// if the user has submitted the form
if (isset($_POST['submit'])) {
    $processData = new ProcessData();
    $record = $processData->setData($_POST, $_FILES, $connection);
    // set session to store the name of the photo so that we can have the photo
    // during resubmission (in case of validation errors)
    $_SESSION['photo'] = $record['photo'];
    // validate data in $record
    $errors = $processData->validateData($record, $connection, 'register');
    // if no error exists after validation then encrypt the passwords and
    // enter the details to the database.
    if (!$errors) {
        $record['password'] = md5($record['password']);
        $status = insert_record($record, $connection);
        if ('success' == $status) {
            $account_sid = 'AC547de080c3d48ff71283595dc7acbed0';
            $auth_token = 'c30e80f20ed4350c71295f9d767b68a5';
            $client = new Services_Twilio($account_sid, $auth_token);
Beispiel #12
0
<?php

require_once dirname(__DIR__) . '/resources/db_connection.php';
require dirname(__DIR__) . '/db_functions.php';
require dirname(__DIR__) . '/process_data.php';
if (!isset($_SESSION['pk_admin'])) {
    header('Location: index.php');
} else {
    if (isset($_POST['submit'])) {
        $userId = $_POST['id'];
        $_SESSION['userName'] = $_POST['userName'];
        $processData = new ProcessData();
        $record = $processData->setData($_POST, $_FILES);
        $row = $record;
        // validate $row
        $errors = $processData->validateData($row, 'update');
        // if no error exists after validation then update the employee_details of the user
        if (!$errors) {
            $status = update_record($userId, $connection, $row);
            if (1 == $status) {
                $_SESSION['message'] = 'Your changes have been saved successfully';
                header('Location: admin_home.php');
            } else {
                $_SESSION['message'] = 'Sorry! Unable to save your changes';
                header('Location: admin_home.php');
            }
        }
    }
}
require dirname(__DIR__) . '/layout/header.php';
?>
Beispiel #13
0
*/
// Turn on error reporting
ini_set('display_errors', 'On');
error_reporting(E_ALL);
require_once 'resources/db_connection.php';
require 'process_data.php';
require 'db_functions.php';
// check if photo's file name is present in the session
if (!isset($_SESSION['photo'])) {
    $photo = '';
}
$row = array();
// if the user has submitted the form
if (isset($_POST['update'])) {
    $userId = $_SESSION['id'];
    $processData = new ProcessData();
    $record = $processData->setData($_POST, $_FILES, $connection);
    $row = $record;
    // validate $row
    $errors = $processData->validateData($row, $connection, 'update');
    // if no error exists after validation then update the employee_details of the user
    if (!$errors) {
        $status = update_record($userId, $connection, $row);
        if (1 == $status) {
            $_SESSION['message'] = 'Your changes have been saved successfully';
            header('Location: home.php');
        } else {
            $_SESSION['message'] = 'Sorry! Unable to save your changes';
            header('Location: home.php');
        }
    }