PageRenderTime 47ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/showcase/views/compile/%%18^180^180E8F63%%edit.tpl.php

https://github.com/roycocup/Tests
PHP | 192 lines | 175 code | 17 blank | 0 comment | 37 complexity | c550ffb9b531cbc14851180178ec089b MD5 | raw file
  1. <?php /* Smarty version 2.6.18, created on 2008-04-29 17:51:00
  2. compiled from view:job/edit.tpl */ ?>
  3. <?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
  4. smarty_core_load_plugins(array('plugins' => array(array('block', 'form', 'view:job/edit.tpl', 1, false),)), $this); ?>
  5. <?php $this->_tag_stack[] = array('form', array('id' => 'selectClient','name' => 'selectClient','method' => 'post','action' => $this->_tpl_vars['requestUri'],'enctype' => "multipart/form-data")); $_block_repeat=true;smarty_block_form($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>
  6. <fieldset class="form">
  7. <strong><?php echo $this->_tpl_vars['title']; ?>
  8. </strong><br>
  9. <span style="color:red;">
  10. <?php $_from = $this->_tpl_vars['errorMessages']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
  11. foreach ($_from as $this->_tpl_vars['error']):
  12. ?>
  13. <?php echo $this->_tpl_vars['error']; ?>
  14. <br>
  15. <?php endforeach; endif; unset($_from); ?>
  16. </span>
  17. <div id="formDiv">
  18. <label for="select">Please select a client</label><br>
  19. <select name="selectClient[client]" id="selectClient[client]" class="medium" onchange="submit();">
  20. <?php $_from = $this->_tpl_vars['clients']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['client'] = array('total' => count($_from), 'iteration' => 0);
  21. if ($this->_foreach['client']['total'] > 0):
  22. foreach ($_from as $this->_tpl_vars['client']):
  23. $this->_foreach['client']['iteration']++;
  24. ?>
  25. <?php if (($this->_foreach['client']['iteration'] <= 1)): ?>
  26. <option value=""> </option>
  27. <?php endif; ?>
  28. <option <?php if ($this->_tpl_vars['posted']['client']['id'] == $this->_tpl_vars['client']->id): ?> selected <?php endif; ?>value="<?php echo $this->_tpl_vars['client']->id; ?>
  29. "><?php echo $this->_tpl_vars['client']->name; ?>
  30. </option>
  31. <?php endforeach; endif; unset($_from); ?>
  32. </select>
  33. <br><br>
  34. </div>
  35. </fieldset>
  36. <?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_form($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); } array_pop($this->_tag_stack); ?>
  37. <?php if ($this->_tpl_vars['selectJob'] == 1): ?>
  38. <?php $this->_tag_stack[] = array('form', array('id' => 'selectJob','name' => 'selectJob','method' => 'post','action' => $this->_tpl_vars['requestUri'],'enctype' => "multipart/form-data")); $_block_repeat=true;smarty_block_form($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>
  39. <fieldset class="form">
  40. <div id="formDiv">
  41. <label for="selectJob">Please select a job number</label><br>
  42. <select name="selectJob[jobId]" id="selectJob[jobId]" class="medium" onchange="submit();">
  43. <?php $_from = $this->_tpl_vars['jobNumbers']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['job'] = array('total' => count($_from), 'iteration' => 0);
  44. if ($this->_foreach['job']['total'] > 0):
  45. foreach ($_from as $this->_tpl_vars['job']):
  46. $this->_foreach['job']['iteration']++;
  47. ?>
  48. <?php if (($this->_foreach['job']['iteration'] <= 1)): ?>
  49. <option value=""> </option>
  50. <?php endif; ?>
  51. <option <?php if ($this->_tpl_vars['posted']['jobId'] == $this->_tpl_vars['job']->job_id): ?> selected <?php endif; ?> value="<?php echo $this->_tpl_vars['job']->job_id; ?>
  52. "><?php echo $this->_tpl_vars['job']->job_number; ?>
  53. - <?php echo $this->_tpl_vars['job']->title; ?>
  54. </option>
  55. <?php endforeach; endif; unset($_from); ?>
  56. </select>
  57. <br><br>
  58. </div>
  59. <input type="hidden" value=<?php echo $this->_tpl_vars['posted']['client']['id']; ?>
  60. name="selectJob[client]" />
  61. </fieldset>
  62. <?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_form($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); } array_pop($this->_tag_stack); ?>
  63. <?php endif; ?>
  64. <?php if ($this->_tpl_vars['jobChosen'] != ''): ?>
  65. <?php $this->_tag_stack[] = array('form', array('id' => 'editJob','name' => 'editJob','method' => 'post','action' => $this->_tpl_vars['requestUri'],'enctype' => "multipart/form-data")); $_block_repeat=true;smarty_block_form($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>
  66. <fieldset class="form">
  67. <div id="formDiv">
  68. <label for="editJob[jobNumber]">Please input a NEW job number</label>
  69. <br>
  70. <input type="text" class="medium" name="editJob[number]" <?php if ($this->_tpl_vars['posted']['jobNumber'] != ''): ?> value=<?php echo $this->_tpl_vars['posted']['jobNumber']; ?>
  71. <?php endif; ?> />
  72. <br><br>
  73. <label for="editJob[title]">Please type in a title (Max: 70 Chars)</label>
  74. <br>
  75. <input <?php if ($this->_tpl_vars['posted']['title'] != ''): ?>value="<?php echo $this->_tpl_vars['posted']['title']; ?>
  76. " <?php endif; ?> type="text" name="editJob[title]" id="editJob[title]" class="medium" size="50" />
  77. <br><br>
  78. <label for="editJob[description]">Please type in a description</label>
  79. <br>
  80. <textarea cols="50" name="editJob[description]" id="editJob[description]" class="medium"><?php echo $this->_tpl_vars['posted']['description']; ?>
  81. </textarea>
  82. <br><br>
  83. <label for="editJob[image]">Please upload an image as main</label>
  84. <br>
  85. <input type="file" size="25" name="image" />
  86. <?php if ($this->_tpl_vars['posted']['media']['images']['0']['name']): ?> Preview <?php echo $this->_tpl_vars['posted']['media']['images']['0']['name']; ?>
  87. <img src="<?php echo $this->_tpl_vars['posted']['media']['images']['0']['path']; ?>
  88. " height="50" width="50" onclick="window.open('<?php echo $this->_tpl_vars['posted']['media']['images']['0']['path']; ?>
  89. '); " /><?php endif; ?>
  90. Alter description (optional) <input type="text" name="editJob[imageAlt]" class="medium" <?php if ($this->_tpl_vars['posted']['media']['images']['0']['description'] != ''): ?> value="<?php echo $this->_tpl_vars['posted']['media']['images']['0']['description']; ?>
  91. " <?php endif; ?> />
  92. <br><br>
  93. <label for="editJob[thumb]">Please upload an image as secondary</label>
  94. <br>
  95. <input type="file" size="25" name="thumb" />
  96. <?php if ($this->_tpl_vars['posted']['media']['thumbs']['0']['name']): ?> Preview <?php echo $this->_tpl_vars['posted']['media']['thumbs']['0']['name']; ?>
  97. <img src="<?php echo $this->_tpl_vars['posted']['media']['thumbs']['0']['path']; ?>
  98. " height="50" width="50" onclick="window.open('<?php echo $this->_tpl_vars['posted']['media']['thumbs']['0']['path']; ?>
  99. '); " /><?php endif; ?>
  100. Alter description (optional) <input type="text" name="editJob[thumbAlt]" class="medium" <?php if ($this->_tpl_vars['posted']['media']['thumbs']['0']['description'] != ''): ?> value="<?php echo $this->_tpl_vars['posted']['media']['thumbs']['0']['description']; ?>
  101. " <?php endif; ?> />
  102. <br><br><br>
  103. <label for="editJob[document]">Please upload the briefing document (.doc and .pdf only)</label>
  104. <br>
  105. <input type="file" size="25" name="document" />
  106. <a href="/download<?php echo $this->_tpl_vars['posted']['media']['documents']['0']['path']; ?>
  107. "><?php echo $this->_tpl_vars['posted']['media']['documents']['0']['name']; ?>
  108. <a/> Description (optional) <input type="text" name="editJob[docdescription]" class="medium" <?php if ($this->_tpl_vars['posted']['media']['documents']['0']['description'] != ''): ?> value=<?php echo $this->_tpl_vars['posted']['media']['documents']['0']['description']; ?>
  109. <?php endif; ?>></input>
  110. <br><br>
  111. <label for="editJob[datePublished]">Please input the date of publishing (dd/mm/YYYY)</label>
  112. <br>
  113. <div id="date">
  114. <input type="text" id="editJob[datePublished]" name="editJob[datePublished]" <?php if ($this->_tpl_vars['posted']['datePublished'] != ''): ?> value=<?php echo $this->_tpl_vars['posted']['datePublished']->tostring('dd/MM/YYYY'); ?>
  115. <?php endif; ?> />
  116. <a id="calendar"><img src="/images/icons/calendar.gif" /></a>
  117. </div>
  118. <br><br>
  119. <label for="select">Please select a status</label><br>
  120. <select name="editJob[status]" id="editJob[status]" class="medium">
  121. <?php $_from = $this->_tpl_vars['status']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
  122. foreach ($_from as $this->_tpl_vars['state']):
  123. ?>
  124. <option <?php if ($this->_tpl_vars['posted']['status']->id == $this->_tpl_vars['state']['id']): ?> selected <?php endif; ?> value="<?php echo $this->_tpl_vars['state']['id']; ?>
  125. "><?php echo $this->_tpl_vars['state']['name']; ?>
  126. </option>
  127. <?php endforeach; endif; unset($_from); ?>
  128. </select>
  129. <br><br><br>
  130. <input type="hidden" value=<?php echo $this->_tpl_vars['posted']['client']['id']; ?>
  131. name="editJob[client]" />
  132. <input type="hidden" value=<?php echo $this->_tpl_vars['posted']['jobId']; ?>
  133. name="editJob[jobId]" />
  134. <input type="hidden" value="<?php echo $this->_tpl_vars['posted']['media']['images']['0']['name']; ?>
  135. " name="editJob[oldImageName]" />
  136. <input type="hidden" value="<?php echo $this->_tpl_vars['posted']['media']['thumbs']['0']['name']; ?>
  137. " name="editJob[oldThumbName]" />
  138. <input type="hidden" value="<?php echo $this->_tpl_vars['posted']['media']['documents']['0']['name']; ?>
  139. " name="editJob[oldDocName]" />
  140. <input type="submit" value="Save" />
  141. <a href="/admin/content/index/<?php echo $this->_tpl_vars['posted']['jobId']; ?>
  142. /<?php echo $this->_tpl_vars['posted']['client']['id']; ?>
  143. "><button> Add/Edit Phases for this job</button></a>
  144. </div>
  145. </fieldset>
  146. <?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_form($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); } array_pop($this->_tag_stack); ?>
  147. <div id="formDiv">
  148. <form action="/admin/job/delete/" Method="POST">
  149. <input type="hidden" value="<?php echo $this->_tpl_vars['posted']['client']['name']; ?>
  150. " name="deleteJob[clientName]" />
  151. <input type="hidden" value="<?php echo $this->_tpl_vars['posted']['client']['id']; ?>
  152. " name="deleteJob[clientId]" />
  153. <input type="hidden" value="<?php echo $this->_tpl_vars['posted']['jobId']; ?>
  154. " name="deleteJob[jobId]" />
  155. <input type="hidden" value="<?php echo $this->_tpl_vars['posted']['media']['images']['0']['name']; ?>
  156. " name="deleteJob[oldImageName]" />
  157. <input type="hidden" value="<?php echo $this->_tpl_vars['posted']['media']['thumbs']['0']['name']; ?>
  158. " name="deleteJob[oldThumbName]" />
  159. <input type="hidden" value="<?php echo $this->_tpl_vars['posted']['media']['documents']['0']['name']; ?>
  160. " name="deleteJob[oldDocName]" />
  161. <button onclick="return confirm('Are you sure you want to delete?');"> Delete Job</button>
  162. </form>
  163. </div>
  164. <?php echo '
  165. <script type="text/javascript">
  166. Calendar.setup(
  167. {
  168. inputField : "editJob[datePublished]", // ID of the input field
  169. ifFormat : "%d/%m/%Y", // the date format
  170. button : "calendar" // ID of the button
  171. }
  172. );
  173. </script>
  174. '; ?>
  175. <?php endif; ?>