コード例 #1
0
ファイル: Users.php プロジェクト: smilexx/counter
 public function printTovar()
 {
     $tovarishestva = Tovarishestva::all();
     foreach ($tovarishestva as $value) {
         $str = '<tr class="tovarRow" data-tovar="' . $value->id . '">
             <td class="login"><a href="/admin/users/' . $value->id . '" style="text-decoration:none"> 
                             <div style="height:100%;width:100%">
                                 ' . $value->name . '
                             </div>
                         </a></td>  
     </tr>';
         echo $str;
     }
 }
コード例 #2
0
ファイル: Report.php プロジェクト: smilexx/counter
 public function generateReport()
 {
     require_once PATH_LIBS . 'phpexcel/PHPExcel.php';
     require_once PATH_LIBS . 'phpexcel/PHPExcel/Writer/Excel2007.php';
     $xls = PHPExcel_IOFactory::load($_SERVER['DOCUMENT_ROOT'] . '/../reports/report.xls');
     $xls->setActiveSheetIndex(0);
     $sheet = $xls->getActiveSheet();
     $KoncentrTovarishestvo = KoncentrTovarishestvo::find_by_sql('SELECT * FROM `counter` inner join `koncentrator_tovarishestvo` on `koncentrator_tovarishestvo`.`name_konc` = `counter`.`concetrator` WHERE `id_tovar` = ' . $_REQUEST['tovarishestvo']);
     $date_start = explode('.', $_REQUEST[Report::DATE_START]);
     $date_start_string = $date_start[2] . '.' . $date_start[1] . '.' . $date_start[0];
     $date_end = explode('.', $_REQUEST[Report::DATE_END]);
     $date_end_string = $date_end[2] . '.' . $date_end[1] . '.' . $date_end[0];
     $i = 10;
     $j = 1;
     foreach ($KoncentrTovarishestvo as $counter) {
         $user = User::find('all', ['conditions' => ['counter = ? and concetrator =?', $counter->counter, $counter->concetrator]]);
         if ($user != null) {
             $sheet->setCellValue('A' . $i, $j);
             $sheet->setCellValue('B' . $i, 'ТП-Рында');
             $sheet->setCellValue('C' . $i, $user[0]->fio);
             $sheet->setCellValue('E' . $i, $user[0]->address);
             $sheet->setCellValue('F' . $i, $user[0]->n_scet);
             $sheet->setCellValue('M' . $i, $counter->date);
             $sheet->setCellValue('N' . $i, (int) $counter->reading);
             $i++;
             $j++;
         }
     }
     $i += 3;
     $sheet->setCellValue('M' . $i, 'От Исполнителя: ______________________________________');
     $i++;
     $sheet->setCellValue('M' . $i, '(должность, подпись, ФИО)');
     $objWriter = new PHPExcel_Writer_Excel5($xls);
     $Tovarishestvo = Tovarishestva::find('all', ['conditions' => ['id = ?', $_REQUEST['tovarishestvo']]]);
     header("Content-type: application/vnd.ms-excel");
     header("Content-Disposition: attachment; filename=" . $Tovarishestvo[0]->name . " " . $_REQUEST[Report::DATE_START] . "-" . $_REQUEST[Report::DATE_END] . ".xls");
     $objWriter->save('php://output');
 }
コード例 #3
0
ファイル: indications.php プロジェクト: smilexx/counter
        </table>
    </div>
    <?php 
} else {
    ?>
    <div class=" col-md-15 well">
        <legend>Выберите товарищество</legend>
        <table  class="table table-striped">
            <thead>
                <tr>	
                    <th>Название</th>
                </tr>
            </thead>
            <tbody>
                <?php 
    $tovarishestva = Tovarishestva::all();
    foreach ($tovarishestva as $value) {
        ?>
                    <tr>
                        <td><a href="/admin/indications/<?php 
        echo $value->id;
        ?>
" style="text-decoration:none"> 
                                <div style="height:100%;width:100%">
                                    <?php 
        echo $value->name;
        ?>
                                </div>
                            </a></td>
                    </tr>
                    <?php