Exemplo n.º 1
0
function get_driver($car_id = null)
{
    $mapdriver = new \app\models\MapDriver();
    $rs = $mapdriver->find()->where(['car_id' => $car_id, 'active' => '1'])->one();
    $driver_id = $rs['driver'];
    $result = $mapdriver->get_driver($driver_id);
    return $result;
}
    $sum_gas = $sum_gas + $rs['gas_price'];
    $sum_allowance_driver = $sum_allowance_driver + $allowance_driver;
    $sum_expense = $sum_expense + $expense;
    $sum_expense_etc = $sum_expense_etc + $expense_etc;
    ?>
                <tr> 
                    <th><?php 
    echo $rs['assign_id'];
    ?>
</th>
                    <th><?php 
    echo $config->thaidate($rs['order_date_start']) . ' - ' . $config->thaidate($rs['order_date_end']);
    ?>
</th>
                    <th><?php 
    echo $map_driv->get_driver($rs['driver1']) . ' - ' . $map_driv->get_driver($rs['driver2']);
    ?>
</th>
                    <th><?php 
    echo $product_type->find()->where(['id' => $rs['product_type']])->one()['product_type'];
    ?>
</th>
                    <td><?php 
    echo $rs['weigh'];
    ?>
</td>
                    <td><?php 
    echo $rs['distance'];
    ?>
</td>
                    <td><?php