public function actionAdmin()
 {
     $model = new Inventory('search');
     $model->unsetAttributes();
     if (isset($_GET['Inventory'])) {
         $model->setAttributes($_GET['Inventory']);
     }
     $this->render('admin', array('model' => $model));
 }
Ejemplo n.º 2
0
 function test_find()
 {
     $item = "POGs";
     $item2 = "Pokemon Cards";
     $test_item = new Inventory($item);
     $test_item->save();
     $test_item2 = new Inventory($item2);
     $test_item2->save();
     $search_item = $test_item->getItem();
     $result = Inventory::find($search_item);
     $this->assertEquals($test_item, $result);
 }
Ejemplo n.º 3
0
 function test_find()
 {
     $description = "Blue candy";
     $description2 = "Light blue candy";
     $test_Inventory = new Inventory($description);
     $test_Inventory->save();
     $test_Inventory2 = new Inventory($description2);
     //Act
     $id = $test_Inventory->getId();
     $result = Inventory::find($id);
     //Assert
     $this->assertEquals($test_Inventory, $result);
 }
 /**
  * Moving an Item from one spot to the other in a Bag
  */
 function game_change($from_bag_id = null, $from_bag_index = null, $to_bag_id = null, $to_bag_index = null)
 {
     $this->render(false);
     App::import('Model', 'Inventory');
     $Inventory = new Inventory();
     $Inventory->unbindModelAll();
     $fromInventory = $Inventory->find('first', array('conditions' => array('Inventory.character_id' => $this->characterInfo['id'], 'Inventory.bag_id' => $from_bag_id, 'Inventory.index' => $from_bag_index)));
     if (!empty($fromInventory)) {
         // KLijken of het vakje leeg is waar we heen gaan
         $toInventory = $Inventory->find('first', array('conditions' => array('Inventory.character_id' => $this->characterInfo['id'], 'Inventory.bag_id' => $to_bag_id, 'Inventory.index' => $to_bag_index)));
         if (!empty($toInventory)) {
             // Niks aan de hand, wisselen
             // to => from
             $oldIds = $Inventory->find('list', array('conditions' => array('Inventory.character_id' => $this->characterInfo['id'], 'Inventory.bag_id' => $from_bag_id, 'Inventory.index' => $from_bag_index)));
             $Inventory->updateAll(array('Inventory.bag_id' => $fromInventory['Inventory']['bag_id'], 'Inventory.index' => $fromInventory['Inventory']['index']), array('Inventory.bag_id' => $toInventory['Inventory']['bag_id'], 'Inventory.index' => $toInventory['Inventory']['index']));
             // from => to
             $Inventory->updateAll(array('Inventory.bag_id' => $toInventory['Inventory']['bag_id'], 'Inventory.index' => $toInventory['Inventory']['index']), array('Inventory.id' => $oldIds));
         } else {
             // kijken of er in de nieuwe bag slot wel ruimte is
             $this->Bag->recursive = 2;
             $toBag = $this->Bag->find('first', array('conditions' => array('Bag.id' => $to_bag_id, 'Bag.character_id' => $this->characterInfo['id'])));
             if (!empty($toBag)) {
                 // Kijken of de index lager is dan het aantal vrije slots
                 if ($toBag['Item']['StatNamed']['slots'] >= $to_bag_index) {
                     // Mag naar de lege plek
                     $Inventory->updateAll(array('Inventory.bag_id' => $to_bag_id, 'Inventory.index' => $to_bag_index), array('Inventory.bag_id' => $fromInventory['Inventory']['bag_id'], 'Inventory.index' => $fromInventory['Inventory']['index']));
                 }
             }
         }
     }
     $this->redirect('/game/bags/view/' . $to_bag_id);
     exit;
 }
Ejemplo n.º 5
0
 function test_find()
 {
     //Arrange
     $item = "Antique Toothpick Holders";
     $item2 = "Ornamental Mouse Traps";
     $test_Inventory = new Inventory($item);
     $test_Inventory->save();
     $test_Inventory2 = new Inventory($item2);
     $test_Inventory2->save();
     //Act
     $id = $test_Inventory->getId();
     $result = Inventory::find($id);
     //Assert
     $this->assertEquals($test_Inventory, $result);
 }
Ejemplo n.º 6
0
 protected function proceed()
 {
     $srv = new InventoriesService();
     switch ($this->action) {
         case 'save':
             $jsInv = json_decode($this->getParam("inventory"));
             $id = null;
             if (!property_exists($jsInv, 'id')) {
                 $jsInv->id = null;
             }
             $inv = Inventory::__build($jsInv->id, $jsInv->date, $jsInv->locationId);
             foreach ($jsInv->items as $item) {
                 if (!property_exists($item, 'missingQty')) {
                     $item->missingQty = null;
                 }
                 if (!property_exists($item, 'unitValue')) {
                     $item->unitValue = null;
                 }
                 if (!property_exists($item, "attrSetInstId")) {
                     $item->attrSetInstId = null;
                 }
                 $item = new InventoryItem($inv->id, $item->productId, $item->attrSetInstId, $item->qty, $item->lostQty, $item->defectQty, $item->missingQty, $item->unitValue);
                 $inv->addItem($item);
             }
             $inv->fillZero();
             $id = $srv->create($inv);
             if ($id !== false) {
                 $this->succeed($id);
             } else {
                 $this->fail(APIError::$ERR_GENERIC);
             }
             break;
     }
 }
Ejemplo n.º 7
0
 /** @depends testConstruct */
 public function testBuild()
 {
     $inv = Inventory::__build(1, 1000, 1);
     $this->assertEquals(1, $inv->id);
     $this->assertEquals(1000, $inv->date);
     $this->assertEquals(1, $inv->locationId);
 }
Ejemplo n.º 8
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $collection = Collection::find($id);
     $inventories = $collection->inventory;
     $inventory = Inventory::find($id);
     $this->layout->content = View::make('collections.edit')->with('collection', $collection)->with('inventories', $inventories)->with('inventory', $inventory);
 }
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Inventory::create([]);
     }
 }
Ejemplo n.º 10
0
 function remove_item()
 {
     $invoice_id = $this->input->post("invoice_id");
     $inventory_id = $this->input->post("inventory_id");
     $inventoryObject = new Inventory($inventory_id);
     $inventoryObject->invoice_id = NULL;
     $inventoryObject->status = 1;
     // In Stock
     $inventoryObject->save();
     $invoiceObject = new Invoice($invoice_id);
     $invoiceObject->total -= $inventoryObject->sale_price;
     $invoiceObject->save();
     $data["total"] = $invoiceObject->total;
     $data["tbody_html"] = $this->_html($invoiceObject);
     echo json_encode($data);
 }
Ejemplo n.º 11
0
 public function add_item($item_id, $item_owner, $amount)
 {
     $criteria = new CDbCriteria();
     $criteria->select = 'MAX(item_unique_id) as item_unique_id';
     $last_item_id = Inventory::model()->find($criteria);
     $form = new Inventory();
     $form->scenario = 'buy';
     $form->item_id = $item_id;
     $form->item_owner = $item_owner;
     $form->item_creator = '';
     $form->item_count = $amount;
     $form->item_unique_id = $last_item_id->item_unique_id + 1;
     $form->item_location = 127;
     $form->item_skin = $item_id;
     $form->save(false);
     return $form->item_unique_id;
 }
Ejemplo n.º 12
0
 public function actionIdelete($id)
 {
     if (Yii::app()->user->isGuest or Yii::app()->user->access_level < Config::get('access_level_admin')) {
         $this->redirect(Yii::app()->homeUrl);
     }
     $model = Inventory::model()->findByPK($id);
     $model->delete();
     $this->redirect(Yii::app()->homeUrl . 'admin/check/items/');
 }
Ejemplo n.º 13
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $del = Inventory::find($id)->delete();
     if ($del) {
         echo "Your Item Deleted";
     } else {
         echo "Not Found or Already Deleted";
     }
 }
Ejemplo n.º 14
0
 function makeSell()
 {
     $date = "{$_POST['date']} 02:02:02";
     db("insert into sell (vendorIndex,vendor,memoNo,rawPrice,extraCost,extraCostDescr,shippingCost,commission,discount,totalPrice,paid,due,date,currDue,sellType) \n\t\t\tvalues ('{$this->clientIndex}','client','{$this->memoNo}','{$this->rawPrice}','{$this->extraCost}','{$this->extraCostDescr}','{$this->shippingCost}','{$this->commission}','{$this->discount}','{$this->totalPrice}','{$this->paid}','{$this->due}','{$date}','{$this->currDue}','clientPurchase')");
     for ($index = 0; $index < $this->productList; $index++) {
         $product = $this->product[$index];
         db("insert into sell_log\n\t\t\t(memoNo,pid,descr,qty,sp,cpDoz,date) values ('{$this->memoNo}','{$product->pid}','{$product->descr}','{$product->qty}','{$product->sp}','{$product->cpDoz}','{$date}')");
         Inventory::remove($product);
     }
 }
Ejemplo n.º 15
0
 static function find($search_id)
 {
     $found_item = null;
     $items = Inventory::getAll();
     foreach ($items as $item) {
         $item_id = $item->getId();
         if ($item_id == $search_id) {
             $found_item = $item;
         }
     }
     return $found_item;
 }
Ejemplo n.º 16
0
 static function find($search_item)
 {
     $found_item = NULL;
     $inventory = Inventory::getAll();
     foreach ($inventory as $item) {
         $item_name = $item->getItem();
         if ($item_name == $search_item) {
             $found_item = $item;
         }
     }
     return $found_item;
 }
Ejemplo n.º 17
0
 static function find($search_id)
 {
     $found_inventory = null;
     $inventory_array = Inventory::getAll();
     foreach ($inventory_array as $inventory_item) {
         $inventory_id = $inventory_item->getId();
         if ($inventory_id == $search_id) {
             $found_inventory = $inventory_item;
         }
     }
     return $found_inventory;
 }
Ejemplo n.º 18
0
 protected function build($dbInv, $pdo = null)
 {
     $db = DB::get();
     $inv = Inventory::__build($dbInv['ID'], $db->readDate($dbInv['DATE']), $dbInv['LOCATION_ID'], $dbInv['PRODUCT_ID'], $dbInv['ATTRSETINST_ID'], $dbInv['QTY'], $dbInv['LOSTQTY'], $dbInv['DEFECTQTY'], $dbInv['MISSINGQTY'], $dbInv['UNITVALUE']);
     $stmt = $pdo->prepare("SELECT * FROM STOCK_INVENTORYCONTENT WHERE " . "INVENTORY_ID = :id");
     $stmt->bindParam(":id", $dbInv['ID']);
     $stmt->execute();
     while ($row = $stmt->fetch()) {
         $item = new InventoryItem($row['PRODUCT_ID'], $row['ATTRSETINST_ID'], $row['QTY'], $row['LOSTQTY'], $row['DEFECTQTY'], $row['MISSINGQTY'], $row['UNITVALUE']);
         $inv->addItem($item);
     }
     return $inv;
 }
Ejemplo n.º 19
0
 function look($words)
 {
     $words = $this->findSynonym($words);
     $obj = load(ROOMFILE, 'mirar', $words);
     // Si no hay un objeto en el lugar, busca en el inventario...
     if ($obj === NULL) {
         $inventory = new Inventory();
         return $inventory->look($words);
     }
     // ** Simple format
     if (is_string($obj)) {
         return array("mirar", $obj);
     }
     // ** Complex format
     // No hay restricciones
     if (!property_exists($obj, 'required')) {
         $this->check_optional_param($obj);
         return array("mirar", $obj->message);
     }
     // ¿Se cumplen las restricciones?
     $required = new Required();
     if ($required->check($obj->required)) {
         // Only first time
         if (!load(USERFILE, 'actions', $words . '_seen')) {
             $this->check_optional_param($obj);
             save(USERFILE, 'actions', $words . '_seen', "1");
         }
         return array("mirar", $obj->message);
     }
     // No se cumplen las restricciones
     if (property_exists($obj, 'excuse')) {
         return array("mirar", $obj->excuse);
     } else {
         return array("mirar", "FAIL");
     }
     // No hay excusa definida => objeto no encontrado
     return array("mirar", "FAIL");
 }
Ejemplo n.º 20
0
 function test_find()
 {
     //Arrange
     $item = 'action figure';
     $item2 = 'stuffed animal';
     $test_Inventory = new Inventory($item);
     $test_Inventory->save();
     $test_Inventory2 = new Inventory($item2);
     $test_Inventory2->save();
     //Act
     $result = Inventory::find($test_Inventory->getId());
     //Assert
     $this->assertEquals($test_Inventory, $result);
 }
Ejemplo n.º 21
0
 /**
  *
  * @param <User> $user
  * @return <Array>
  * @SQl SELECT inventory.id AS inventory_id, inventory.artifactlevel AS inventory_artifactlevel, inventory.artifactid AS inventory_artifactid, inventory.userid AS inventory_userid, user.id AS user_id, user.username AS user_username, artifact.* FROM inventory, user, artifactinfo AS artifact WHERE inventory.userid = user.id AND inventory.artifactid = artifact.id AND inventory.userid =1
  */
 public function getInventory(User $user)
 {
     $con = Connection::createConnection();
     $result = mysql_query("SELECT inventory.id AS inventory_id, inventory.artifactlevel AS inventory_artifactlevel, inventory.artifactid AS inventory_artifactid, inventory.userid AS inventory_userid, user.id AS user_id, user.username AS user_username, artifact.* FROM inventory, user, artifactinfo AS artifact WHERE inventory.userid = user.id AND inventory.artifactid = artifact.id AND inventory.userid ={$user->id}");
     $myinventory = array();
     while ($row = mysql_fetch_array($result)) {
         $inventoryObj = new Inventory();
         $artifact = new ArtifactInfo();
         $user = new User();
         $inventoryObj->artifactLvl = $row['inventory_artifactlevel'];
         $inventoryObj->id = $row['inventory_id'];
         $user->id = $row['user_id'];
         $user->username = $row['user_username'];
         $artifact->desc = $row['desc'];
         $artifact->id = $row['id'];
         $artifact->name = $row['name'];
         $artifact->isActive = $row['isactive'];
         $inventoryObj->setUser($user);
         $inventoryObj->setArtifact($artifact);
         array_push($myinventory, $inventoryObj);
     }
     Connection::closeConnection($con);
     return $myinventory;
 }
Ejemplo n.º 22
0
 public function store($id)
 {
     $validator = Validator::make(Input::all(), Comment::$rules);
     $comment = Inventory::find($id);
     if ($validator->passes()) {
         $comment = new Comment();
         $comment->content = Input::get('comment');
         $comment->user_id = Auth::user()->id;
         $comment->img_id = $id;
         $comment->save();
         return Redirect::to('/inventory/' . $id);
     } else {
         return Redirect::to('inventory')->with('message', 'The following errors occurred')->withErrors($validator)->withInput();
     }
 }
function submit_products()
{
    $start = 0;
    while (true) {
        $inventories = Inventory::whereNull('shopify_id')->orWhere('dirty', 1)->skip($start)->take(100)->get();
        $cnt = count($inventories);
        if ($cnt == 0) {
            break;
        }
        foreach ($inventories as $inventory) {
            if ($inventory->image == '') {
                continue;
            }
            if ($inventory->shopify_id == NULL) {
                $amzInfo = AmazonInfo::where("inventory_id", $inventory->id)->first();
                $collection = Collection::where("name", $amzInfo->category1)->first();
                if ($collection == NULL) {
                    //echo '[', date('Y-m-d H:m:s'), '] Skip - ', $inventory->name, "\r\n";
                    continue;
                }
                $result = create_product($inventory->name, $inventory->description, 'Bellwether', 'Book', $inventory->sku, $inventory->price, $inventory->quantity, $inventory->image, $inventory->isbn);
                if ($result['success'] == 'true') {
                    /*
                    	Check if collection exists and add product & category...
                    */
                    if ($collection != NULL) {
                        $inventory->dirty = 0;
                        $sid = $result['product']['id'];
                        $inventory->shopify_id = $sid;
                        $inventory->save();
                        echo '[', date('Y-m-d H:m:s'), '] Added Product - ', "ID ", $sid, ", ", $inventory->name, "\r\n";
                        add_product_to_collection($result['product']['id'], $collection->shopify_id);
                        echo 'Added to Collection - ' . $collection->name . "\r\n";
                    }
                }
            } else {
                $result = update_product_content($inventory->shopify_id, $inventory->price, $inventory->quantity, $inventory->sku);
                if ($result['success'] == 'true') {
                    $inventory->dirty = 0;
                    $inventory->save();
                    echo 'Updated Product - ' . $inventory->name . "\r\n";
                }
            }
        }
        $start += $cnt;
    }
}
Ejemplo n.º 24
0
 function makePurchase()
 {
     $date = "{$_POST['date']} 02:02:02";
     $this->purchaseType = "defaultPurchase";
     //insert into sell and sellLog
     //vendorType = [factory, factory, staff, bank, addition]
     //
     //do this in distraction free mode shift+f11
     //first field name, then field value, type both at once first
     db("insert into purchase\n\t\t\t(vendorIndex,vendor,memoNo,rawPrice,paid,due,date,purchaseType)\n\t\t\tvalues\n\t\t\t('{$this->factoryIndex}','factory','{$this->memoNo}','{$this->rawPrice}','{$this->paid}','{$this->due}','{$date}','{$this->purchaseType}')\n\t\t\t");
     for ($index = 0; $index < $this->productList; $index++) {
         $product = $this->product[$index];
         //echo "('$this->memoNo','$product->pid','$product->descr','$product->qty','$product->sp','$product->cpDoz')";
         db("insert into purchase_log\n\t\t\t\t(memoNo,pid,descr,qty,sp,cpDoz,date)\n\t\t\t\tvalues\n\t\t\t\t('{$this->memoNo}','{$product->pid}','{$product->descr}','{$product->qty}','{$product->sp}','{$product->cpDoz}','{$date}')\n\t\t\t\t");
         Inventory::add($product);
     }
 }
Ejemplo n.º 25
0
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Entry();
     if (isset($_POST['amount']) && isset($_POST['invoice']) && isset($_POST['name'])) {
         $inventory_info = $_POST["name"];
         $inventory_info_arr = explode(":", $inventory_info);
         $inventory_id = intval($inventory_info_arr[0]);
         $inventory = Inventory::model()->findByPk($inventory_id);
         if ($inventory->id) {
             $inventory_id = $inventory->id;
             $model->inventory = $inventory_id;
             $model->item = $inventory->name . " - " . $inventory->model;
             $model->price = intval($_POST['price']);
             $model->amount = intval($_POST['amount']);
             $model->invoice = intval($_POST['invoice']);
             if ($model->save()) {
                 $this->redirect(array('/invoice/view', 'id' => $model->invoice));
             }
         } else {
             throw new Exception("Invalid Inventory ID");
         }
     }
     $this->render('/invoice/view', array('id' => $_POST['invoice']));
 }
 public function actionBuy()
 {
     $output = array('errno' => 1, 'html' => '');
     //Check session
     if (!Yii::app()->user->isGuest) {
         //Check input
         if (isset($_GET['equipments_type']) && is_numeric($_GET['equipments_type']) && $_GET['equipments_type'] > 0 && isset($_GET['id']) && is_numeric($_GET['id']) && $_GET['id'] > 0) {
             //Search object
             switch ($_GET['equipments_type']) {
                 case Inventory::EQUIPMENT_TYPE_ARMOUR:
                     $item = Armours::model()->findByPk($_GET['id']);
                     $itemObject = new ArmoursObjects();
                     $itemObject->attributes = array('armours_id' => $item->id, 'knights_id' => $this->user_data['knights']->id, 'current_pde' => $item->pde);
                     break;
                 case Inventory::EQUIPMENT_TYPE_SPEAR:
                     $item = Spears::model()->findByPk($_GET['id']);
                     $itemObject = new SpearsObjects();
                     $itemObject->attributes = array('spears_id' => $item->id, 'knights_id' => $this->user_data['knights']->id, 'current_pde' => $item->pde);
                     break;
                 case Inventory::EQUIPMENT_TYPE_TRICK:
                     $item = null;
                     break;
                 default:
                     $item = null;
             }
             //Check item
             if ($item) {
                 //Check requeriments
                 if (EquipmentRequirements::checkAccomplish($_GET['equipments_type'], $_GET['id'], $this->user_data['knights']->id)) {
                     //Check coins
                     if ($item->prize <= $this->user_data['knights']->coins) {
                         //add item to inventory of knight
                         if ($emptyPosition = Inventory::getFirstEmptySocket($this->user_data['knights']->id)) {
                             //Save item object
                             $itemObject->save();
                             //Add item to knight's inventory
                             $inventoryObject = new Inventory();
                             $inventoryObject->attributes = array('knights_id' => $this->user_data['knights']->id, 'type' => $_GET['equipments_type'], 'identificator' => $itemObject->id, 'position' => $emptyPosition, 'amount' => 1);
                             $inventoryObject->save();
                             //sustract coins
                             $this->user_data['knights']->coins -= $item->prize;
                             $this->user_data['knights']->save();
                             //Set purchase history
                             $purchase = new KnightsPurchases();
                             $purchase->attributes = array('knights_id' => $this->user_data['knights']->id, 'equipments_type_id' => $_GET['equipments_type'], 'identificator' => $_GET['id'], 'date' => date('Y-m-d H:i:s'), 'status' => KnightsPurchases::STATUS_PURCHASED, 'knights_card_charisma' => $this->user_data['knights_card']->charisma, 'knights_card_trade' => $this->user_data['knights_card']->trade);
                             if (!$purchase->save()) {
                                 Yii::log('No salva el historial de la compra.');
                             }
                             $output['errno'] = 0;
                             $output['html'] = '<p>Ya tienes el objeto en tu <a href="/character/inventory/sir/' . $this->user_data['knights']->name . '">inventario</a> listo para utilizar.</p>';
                             $output['coins'] = number_format($this->user_data['knights']->coins, 0, ',', '.');
                         } else {
                             $output['html'] = '<p>No tienes suficiente espacio en el inventario secundario.</p>';
                         }
                     } else {
                         $output['html'] = '<p>¡No tienes suficiente dinero!</p><p>Siempre puedes <a href="/jobs">ganar algo de dinero</a> prestando tus servicios como caballero.</p>';
                     }
                 } else {
                     $output['html'] = '<p>No cumples con alguno de los requisitos.</p>';
                 }
             } else {
                 $output['html'] = '<p>El objecto no se ha encontrado.</p>';
             }
         } else {
             $output['html'] = '<p>Los datos del item no son correctos.</p>';
         }
     } else {
         $output['html'] = '<p>La sesión ha expirado. Necesitas volver a hacer login.</p>';
     }
     echo CJSON::encode($output);
 }
Ejemplo n.º 27
0
<?php

include "redirect.php";
include "../includes/db_lib.php";
putUILog('update_reagent', 'X', basename($_SERVER['REQUEST_URI'], ".php"), 'X', 'X', 'X');
$lid = $_REQUEST['lid'];
$r_id = $_REQUEST['r_id'];
$reagent = $_REQUEST['reagent'];
$unit = $_REQUEST['unit'];
$remarks = $_REQUEST['remarks'];
Inventory::updateReagent($lid, $r_id, $reagent, $unit, $remarks);
header('Location: ../view_stock.php');
Ejemplo n.º 28
0
$getMode = admFuncVariableIsValid($_GET, 'mode', 'string', array('defaultValue' => 'choose', 'validValues' => array('choose', 'save', 'dont_save', 'upload', 'delete')));
// only users with the right to edit inventory could use this script
if ($gCurrentUser->editInventory() == false) {
    $gMessage->show($gL10n->get('SYS_NO_RIGHTS'));
}
// in ajax mode only return simple text on error
if ($getMode == 'delete') {
    $gMessage->showHtmlTextOnly(true);
}
// checks if the server settings for file_upload are set to ON
if (ini_get('file_uploads') != '1') {
    $gMessage->show($gL10n->get('SYS_SERVER_NO_UPLOAD'));
}
// read user data and show error if user doesn't exists
$gInventoryFields = new InventoryFields($gDb, $gCurrentOrganization->getValue('org_id'));
$inventory = new Inventory($gDb, $gInventoryFields, $getItemId);
// bei Ordnerspeicherung pruefen ob der Unterordner in adm_my_files mit entsprechenden Rechten existiert
if ($gPreferences['profile_photo_storage'] == 1) {
    // ggf. Ordner für Userfotos in adm_my_files anlegen
    $myFilesProfilePhotos = new MyFiles('USER_PROFILE_PHOTOS');
    if ($myFilesProfilePhotos->checkSettings() == false) {
        $gMessage->show($gL10n->get($myFilesProfilePhotos->errorText, $myFilesProfilePhotos->errorPath, '<a href="mailto:' . $gPreferences['email_administrator'] . '">', '</a>'));
    }
}
if ($inventory->getValue('inv_id') == 0) {
    $gMessage->show($gL10n->get('SYS_INVALID_PAGE_VIEW'));
}
if ($getMode == 'save') {
    /*****************************Foto speichern*************************************/
    if ($gPreferences['profile_photo_storage'] == 1) {
        // Foto im Dateisystem speichern
Ejemplo n.º 29
0
<?php

include "redirect.php";
include "../includes/db_lib.php";
putUILog('add_new_stock', 'X', basename($_SERVER['REQUEST_URI'], ".php"), 'X', 'X', 'X');
$reagent_id = $_REQUEST['reagent'];
//$unit = $_REQUEST['unit'];
$remarks = $_REQUEST['remarks'];
$lot = $_REQUEST['lot'];
$e_date = $_REQUEST['yyyy_e'] . "-" . $_REQUEST['mm_e'] . "-" . $_REQUEST['dd_e'];
$manu = $_REQUEST['manu'];
$sup = $_REQUEST['sup'];
$quant = $_REQUEST['quant'];
$cost = $_REQUEST['cost'];
$r_date = $_REQUEST['yyyy_r'] . "-" . $_REQUEST['mm_r'] . "-" . $_REQUEST['dd_r'];
Inventory::addStock($reagent_id, $lot, $e_date, $manu, $sup, $quant, $cost, $r_date, $remarks);
header('Location: ../view_stock.php');
 /** equip_loan_post()
 		Display the form for printing/pdf output.
 	*/
 public function equip_loan_post()
 {
     $Inventory = new Inventory($_REQUEST['user']);
     // Set title
     $this->title = _('FOG Equipment Loan Form');
     // This gets the download links for which type of file you want.
     print "\n\t\t\t\t<h2>" . '<a href="export.php?type=pdf&filename=' . $Inventory->get('primaryuser') . 'EquipmentLoanForm" alt="Export PDF" title="Export PDF" target="_blank">' . $this->pdffile . '</a></h2>';
     // Report Maker
     $ReportMaker = new ReportMaker();
     // Get the current Inventory based on what was selected.
     // Title Information
     $ReportMaker->appendHTML("<!-- " . _("FOOTER CENTER") . " \"" . '$PAGE' . " " . _("of") . " " . '$PAGES' . " - " . _("Printed") . ": " . $this->nice_date()->format("D M j G:i:s T Y") . "\" -->");
     $ReportMaker->appendHTML("<center><h2>" . _("[YOUR ORGANIZATION HERE]") . "</h2></center>");
     $ReportMaker->appendHTML("<center><h3>" . _("[sub-unit here]") . "</h3></center>");
     $ReportMaker->appendHTML("<center><h2><u>" . _("PC Check-Out Agreement") . "</u></h2></center>");
     // Personal Information
     $ReportMaker->appendHTML("<h4><u>" . _("Personal Information") . "</u></h4>");
     $ReportMaker->appendHTML("<h4><b>" . _("Name") . ": </b><u>" . $Inventory->get('primaryUser') . "</u></h4>");
     $ReportMaker->appendHTML("<h4><b>" . _("Location") . ": </b><u>" . _("Your Location Here") . "</u></h4>");
     $ReportMaker->appendHTML("<h4><b>" . _("Home Address") . ": </b>__________________________________________________________________</h4>");
     $ReportMaker->appendHTML("<h4><b>" . _("City / State / Zip") . ": </b>__________________________________________________________________</h4>");
     $ReportMaker->appendHTML("<h4><b>" . _("Extension") . ":</b>_________________ &nbsp;&nbsp;&nbsp;<b>" . _("Home Phone") . ":</b> (__________)_____________________________</h4>");
     // Computer Information
     $ReportMaker->appendHTML("<h4><u>" . _("Computer Information") . "</u></h4>");
     $ReportMaker->appendHTML("<h4><b>" . _("Serial Number / Service Tag") . ": </b><u>" . $Inventory->get('sysserial') . " / " . $Inventory->get('caseasset') . "_____________________</u></h4>");
     $ReportMaker->appendHTML("<h4><b>" . _("Barcode Numbers") . ": </b><u>" . $Inventory->get('other1') . "   " . $Inventory->get('other2') . "</u>________________________</h4>");
     $ReportMaker->appendHTML("<h4><b>" . _("Date of Checkout") . ": </b>____________________________________________</h4>");
     $ReportMaker->appendHTML("<h4><b>" . _("Notes / Miscellaneous / Included Items") . ": </b></h4>");
     $ReportMaker->appendHTML("<h4><b>_____________________________________________________________________________________________</b></h4>");
     $ReportMaker->appendHTML("<h4><b>_____________________________________________________________________________________________</b></h4>");
     $ReportMaker->appendHTML("<h4><b>_____________________________________________________________________________________________</b></h4>");
     $ReportMaker->appendHTML("<hr />");
     $ReportMaker->appendHTML("<h4><b>" . _("Releasing Staff Initials") . ": </b>_____________________     " . _("(To be released only by XXXXXXXXX)") . "</h4>");
     $ReportMaker->appendHTML("<h4>" . _("I have read, understood, and agree to all the Terms and Condidtions on the following pages of this document.") . "</h4>");
     $ReportMaker->appendHTML("<br />");
     $ReportMaker->appendHTML("<h4><b>" . _("Signed") . ": </b>X _____________________________  " . _("Date") . ": _________/_________/20_______</h4>");
     $ReportMaker->appendHTML(_("<!-- " . _("NEW PAGE") . " -->"));
     $ReportMaker->appendHTML("<!-- " . _("FOOTER CENTER") . " \"" . '$PAGE' . " " . _("of") . " " . '$PAGES' . " - " . _("Printed") . ": " . $this->nice_date()->format("D M j G:i:s T Y") . "\" -->");
     $ReportMaker->appendHTML("<center><h3>" . _("Terms and Conditions") . "</h3></center>");
     $ReportMaker->appendHTML("<hr />");
     $ReportMaker->appendHTML("<h4>" . _("Your terms and conditions here") . "</h4>");
     $ReportMaker->appendHTML("<h4><b>" . _("Signed") . ": </b>" . _("X") . " _____________________________  " . _("Date") . ": _________/_________/20_______</h4>");
     print "\n\t\t\t<p>" . _('Your form is ready.') . '</p>';
     $_SESSION['foglastreport'] = serialize($ReportMaker);
 }