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


PHP BaseController::maxAge方法代码示例

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


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

示例1: excelDownload1

 /**
  * a function to export data to excel
  */
 public function excelDownload1()
 {
     /** Include PHPExcel */
     require_once dirname(__FILE__) . '/Classes/PHPExcel.php';
     // Create new PHPExcel object
     $objPHPExcel = new PHPExcel();
     $title = "";
     $pat = false;
     $row = array();
     $column = array();
     $columntype = $this->generateArray(Input::get("show"));
     if (Input::get("vertical") == "Patients") {
         $pat = true;
     }
     if (Input::get("horizontal") == "Year") {
         $row = array("01" => "jan", "02" => "feb", "03" => "mar", "04" => "apr", "05" => "may", "06" => "jun", "07" => "jul", "08" => "aug", "09" => "sep", "10" => "oct", "11" => "nov", "12" => "dec");
         foreach ($row as $key => $value) {
             $from = Input::get('year') . "-" . $key . "-01";
             $to = Input::get('year') . "-" . $key . "-31";
             if (isset($columntype)) {
                 foreach ($columntype as $key1 => $value1) {
                     $patientquery = DB::table('patient');
                     $visitquery = DB::table('visit');
                     $query = $this->processQuery($patientquery, $visitquery);
                     $que = $this->checkCondition($query, $pat, $key1)->whereBetween('created_at', array($from, $to));
                     $column[$value1][] = $que->count();
                 }
                 $title .= " " . $query[2] . " " . Input::get('year');
             }
         }
     } elseif (Input::get("horizontal") == "Years") {
         $row = range(Input::get('start'), Input::get('end'));
         foreach ($row as $value) {
             $from = $value . "-01-01";
             $to = $value . "-12-31";
             if (isset($columntype)) {
                 foreach ($columntype as $key1 => $value1) {
                     $patientquery = DB::table('patient');
                     $visitquery = DB::table('visit');
                     $query = $this->processQuery($patientquery, $visitquery);
                     $que = $this->checkCondition($query, $pat, $key1)->whereBetween('created_at', array($from, $to));
                     $column[$value1][] = $que->count();
                 }
                 $title .= " " . $query[2] . " " . Input::get('start') . " - " . Input::get('end');
             }
         }
     } elseif (Input::get("horizontal") == "Age Range") {
         //setting the limits
         $agetouse = Input::get('age') == 0 ? 3 : Input::get('age');
         if (parent::maxAge() % $agetouse == 0) {
             $limit = parent::maxAge();
         } else {
             $limit = parent::maxAge() - parent::maxAge() % $agetouse + $agetouse;
         }
         //making a loop for values
         //year iterator
         $k = 0;
         //getting age
         $range = Input::get('age');
         $yeardate = date("Y") + 1;
         $yaerdate1 = $yeardate . "-01-01";
         //creating title
         $data = array();
         for ($i = $range; $i <= $limit; $i += $range) {
             $row[] = $k . " - " . $i;
             //start year
             $time = $k * 365 * 24 * 3600;
             $today = date("Y-m-d");
             $timerange = strtotime($today) - $time;
             $start = date("Y", $timerange) + 1 . "-01-01";
             //end year
             $time1 = $i * 365 * 24 * 3600;
             $timerange1 = strtotime($today) - $time1;
             $end = date("Y", $timerange1) . "-01-01";
             if (isset($columntype)) {
                 foreach ($columntype as $key1 => $value1) {
                     $patientquery = DB::table('patient');
                     $visitquery = DB::table('visit');
                     $query = $this->processQuery($patientquery, $visitquery);
                     $que = $this->checkCondition($query, true, $key1)->whereBetween('birth_date', array($end, $start));
                     $column[$value1][] = $que->count();
                 }
                 $title .= " Age Range " . $query[2];
             }
             $k = $i;
         }
     }
     // Set document properties
     $objPHPExcel->getProperties()->setCreator("Cervical Cancer Prevention Program")->setLastModifiedBy(Auth::user()->first_name)->setTitle($title)->setSubject($title)->setDescription("Cervical Cancer Prevention Program Reports")->setKeywords("cancer cecap openxml php")->setCategory("Result file");
     $latterArr = array("A", "B", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "AB", "AC", "AD", "AE", "AF", "AG", "AH", "AI", "AJ", "AK", "AL", "AM", "AN", "AO", "AP", "AQ", "AR", "AS", "AT", "AU", "AV", "AW", "AX", "AY", "AZ", "BA", "BB", "BC", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BK", "BM", "BL", "BO", "BP", "BQ", "BR", "BS", "BT", "BU", "BV", "BW", "BX", "BY", "BZ");
     $ttlecont = 1;
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A1', Input::get("show"));
     foreach ($row as $header) {
         $objPHPExcel->setActiveSheetIndex(0)->setCellValue("{$latterArr[$ttlecont]}1", $header);
         $ttlecont++;
     }
     $k = 2;
//.........这里部分代码省略.........
开发者ID:kelvinmbwilo,项目名称:cervical,代码行数:101,代码来源:GeneralController.php

示例2: makeLine


//.........这里部分代码省略.........
                            $column .= $i < count($row1) ? $que->count() . "," : $que->count();
                        }
                        $i++;
                    }
                    $column .= $col < count($columntype) ? "]}," : "]}";
                    $col++;
                }
            } elseif (isset($columnhistory)) {
                foreach ($columnhistory as $key1 => $value1) {
                    $column .= "{ name: '" . $value1 . "', data: [ ";
                    $i = 1;
                    foreach ($row1 as $value) {
                        $from = $value . "-01-01";
                        $to = $value . "-12-31";
                        $patientquery = DB::table('patient');
                        $visitquery = DB::table('visit');
                        $query = $this->processQuery($patientquery, $visitquery);
                        if ($pat) {
                            $que = $query[0]->whereIn('id', PapsmearStatus::where('status', $key1)->get()->lists('patient_id') + array('0'))->whereBetween('created_at', array($from, $to));
                            $column .= $i < count($row1) ? $que->count() . "," : $que->count();
                        } elseif ($vis) {
                            $que = $query[1]->whereIn('id', PapsmearStatus::where('status', $key1)->get()->lists('visit_id') + array('0'))->whereBetween('created_at', array($from, $to));
                            $column .= $i < count($row1) ? $que->count() . "," : $que->count();
                        }
                        $i++;
                    }
                    $column .= $col < count($columnhistory) ? "]}," : "]}";
                    $col++;
                }
            }
            $title = Input::get('vertical') . " " . $query[2] . " " . Input::get('Year');
        } elseif (Input::get("horizontal") == "Age Range") {
            //setting the limits
            if (parent::maxAge() % Input::get('age') == 0) {
                $limit = parent::maxAge();
            } else {
                $limit = parent::maxAge() - parent::maxAge() % Input::get('age') + Input::get('age');
            }
            //making a loop for values
            //year iterator
            $k = 0;
            //getting age
            $range = Input::get('age');
            $yeardate = date("Y") + 1;
            $yaerdate1 = $yeardate . "-01-01";
            //creating title
            $j = 1;
            for ($i = $range; $i <= $limit; $i += $range) {
                $row .= $i < $limit ? "'" . $k . " - " . $i . "'," : "'" . $k . " - " . $i . "'";
                $k = $i;
            }
            $col = 1;
            if (isset($columntype)) {
                foreach ($columntype as $key1 => $value1) {
                    $column .= "{ name: '" . $value1 . "', data: [ ";
                    $i = 1;
                    for ($i = $range; $i <= $limit; $i += $range) {
                        //start year
                        $time = $k * 365 * 24 * 3600;
                        $today = date("Y-m-d");
                        $timerange = strtotime($today) - $time;
                        $start = date("Y", $timerange) + 1 . "-01-01";
                        //end year
                        $time1 = $i * 365 * 24 * 3600;
                        $timerange1 = strtotime($today) - $time1;
                        $end = date("Y", $timerange1) . "-01-01";
开发者ID:kelvinmbwilo,项目名称:cervical,代码行数:67,代码来源:PapSmearController.php

示例3: makeLine


//.........这里部分代码省略.........
                        $to = $value . "-12-31";
                        $patientquery = DB::table('patient');
                        $visitquery = DB::table('visit');
                        $query = $this->processQuery($patientquery, $visitquery);
                        $count == 0 ? $que = $query[1]->whereIn('id', HivStatus::where('pitc_agreed', "yes")->get()->lists('visit_id') + array('0'))->whereBetween('created_at', array($from, $to)) : ($que = $query[1]->whereIn('id', HivStatus::where('pitc_result', $key1)->get()->lists('visit_id') + array('0'))->whereBetween('created_at', array($from, $to)));
                        $column .= $i < count($row1) ? $que->count() . "," : $que->count();
                        $i++;
                    }
                    $count++;
                    $column .= $col < count($columresult) ? "]}," : "]}";
                    $col++;
                }
            } elseif (isset($columreason)) {
                foreach ($columreason as $key1 => $value1) {
                    $column .= "{ name: '" . $value1 . "', data: [ ";
                    $i = 1;
                    foreach ($row1 as $value) {
                        $from = $value . "-01-01";
                        $to = $value . "-12-31";
                        $patientquery = DB::table('patient');
                        $visitquery = DB::table('visit');
                        $query = $this->processQuery($patientquery, $visitquery);
                        $que = $query[1]->whereIn('id', HivStatus::where('unknown_reason', $key1)->get()->lists('visit_id') + array('0'))->whereBetween('created_at', array($from, $to));
                        $column .= $i < count($row1) ? $que->count() . "," : $que->count();
                        $i++;
                    }
                    $column .= $col < count($columreason) ? "]}," : "]}";
                    $col++;
                }
            }
            $title = Input::get('vertical') . " " . $query[2] . " " . Input::get('Year');
        } elseif (Input::get("horizontal") == "Age Range") {
            //setting the limits
            if (parent::maxAge() % Input::get('age') == 0) {
                $limit = parent::maxAge();
            } else {
                $limit = parent::maxAge() - parent::maxAge() % Input::get('age') + Input::get('age');
            }
            //making a loop for values
            //year iterator
            $k = 0;
            //getting age
            $range = Input::get('age');
            $yeardate = date("Y") + 1;
            $yaerdate1 = $yeardate . "-01-01";
            //creating title
            $j = 1;
            for ($i = $range; $i <= $limit; $i += $range) {
                $row .= $i < $limit ? "'" . $k . " - " . $i . "'," : "'" . $k . " - " . $i . "'";
                $k = $i;
            }
            $col = 1;
            if (isset($columntype)) {
                foreach ($columntype as $key1 => $value1) {
                    $column .= "{ name: '" . $value1 . "', data: [ ";
                    $i = 1;
                    for ($i = $range; $i <= $limit; $i += $range) {
                        //start year
                        $time = $k * 365 * 24 * 3600;
                        $today = date("Y-m-d");
                        $timerange = strtotime($today) - $time;
                        $start = date("Y", $timerange) + 1 . "-01-01";
                        //end year
                        $time1 = $i * 365 * 24 * 3600;
                        $timerange1 = strtotime($today) - $time1;
                        $end = date("Y", $timerange1) . "-01-01";
开发者ID:kelvinmbwilo,项目名称:cervical,代码行数:67,代码来源:HivController.php


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