Example #1
0
 /**
  * Model create.
  *
  * @return View
  */
 public function getCreate()
 {
     // Show the page
     $depreciation_list = depreciationList();
     $manufacturer_list = manufacturerList();
     $category_list = categoryList();
     $view = View::make('backend/models/edit');
     $view->with('category_list', $category_list);
     $view->with('depreciation_list', $depreciation_list);
     $view->with('manufacturer_list', $manufacturer_list);
     $view->with('model', new Model());
     return $view;
 }
Example #2
0
 /**
  * Asset clone.
  *
  * @param  int  $assetId
  * @return View
  */
 public function getClone($assetId = null)
 {
     // Check if the asset exists
     if (is_null($asset_to_clone = Asset::find($assetId))) {
         // Redirect to the asset management page
         return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
     } else {
         if (!Company::isCurrentUserHasAccess($asset_to_clone)) {
             return Redirect::to('hardware')->with('error', Lang::get('general.insufficient_permissions'));
         }
     }
     // Grab the dropdown lists
     $model_list = modelList();
     $statuslabel_list = statusLabelList();
     $location_list = locationsList();
     $manufacturer_list = manufacturerList();
     $category_list = categoryList();
     $supplier_list = suppliersList();
     $assigned_to = usersList();
     $statuslabel_types = statusTypeList();
     $company_list = Company::getSelectList();
     $asset = clone $asset_to_clone;
     $asset->id = null;
     $asset->asset_tag = '';
     $asset->serial = '';
     $asset->assigned_to = '';
     return View::make('backend/hardware/edit')->with('supplier_list', $supplier_list)->with('model_list', $model_list)->with('statuslabel_list', $statuslabel_list)->with('statuslabel_types', $statuslabel_types)->with('assigned_to', $assigned_to)->with('asset', $asset)->with('location_list', $location_list)->with('manufacturer', $manufacturer_list)->with('category', $category_list)->with('company_list', $company_list);
 }
         echo "<script> alert('Store error: " . $song->getError() . "'); window.history.go(-1); </script>\n";
         exit;
     }
     mosRedirect("index2.php?option=com_chordbase&task=songlist");
     break;
 case "removeSong":
     remove($cid, "songs", "song_id", "songlist");
     break;
 case "publishSong":
     publish($cid, 1, "songs", "songlist", "published", "song_id");
     break;
 case "unpublishSong":
     publish($cid, 0, "songs", "songlist", "published", "song_id");
     break;
 case "categoryList":
     categoryList();
     break;
 case "newCategory":
     HTML_chordbase::cb_header("Category");
     $category = new cbCategory($database, "#__cb_");
     $category->published = 1;
     $category->form("index2.php?option=com_chordbase&task=saveCategory");
     break;
 case "editCategory":
     HTML_chordbase::cb_header("Category Editor");
     $category = new cbCategory($database, "#__cb_");
     $category->load($category_id);
     $category->form("index2.php?option=com_chordbase&task=saveCategory");
     break;
 case "saveCategory":
     $category = new cbCategory($database, "#__cb_");
Example #4
0
include_once 'config.inc.php';
include_once 'functions.php';
//Script for inserting and updating goods
insertOrUpdate($link);
//Script for getting SQL from database according to sort options
$res = userSort($link);
while ($row = mysqli_fetch_assoc($res)) {
    $items[] = $row;
}
//Script for getting list of vendors
$producerList = producerList($link);
while ($row = mysqli_fetch_assoc($producerList)) {
    $producers[] = $row;
}
//Script for getting list of categories
$categoryList = categoryList($link);
while ($row = mysqli_fetch_assoc($categoryList)) {
    $categories[] = $row;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Svyatoslav's magazine</title>
    <style>
        .form
        {
            float:left;
            height:auto;
            width:400px;