Beispiel #1
0
 public static function index()
 {
     self::setHtmlHead();
     if (!self::checkAndLoadInputParams()) {
         self::wrongParams();
         return;
     }
     $exportsName = ExportsModel::getTypes();
     $data = array('exportsName' => $exportsName, 'formAction' => Settings::getRoute('pageOptions'), 'filename' => InputData::getGet('file'));
     view::template('pageSetExportType', $data);
 }
Beispiel #2
0
 private static function wrongParams()
 {
     if (!self::$file) {
         self::$errors[] = "Липсва файл!";
     }
     //        if (!self::$convertType)
     //            self::$errors[] = "Липсва вид на конверта!";
     if (!self::$convertType) {
         Router::redirect(Settings::getRoute('pageSetExport') . '?file=' . self::$file);
     }
     $data = array('errors' => self::$errors);
     View::template("pageError", $data);
 }
 public static function index()
 {
     self::setHtmlHead();
     self::setHtmlHead();
     if (!self::checkAndLoadInputParams()) {
         self::wrongParams();
         return;
     }
     $convertObject = new PHPExelLoadModel(InputData::getPost('file'));
     if (!$convertObject) {
         $this->dump("Error create Convert object");
         return;
     }
     $data = $convertObject->getExelData();
     $hotelsNames = array_keys($data['hotels']);
     $data = array('hotelsNames' => $hotelsNames, 'formAction' => Settings::getRoute('pageConvert'), 'filename' => InputData::getPost('file'), 'convertType' => InputData::getPost('convertType'));
     view::template('pageSetOptions', $data);
 }
<br />
<br />
<br />
<br />

<div class="container-fluid container">
    <div class="row">
        <div class ='col-sm-3 text-left'>
            <a href="<?php 
echo Settings::getRoute('pageHome');
?>
" class="btn btn-primary btn active" role="button">Начало</a>
        </div>
        <div class ='col-sm-8 text-left'> 
            <div class='form-group'> 
                <label>
                    <h3>Хотели</h3> 
                </label>
            </div>
            <form method="POST" action="<?php 
echo $formAction;
?>
" >
                <?php 
foreach ($hotelsNames as $name) {
    ?>
                    <div class='form-group col-sm-3 pull-left'>
                        <?php 
    echo View::template('system/htmlInput', array('data' => array('type' => 'checkbox', 'name' => 'hotelsNames[]', 'value' => $name, 'checked' => 'checked')));
    echo $name;
    ?>
Beispiel #5
0
                        <?php 
echo View::template('system/htmlInput', array('data' => array('type' => 'submit', 'value' => 'Конвертирай', 'class' => 'btn btn-primary')));
?>
                    </div>
                </div>
            </form>
        </div>
        <div class ='col-sm-4 separator pull-left'>
            <label ><h3>Качени файлове:</h3></label>
            <div id="existingFiles">
                <?php 
foreach ($existingFiles as $file) {
    $file = end(explode('/', $file));
    ?>
                - <a href="<?php 
    echo Settings::getRoute('pageSetExport') . '?file=' . $file;
    ?>
"><?php 
    echo $file;
    ?>
</a><br />
                <?php 
}
?>
            </div>
        </div>
    </div>
</div>

<div id = 'footer'></div>