Advertisement
teague

Untitled

Jun 7th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.13 KB | None | 0 0
  1. <?php
  2. require_once('lines_config.php');
  3. require_once('marathon.php');
  4. $domain_prefix = '/rsklines/';
  5. $mar_length = 100;
  6. $template_text = 'До конца стодневки осталось {$remains} дней';
  7. $marathons = new Marathons();
  8. $rows = $marathons->getMarathons();
  9. ?>
  10. <!DOCTYPE html>
  11. <html lang="en">
  12.  
  13. <head>
  14.  
  15. <meta charset="utf-8">
  16. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  17. <meta name="viewport" content="width=device-width, initial-scale=1">
  18. <meta name="description" content="">
  19. <meta name="author" content="">
  20.  
  21. <title>Линейки для стодневок бросающих курить</title>
  22.  
  23. <!-- Bootstrap Core CSS - Uses Bootswatch Flatly Theme: http://bootswatch.com/flatly/ -->
  24. <link href="<?= $domain_prefix ?>css/bootstrap.min.css" rel="stylesheet">
  25.  
  26. <!-- Custom CSS -->
  27. <link href="<?= $domain_prefix ?>css/freelancer.css" rel="stylesheet">
  28.  
  29. <!-- Custom Fonts -->
  30. <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
  31. <link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
  32. <link href="http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css">
  33.  
  34. <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  35. <!--[if lt IE 9]>
  36. <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  37. <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
  38. <![endif]-->
  39. <!-- jQuery -->
  40. <script src="<?= $domain_prefix ?>js/jquery.js"></script>
  41.  
  42. <script>
  43. function uploadImage(idx) {
  44. var content = null, iframe = $('iframe[name="uploadTrg[' + idx + ']"').get(0);
  45. if (iframe.contentDocument) {
  46. content = iframe.contentDocument.body.innerHTML;
  47. } else if (iframe.contentWindow) {
  48. content = iframe.contentWindow.document.body.innerHTML;
  49. } else if (iframe.document) {
  50. content = iframe.document.body.innerHTML;
  51. }
  52. $('*[id="preview[0]"').attr('src', content);
  53.  
  54. }
  55. </script>
  56. </head>
  57.  
  58. <body id="page-top" class="index">
  59.  
  60. <!-- Navigation -->
  61. <nav class="navbar navbar-default navbar-fixed-top">
  62. <div class="container">
  63. <!-- Brand and toggle get grouped for better mobile display -->
  64. <div class="navbar-header page-scroll">
  65. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
  66. <span class="sr-only">Навигация</span>
  67. <span class="icon-bar"></span>
  68. <span class="icon-bar"></span>
  69. <span class="icon-bar"></span>
  70. </button>
  71. <a class="navbar-brand" href="#page-top">Генератор линеек</a>
  72. </div>
  73.  
  74. <!-- Collect the nav links, forms, and other content for toggling -->
  75. <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
  76. <ul class="nav navbar-nav navbar-right">
  77. <li class="hidden">
  78. <a href="#page-top"></a>
  79. </li>
  80. <li class="page-scroll">
  81. <a href="#ndays">Стодневки</a>
  82. </li>
  83. <!-- <li class="page-scroll">
  84. <a href="#about">Обо мне</a>
  85. </li> -->
  86. <li class="page-scroll">
  87. <a href="#contact">Контакты</a>
  88. </li>
  89. </ul>
  90. </div>
  91. <!-- /.navbar-collapse -->
  92. </div>
  93. <!-- /.container-fluid -->
  94. </nav>
  95.  
  96. <!-- Header -->
  97. <!-- <header>
  98. <div class="container">
  99. <div class="row">
  100. <div class="col-lg-12"> -->
  101.  
  102. <!-- <img class="img-responsive" src="img/profile.png" alt="">
  103. <div class="intro-text">
  104. <span class="name">Start Bootstrap</span>
  105. <hr class="star-light">
  106. <span class="skills">Web Developer - Graphic Artist - User Experience Designer</span>
  107. </div>-->
  108. <!-- </div>
  109. </div>
  110. </div>
  111. </header> -->
  112.  
  113. <!-- Ndays Grid Section -->
  114. <section id="ndays">
  115. <div class="container">
  116. <!-- <div class="row">
  117. <div class="col-lg-12 text-center">
  118. <h2>Стодневки</h2>
  119. <hr class="star-primary">
  120. </div>
  121. </div> -->
  122. <?php
  123. if (1 == 0):
  124. foreach ($rows as $key => $row):
  125.  
  126. $result_links = !empty($row['resulting_image']) ?
  127. ('<input value="http://ne-kurim.ru/lines/'.$row['resulting_image'].'" class="form-control team" style="300px !important;">') : '';
  128.  
  129. //('Файл :'.$row['resulting_image'].', ссылка на линейку: <a target="_blank" href="http://'.$_SERVER['HTTP_HOST'].$domain_prefix.'img'.$row['id'].'.jpg">"http://'.$_SERVER['HTTP_HOST'].$domain_prefix.'img'.$row['id'].'.jpg"</a>') : '';
  130. ?>
  131. <section class="marathon-section" id="nday_<?=$key?>">
  132. <div class="container marathon-container">
  133. <header style="display:none;">
  134.  
  135. <div style="float:left">
  136. <span class="badge-id badge badge-success">ID:<?=$row['id']?></span>
  137. <input type="hidden" name="id[<?= $row['id'] ?>]" value="<?=$row['id']?>" />
  138. </div>
  139. <label for="marathon_name_<?= $key ?>">Название марафона</label>
  140. <input style="color:#000" name="marathon_name[<?= $key ?>]" id="marathon_name_<?= $key ?>" value="<?= $row['marathon_name'] ?>" size="48"/>
  141. </header>
  142. <div class="row">
  143.  
  144. <div class="col-md-4 col-lg-4" style="padding-top:25px;display:none;">
  145. <form action="action.php" name="upload_form[<?= $key ?>]" method="post" enctype="multipart/form-data" target="uploadTrg[<?= $key ?>]">
  146. <input type="file" class="form-control" name="add_image[<?= $key ?>]" id="add_image_<?= $key ?>"/>
  147. <!-- <input type="hidden" name="purpose[<?= $key ?>]" value="upload" /> -->
  148. </form>
  149. <iframe id="uploadTrg[<?= $key ?>]" my-required="1" name="uploadTrg[<?= $key ?>]" height="0" width="0" frameborder="0" scrolling="yes" onload="uploadImage(<?= $key ?>)"></iframe>
  150. </div>
  151. <div class="col-md-3 col-lg-3">
  152. <label for="start_date[<?= $key ?>]">Начало марафона</label>
  153. <input type="date" class="form-control" class="start-date" my-required="1" name="start_date[<?= $key ?>]" value="<?= date('Y-m-d', strtotime($row['marathon_start'])) ?>"/>
  154. </div>
  155. <div class="col-md-2 col-lg-2">
  156. <label for="marathon_number">№ марафона</label>
  157. <input type="number" class="form-control" my-required="1" min="1" max="500" name="marathon_number[<?= $key ?>]" id="marathon_number_<?=$key?>" value="<?= $row['marathon_number'] ?>"/>
  158. </div>
  159. <div class="col-md-2 col-lg-2">
  160. <label for="ndays_count">Длительность, дней</label>
  161. <input type="number" class="form-control" my-required="1" min="1" max="500" name="ndays_count[<?= $key ?>]" id="ndays_count_<?=$key?>" value="<?= $row['length'] ?>"/>
  162. </div>
  163. </div>
  164. <div class="row" style="margin-top:20px;">
  165. <div class="col-md-4 col-lg-4">
  166. <label for="occupation">Должность</label>
  167. <?php
  168. $val = intval($row['position']);
  169. ?>
  170. <select id="occupation_<?= $key ?>" class="form-control sel-occupation" name="occupation[<?= $key ?>]" style="width:300px">
  171. <option <?= empty($val) ? "selected" : "" ?> value="0"></option>
  172. <option <?= $val == 1 ? "selected" : "" ?> value="1">Капитан</option>
  173. <option <?= $val == 2 ? "selected" : "" ?> value="2">Заместитель капитана</option>
  174. <option <?= $val == 3 ? "selected" : "" ?> value="3">Мудрец</option>
  175. <option <?= $val == 4 ? "selected" : "" ?> value="4">Помощник рефери</option>
  176. <option <?= $val == 5 ? "selected" : "" ?> value="5">Мотиваторник</option>
  177. <option <?= $val == 6 ? "selected" : "" ?> value="6">Демотиваторник</option>
  178. <option <?= $val == 7 ? "selected" : "" ?> value="7">Позитивник</option>
  179. <option <?= $val == 7 ? "selected" : "" ?> value="8">Другое...</option>
  180. </select>
  181.  
  182. </div>
  183. <div class="col-md-4 col-lg-4 other_occ_container" style="<?= $val == 8 ? '' : 'display:none;' ?> ">
  184. <label for="other_occupation[<?= $key ?>]">Другая должность</label>
  185. <input type="text" class="form-control other_occupation" id="other_occupation_<?= $key ?>" name="other_occupation[<?= $key ?>]" style=" width:300px;"/>
  186. </div>
  187. <div class="col-md-4 col-lg-4 team" >
  188. <label for="team[<?= $key ?>]">Команда</label>
  189. <input type="text" class="form-control team" id="team_<?= $key ?>" name="team[<?= $key ?>]" value="<?=$row['team']?>" style="width:300px;"/>
  190. </div>
  191. </div>
  192. <div class="row" style="display:none;">
  193. <div class="col-md-8 col-lg-8">
  194. <label for="text_template">Текст в подписи </label>
  195. <input type="text" class="form-control" name="text_template[<?= $key ?>]" id="text_template_<?=$key?>" value="<?= $row['text_template']?>"/>
  196. </div>
  197. </div>
  198. <div class="row" style="margin-top:20px;">
  199. <div class="col-md-2 col-lg-2">
  200. <button id="send[<?= $key ?>]" style="font-size:18px;padding:5px;width:180px;">Получить линейку</button>
  201. </div>
  202. <div class="col-md-8 col-lg-8">
  203. <img class="preview" id="preview_<?= $key ?>" style="width:302px;height:32px;display:none;" src="<?= $row['template_path'] ?>" />
  204. <img class="postperform" id="postperform_<?= $key ?>" style="width:302px;height:32px;" src="<?= $row['resulting_image'] ?>"/>
  205. </div>
  206. </div>
  207. <div class="row" style="margin-top:30px;width:500px;">
  208. <div class="col-md-10 col-lg-10">
  209. Скопировать и вставить в подпись:
  210. <span id="post-perform-url_<?= $key ?>" class="text-info post-perform-url"><?=$result_links?></span>
  211. </div>
  212. </div>
  213. </div>
  214. </section>
  215. <?php
  216. endforeach;
  217. echo '<button id="clone">Создать еще одну линейку</button>';
  218. else:
  219. $key = 0;
  220. ?>
  221. <section class="marathon-section" id="nday_<?=$key?>">
  222. <div class="container marathon-container">
  223. <header style="display:none;">
  224.  
  225. <div style="float:left">
  226. <span class="badge-id badge badge-success">ID:<?=$row['id']?></span>
  227. <input type="hidden" name="id[<?= $row['id'] ?>]" value="<?=$row['id']?>" />
  228. </div>
  229. <label for="marathon_name_<?= $key ?>">Название марафона</label>
  230. <input style="color:#000" name="marathon_name[<?= $key ?>]" id="marathon_name_<?= $key ?>" value="Марафон" size="48"/>
  231. </header>
  232. <div class="row">
  233.  
  234. <div class="col-md-4 col-lg-4" style="padding-top:25px;display:none;">
  235. <form action="action.php" name="upload_form[<?= $key ?>]" method="post" enctype="multipart/form-data" target="uploadTrg[<?= $key ?>]">
  236. <input type="file" class="form-control" name="add_image[<?= $key ?>]" id="add_image_<?= $key ?>"/>
  237. <!-- <input type="hidden" name="purpose[<?= $key ?>]" value="upload" /> -->
  238. </form>
  239. <iframe id="uploadTrg[<?= $key ?>]" my-required="1" name="uploadTrg[<?= $key ?>]" height="0" width="0" frameborder="0" scrolling="yes" onload="uploadImage(<?= $key ?>)"></iframe>
  240. </div>
  241. <div class="col-md-3 col-lg-3">
  242. <label for="start_date[<?= $key ?>]">Начало марафона</label>
  243. <input type="date" class="form-control" class="start-date" my-required="1" name="start_date[<?= $key ?>]" value="<?= date('Y-m-d') ?>"/>
  244. </div>
  245. <div class="col-md-2 col-lg-2">
  246. <label for="marathon_number">№ марафона</label>
  247. <input type="number" class="form-control" my-required="1" min="1" max="500" name="marathon_number[<?= $key ?>]" id="marathon_number_<?=$key?>" value="<?=9?>"/>
  248. </div>
  249. <div class="col-md-2 col-lg-2">
  250. <label for="ndays_count">Длительность, дней</label>
  251. <input type="number" class="form-control" my-required="1" min="1" max="500" name="ndays_count[<?= $key ?>]" id="ndays_count_<?=$key?>" value="<?=100?>"/>
  252. </div>
  253. </div>
  254. <div class="row" style="margin-top:20px;">
  255. <div class="col-md-4 col-lg-4">
  256. <label for="occupation">Должность</label>
  257. <?php
  258. $val = intval($row['position']);
  259. ?>
  260. <select id="occupation_<?= $key ?>" class="form-control sel-occupation" name="occupation[<?= $key ?>]" style="width:300px">
  261. <option <?= empty($val) ? "selected" : "" ?> value="0"></option>
  262. <option <?= $val == 1 ? "selected" : "" ?> value="1">Капитан</option>
  263. <option <?= $val == 2 ? "selected" : "" ?> value="2">Заместитель капитана</option>
  264. <option <?= $val == 3 ? "selected" : "" ?> value="3">Мудрец</option>
  265. <option <?= $val == 4 ? "selected" : "" ?> value="4">Помощник рефери</option>
  266. <option <?= $val == 5 ? "selected" : "" ?> value="5">Мотиваторник</option>
  267. <option <?= $val == 6 ? "selected" : "" ?> value="6">Демотиваторник</option>
  268. <option <?= $val == 7 ? "selected" : "" ?> value="7">Позитивник</option>
  269. <option <?= $val == 7 ? "selected" : "" ?> value="8">Другое...</option>
  270. </select>
  271.  
  272. </div>
  273. <div class="col-md-4 col-lg-4 other_occ_container" style="<?= $val == 8 ? '' : 'display:none;' ?> ">
  274. <label for="other_occupation[<?= $key ?>]">Другая должность</label>
  275. <input type="text" class="form-control other_occupation" id="other_occupation_<?= $key ?>" name="other_occupation[<?= $key ?>]" style=" width:300px;"/>
  276. </div>
  277. <div class="col-md-4 col-lg-4 team" >
  278. <label for="team[<?= $key ?>]">Команда</label>
  279. <input type="text" class="form-control team" id="team_<?= $key ?>" name="team[<?= $key ?>]" value="<?=$row['team']?>" style="width:300px;"/>
  280. </div>
  281. </div>
  282. <div class="row" style="display:none;">
  283. <div class="col-md-8 col-lg-8">
  284. <label for="text_template">Текст в подписи </label>
  285. <input type="text" class="form-control" name="text_template[<?= $key ?>]" id="text_template_<?=$key?>" value="<?= $row['text_template']?>"/>
  286. </div>
  287. </div>
  288. <div class="row" style="margin-top:20px;">
  289. <div class="col-md-2 col-lg-2">
  290. <button id="send[<?= $key ?>]" style="font-size:18px;padding:5px;width:180px;">Получить линейку</button>
  291. </div>
  292. <div class="col-md-8 col-lg-8">
  293. <!-- <img class="preview" id="preview_<?= $key ?>" style="width:302px;height:32px;display:none;" src="uploads/100dney" />-->
  294. <img class="postperform" id="postperform_<?= $key ?>" style="width:302px;height:32px;" src="<?= $row['resulting_image'] ?>"/>
  295. </div>
  296. </div>
  297. <div class="row" style="margin-top:30px;width:500px;">
  298. <div class="col-md-10 col-lg-10">
  299. Скопировать и вставить в подпись:
  300. <span id="post-perform-url_<?= $key ?>" class="text-info post-perform-url"><?=$result_links?></span>
  301. </div>
  302. </div>
  303. </div>
  304. </section>
  305. <!-- <button id="clone">Создать еще одну линейку.</button> -->
  306. <?php
  307. endif;
  308. ?>
  309. </div>
  310. </section>
  311. <!-- About Section -->
  312.  
  313.  
  314. <!-- Contact Section -->
  315. <section id="contact">
  316. <div class="container">
  317. <div class="row">
  318. <div class="col-lg-12 text-center">
  319. <h3>Свяжитесь со мной</h3>
  320. <hr class="star-primary">
  321. </div>
  322. </div>
  323.  
  324. </div>
  325.  
  326. </section>
  327.  
  328. <!-- Footer -->
  329. <!-- <footer class="text-center">
  330. <div class="footer-above">
  331. <div class="container">
  332. <div class="row">
  333. <div class="footer-col col-md-4">
  334. <h3>***</h3>
  335. <p>****<br>***</p>
  336. </div>
  337. <div class="footer-col col-md-4">
  338. <h3>Я в Web</h3>
  339. <ul class="list-inline">
  340. <li>
  341. <a href="#" class="btn-social btn-outline"><i class="fa fa-fw fa-facebook"></i></a>
  342. </li>
  343. <li>
  344. <a href="#" class="btn-social btn-outline"><i class="fa fa-fw fa-google-plus"></i></a>
  345. </li>
  346. <li>
  347. <a href="#" class="btn-social btn-outline"><i class="fa fa-fw fa-twitter"></i></a>
  348. </li>
  349. <li>
  350. <a href="#" class="btn-social btn-outline"><i class="fa fa-fw fa-linkedin"></i></a>
  351. </li>
  352. <li>
  353. <a href="#" class="btn-social btn-outline"><i class="fa fa-fw fa-dribbble"></i></a>
  354. </li>
  355. </ul>
  356. </div>
  357. <div class="footer-col col-md-4">
  358. <h3>Фрилансер</h3>
  359.  
  360. </div>
  361. </div>
  362. </div>
  363. </div>
  364. <div class="footer-below">
  365. <div class="container">
  366. <div class="row">
  367. <div class="col-lg-12">
  368. Copyright &copy; Мой сайт
  369. </div>
  370. </div>
  371. </div>
  372. </div>
  373. </footer> -->
  374.  
  375. <!-- Scroll to Top Button (Only visible on small and extra-small screen sizes) -->
  376. <div class="scroll-top page-scroll visible-xs visible-sm">
  377. <a class="btn btn-primary" href="#page-top">
  378. <i class="fa fa-chevron-up"></i>
  379. </a>
  380. </div>
  381.  
  382. <!-- Portfolio Modals -->
  383. <div class="portfolio-modal modal fade" id="portfolioModal1" tabindex="-1" role="dialog" aria-hidden="true">
  384. <div class="modal-content">
  385. <div class="close-modal" data-dismiss="modal">
  386. <div class="lr">
  387. <div class="rl">
  388. </div>
  389. </div>
  390. </div>
  391. <div class="container">
  392. <div class="row">
  393. <div class="col-lg-8 col-lg-offset-2">
  394. <div class="modal-body">
  395. <h2>Project Title</h2>
  396. <hr class="star-primary">
  397. <img src="img/portfolio/cabin.png" class="img-responsive img-centered" alt="">
  398. <p>Use this area of the page to describe your project. The icon above is part of a free icon set by <a href="https://sellfy.com/p/8Q9P/jV3VZ/">Flat Icons</a>. On their website, you can download their free set with 16 icons, or you can purchase the entire set with 146 icons for only $12!</p>
  399. <ul class="list-inline item-details">
  400. <li>Client:
  401. <strong><a href="http://startbootstrap.com">Start Bootstrap</a>
  402. </strong>
  403. </li>
  404. <li>Date:
  405. <strong><a href="http://startbootstrap.com">April 2014</a>
  406. </strong>
  407. </li>
  408. <li>Service:
  409. <strong><a href="http://startbootstrap.com">Web Development</a>
  410. </strong>
  411. </li>
  412. </ul>
  413. <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-times"></i> Close</button>
  414. </div>
  415. </div>
  416. </div>
  417. </div>
  418. </div>
  419. </div>
  420.  
  421. <!-- Bootstrap Core JavaScript -->
  422. <script src="<?= $domain_prefix ?>js/bootstrap.min.js"></script>
  423.  
  424. <!-- Plugin JavaScript -->
  425. <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
  426. <script src="<?= $domain_prefix ?>js/classie.js"></script>
  427. <script src="<?= $domain_prefix ?>js/cbpAnimatedHeader.js"></script>
  428.  
  429. <!-- Contact Form JavaScript -->
  430. <script src="<?= $domain_prefix ?>js/jqBootstrapValidation.js"></script>
  431. <script src="<?= $domain_prefix ?>js/contact_me.js"></script>
  432.  
  433. <!-- Custom Theme JavaScript -->
  434. <script src="<?= $domain_prefix ?>js/freelancer.js"></script>
  435. <!-- a bit of ALEXRSK Interfaces -->
  436. <script src="<?= $domain_prefix ?>js/interface-rsk.js"></script>
  437. </body>
  438.  
  439. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement