当前位置: 首页>>代码示例>>PHP>>正文


PHP Logs::create方法代码示例

本文整理汇总了PHP中Logs::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Logs::create方法的具体用法?PHP Logs::create怎么用?PHP Logs::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Logs的用法示例。


在下文中一共展示了Logs::create方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 public function run()
 {
     $faker = Faker::create();
     Logs::truncate();
     foreach (range(1, 500) as $index) {
         Logs::create(["ip" => $faker->localIpv4, "host" => $faker->domainName, "lastpage" => "", "last_visit" => $faker->dateTimeBetween($startDate = '-120 days', $endDate = 'now'), "created_at" => $faker->date($format = 'Y-m-d', $max = 'now') . ' ' . $faker->time($format = 'H:i:s', $max = 'now'), "updated_at" => $faker->date($format = 'Y-m-d', $max = 'now') . ' ' . $faker->time($format = 'H:i:s', $max = 'now'), "role_id" => $faker->numberBetween($min = 1, $max = 6), "data_id" => $faker->numberBetween($min = 1, $max = 11)]);
     }
 }
开发者ID:nattaphat,项目名称:cuse2,代码行数:8,代码来源:LogsTableSeeder.php

示例2: Logs

                $logs = new Logs();
                $logs->user_id = $user->id;
                $logs->platform = "WEB PORTAL";
                $logs->type = "UPDATED ACCOUNT";
                $logs->create();
                $user->update();
                $message = "Successfully saved.";
            } else {
                $message = "Username already exists.";
            }
        } else {
            $logs = new Logs();
            $logs->user_id = $user->id;
            $logs->platform = "WEB PORTAL";
            $logs->type = "UPDATED ACCOUNT";
            $logs->create();
            $user->update();
            $message = "Successfully saved.";
        }
    } else {
        $message = "All fields are required.";
    }
} else {
    if (isset($_POST['reset'])) {
        $message = "Successfully reset.";
    }
}
$hit = new Hit();
$hit->name = "account.php";
$hit->platform = "WEB PORTAL";
$hit->user_id = $session->is_logged_in() == true ? $session->user_id : 0;
开发者ID:NemOry,项目名称:KellyEscapeGameWebPanel,代码行数:31,代码来源:account.php

示例3: validate

 /**
  * authanticate user during login.
  *
  * @return view
  */
 public function validate()
 {
     $user = User::where("email", Input::get('email'))->first();
     if ($user && $user->password == Input::get('password')) {
         if (Input::get('keep') == "cheked") {
             Auth::login($user, TRUE);
         } else {
             Auth::login($user, FALSE);
         }
         if (Auth::check()) {
             Logs::create(array("user_id" => Auth::user()->id, "action" => "Logging in"));
             return Redirect::to("home");
         }
     } else {
         return View::make("login")->with("error", "Incorrect Username or Password");
     }
 }
开发者ID:kelvinmbwilo,项目名称:cervical,代码行数:22,代码来源:UserController.php

示例4: DateTime

            $accion = "Visito Mi Historial";
            break;
        case 'dashboard/payments/neighbors':
            $accion = "Visito Mis Vecinos";
            break;
        case 'dashboard/incomes/charge':
            $accion = "Visito Ingresos Cobrar";
            break;
        case 'dashboard/incomes/record':
            $accion = "Visito Ingresos Historial";
            break;
        case 'dashboard/incomes/charge/balances':
            $accion = "Visito Ingresos Saldos";
            break;
        case 'dashboard/expenses':
            $accion = "Visito Egresos Registrar Gasto";
            break;
    }
    if ($accion != '' and Auth::check()) {
        $colonia = Session::get("colonia");
        $urbanism = Urbanism::where('colony_id', '=', $colonia)->first();
        Logs::create(['user' => Auth::user()->Neighbors->name . ' ' . Auth::user()->Neighbors->last_name, 'rol_user' => Role::find(Auth::user()->AssigmentRole[0]->role_id)->name, 'urbanism_id' => $urbanism->id, 'user_email' => Auth::user()->email, 'accion' => $accion, 'fecha' => (new DateTime())->format('d-m-Y H:i:s')]);
    }
    return false;
});
Event::fire('illuminate.controller');
Event::listen('logs', function ($accion) {
    $colonia = Session::get("colonia");
    $urbanism = Urbanism::where('colony_id', '=', $colonia)->first();
    Logs::create(['user' => Auth::user()->Neighbors->name . ' ' . Auth::user()->Neighbors->last_name, 'rol_user' => Role::find(Auth::user()->AssigmentRole[0]->role_id)->name, 'urbanism_id' => $urbanism->id, 'user_email' => Auth::user()->email, 'accion' => $accion, 'fecha' => (new DateTime())->format('d-m-Y H:i:s')]);
});
开发者ID:prianticonsulting,项目名称:Habitaria,代码行数:31,代码来源:events.php

示例5: store_followup

 public function store_followup($id)
 {
     $patient = Patient::find($id);
     $patient->first_name = Input::get("firstname");
     $patient->middle_name = Input::get("middlename");
     $patient->last_name = Input::get("lastname");
     $patient->birth_date = Input::get("dob");
     $patient->hospital_id = Input::get("hosp_no");
     $patient->phone = Input::get("phone");
     $patient->facility_id = Input::get("facility");
     $patient->save();
     //adding patient visit info
     $visit = Visit::create(array("patient_id" => $patient->id, "visit_date" => date('Y-m-d'), "server_status" => 'not', "user" => Auth::user()->firstname . " " . Auth::user()->middlename . " " . Auth::user()->lastname));
     //adding address information
     PatientInfo::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "hospital_id" => "somenumber", "region" => Input::get("region"), "district" => Input::get("district"), "ward" => Input::get("ward"), "ten_cell_leader" => Input::get("t_cell_leadr")));
     //adding gynecological history inforamtion for a visit
     GynecologicalHistory::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "parity" => Input::get("parity"), "number_of_pregnancy" => Input::get("number_of_preg"), "menarche" => Input::get("menarche"), "age_at_sexual_debut" => Input::get("start_sex_age"), "marital_status" => Input::get("marital"), "age_at_first_marriage" => Input::get("first_marriage"), "sexual_partner" => Input::get("sexual_partner"), "partner_sexual_partner" => Input::get("partner_sexual_partner")));
     //adding contraceptive history
     ContraceptiveHistory::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "current_status" => Input::get("current_on_contra"), "current_contraceptive_id" => Input::has("current_contra") ? Input::get("current_contra") : ""));
     //adding HIV status
     HivStatus::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "status" => Input::has("hiv_status") ? Input::get("hiv_status") : "", "test_status" => Input::has("hiv_test_status") ? Input::get("hiv_test_status") : "", "unknown_reason" => Input::has("unknown_reason") ? Input::get("unknown_reason") : "", "years_since_first_diagnosis" => Input::has("year_since_diagnosis") ? Input::get("year_since_diagnosis") : "", "year_of_last_test" => Input::has("last_test") ? Input::get("last_test") : "", "art_status" => Input::has("art_status") ? Input::get("art_status") : "", "current_art_status" => Input::has("current_art_status") ? Input::get("current_art_status") : "", "pitc_offered" => Input::get("test_again") == "yes" ? "yes" : "no", "pitc_agreed" => Input::has("test_again") ? Input::get("test_again") : "", "pitc_result" => Input::has("current_test_result") ? Input::get("current_test_result") : "", "pitc_cd4_count" => Input::has("current_cd4") ? Input::get("current_cd4") : "", "prev_cd4_count" => Input::has("prev_cd4") ? Input::get("prev_cd4") : ""));
     //adding VIA Status
     ViaStatus::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "via_counselling_status" => Input::get("via_counceling"), "via_test_status" => Input::get("via_test"), "reject_reason" => Input::has("via_reason") ? Input::get("via_reason") : "", "via_result" => Input::has("via_results") ? Input::get("via_results") : ""));
     //adding colposcopy
     ColposcopyStatus::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "status" => Input::get("colposcopy_status"), "result_id" => Input::has("colpo_result") ? Input::get("colpo_result") : ""));
     //adding Pap smear result
     PapsmearStatus::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "status" => Input::get("pap_status"), "result_id" => Input::has("pap_result") ? Input::get("pap_result") : ""));
     //adding intervetion status
     Intervention::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "type_id" => Input::has("intervention") ? Input::get("intervention") : "", "indicator_id" => Input::has("indicator") ? Input::get("indicator") : "", "histology_id" => Input::has("histology") ? Input::get("histology") : "", "cancer_id" => Input::has("cancer") ? Input::get("cancer") : "", "grade" => Input::has("hist_grade") ? Input::get("hist_grade") : "", "stages" => Input::has("stages") ? Input::get("stages") : "", "differentiation" => Input::has("differentiation") ? Input::get("differentiation") : ""));
     $report = PatientReport::where('patient_id', $patient->id)->first();
     $report->region = Input::get("region");
     $report->district = Input::get("district");
     $report->number_of_pregnancy = Input::get("number_of_preg");
     $report->marital_status = Input::get("marital");
     $report->first_marriage = Input::get("first_marriage");
     $report->partners = Input::get("sexual_partner");
     $report->partners_partner = Input::get("partner_sexual_partner");
     $report->contraceptive_status = Input::get("current_on_contra");
     $report->facility_id = Input::get("facility");
     if (Input::has("current_contra")) {
         $report->contraceptive_type = Input::get("current_contra");
     }
     if (Input::has("hiv_status")) {
         $report->HIV_status = Input::get("hiv_status");
     }
     if (Input::has("current_cd4")) {
         $report->cd4_count = Input::get("current_cd4");
     } elseif (Input::has("prev_cd4")) {
         $report->cd4_count = Input::has("prev_cd4");
     }
     $report->save();
     if (Input::get("next_visit") != "") {
         Notification::create(array("patient_id" => $patient->id, "message" => "Kumbuka Kwenda katika kituo ulichopimwa mara ya mwisho saratani ya shingo ya kizazi. Tafadhali fika bila kukosa tarehe  " . Input::get('next_visit'), "status" => "pending", "phone_number" => $patient->phone, "next_visit" => Input::get('next_visit')));
     }
     Logs::create(array("user_id" => Auth::user()->id, "action" => "Patient followup for " . $patient->first_name . " " . $patient->last_name));
     $msg = "Patient followup stored successfull";
     return View::make('visit.index', compact('patient', "msg"));
 }
开发者ID:kelvinmbwilo,项目名称:cervical,代码行数:58,代码来源:PatientController.php

示例6: LogMsg

 public static function LogMsg($LogType, $KitTypeID, $KitID, $ContentsID, $Message)
 {
     $log = Logs::create(array('LogDate' => new DateTime('today'), 'LogType' => $LogType, 'LogKey1' => $KitTypeID, 'LogKey2' => $KitID, 'LogKey3' => $ContentsID, 'LogUserID' => Auth::user()->id, 'LogMessage' => $Message));
     return $log->ID;
 }
开发者ID:KWinston,项目名称:EPLProject,代码行数:5,代码来源:Logs.php

示例7: update

 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $users = User::find($id);
     $users->first_name = Input::get("first_name");
     $users->last_name = Input::get("last_name");
     $users->middle_name = Input::get("middle_name");
     $users->access = Input::get("role");
     $users->email = Input::get("email");
     $users->phone = Input::get("phone");
     //        $user->gender = Input::get("gender");
     $users->save();
     $name = $users->first_name . " " . $users->middle_name . " " . $users->last_name;
     Logs::create(array("user_id" => Auth::user()->id, "action" => "Update user named " . $name));
     return "Successfully updated";
 }
开发者ID:AmaniYunge,项目名称:SYoDeO,代码行数:21,代码来源:UserController.php

示例8: Logs

<?php

require_once "../../includes/initialize.php";
global $session;
if (!$session->is_logged_in()) {
    redirect_to("../../index.php");
}
if ($_POST['oper'] == 'add') {
    $log = new Logs();
    $log->user_id = $_POST['user_id'];
    $log->platform = $_POST['platform'];
    $log->date = $_POST['date'];
    $log->type = $_POST['type'];
    $log->create();
} else {
    if ($_POST['oper'] == 'edit') {
        $log = Logs::get_by_id($_POST['id']);
        $log->user_id = $_POST['user_id'];
        $log->platform = $_POST['platform'];
        $log->date = $_POST['date'];
        $log->type = $_POST['type'];
        $log->update();
    } else {
        if ($_POST['oper'] == 'del') {
            Logs::get_by_id($_POST['id'])->delete();
        }
    }
}
开发者ID:NemOry,项目名称:KellyEscapeGameWebPanel,代码行数:28,代码来源:hits_manipulate.php

示例9: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $facility = Facility::find($id);
     $name = $facility->facility_name;
     $facility->delete();
     Logs::create(array("user_id" => Auth::user()->id, "action" => "Delete facility named " . $name));
 }
开发者ID:kelvinmbwilo,项目名称:cervical,代码行数:13,代码来源:FacilitiesController.php


注:本文中的Logs::create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。