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


PHP Client::clientSelectBox方法代码示例

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


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

示例1: editemails

 /**
  * Edit Emails Reports
  * @return Array json Emails
  */
 public function editemails($id)
 {
     // Find the emailreport using the email id
     $email = Emails::find($id);
     $clientspermissions = "";
     $jobspermissions = "";
     $clientspermissions = unserialize($email->clients);
     $jobspermissions = unserialize($email->jobs);
     Former::populate($email);
     return View::make('admin.emailnewedit')->with('when', array('Daily' => 'Daily', "Weekly" => "Weekly", "Monthly" => "Monthly"))->with('whenSelected', $email->when)->with('clients', Client::clientSelectBox())->with('clientsSelected', $clientspermissions)->with('jobsSelected', $jobspermissions)->with('jobs', Job::jobSelectBox())->with('emails', $email->emails)->with('id', $email->id);
 }
开发者ID:erpio,项目名称:Reportula,代码行数:15,代码来源:EmailsController.php

示例2: edituser

 /**
  * Edit User
  * @return Array json Users
  */
 public function edituser($id)
 {
     // Find the user using the user id
     $user = Sentry::getUserProvider()->findById($id);
     // Get the user groups
     $groupsOfSelected = $user->getGroups();
     foreach ($groupsOfSelected as $group) {
         $this->groupSelected[$group->id] = $group->id;
     }
     $clientspermissions = "";
     $jobspermissions = "";
     $permissions = Userspermissions::find($id);
     if ($permissions != null) {
         $clientspermissions = unserialize($permissions->clients);
         $jobspermissions = unserialize($permissions->jobs);
     }
     Former::populate($user);
     //LOG::info(User::find($id));
     return View::make('admin.usersnewedit')->with('groups', $this->group_array)->with('groupSelected', $this->groupSelected)->with('clients', Client::clientSelectBox())->with('clientsSelected', $clientspermissions)->with('jobsSelected', $jobspermissions)->with('jobs', Job::jobSelectBox())->with('email', $user->email)->with('id', $user->id);
 }
开发者ID:acrixl,项目名称:Reportula,代码行数:24,代码来源:UsersController.php

示例3: editgroup

 /**
  * Edit Group
  * @return Array json groups
  */
 public function editgroup($id)
 {
     // Find the user using the user id
     $group = Sentry::getGroupProvider()->findById($id);
     $users = Sentry::getUserProvider()->findAllInGroup($group);
     // Get the user groups
     $userSelected = "";
     foreach ($users as $user) {
         $userSelected[$user->id] = $user->id;
     }
     /* Get Groups Permissions */
     $clientspermissions = "";
     $jobspermissions = "";
     $permissions = Groupspermissions::find($id);
     if ($permissions != null) {
         $clientspermissions = unserialize($permissions->clients);
         $jobspermissions = unserialize($permissions->jobs);
     }
     // LOG::info( $group->name);
     Former::populate($group->id);
     return View::make('admin.groupsnewedit')->with('users', $this->user_array)->with('userSelected', $userSelected)->with('clients', Client::clientSelectBox())->with('clientsSelected', $clientspermissions)->with('jobsSelected', $jobspermissions)->with('jobs', Job::jobSelectBox())->with('groupname', $group->name)->with('id', $group->id);
 }
开发者ID:acrixl,项目名称:Reportula,代码行数:26,代码来源:GroupsController.php

示例4: clients

 public function clients($client = null)
 {
     $start = Input::get('start', Date::now()->sub('1 day'));
     $end = Input::get('end', Date::now());
     $clientselected = Input::get('Client', $client);
     $client = Client::where('clientid', '=', $clientselected)->first();
     $user = Sentry::getUser();
     // Get Clients to fill the Client Select Box And Select Values From Permissions
     $permissions = Userspermissions::where('id', '=', $user->id)->remember(10)->first();
     if ($permissions !== null) {
         $permissions = unserialize($permissions->clients);
         $clients = Client::wherein('clientid', $permissions)->remember(10)->get();
         $clientSelectBox = Client::clientSelectBox($clients->toArray());
     } else {
         $clientSelectBox = Client::clientSelectBox();
     }
     ///// End Permissions
     if ($client == Null) {
         $platform = "";
         $fileretension = "";
         $jobretension = "";
         $autoprune = "";
         $terminatedJobs = "0";
         $cancelJobs = "0";
         $runningJobs = "0";
         $wattingJobs = "0";
         $errorJobs = "0";
         // Indicates Failed and Okay Jobs
         $nTransBytes = "0";
         $nTransFiles = "0";
         $graphOkJob = "0";
         $graphFailedJob = "0";
     } else {
         $platform = $client->Uname;
         $autoprune = $client->AutoPrune;
         /* Calculate the Retension Period */
         $to = Date::now();
         $text = " Days";
         /* 86400  -> equal to seconds in i day*/
         $fileretension = $client->fileretention / 86400 . $text;
         if ($fileretension >= 365) {
             $type = ' Year';
             $fileretension = intval($fileretension / 31536000) . $type;
         }
         /* 86400  -> equal to seconds in i day*/
         $jobretension = $client->jobretention / 86400 . $text;
         if ($jobretension >= 365) {
             $type = ' Year';
             $jobretension = intval($jobretension / 31536000) . $type;
         }
         /* Get Terminated Jobs */
         $tjobs = Job::where('jobstatus', '=', 'T')->where('starttime', '>=', $start)->where('endtime', '<=', $end)->where('clientid', '=', $client->clientid)->remember(10)->get();
         // Number Terminate Jobs
         $terminatedJobs = count($tjobs);
         /* Get Canceled Jobs */
         $canceledJobs = Job::where('jobstatus', '=', 'A')->where('starttime', '>=', $start)->where('endtime', '<=', $end)->where('clientid', '=', $client->ClientId)->remember(10)->get();
         // Number Terminate Jobs
         $cancelJobs = count($canceledJobs);
         /* Get Canceled Jobs */
         $canceledJobs = Job::where('jobstatus', '=', 'A')->where('starttime', '>=', $start)->where('endtime', '<=', $end)->where('clientid', '=', $client->ClientId)->remember(10)->get();
         // Number Terminate Jobs
         $cancelJobs = count($canceledJobs);
         /* Get Running Jobs */
         $runJobs = Job::where('jobstatus', '=', 'R')->where('starttime', '>=', $start)->where('endtime', '<=', $end)->where('clientid', '=', $client->ClientId)->remember(10)->get();
         // Number Running Jobs
         $runningJobs = count($runJobs);
         /* Get Watting Jobs */
         $wateJobs = Job::wherein('jobstatus', array('c', 'F', 'j', 'M', 'm', 'p', 's', 't'))->where('endtime', '<=', $end)->where('starttime', '>=', $start)->where('clientid', '=', $client->ClientId)->remember(10)->get();
         // Number Watting Jobs
         $wattingJobs = count($wateJobs);
         /* Get Error Jobs */
         $errJobs = Job::wherein('jobstatus', array('e', 'f', 'E'))->where('starttime', '>=', $start)->where('endtime', '<=', $end)->where('clientid', '=', $client->ClientId)->remember(10)->get();
         // Number Error Jobs
         $errorJobs = count($errJobs);
         $nTransBytes = 0;
         $nTransFiles = 0;
         $terminatedJobs = count($tjobs);
         /* Calculate Jobs and Bytes */
         $tjobs = $tjobs->toArray();
         $nTransFiles = array_sum(array_fetch($tjobs, 'jobfiles'));
         $nTransBytes = array_sum(array_fetch($tjobs, 'jobbytes'));
         // Value for The Graphs
         $graphOkJob = $terminatedJobs != 0 ? $terminatedJobs / ($terminatedJobs + $errorJobs) * 100 : 0;
         $graphFailedJob = $errorJobs != 0 ? $errorJobs / ($errorJobs + $terminatedJobs) * 100 : 0;
         $nTransFiles = preg_replace("/(?<=\\d)(?=(\\d{3})+(?!\\d))/", ",", $nTransFiles);
         $nTransBytes = $this->byte_format($nTransBytes);
     }
     /* Draws Files Graph */
     $graphFiles = DB::table($this->tables['job'])->where('clientid', '=', $clientselected)->where('starttime', '>=', $start)->where('endtime', '<=', $end)->orderby('starttime', 'asc')->remember(10)->get(array(DB::raw('date(' . $this->tables['job'] . '.starttime) as date'), DB::raw('jobfiles as files')));
     $graphFiles = json_encode((array) $graphFiles);
     /* Draws Bytes Graph */
     $graphBytes = DB::table($this->tables['job'])->where('clientid', '=', $clientselected)->where('starttime', '>=', $start)->where('endtime', '<=', $end)->orderby('starttime', 'asc')->remember(10)->get(array(DB::raw('date(' . $this->tables['job'] . '.starttime) as date'), DB::raw('jobbytes as bytes')));
     $graphBytes = json_encode((array) $graphBytes);
     Former::populate(array('date' => $start . ' - ' . $end), array('Client' => $clientselected));
     return View::make('clients', array('terminatedJobs' => $terminatedJobs, 'nTransFiles' => $nTransFiles, 'cancelJobs' => $cancelJobs, 'runningJobs' => $runningJobs, 'wattingJobs' => $wattingJobs, 'errorJobs' => $errorJobs, 'nTransBytes' => $nTransBytes, 'start' => $start, 'end' => $end, 'type' => 'terminated', 'clientSelected' => $clientselected, 'graphOkJob' => $graphOkJob, 'graphFailedJob' => $graphFailedJob, 'platform' => $platform, 'fileretension' => $fileretension, 'jobretension' => $jobretension, 'autoprune' => $autoprune, 'clientSelectBox' => $clientSelectBox, 'graphFiles' => $graphFiles, 'graphBytes' => $graphBytes));
 }
开发者ID:acrixl,项目名称:Reportula,代码行数:96,代码来源:ClientsController.php


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