//var_dump($model);die; ?> <div class="page-scroll col-md-5 col-xs-12"> <?php $this->params['breadcrumbs'] = $params['breadcrumbs']; foreach ($model['models'] as $number => $m) { // var_dump($model);die; echo Collapse::widget(['items' => [['label' => $m[0]['number_type'] != 4 ? $number . ' - ' . $m[0]['desc_en'] : $number . ' - ** Std Parts', 'content' => $this->render('parts_group', ['model' => $m]), 'options' => ['class' => "panel-label col-xs-12 row", 'id' => $number]]]]); // :'<div class="panel-group collapse in"><div class="col-xs-12 panel panel-default row"><div class="panel-heading"><h4 class="panel-title">'.Html::a($m[0]['number'].' - ** Std Parts',Url::to(['/finddetails','article'=>$m[0]['number']]),['target'=>'blank']).'</h4></div></div></div>'); } ?> </div> <div class="col-md-7 col-xs-12"> <div class="page_image"> <?php echo Html::img(\app\modules\catalog\models\ToyotaQuery::getImageUrl() . "/Img/" . $model['params']['catalog'] . "/" . $model['params']['rec_num'] . "/" . $model['params']['pic_code'] . '.png', []); ?> </div> <?php foreach ($model['labels'] as $labels) { // var_dump($m[0]);die; foreach ($labels as $m) { $label = '<div id="' . $m['number'] . '" data-position="1" title="' . $m['desc_en'] . '" class="page_label" style="left: ' . $m['x1'] . 'px; top: ' . $m['y1'] . 'px; width: ' . $m['width'] . 'px; height: ' . ($m['height'] < 20 ? '20' : $m['height']) . 'px; ">' . $m['number'] . '</div>'; echo $label; } } ?> </div>
<?php use yii\widgets\DetailView; use yii\helpers\Html; /** * Created by PhpStorm. * User: marat * Date: 25.06.15 * Time: 18:00 */ //var_dump($model);die; ?> <div class="col-md-6 col-sm-12"> <?php echo DetailView::widget(['model' => $model, 'template' => "<tr><td>{value}</td></tr>", 'attributes' => [['label' => 'desc_en', 'format' => 'raw', 'value' => Html::a($model['desc_en'], \yii\helpers\Url::to(array_merge(['page', $model])))], ['label' => 'pic_code', 'format' => 'raw', 'value' => Html::a(Html::img(\app\modules\catalog\models\ToyotaQuery::getImageUrl() . "/Img/" . $model['catalog'] . "/" . $model['rec_num'] . "/" . $model['pic_code'] . '.png', ['height' => '300px']), \yii\helpers\Url::to(array_merge(['page', $model])))]]]); ?> </div>
public function TOY_VIN_info($prms) { // VIN - проверка $vin = trim($prms['vin']); // if(empty($vin)){ // echo "_TOY_VIN_info - пустой VIN"; // return array(); // } // VIN - serial number $vin_sn = substr($vin, -7); // mysql_fetch_array($r_q, MYSQL_ASSOC) - будет глатать поля с одинаковыми именами, поэтму нужно предусмотреть для frames.catalog имя f_catalog $query = new ToyotaQuery($prms); $query->select('f.id, f.catalog f_catalog, f.frame_code, f.serial_group, f.serial_number, f.ext, f.model2, f.vdate, f.color_trim_code, f.siyopt_code, f.opt, j.*, s.*')->from('johokt j')->leftJoin('frames f', 'f.frame_code = j.frame')->leftJoin('shamei s', 's.catalog = j.catalog AND s.catalog_code = j.catalog_code')->where("j.vin8 LIKE CONCAT(SUBSTRING('{$vin}', 1, 8), '%')")->andWhere("j.vin8 = SUBSTRING('{$vin}', 1, LENGTH(vin8))")->andWhere("f.catalog = IF(j.catalog = 'JP', 'DM', 'OV')")->andWhere("f.serial_number = '{$vin_sn}'")->andWhere("CONCAT(f.frame_code, f.ext, '-', SUBSTRING_INDEX(f.model2, '(', 1)) = j.model_code")->andWhere("(f.vdate BETWEEN j.prod_start AND j.prod_end or IFNULL(f.vdate, '') = '')")->andWhere("(SUBSTRING(f.siyopt_code, 1, 4) = j.sysopt OR IFNULL(j.sysopt, '') = '' OR IFNULL(f.siyopt_code, '') = '')"); if (isset($prms['catalog'])) { $query->andWhere("j.catalog = :catalog", [':catalog' => $prms['catalog']]); } $res = $query->all(); // выполним // просимофорим разработчика что с VIN получился не однозначный поиск // результатом должна быть только одна строчка, будем ловить если не так // if(isset($prms['catalog']) and count($res)>1) var_dump('БЛЯХА - почемуто больше чем одна запись, а хочется однозначно найти VIN!',$res); return $res; }
use yii\helpers\Url; use yii\helpers\Html; /** * Created by PhpStorm. * User: marat * Date: 10.01.15 * Time: 15:39 **/ //var_dump($model);die; ?> <div class="acatalog-block"> <div> <?php echo Html::img(\app\modules\catalog\models\ToyotaQuery::getImageUrl() . "ImgIllIndex/" . $model['catalog'] . "/" . $model['catalog_code'] . "/" . $model['pic_code'] . '.png', ['height' => '100px']); ?> <!-- echo Html::img(\app\modules\catalog\models\ToyotaQuery::getImageUrl().$model['pic_code'].'.png',['height'=>'100px']);?>--> </div> <div> <?php echo Html::a(Html::encode($model['desc_en']), Url::to(['album', 'catalog_code' => $model['catalog_code'], 'catalog' => $model['catalog'], 'model_name' => $model['model_name'], 'compl_code' => $model['compl_code'], 'vdate' => isset($model['vdate']) ? $model['vdate'] : '', 'part_group' => $model['part_group'], 'model_code' => $model['model_code'], 'user_id' => isset($model['user_id']) ? $model['user_id'] : ''])); ?> </div> </div>