Guest User

Untitled

a guest
Mar 19th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.83 KB | None | 0 0
  1. 
  2. <?php
  3. use dosamigosselectizeSelectizeDropDownList;
  4. use kartikfileFileInput;
  5. use yiiflagsFlags;
  6. use yiihelpersHtml;
  7. use yiihelpersUrl;
  8. use yiiwebJsExpression;
  9. use yiiwidgetsBreadcrumbs;
  10.  
  11.  
  12. $this->title = Html::encode(Yii::$app->settings->get('site', 'title_translate'));
  13. $this->registerMetaTag(['description' => Yii::$app->settings->get('site', 'description_translate')]);
  14. $this->params['breadcrumbs'][] = $this->title;
  15.  
  16. $languages = array_map(function(appmodelsLanguage $language) {
  17. return [
  18. $language->id => Flags::widget([
  19. 'flag' => $language->icon,
  20. 'type' => Flags::FLAT_24,
  21. 'useSprite' => false
  22. ]) . ' ' . '<span class="lng-drop">' . $language->language . '</span>',
  23. ];
  24. }, $languages);
  25. $sources = array_map(function(appmodelsLanguage $source) {
  26. return [
  27. $source->id => Flags::widget([
  28. 'flag' => $source->icon,
  29. 'type' => Flags::FLAT_24,
  30. 'useSprite' => false
  31. ]) . ' ' . '<span class="lng-drop">' . $source->language . '</span>',
  32. ];
  33. }, $sources);
  34. ?>
  35. <?= $this->render('_header_breadcrumbs') ?>
  36. <div class="container">
  37. <div class="row">
  38. <form class="col-md-9 ">
  39. <ul class="timeline-2">
  40. <li class="animated fadeInRight animation-delay-10">
  41. <time class="timeline-time" datetime=""><span class="timeline-point-w" style="font-size: 40px;">1</span></time>
  42. <div class="panel panel-royal panel-class" style="border-radius:5px; margin-bottom: 70px;">
  43.  
  44. </li>
  45.  
  46. <li class="animated fadeInRight animation-delay-8 timeline-language">
  47. <time class="timeline-time" datetime=""><span class="timeline-point-w" style="font-size: 40px;">2</span></time>
  48.  
  49. <div class="">
  50. <div class="form-group">
  51. <label for="select">My Source Language</label>
  52. <?= SelectizeDropDownList::widget([
  53. 'options' => [
  54. 'id' => 'sourceLangSelect',
  55. 'class' => 'sourceLangSelect cookieset',
  56. ],
  57. 'name' => 'tags',
  58. 'value' => 41, // initial value
  59. // 'value'=>new JsExpression(' alert("hello") ; $.cookie("sourceLangSelect")'),
  60. 'items' => $sources,
  61. 'clientOptions' => [
  62. 'placeholder' => 'Select source language',
  63. 'optgroups' => false,
  64. 'render' => [
  65. 'option' => new JsExpression('function(item) {
  66. return '<div>' + item.text + '</div>';
  67. }'),
  68. 'item' => new JsExpression('function(item) {
  69. return '<div>' + item.text + '</div>';
  70. }'),
  71. ],
  72. 'onInitialize' => new JsExpression('function() {
  73. $('#sourceLangSelect').trigger('selectizeInit');
  74. }'),
  75. ],
  76. ]);?>
  77. </div>
  78. <i class="fa fa-arrow-down fa-2x"></i>
  79. <div class="form-group">
  80. <label for="select">My Target Language(s)‎</label>
  81. <?= SelectizeDropDownList::widget([
  82. 'options' => [
  83. 'id' => 'targetLangSelect',
  84. 'class' => 'targetLangSelect cookieset',
  85. ],
  86. 'name' => 'tags',
  87. 'items' => $languages,
  88. 'clientOptions' => [
  89. 'placeholder' => 'Select target language',
  90. 'maxItems' => null,
  91. 'optgroups' => false,
  92. 'render' => [
  93. 'option' => new JsExpression('function(item) {
  94. return '<div>' + item.text + '</div>';
  95. }'),
  96. 'item' => new JsExpression('function(item) {
  97. return '<div>' + item.text + '</div>';
  98. }'),
  99. ],
  100. 'onInitialize' => new JsExpression('function() {
  101. $('#targetLangSelect').trigger('selectizeInit');
  102. }'),
  103. ],
  104. ]);?>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </li>
  113. <li class="animated fadeInRight animation-delay-6">
  114. <time class="timeline-time" datetime=""><span class="timeline-point-w" style="font-size: 40px;">3</span></time>
  115.  
  116. <ul class="expert-block cookieset">
  117. <?php foreach ($experts as $expert) :?>
  118. <li> <i class="<?=$expert->icon?>"></i> <span id="<?=$expert->id?>" class="name"><?=$expert->name?></span>
  119. <p class="description"><?=$expert->description?></p>
  120. </li>
  121. <?php endforeach; ?>
  122. </ul>
  123. </div>
  124. </div>
  125. </li>
  126. <li class="animated fadeInRight animation-delay-2 timeline-input-file">
  127. <time class="timeline-time" datetime=""><span class="timeline-point-w" style="font-size: 40px;">4</span></time>
  128.  
  129. <?php echo '<label class="control-label">Add Attachments</label>';
  130. echo FileInput::widget([
  131. 'id' => 'input-id',
  132. 'name' => 'attachment_3[]',
  133. 'options'=>[
  134. 'multiple'=>true
  135. ],
  136. 'pluginOptions' => [
  137. 'previewFileType' => 'any',
  138. 'showPreview' => true,
  139. 'showCaption' => true,
  140. 'showRemove' => false,
  141. 'showUpload' => false,
  142. 'maxFileSize'=>2500000,
  143. 'uploadUrl' => yiihelpersUrl::to(['/site/upload-any-file']),
  144. 'fileActionSettings' => [
  145. 'showZoom' => false,
  146. 'showRemove' => true,
  147. 'showUpload' => false,
  148.  
  149. ],
  150. 'layoutTemplates' => [
  151. 'close' => '',
  152. 'footer' => '<div class="file-thumbnail-footer">'
  153. . '<div class="file-footer-caption" title="{caption}">{caption}<br>{size}</div>'
  154. . '{actions}'
  155. . '</div>',
  156. ],
  157. 'maxFileCount' => 10,
  158. ],
  159. ]);?>
  160. <p class="format-icons">
  161. <i class="fa fa-lg fa-file-word-o text-primary"></i>
  162. <i class="fa fa-lg fa-file-pdf-o text-primary"></i>
  163. <i class="fa fa-lg fa-file-powerpoint-o text-primary"></i>
  164. <i class="fa fa-lg fa-file-excel-o text-primary"></i>
  165. <i class="fa fa-lg fa-file-text-o text-primary"></i>
  166. </p>
  167. <div id="loading" style="display:none"></div>
  168. <div class="word-count-block" style="">
  169. <p style="display:inline-flex">
  170. <span>word count:</span>
  171. <input class="form-control" required type="number" min="1" id="wcount" value="0"/>
  172. </p>
  173. </div>
  174. <input type="hidden" value="0" class="word-count-all-block"/>
  175. </div>
  176. </div>
  177. </li>
  178. <li class="animated fadeInRight animation-delay-2">
  179. <time class="timeline-time" datetime=""><span class="timeline-point-w" style="font-size: 40px;">5</span></time>
  180.  
  181. <div class="form-group">
  182. <label for="select">Priorities...</label>
  183. <select class="form-control cookieset">
  184. <?php foreach ($presets as $key => $value) :?>
  185. <option value="<?=$key?>"><?=$value;?></option>
  186. <?php endforeach; ?>
  187. </select>
  188. </div>
  189. <div class="form-group">
  190. <label for="free-brief">Add a free text brief for your Account Manager</label>
  191. <textarea maxlength="10000" placeholder="Your text..." rows="4" class="form-control cookieset" id="free-brief"></textarea>
  192. </div>
  193. </div>
  194. </div>
  195. </li>
  196. <li class="animated fadeInRight animation-delay-2">
  197. <time class="timeline-time" datetime=""><span class="timeline-point-w" style="font-size: 40px;">6</span></time>
  198.  
  199. <div class="col-lg-6 col-sm-12">
  200. <i class="fa fa-credit-card fa-2x"></i>
  201. <label>PRICE</label>
  202. <p class="price"><?=Html::encode(Yii::$app->settings->get('site', 'currency')) . Html::encode(Yii::$app->settings->get('site', 'price'))?>/word</p>
  203. <input type="hidden" value="<?=Html::encode(Yii::$app->settings->get('site', 'price'))?>" class="price-settings">
  204. <input type="hidden" value="" class="price-lang">
  205. </div>
  206. <div class="col-lg-6 col-sm-12">
  207. <i class="fa fa-clock-o fa-2x"></i>
  208. <label>DELIVERY TIME</label>
  209. <p class="speed">Minimum 16 hr</p>
  210. <input type="hidden" value="<?=Html::encode(Yii::$app->settings->get('site', 'speed'))?>" class="speed-settings">
  211. <input type="hidden" value="<?=Html::encode(Yii::$app->settings->get('site', 'minimum_words'))?>" class="word-settings">
  212. <input type="hidden" value="57600" class="speed-seconds">
  213. <input type="hidden" value="" class="speed-lang">
  214. <input type="hidden" value="" class="speed-type">
  215. <input type="hidden" value="1" class="hour_index">
  216. </div>
  217. </div>
  218. </div>
  219. </li>
  220. <li class="animated fadeInRight animation-delay-2">
  221. <time class="timeline-time" datetime=""><span class="timeline-point-w" style="font-size: 40px;">7</span></time>
  222.  
  223. <a data-trigger="manual" id="translate-now" style="background-image: none" tabindex="0" class="btn btn-ar btn-transparent-opaque btn-xl translate-btn" role="button" data-html="true" data-placement="top" data-toggle="popover" title="" data-content='<ul class="submit-popover-list"><li class="lng">Source and Target Languages</li><li class="inactive expertise">Expertise</li><li class="inactive files">Files / Word Count</li></ul>' data-original-title="Please complete the following in order to start translation:" disabled="disabled">Translate Now</a>
  224. <p id="error-submit-block" class="text-danger"></p>
  225. </div>
  226. </div>
  227. </li>
  228. </ul>
  229. </form>
  230. <div class="col-md-3">
  231. <div class="floating_content">
  232. <div class="content-box animated fadeInDown animation-delay-14" style="color: #666; background-color: white;border-radius:5px;margin-top: -20px;">
  233. <div class="guarantee"></div>
  234. <h4 class="content-box-title" style="color:#666;">Order summary</h4>
  235. <div class="panel-body">
  236. <div class="col-lg-6 col-sm-12">
  237. <i class="fa fa-credit-card fa-2x"></i>
  238. <label>PRICE</label>
  239. <p class="price"><?=Html::encode(Yii::$app->settings->get('site', 'currency')) . Html::encode(Yii::$app->settings->get('site', 'price'))?>/word</p>
  240. </div>
  241. <div class="col-lg-6 col-sm-12">
  242. <i class="fa fa-clock-o fa-2x"></i><br/>
  243. <label>DELIVERY TIME</label>
  244. <p class="speed">Minimum 16 hr</p>
  245. </div>
  246. </div>
  247. </div>
  248. <br>
  249. <div class="text-center animated fadeInDown animation-delay-16" style="">
  250. <a class="btn btn-success quality_btn" href="<?=Url::to(['site/quality'])?>" style="background-color: #3ab94e;border-color: #3ab94e;">Quality Standard</a>
  251. </div>
  252. <br/>
  253.  
  254. <div class="panel-group animated fadeInDown animation-delay-10" id="accordion">
  255.  
  256. <!--<div class="panel panel-default">-->
  257. <div class="panel-default">
  258. <div class="panel-heading panel-heading-link">
  259. <!--<div class=" ">-->
  260.  
  261. <div class="text-center animated fadeInDown animation-delay-16" style="">
  262. <a class="btn btn-success quality_btn" data-toggle="collapse" data-parent="#accordion" href="#collapseZero" style="border-color: rgb(58, 185, 78); background-color: rgb(58, 185, 78) !important; color: white; font-family: Roboto;">How to Use&nbsp;&nbsp;&nbsp;<i class="fa fa-arrow-down fa-4x" aria-hidden="true"></i>
  263. </a>
  264. </div>
  265.  
  266. </div>
  267. <div id="collapseZero" class="panel-collapse collapse">
  268. <div class="panel-body">
  269. <div class="panel panel-default">
  270. <div class="panel-heading panel-heading-link">
  271. <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
  272. <i class="fa fa-lightbulb-o"></i> Step 1
  273. </a>
  274. </div>
  275. <div id="collapseOne" class="panel-collapse collapse">
  276.  
  277. </div>
  278. </div>
  279. </div>
  280. </div>
  281.  
  282. </div>
  283. </div>
  284. </div>
  285. </div>
  286. </div>
  287.  
  288. <?= $this->render('_wordcountmodal', []) ?>
  289. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  290. <script>
  291. $(document).ready(function(){
  292. console.log($.cookie("sourceLangSelect"));
  293. $(this).scroll(function(){
  294. if($( window ).width()>922){
  295. $(".floating_content").css("position","relative");
  296. // console.log($(this).scrollTop());
  297. if($(this).scrollTop()< 1900)
  298. {
  299.  
  300. $(".floating_content").css("bottom",(-1*($(this).scrollTop())));
  301.  
  302. }
  303. }
  304. });
  305.  
  306.  
  307. $("#wcount").change(function(){
  308. $("li.active").find("a").click();
  309. });
  310.  
  311. $(".cookieset").change(function(){
  312. var source = $('#sourceLangSelect').next().find('.items div').attr('data-value');
  313. var target = [];
  314. $('#targetLangSelect').next().find('.items div').each(function() { target.push($(this).attr('data-value')); });
  315. if(source && target.length > 0) {error = false;}
  316. var presets = $('.brief-block select').val();
  317.  
  318. var speed = $('.project-block .speed-seconds').val();
  319. var price = $('.project-block .price').text();
  320.  
  321. $.cookie("sourceLangSelect", source , {path: "/"});
  322. $.cookie("targetLangSelect", target , {path: "/"});
  323. $.cookie("presets", target , {path: "/"});
  324. $.cookie("speed", speed , {path: "/"});
  325. $.cookie("price", price , {path: "/"});
  326.  
  327. });
  328.  
  329. $(".cookieset").click(function(){
  330.  
  331. var type = $('.animation-delay-10 ul.ar-nav-pills li.active a').text();
  332. var expert = $('.expert-block li.active span').attr('id');
  333.  
  334. $.cookie("type", type , {path: "/"});
  335. $.cookie("expert", expert , {path: "/"});
  336.  
  337. });
  338.  
  339. $(".cookieset").keyup(function(){
  340. var free = $('.brief-block #free-brief').val();
  341. $.cookie("free", free , {path: "/"});
  342.  
  343. });
  344. });
  345. </script>
Add Comment
Please, Sign In to add comment