quotation.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. <?php
  2. include "Connection.php";
  3. include "../global.php";
  4. require_once(dirname(__FILE__)."/_api/global.php");
  5. $conn = new Connection();
  6. $db = $conn->getConnection();
  7. $token = escape_str($_REQUEST["token"]);
  8. $check_arr=$conn->selectQuery(TABLE_QUOTATIONSHARE ,"*","sharetoken='".$token."'","1");
  9. if(!$check_arr['nr']>0)
  10. {
  11. $client_ip=globalfunc::getIp($conn);
  12. $sec=LOCK_ACCESS_MINUTES*60;
  13. $expiry_time=date('Y-m-d H:i:s',strtotime('-'.$sec.' seconds',strtotime(NOW)));
  14. $lock_qry_str="SELECT SUM(lock_count) lock_count FROM ".TABLE_LOCK_ACCESS." WHERE is_deleted='0' AND modified_on>='".$expiry_time."' AND ip='".$client_ip."' GROUP BY ip LIMIT 1";
  15. $lock_value=$conn->getQueryValue($lock_qry_str);
  16. if(count($lock_value)>0 && $lock_value[0]->lock_count>=3)
  17. {
  18. header("HTTP/1.1 404 Page Not Found");
  19. header('Access-Control-Allow-Origin: *');
  20. echo 'Sorry Invalid Access. Access Blocked For 10 min.'; exit;
  21. }
  22. globalfunc::insertLockLog($conn,$token);
  23. header("HTTP/1.1 404 Page Not Found");
  24. header('Access-Control-Allow-Origin: *');
  25. echo 'PAGE NOT FOUND'; exit;
  26. }
  27. //GET DEALER
  28. $dealer_arr=$conn->selectQuery(DMS_DEALER ,"dealer_code,dealer_name,phone,email,address,state,city"," dealer_code='".$check_arr['result'][0]->dealer_code."' ","1");
  29. $dealer_name=($dealer_arr['nr']>0)?$dealer_arr['result'][0]->dealer_name:'';
  30. $dealer_address=($dealer_arr['nr']>0 && $dealer_arr['result'][0]->address!='')?$dealer_arr['result'][0]->address:$dealer_name;
  31. $dealer_phone=($dealer_arr['nr']>0 && $dealer_arr['result'][0]->phone!='')?$dealer_arr['result'][0]->phone:'';
  32. $dealer_email=($dealer_arr['nr']>0 && $dealer_arr['result'][0]->email!='')?$dealer_arr['result'][0]->email:'';
  33. //GET MODEL
  34. $model_arr=$conn->selectQuery(DMS_ENQUIRY_MODEL ,"title,title_code,variant,variant_code"," title_code='".$check_arr['result'][0]->model."' AND variant_code='".$check_arr['result'][0]->variant."' ","1");
  35. $model_str=($model_arr['nr']>0)?$model_arr['result'][0]->title:'';
  36. $variant_str=($model_arr['nr']>0)?$model_arr['result'][0]->variant:'';
  37. $check_arr['result'][0]->exsh_price=($check_arr['result'][0]->exsh_price)?$check_arr['result'][0]->exsh_price:0;
  38. $check_arr['result'][0]->rto_price=($check_arr['result'][0]->rto_price)?$check_arr['result'][0]->rto_price:0;
  39. $check_arr['result'][0]->insurance_price=($check_arr['result'][0]->insurance_price)?$check_arr['result'][0]->insurance_price:0;
  40. $check_arr['result'][0]->access_price=($check_arr['result'][0]->access_price)?$check_arr['result'][0]->access_price:0;
  41. $check_arr['result'][0]->exwarr_price=($check_arr['result'][0]->exwarr_price)?$check_arr['result'][0]->exwarr_price:0;
  42. $check_arr['result'][0]->other_price=($check_arr['result'][0]->other_price)?$check_arr['result'][0]->other_price:0;
  43. $check_arr['result'][0]->total_price=($check_arr['result'][0]->total_price)?$check_arr['result'][0]->total_price:0;
  44. // print_r($check_arr);
  45. $quotationhtml ='<!doctype html>
  46. <html lang="en">
  47. <head>
  48. <meta charset="utf-8">
  49. <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
  50. <title>Hyper-M</title>
  51. <base href="'.SITE_URL.'">
  52. <meta name="viewport" content="width=device-width, initial-scale=1">
  53. <link rel="icon" type="image/x-icon" href="images/loc-logo.png">
  54. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  55. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
  56. <style>
  57. body{
  58. float: left;
  59. width: 100%;
  60. background: #ececec;
  61. }
  62. .section {
  63. width: 100%;
  64. max-width: 900px;
  65. margin: 0px auto;
  66. display: block;
  67. }
  68. .top-section{
  69. padding: 30px;
  70. float: left;
  71. width: 100%;
  72. }
  73. .top-section .box-type {
  74. box-shadow: 0 0px 8px rgba(0, 0, 0, 0.3);
  75. padding: 25px;
  76. float: left;
  77. width: 100%;
  78. border-radius: 5px;
  79. background: #fff;
  80. }
  81. .wid100 {
  82. width: 100%;
  83. float: left;
  84. }
  85. .dis p {
  86. color: #0397d7 !important;
  87. }
  88. .form-group1 {
  89. display: initial;
  90. margin-bottom: 0px;
  91. }
  92. .form-group1 input {
  93. padding: 0;
  94. height: initial;
  95. width: initial;
  96. margin-bottom: 0;
  97. display: none;
  98. cursor: pointer;
  99. }
  100. .form-group1 label {
  101. position: relative;
  102. cursor: pointer;
  103. }
  104. .form-group1 label:before {
  105. content: \'\';
  106. -webkit-appearance: none;
  107. background-color: transparent;
  108. border: 2px solid #0079bf;
  109. box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0px -15px 10px -12px rgba(0, 0, 0, 0.05);
  110. padding: 6px;
  111. display: inline-block;
  112. position: relative;
  113. vertical-align: middle;
  114. cursor: pointer;
  115. margin-right: 5px;
  116. }
  117. .form-group1 input:checked+label:after {
  118. content: \'\';
  119. display: block;
  120. position: absolute;
  121. top: 5px;
  122. left: 6px;
  123. width: 5px;
  124. height: 9px;
  125. border: solid #0079bf;
  126. border-width: 0 2px 2px 0;
  127. -webkit-transform: rotate(45deg);
  128. transform: rotate(45deg);
  129. }
  130. .section .w100 {
  131. float: left;
  132. width: 100%;
  133. }
  134. .section .w100 .back {
  135. display: inline-block;
  136. cursor: pointer;
  137. }
  138. .section .w100 .back img {
  139. width: 14px;
  140. padding-right: 5px;
  141. }
  142. .section .w100 .back:hover,
  143. .section .w100 .back:focus,
  144. .section .w100 .back:active {
  145. outline: none;
  146. }
  147. .section .w100 .monthly-det {
  148. float: right;
  149. margin: 0 10px 15px 10px;
  150. }
  151. .section .w100 .monthly-det img {
  152. width: 12px;
  153. cursor: pointer;
  154. }
  155. .section .w100 .monthly-det p {
  156. margin: 0;
  157. display: inline-block;
  158. padding: 0 5px;
  159. min-width: 120px;
  160. text-align: center;
  161. }
  162. .section .w100 .btns {
  163. width: auto;
  164. border-radius: 100px;
  165. float: right;
  166. margin: 0;
  167. padding: 6px 40px;
  168. font-size: 14px;
  169. height: auto;
  170. font-weight: 500;
  171. }
  172. .section .w100 .btns.blue {
  173. color: #00334c !important;
  174. border: 2px solid #00334c;
  175. width: 100%;
  176. }
  177. .section h5.tit {
  178. color: #003d58;
  179. }
  180. .section .task-left .logo img {
  181. max-width: 140px;
  182. }
  183. .section .showroom {
  184. text-align: center;
  185. }
  186. .section .showroom h5 {
  187. font-size: 16px;
  188. }
  189. .section .showroom address {
  190. font-size: 14px;
  191. }
  192. .section .quote-detail {
  193. padding: 15px;
  194. }
  195. .section .quote-detail .form-group {
  196. width: 100%;
  197. float: left;
  198. }
  199. .section .quote-detail .form-group label {
  200. width: 35%;
  201. float: left;
  202. line-height: 3;
  203. font-weight: 500;
  204. font-size: 14px;
  205. }
  206. .section .quote-detail .form-group .form-control {
  207. width: 65%;
  208. float: left;
  209. font-size: 14px;
  210. font-weight: 500;
  211. color: #333;
  212. }
  213. .section .quote-table {
  214. border: 1px solid #dee2e6;
  215. }
  216. .section .quote-table thead th {
  217. background: #00334c;
  218. color: #fff;
  219. white-space: nowrap;
  220. min-width: 160px;
  221. text-align: left;
  222. font-size: 14px;
  223. }
  224. .section .quote-table tbody tr td {
  225. font-size: 14px;
  226. font-weight: 500;
  227. border: none;
  228. vertical-align: middle;
  229. text-align: left;
  230. }
  231. .section .quote-table tbody tr td .form-group {
  232. margin-bottom: 0;
  233. }
  234. .section .quote-table tbody tr td .form-group .form-control {
  235. font-size: 14px;
  236. font-weight: 500;
  237. }
  238. .section .quote-table tbody tr td textarea.form-control {
  239. height: 38px;
  240. }
  241. .section .quote-table tbody tr td:before {
  242. display: none;
  243. }
  244. .section .quote-table tbody tr:last-child {
  245. background: #e0e0e0;
  246. }
  247. .section .quote-table tbody tr:nth-child(even) {
  248. background: none;
  249. }
  250. .section .terms h5 {
  251. font-size: 16px;
  252. }
  253. .section .terms p {
  254. margin: 0;
  255. padding: 0;
  256. margin-bottom: 10px;
  257. font-size: 14px;
  258. font-weight: 500;
  259. }
  260. </style>
  261. </head>
  262. <body>
  263. <div class="section task-section">
  264. <div class="top-section">
  265. <div class="box-type task-left">
  266. <div class="row">
  267. <div class="col-sm-3 logo text-center">
  268. <img src="images/logo.png" alt="Logo">
  269. </div>
  270. <div class="col-sm-6 showroom">
  271. <h5>'.$dealer_name.'</h5>
  272. <address>
  273. Showroom : '.$dealer_address.'<br>';
  274. $quotationhtml.=($dealer_phone)?'Tel. : '.$dealer_phone:'';
  275. $quotationhtml.=($dealer_phone && $dealer_email)?", ":'';
  276. $quotationhtml.=($dealer_email)?'Email: '.$dealer_email:'';
  277. $quotationhtml.='</address>
  278. </div>
  279. <div class="col-sm-3 text-center">
  280. <!--h5>'.$dealer_name.'</h5-->
  281. </div>
  282. <div class="col-sm-12 text-center">
  283. <h5 class="tit">QUOTATION FORM</h5>
  284. </div>
  285. <div class="col-sm-12 quote-detail">
  286. <div class="form-group">
  287. <label>Customer Name</label>
  288. <div class="form-control">'.$check_arr['result'][0]->name.'</div>
  289. </div>
  290. <div class="form-group" id="boot-select">
  291. <label> Model</label>
  292. <div class="form-control">'.$model_str.'</div>
  293. </div>
  294. <div class="form-group" id="boot-select">
  295. <label> Variant</label>
  296. <div class="form-control">'.$variant_str.'</div>
  297. </div>
  298. <div class="form-group">
  299. <label>Contact No</label>
  300. <div class="form-control">'.$check_arr['result'][0]->mobile.'</div>
  301. </div>
  302. <div class="form-group">
  303. <label>E-mail</label>
  304. <div class="form-control">'.$check_arr['result'][0]->email.'</div>
  305. </div>
  306. <div class="form-group">
  307. <label>Date</label>
  308. <div class="form-control">'. strtoupper(date('d-M-Y',strtotime($check_arr['result'][0]->created_on))).'</div>
  309. </div>
  310. </div>
  311. <div class="col-sm-12 table-responsive">
  312. <table class="table bordered quote-table">
  313. <thead>
  314. <tr>
  315. <th>Vehicle Quotation</th>
  316. <th>Unit Price</th>
  317. <th>Remarks if any</th>
  318. </tr>
  319. </thead>
  320. <tbody>
  321. <tr>
  322. <td>Ex. Showroom Price</td>
  323. <td>
  324. <div class="form-group">
  325. <div class="form-control">'.$check_arr['result'][0]->exsh_price.'</div>
  326. </div>
  327. </td>
  328. <td>';
  329. //EXSH REMARKS
  330. $quotationhtml.=($check_arr['result'][0]->exsh_remark!='')?'<div class="form-group">
  331. <div class="form-control">'.$check_arr['result'][0]->exsh_remark.'</div>
  332. </div>':'';
  333. $quotationhtml.='</td>
  334. </tr>
  335. <tr>
  336. <td>Road Tax/ RTO Charges</td>
  337. <td>
  338. <div class="form-group">
  339. <div class="form-control">'.$check_arr['result'][0]->rto_price.'</div>
  340. </div>
  341. </td>
  342. <td>';
  343. //RTO REMARKS
  344. $quotationhtml.=($check_arr['result'][0]->rto_remark!='')?'<div class="form-group">
  345. <div class="form-control">'.$check_arr['result'][0]->rto_remark.'</div>
  346. </div>':'';
  347. $quotationhtml.='</td>
  348. </tr>
  349. <tr>
  350. <td>Insurance</td>
  351. <td>
  352. <div class="form-group">
  353. <div class="form-control">'.$check_arr['result'][0]->insurance_price.'</div>
  354. </div>
  355. </td>
  356. <td>';
  357. //INSURANCE
  358. $quotationhtml.=($check_arr['result'][0]->insurance_remark!='')?'<div class="form-group">
  359. <div class="form-control">'.$check_arr['result'][0]->insurance_remark.'</div>
  360. </div>':'';
  361. $quotationhtml.='</td>
  362. </tr>
  363. <tr>
  364. <td>Accessories</td>
  365. <td>
  366. <div class="form-group">
  367. <div class="form-control">'.$check_arr['result'][0]->access_price.'</div>
  368. </div>
  369. </td>
  370. <td>';
  371. //ACCESSORIES
  372. $quotationhtml.=($check_arr['result'][0]->access_remark!='')?'<div class="form-group">
  373. <div class="form-control">'.$check_arr['result'][0]->access_remark.'</div>
  374. </div>':'';
  375. $quotationhtml.='</td>
  376. </tr>
  377. <tr>
  378. <td>Extended Warranty</td>
  379. <td>
  380. <div class="form-group">
  381. <div class="form-control">'.$check_arr['result'][0]->exwarr_price.'</div>
  382. </div>
  383. </td>
  384. <td>';
  385. //EXTENDED WARRANTY
  386. $quotationhtml.=($check_arr['result'][0]->access_remark!='')?'<div class="form-group">
  387. <div class="form-control">'.$check_arr['result'][0]->exwarr_remark.'</div>
  388. </div>':'';
  389. $quotationhtml.='</td>
  390. </tr>
  391. <tr>
  392. <td>Others</td>
  393. <td>
  394. <div class="form-group">
  395. <div class="form-control">'.$check_arr['result'][0]->other_price.'</div>
  396. </div>
  397. </td>
  398. <td>';
  399. //OTHERS
  400. $quotationhtml.=($check_arr['result'][0]->other_remark!='')?'<div class="form-group">
  401. <div class="form-control">'.$check_arr['result'][0]->other_remark.'</div>
  402. </div>':'';
  403. $quotationhtml.='</td>
  404. </tr>
  405. <tr>
  406. <td>Total On-Road Price</td>
  407. <td>
  408. <div class="form-group">
  409. <div class="form-control">'.$check_arr['result'][0]->total_price.'</div>
  410. </div>
  411. </td>
  412. <td>
  413. </td>
  414. </tr>';
  415. $quotationhtml.=($check_arr['result'][0]->discount!='')?'<tr>
  416. <td>Offer/Discount</td>
  417. <td>
  418. <div class="form-group">
  419. <div class="form-control">'.$check_arr['result'][0]->discount.'</div>
  420. </div>
  421. </td>
  422. <td>
  423. </td>
  424. </tr>':'';
  425. $quotationhtml.=($check_arr['result'][0]->discount!='')?'<tr>
  426. <td>Price after Discount</td>
  427. <td>
  428. <div class="form-group">
  429. <div class="form-control">'.$check_arr['result'][0]->final_price.'</div>
  430. </div>
  431. </td>
  432. <td>
  433. </td>
  434. </tr>':'';
  435. $quotationhtml.='</tbody>
  436. </table>
  437. </div>
  438. <div class="col-sm-12 terms">
  439. <h5>T&C:</h5>
  440. <p>1) The above prices are inclusive of all Taxes</p>
  441. <p>2) This Quote is valid till '.date('d-m-Y',strtotime($check_arr['result'][0]->validity_date)).' Only</p>
  442. <p>3) The above prices are subject to change without any notice & the prices prevailing at the time
  443. of delivery shall be charged</p>
  444. <p>This is system generated vehicle quotation only, does not require any signature.</p>
  445. </div>
  446. </div>
  447. </div>
  448. </div>
  449. </div>
  450. </body>
  451. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
  452. <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
  453. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
  454. </html>';
  455. echo $quotationhtml;
  456. exit;
  457. ?>