I
I
ilysion_in_life2018-04-30 11:58:24
Yii
ilysion_in_life, 2018-04-30 11:58:24

Yii2 DatePicker how to display information by date for 2 tables?

Hello, can anyone suggest a solution to this problem? There are 2 tables that accept data from different models $model and $data, you need to select information by date using https://github.com/2amigos/yii2-date-picker-widget i.e. when choosing to display data in both tables for a given day of the month with one model, I know how to do this, but with two I can’t figure out how to synchronize, who can tell, maybe someone has already done this?
Calling Models

$model = Propuchen::find('DATE (DateZvonka)=:DateZvonka', array (':DateZvonka'=>$date));
$model2 = ShapkaPriehalo::find('DATE (Date)=:Date', array (':Date'=>$date));

An example of one of the tables
<div class="table-responsive">      
  <table class="table table-bordered">
    <thead style="background-color: #000; color:#fff;">
      <tr>
        <th>Дата</th>
        <th>Время записи</th>
        <th>Имя клиента</th>
        <th>Снятая или нет</th>
        <th>Модель<p>автомобиля</th>
        <th>Год</th>
        <th>Телефон</th>
        <th>Причина обращения</th>
        <th>Город</th>
        <th>Комментарий</th>
      </tr>
    </thead>
    <tbody>
    <tr><td style="min-height:20px;">--Неразобран--</td></tr>
    <?php foreach($data2 as $key=> $value){ ?>
      <tr>
        <td style="max-width: 110px;min-width: 110px;"><?php echo Yii::$app->formatter->asDate($value['DateZvonka'], 'php:Y-m-d');?></td>
        <td></td>
        <td><?php echo $value['Klient']?></td>
        <td></td>
        <td></td>
        <td style="max-width: 35px;min-width: 35px;"></td>
        <td><?php echo $value['NomerTelefona']?></td>
        <td></td>
        <td style="max-width: 103px;min-width: 103px;"></td>
        <td></td>
      </tr>
    <?php }?>
    </tbody>
  </table>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question