Ejemplo n.º 1
0
 public function actionDetails($quote)
 {
     $chat = new Chat();
     if ($chat->load(Yii::$app->request->post())) {
         $use = new User();
         $user = Yii::$app->user->identity->username;
         $val = $use->findByUsername1($user);
         $chat->user_id = $val->id;
         $chat->request_id = $quote;
         $reqs = Carrequest::find()->where('id=:id', array('id' => $quote))->one();
         $chat->dealer_id = $reqs->dealer_id;
         $chat->sent = 2;
         if ($chat->save()) {
             $chat->message = "";
             return $this->render('detail', ['quote' => $quote]);
         }
     }
     return $this->render('detail', ['quote' => $quote]);
 }
Ejemplo n.º 2
0
<th>Color</th>
<th>Delivery</th>
<th>On-Road Price</th>
<th>Quote	Specification</th>

</tr>




<?php 
if (count($rows) > 0) {
    foreach ($rows as $row) {
        echo "<tr>";
        $car = Car::find()->where('id=:id', array('id' => $row->car_id))->one();
        $reqs = Carrequest::find()->where('request_id=:id', array('id' => $row->id))->all();
        if (count($reqs) > 0) {
            foreach ($reqs as $req) {
                if ($req->status == 1) {
                    $reply = Reply::find()->where('request_id=:id', array('id' => $req->id))->one();
                    echo "<td>" . $row->id . "</td>";
                    echo "<td>" . $req->dealer_id . "</td>";
                    echo "<td>" . $car->model . "</td>";
                    echo "<td>" . $car->model_name . "</td>";
                    echo "<td>" . $car->fuel . "</td>";
                    echo "<td>" . $car->variant . "</td>";
                    echo "<td>" . $row->color . "</td>";
                    echo "<td>" . $row->delivery . "</td>";
                    if (count($reply) > 0) {
                        echo "<td><b>" . $reply->price . "</b></td>";
                        $data = explode(",", $reply->feature);