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


PHP Reports::whereDate方法代码示例

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


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

示例1: cheque

 public function cheque()
 {
     Session::put('goToChecklist', 'true');
     //Initializations
     $amt = Input::get('amt');
     $num = Input::get('num');
     $date = Input::get('date');
     $taskdetails_id = Input::get('taskdetails_id');
     $check = 0;
     //Validation Process
     if (ctype_alnum(str_replace(array(' ', '-', '.'), '', $num))) {
         $check = $check + 1;
     }
     if (ctype_digit(str_replace(array(' ', ',', '.'), '', $amt))) {
         $check = $check + 1;
     }
     if (trim(Input::get('date')) == "01/01/70") {
         $check = 0;
     }
     if ($check == 2) {
         $taskd = TaskDetails::find($taskdetails_id);
         $docs = Document::find($taskd->doc_id);
         if ($taskd->status == "Done") {
             Session::put('errorchecklist', 'Saved failed. Task was already completed by another user.');
             return Redirect::back();
         }
         $id = $docs->pr_id;
         //Cheque
         $timestamp = strtotime($date);
         $dateFinished = date("Y-m-d H:i:s", $timestamp);
         $dateFinished = substr($dateFinished, 0, strrpos($dateFinished, ' '));
         $reports = Reports::whereDate($dateFinished)->first();
         if ($reports == null) {
             $reports = new Reports();
             $reports->date = $dateFinished;
             $reports->chequeCount = 1;
         } else {
             $reports->chequeCount = $reports->chequeCount + 1;
         }
         $reports->save();
         //End Cheque
         $delcount = Count::where('doc_id', $docs->id)->delete();
         $userx = User::get();
         foreach ($userx as $userv) {
             $count = new Count();
             $count->user_id = $userv->id;
             $count->doc_id = $docs->id;
             $count->save();
         }
         Session::put('successchecklist', 'Task completed.');
         $taskd = TaskDetails::find($taskdetails_id);
         $taskd->status = "Done";
         $taskd->custom1 = $amt;
         $taskd->custom2 = $num;
         $taskd->custom3 = $date;
         $taskd->save();
         $tasknext = TaskDetails::find($taskdetails_id + 1);
         $tasknextc = TaskDetails::where('id', $taskdetails_id + 1)->where('doc_id', $docs->pr_id)->count();
         date_default_timezone_set("Asia/Manila");
         $upDate = date('Y-m-d H:i:s');
         DB::table('purchase_request')->where('id', $id)->update(array('updated_at' => $upDate));
         DB::table('taskdetails')->where('id', $taskdetails_id)->update(array('dateFinished' => $upDate));
         if ($tasknextc != 0) {
             //Project Type Filter
             $counter = 1;
             $tasknext = TaskDetails::find($taskdetails_id + $counter);
             while ($tasknext->status == "Lock" || $tasknext->status == "Done") {
                 $counter = $counter + 1;
                 $tasknext = TaskDetails::find($taskdetails_id + $counter);
             }
             $tasknext->status = "New";
             $tasknext->save();
             //End Project Type Filter
         } else {
             $purchase = Purchase::find($docs->pr_id);
             $purchase->status = "Closed";
             $purchase->save();
             $request_id = Input::get('pr_id');
             return Redirect::to("purchaseRequest/vieweach/{$request_id}");
         }
     } else {
         Session::put('errorchecklist', 'Invalid input.');
         return Redirect::back()->withInput();
     }
     return Redirect::back();
 }
开发者ID:iHunt101,项目名称:procurementTrackingSystem,代码行数:86,代码来源:PurchaseRequestController.php

示例2: janisawesome


//.........这里部分代码省略.........
                         }
                     }
                     //End Project Type
                     $firstnew = 1;
                     $task_details->doc_id = $document->id;
                     $task_details->save();
                 }
                 $users = User::all();
                 foreach ($users as $user) {
                     $count = new Count();
                     $count->user_id = $user->id;
                     $count->doc_id = $doc_id;
                     $count->save();
                 }
                 $pr_id = Session::get('pr_id');
                 DB::table('attachments')->where('doc_id', $doc_id)->update(array('saved' => 1));
                 DB::table('attachments')->where('saved', '=', 0)->delete();
                 Session::forget('doc_id');
                 $connected = true;
                 // $connected = @fsockopen("www.google.com", 80);  //website, port  (try 80 or 443)
                 if (!$connected) {
                     $sendee = DB::table('users')->where('id', $purchase->requisitioner)->first();
                     $email = $sendee->email;
                     $fname = $sendee->firstname;
                     $data = ['id' => $purchase->id];
                     Mail::send('emails.template', $data, function ($message) use($email, $fname) {
                         $message->from('procurementTrackingSystem@tarlac.com', 'Procurement Tracking System Tarlac');
                         $message->to($email, $fname)->subject('Tarlac Procurement Tracking System: New Purchase Request Created');
                     });
                     $notice = "Purchase request created successfully. ";
                     // Insert data to reports table
                     $date_received = Input::get('dateReceived');
                     $date_received = substr($date_received, 0, strrpos($date_received, ' '));
                     $reports = Reports::whereDate($date_received)->first();
                     if ($reports == null) {
                         $reports = new Reports();
                         $reports->date = $date_received;
                         $reports->pRequestCount = 1;
                     } else {
                         $reports->pRequestCount = $reports->pRequestCount + 1;
                     }
                     $reports->save();
                     //End Reports
                 } else {
                     // Insert data to reports table
                     $date_received = Input::get('dateReceived');
                     $date_received = substr($date_received, 0, strrpos($date_received, ' '));
                     $reports = Reports::whereDate($date_received)->first();
                     if ($reports == null) {
                         $reports = new Reports();
                         $reports->date = $date_received;
                         $reports->pRequestCount = 1;
                     } else {
                         $reports->pRequestCount = $reports->pRequestCount + 1;
                     }
                     $reports->save();
                     //End Reports
                     $notice = "Purchase request created successfully. Email notice was not sent. ";
                 }
                 Session::put('notice', $notice);
                 $office = Office::all();
                 $users = User::all();
                 $workflow = Workflow::all();
                 //return Redirect::to('purchaseRequest/view');
                 return Redirect::to('janisawesome');
                 Session::put('imgsuccess', 'Files uploaded.');
开发者ID:iHunt101,项目名称:procurementTrackingSystem,代码行数:67,代码来源:BaseController.php


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