コード例 #1
0
 public function getDelete($id = null)
 {
     if (!is_null($id)) {
         $id = SiteHelpers::encryptID($id, true);
         PlotModel::where('id', $id)->delete();
         return Redirect::to('plot')->with('message', SiteHelpers::alert('success', "Data deleted esuccessfully"));
     }
 }
コード例 #2
0
 public function postSave()
 {
     $id = Input::get('id');
     $starts = Input::get('start');
     $ends = Input::get('end');
     if (empty($id)) {
         $data = new PlotModel();
         $data->name = Input::get('name');
         $data->id_tech = Input::get('id_tech');
         $data->info = Input::get('info');
         $data->save();
         $i = 0;
         foreach ($starts as $start) {
             $plot = new PlotDataModel();
             $plot->id_plot = $data->id;
             $plot->start = $start;
             $plot->end = $ends[$i];
             $plot->save();
             $i++;
         }
     } else {
         $data = PlotModel::find($id);
         $data->name = Input::get('name');
         $data->id_tech = Input::get('id_tech');
         $data->info = Input::get('info');
         $data->save();
         PlotDataModel::where('id_plot', $id)->delete();
         $i = 0;
         foreach ($starts as $start) {
             $plot = new PlotDataModel();
             $plot->id_plot = $data->id;
             $plot->start = $start;
             $plot->end = $ends[$i];
             $plot->save();
             $i++;
         }
     }
     return Redirect::to('plot')->with('message', SiteHelpers::alert('success', "Data saved successfully"));
 }
コード例 #3
0
        <script src="{{ URL::to('highchart/highcharts.js')}}"></script>

        <script type="text/javascript" src="{{URL::to('cvg/rgbcolor.js')}}"></script>
        <script type="text/javascript" src="{{URL::to('cvg/StackBlur.js')}}"></script>
        <script type="text/javascript" src="{{URL::to('cvg/canvg.js')}}"></script>
        <script type = "text/javascript">
        $("#save_img").click(function () {
save_image();
        });
        function make_chart() {
<?php 
for ($i = 0; $i < $count; $i++) {
    $y = json_encode($charts_data['y'][$i]);
    $yy = json_encode($charts_data['yy'][$i]);
    $x = json_encode($charts_data['x'][$i]);
    $plot_name = PlotModel::where('id', $charts_data['plot'][$i])->first();
    ?>
            $('#container{{$i}}').highcharts({
                 credits: {
            enabled: false
        },
            chart: {
            borderWidth: 1,
                    plotBorderWidth: 1,
                    spacingRight: 10,
                    spacingLeft: 10,
                    spacingTop: 10,
                    spacingBottom: 80,
                    zoomType: 'xy',
                    height: 448,
                    width: 653,
コード例 #4
0
 public function postFinalpresentation()
 {
     $id_result = Input::get('id_result');
     $resulted = AutomateModel::where('id', $id_result)->first();
     //        $range_name_id = Input::get('range_name_id');
     $result = LogChartModel::where('id_result', $id_result)->get();
     $objPHPPowerPoint = new PhpPowerpoint();
     // Set properties
     //        echo date('H:i:s') . ' Set properties' . EOL;
     $objPHPPowerPoint->getProperties()->setCreator('HAT Developer')->setLastModifiedBy('HAT Developer')->setTitle('Sample 07 Title')->setSubject('Sample 07 Subject')->setDescription('Sample 07 Description')->setKeywords('office 2007 openxml libreoffice odt php')->setCategory('Sample Category');
     // Remove first slide
     //        echo date('H:i:s') . ' Remove first slide' . EOL;
     $objPHPPowerPoint->removeSlideByIndex(0);
     // Set Style
     $oFill = new Fill();
     //        $oFill->setFillType(Fill::FILL_SOLID)->setStartColor(new Color('FFE06B20'));
     $oShadow = new Shadow();
     $oShadow->setVisible(true)->setDirection(45)->setDistance(10);
     //FIRST SLIDE
     $currentSlide = $this->createTemplatedSlide($objPHPPowerPoint);
     // local function
     // Create a shape (text)
     // Create a shape (text)
     $shape = $currentSlide->createRichTextShape();
     $shape->setHeight(600)->setWidth(930)->setOffsetX(40)->setOffsetY(300);
     $shape->getActiveParagraph()->getAlignment()->setHorizontal(Alignment::HORIZONTAL_LEFT)->setMarginLeft(25)->setIndent(-25);
     $shape->getActiveParagraph()->getFont()->setSize(18)->setColor(new Color('E07116'));
     //        $shape->getActiveParagraph()->getBulletStyle()->setBulletType(Bullet::TYPE_BULLET);
     $shape->createTextRun($resulted->info);
     //END OF FIRST SLIDE
     $index = 0;
     //        print_r('here'); exit();
     foreach ($result as $file) {
         //            echo $file->filename.'<br>';
         $currentSlide = $this->createTemplatedSlide($objPHPPowerPoint);
         $shape = $currentSlide->createDrawingShape();
         $shape->setName('Result Chart')->setDescription('PHPPowerPoint logo')->setPath(public_path($file->filename))->setHeight(450)->setWidth(650)->setOffsetX(100)->setOffsetY(160);
         $shape->getShadow()->setVisible(true)->setDirection(45)->setDistance(10);
         $shape = $currentSlide->createRichTextShape();
         $shape->setHeight(50)->setWidth(930)->setOffsetX(20)->setOffsetY(45);
         $shape->getActiveParagraph()->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER)->setMarginLeft(25)->setIndent(-25);
         $shape->getActiveParagraph()->getFont()->setSize(23)->setColor(new Color('D66204'));
         //        $shape->getActiveParagraph()->getBulletStyle()->setBulletType(Bullet::TYPE_BULLET);
         $title = explode(',', $file->title);
         $plot_data = PlotDataModel::where('id_plot', $file->id_plot)->get();
         $plot_name = PlotModel::where('id', $file->id_plot)->first();
         $technya = TechnologyModel::where('id', $plot_name->id_tech)->first();
         if ($technya->name == 'UMTS') {
             $shape->createTextRun(str_ireplace('ch', 'UARFCN', $title[1]) . ' Histogram');
         } else {
             if ($technya->name == 'LTE') {
                 $shape->createTextRun(str_ireplace('ch', 'LARFCN', $title[1]) . ' Histogram');
             } else {
                 $shape->createTextRun(str_ireplace('ch', 'ARFCN', $title[1]) . ' Histogram');
             }
         }
         $co = count($plot_data);
         $shape = $currentSlide->createTableShape(1);
         $shape->setWidth(150);
         $shape->setOffsetX(760);
         $shape->setOffsetY(200);
         $row = $shape->createRow();
         $row->getFill()->setFillType(Fill::FILL_SOLID)->setStartColor(new Color('EEF0EB'))->setEndColor(new Color('EEF0EB'));
         $row->nextCell()->createTextRun($plot_name->name);
         $i = 2;
         foreach ($plot_data as $rw) {
             $row = $shape->createRow();
             if ($i % 2 == 0) {
                 $row->getFill()->setFillType(Fill::FILL_SOLID)->setStartColor(new Color('DCEBCA'))->setEndColor(new Color('DCEBCA'));
             } else {
                 $row->getFill()->setFillType(Fill::FILL_SOLID)->setStartColor(new Color('EEF0EB'))->setEndColor(new Color('EEF0EB'));
             }
             $row->nextCell()->createTextRun($rw->start . ' to ' . $rw->end);
             $i++;
         }
         $index++;
     }
     // Save file
     $named = date('Ymdhis_') . $this->toAscii($resulted->info);
     $this->write($objPHPPowerPoint, $named, $this->writers);
     $resultsave = AutomateModel::find($id_result);
     $resultsave->file_result = date('Y-m-d') . '/' . $named;
     $resultsave->save();
     Session::flash('message', SiteHelpers::alert('success', Lang::get('Process has completed, check the result on table bellow')));
     return Redirect::to('/automate');
 }