本文整理汇总了PHP中Logs::DamageReport方法的典型用法代码示例。如果您正苦于以下问题:PHP Logs::DamageReport方法的具体用法?PHP Logs::DamageReport怎么用?PHP Logs::DamageReport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Logs
的用法示例。
在下文中一共展示了Logs::DamageReport方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
public function store()
{
$inp = Input::all();
// print dd($inp);
$id = $inp['ID'];
$kit = Kits::findOrFail($id);
if (!isset($inp['Available'])) {
$inp['Available'] = 0;
}
$kit->fill($inp);
$kit->save();
$res = "OK";
if (isset($inp["contents"])) {
foreach ($inp["contents"] as $idx => $item) {
if ($item["status"] == 1) {
if (strlen($item["DamagedLogID"]) == 0) {
$item["DamagedLogID"] = null;
}
if (strlen($item["MissingLogID"]) == 0) {
$item["MissingLogID"] = null;
}
$content = KitContents::create($item);
$content->save();
} else {
if ($item["status"] == 3) {
$content = KitContents::findOrFail($item["ID"]);
$content->fill($item);
if (isset($item["Damaged"])) {
if ($item["Damaged"] == 0) {
$content->DamagedLogID = null;
} else {
if ($item["DamagedLogID"] == null) {
$content->DamagedLogID = Logs::DamageReport($kit->KitType, $kit->ID, $content->ID, $item["DamagedMessage"]);
}
}
} else {
$content->DamagedLogID = null;
}
if (isset($item["Missing"])) {
if ($item["Missing"] == 0) {
$content->MissingLogID = null;
} else {
if ($item["MissingLogID"] == null) {
$content->MissingLogID = Logs::MissingReport($kit->KitType, $kit->ID, $content->ID, $item["missingMessage"]);
}
}
} else {
$content->MissingLogID = null;
}
$content->save();
}
}
if ($item["status"] == 4 && $item["ID"] != "***NEW***") {
// delete the kitContent
$content = KitContents::destroy($item["ID"]);
}
}
}
return $res;
}
示例2: store
public function store()
{
$kit = Kits::findOrFail(Input::get('ID'));
foreach ($kit->contents as $cont) {
if ($cont->DamagedLogID == null && Input::has('DamagedMsg_' . $cont->ID)) {
$cont->DamagedLogID = Logs::DamageReport($kit->KitType, $kit->ID, $cont->ID, base64_decode(Input::get('DamagedMsg_' . $cont->ID)));
}
if ($cont->MissingLogID == null && Input::has('MissingMsg_' . $cont->ID)) {
$cont->MissingLogID = Logs::MissingReport($kit->KitType, $kit->ID, $cont->ID, base64_decode(Input::get('MissingMsg_' . $cont->ID)));
}
$cont->save();
}
return "OK";
}
示例3: store
public function store()
{
$kit = Kits::findOrFail(Input::get('ID'));
$kit->KitState = 2;
$kit->save();
foreach ($kit->contents as $content) {
if (Input::has('isMissing_' . $content->ID) && Input::get('isMissing_' . $content->ID) == '1' && $content->MissingLogID == null) {
$message = Input::get('MissingID_' . $content->ID);
$logID = Logs::MissingReport($kit->KitType, $kit->ID, $content->ID, $message);
$content->MissingLogID = $logID;
}
if (Input::has('isDamaged_' . $content->ID) && Input::get('isDamaged_' . $content->ID) == '1' && $content->DamagedLogID == null) {
$message = Input::get('DamagedID_' . $content->ID);
$logID = Logs::DamageReport($kit->KitType, $kit->ID, $content->ID, $message);
$content->DamagedLogID = $logID;
}
$content->save();
}
if (Input::has('LogMessage') && strlen(Input::get('LogMessage')) > 0) {
$message = Input::get('LogMessage');
$logNote = Logs::Note($kit->KitType, $kit->ID, NULL, $message);
}
return Redirect::action('recieve_kit.index');
}