public function postCreate() { $validator = Validator::make(Input::all(), Product::$rules); if ($validator->passes()) { $product = new Product(); $product->title = Input::get('title'); $product->description = Input::get('description'); $id = Input::get('product_id'); $skuAsset = sprintf("%06s", $id); $product->sku = 'INDE' . $skuAsset; $product->category_id = Input::get('category_id'); $product->subcategory_id = Input::get('subcategory_id'); $product->price = Input::get('price'); $product->weight = Input::get('weight'); $product->supplier_id = Auth::user()->id; $product->image = 'images/products/INDE' . $skuAsset; $product->save(); $details = new Detail(); $details->details = Input::get('details'); $details->model = Input::get('model'); $details->brand = Input::get('brand'); $details->moredescription = Input::get('moredescription'); $details->product_id = Input::get('product_id'); $details->save(); return Response::json('success', 200); } else { return $validator->errors; } }
public static function kvObjectToNoteEvent($kvObject) { if ($kvObject == null || $kvObject->getKey() == null) { return null; } try { $array = $kvObject->getValue(); $detail = new Detail(); $detail->setKey($kvObject->getKey()); if (array_key_exists('data', $array) && $array['data'] != null) { $detail->setData($array['data']); } return $detail; } catch (Exception $e) { } return null; }
$extra = array(); // And now give all the arrays and whatnots to twig.. if ($pageview == 'overview') { $extra['items'] = Detail::combineditems(md5($id), $killdata['items']); $extra['invAll'] = involvedCorpsAndAllis(md5($id), $killdata['involved']); $extra['involved'] = $involved; $extra['allinvolved'] = $allinvolved; } $extra['location'] = @$killdata['info']['location']['itemName']; $extra['totalisk'] = $killdata['info']['zkb']['totalValue']; $extra['droppedisk'] = droppedIsk(md5($id), $killdata['items']); $extra['shipprice'] = Price::getItemPrice($killdata['victim']['shipTypeID'], date('Ymd', strtotime($killdata['info']['dttm']))); $extra['lostisk'] = $extra['shipprice'] + destroyedIsk(md5($id), $killdata['items']); $extra['fittedisk'] = fittedIsk(md5($id), $killdata['items']); $extra['relatedtime'] = date('YmdH00', strtotime($killdata['info']['dttm'])); $extra['fittingwheel'] = Detail::eftarray(md5($id), $killdata['items'], @$killdata['victim']['characterID']); $extra['involvedships'] = involvedships($killdata['involved']); $extra['involvedshipscount'] = count($extra['involvedships']); $extra['totalprice'] = usdeurgbp($killdata['info']['zkb']['totalValue']); $extra['destroyedprice'] = usdeurgbp($extra['lostisk']); $extra['droppedprice'] = usdeurgbp($extra['droppedisk']); $extra['fittedprice'] = usdeurgbp($extra['fittedisk']); $extra['efttext'] = Fitting::EFT($extra['fittingwheel']); $extra['dnatext'] = Fitting::DNA($killdata['items'], $killdata['victim']['shipTypeID']); $extra['edkrawmail'] = 'deprecated - use CREST'; $extra['zkbrawmail'] = 'deprecated - use CREST'; $extra['slotCounts'] = Info::getSlotCounts($killdata['victim']['shipTypeID']); $extra['commentID'] = $id; $extra['crest'] = $mdb->findDoc('crestmails', ['killID' => $id, 'processed' => true]); $extra['prevKillID'] = $mdb->findField('killmails', 'killID', ['cacheTime' => 300, 'killID' => ['$lt' => $id]], ['killID' => -1]); $extra['nextKillID'] = $mdb->findField('killmails', 'killID', ['cacheTime' => 300, 'killID' => ['$gt' => $id]], ['killID' => 1]);
/* * Display content */ $app->get('/:alias', function ($alias) use($app) { $content = new Content(); $content = $content->load($alias); if (!$content) { if (BootWiki::getLoggedAccount() == null) { $app->redirect(BASEURL . '/mod/404'); } else { $alias = Content::createAlias($alias); $app->redirect(BASEURL . '/edit/' . $alias); } } // Load content $main = new Detail(); $main->visit($content); // Load layout $layout = new Layout($main); $layout->loadRecent(); $layout->loadPopular(); // Add SEO $layout->title = $content->title; $layout->description = $content->description; $layout->keywords = $content->getKeywords(); $layout->author = $content->author; $layout->main_image = $content->image->getUrl(); // Print layout $app->response()->body((string) $layout); }); /*
/** * Constructor * * @param string $key * @param boolean $match * @param float $value * @param string $description * @param array $details */ public function __construct($key, $match, $value, $description, $details) { parent::__construct($match, $value, $description); $this->key = $key; $this->details = $details; }
public function __construct($id = false, $table = null, $ds = null) { parent::__construct($id, $table, $ds); }
function save_detail() { $id = $this->input->post("id"); if ($id == 0) { $detailObject = new Detail(); } else { $detailObject = new Detail($id); } $detailObject->inventory_id = $this->input->post("inventory_id"); $detailObject->description = $this->input->post("description"); $detailObject->price = $this->input->post("price"); $detailObject->save(); echo $detailObject->id; }
public function agregar() { if ($_POST) { $this->load->helper('date'); $this->load->library('Utils'); $insert = $_POST; $insert['user_id'] = 1; $insert['fecha'] = date('Y-m-d'); $pago = new Payment(elements(array('student_id', 'user_id', 'fecha', 'importe'), $insert)); if ($pago->is_valid()) { $pago->save(); foreach ($insert['parcial'] as $k => $v) { $detalle = array('debt_id' => $k, 'payment_id' => $pago->id, 'importe' => $v); $d = new Detail($detalle); if ($d->is_valid()) { $d->save(); } } $this->session->set_flashdata('msg', '<div class="success">El pago se realizó correctamente.</div>'); redirect($this->agent->referrer()); } else { $this->session->set_flashdata('msg', '<div class="error">No pudo procesarse el pago, intente nuevamente.</div>'); } } }
</nav> <div class="intro-content" > <div class="container"> <div class="jumbotron"> <div class="container"> <?php class Detail extends dbConnection { public function __construct() { parent::__construct(); } } if ($id != "") { $db = new Detail(); $sql = "select * from tournament where tournament_id='" . $id . "'"; $rs = mysqli_query($db->getLink(), $sql); $data = mysqli_fetch_array($rs); echo "<h1 class='text-center'>" . $data['tournament_name'] . "</h1>"; echo "<hr/>"; echo "<img style='width:70%;margin: auto;' class='img-responsive' style='width: 100%' src='" . $data['tournament_img'] . "'>"; echo "<h5 style='margin-left:10px;font-size:1.2em' >รายละเอียด </h5>"; echo "<hr/>"; echo "<h6 style='margin-left:10px;font-size:1.2em'>วันที่ : " . $data['tournament_start'] . "</h6>"; echo "<h6 style='margin-left:10px;width:80%;font-size:1.2em' >เวลา : " . $data['tournament_time'] . " น.</h6>"; echo "<h6 style='margin-left:10px;width:80%;font-size:1.2em' >สถานที่ : " . $data['tournament_location'] . "</h6>"; echo "<hr/><h6 class='text-center' style='margin-left:10px;font-size:1.2em' >" . $data['tournament_detail'] . "</h6>"; //echo "<button class='btn btn-primary' style='min-width:80px;height:40px;font-weight: bold;margin-bottom:10px' >BUY (300 Bath.)</button>"; } else { echo "<h1 class='text-center'>ไม่พบข้อมูลนะจ๊ะ</h1>";