PageRenderTime 44ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/public/admin-console/application/views/site_content.php

https://gitlab.com/vince.omega/mcb-nov-build
PHP | 194 lines | 161 code | 29 blank | 4 comment | 6 complexity | 87441a9f59a76b17b16ed65dfce81c16 MD5 | raw file
  1. <?php defined('SYSPATH') OR die('No direct access allowed.'); ?>
  2. <?php echo html::script(array (url::base().'media/js/fckeditor/fckeditor.js'), FALSE); ?>
  3. <script type="text/javascript">
  4. window.onload = function()
  5. {
  6. // Automatically calculates the editor base path based on the _samples directory.
  7. // This is usefull only for these samples. A real application should use something like this:
  8. // oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
  9. var sBasePath = '<?php echo url::base() ?>/media/js/fckeditor/';
  10. var oFCKeditor = new FCKeditor( 'categoryDescription' ) ;
  11. oFCKeditor.Width = '100%' ;
  12. oFCKeditor.Height = '512' ;
  13. oFCKeditor.BasePath = sBasePath ;
  14. oFCKeditor.ReplaceTextarea() ;
  15. var oFCKeditor = new FCKeditor( 'categoryShortDescription' ) ;
  16. oFCKeditor.Width = '100%' ;
  17. oFCKeditor.Height = '300' ;
  18. oFCKeditor.BasePath = sBasePath ;
  19. oFCKeditor.ReplaceTextarea() ;
  20. }
  21. </script>
  22. <?php
  23. $id = $this->uri->segment(3);
  24. $category = Category::getCategoryById($id);
  25. $categories = Category::getAll();
  26. $products = Category::getProductsByCategory($id);
  27. ?>
  28. <form action="<?php echo url::base() . $this->uri->segment(1). '/' . $this->uri->segment(2) . '/' .$id ?>" method="POST" enctype="multipart/form-data" id="form" >
  29. <div id="mainContent" >
  30. <div class="box">
  31. <div class="left"></div>
  32. <div class="right"></div>
  33. <div class="heading"><h2 id="heading">Category</h2>
  34. <span id="buttons">
  35. <input type="submit" name="save" value="Save" class="css-button">
  36. <input type="button" onclick="location = '<?php echo url::base() . $this->uri->segment(1) ?>'" value='Cancel' class="css-button" />
  37. </span>
  38. </div>
  39. </div>
  40. <div id="contentLeft">
  41. <div id="tabs" class="htabs" >
  42. <a tab="#tab_general">General</a>
  43. <a tab="#tab_meta_infromation">Meta Information</a>
  44. <!--<a tab="#tab_category_products">Category Products</a>-->
  45. </div>
  46. </div>
  47. <div id="contentRight">
  48. <div id="tab_general">
  49. <div class="headline">General Information</div>
  50. <table>
  51. <colgroup>
  52. <col width="150" />
  53. <col width="500" />
  54. </colgroup>
  55. <tr>
  56. <td><label for="categoryName">Name</label></td>
  57. <td><input type="text" name="categoryName" id="categoryName" class="formText" value="<?php echo html::specialchars($category->name); ?>" /></td>
  58. </tr>
  59. <tr>
  60. <td><label for="categoryDescription">Description</label></td>
  61. <td><textarea name="categoryDescription" id="categoryDescription" class="formText"><?php echo $category->categories_description->description ?></textarea></td>
  62. </tr>
  63. <tr>
  64. <td><label for="categoryShortDescription">Short Description</label></td>
  65. <td><textarea name="categoryShortDescription" id="categoryShortDescription" class="formText"><?php echo $category->categories_description->short_description ?></textarea></td>
  66. </tr>
  67. <tr>
  68. <td><label for="categoryParent">Parent category</label></td>
  69. <td>
  70. <select name="categoryParent" id="categoryParent" class="formSelect">
  71. <option value='0'></option>
  72. <?php
  73. foreach ($categories as $key=>$value){
  74. $sel = '';
  75. $disable = '';
  76. if ($key == $category->parent_id)
  77. $sel = 'selected=selected';
  78. if ($key == $category->id)
  79. $disable = 'disabled';
  80. echo '<option value="'.$key.'" '.$sel. $disable .'>'.$value.'</option>';
  81. }
  82. ?>
  83. </select>
  84. </td>
  85. </tr>
  86. <tr>
  87. <td><label for="image">Image</label></td>
  88. <td><input type="file" name="image" id="image" class="formText" /></td>
  89. </tr>
  90. <tr>
  91. <td><label for="image_alt">Image alt value</label></td>
  92. <td><input type="text" id="image_alt" class="formText" name="image_alt" value="<?php echo $category->categories_description->image_alt; ?>" /></td>
  93. </tr>
  94. <tr>
  95. <td><?php if( $category->categories_description->image) { ?>
  96. <img src="/env/category_images/<?php echo $category->categories_description->image; ?>" />
  97. <?php }
  98. else echo '&nbsp;';
  99. ?>
  100. </td>
  101. <td></td>
  102. </tr>
  103. </table>
  104. </div> <!-- div id="tab_general" -->
  105. <div id="tab_meta_infromation">
  106. <div class="headline">Meta Information</div>
  107. <table>
  108. <colgroup>
  109. <col width="150" />
  110. <col />
  111. </colgroup>
  112. <tr>
  113. <td><label for="metaTitle">Meta Title</label></td>
  114. <td><input id="metaTitle" type="text" class="formText" name="metaTitle" value="<?php echo html::specialchars($category->categories_description->meta_title, FALSE) ?>" /></td>
  115. </tr>
  116. <tr>
  117. <td><label for="metaDescription">Description</label></td>
  118. <td><textarea id="metaDescription" class="formText" name="metaDescription"><?php echo $category->categories_description->meta_description ?></textarea></td>
  119. </tr>
  120. <tr>
  121. <td><label for="metaKeywords">Keywords</label></td>
  122. <td><textarea id="metaKeywords" class="formText" name="metaKeywords"><?php echo $category->categories_description->meta_keywords?></textarea></td>
  123. </tr>
  124. <tr>
  125. <td><label for="metaUrl">URL</label></td>
  126. <td><input id="metaUrl" type="text" class="formText" name="metaUrl" value="<?php echo html::specialchars($category->categories_description->title_url, FALSE) ?>" /></td>
  127. </tr>
  128. </table>
  129. </div> <!-- div id="tab_meta_infromation" -->
  130. <!--
  131. <div id="tab_category_products">
  132. <div class="headline">Category Products</div>
  133. <table class="list">
  134. <col width="35" />
  135. <col width="20" />
  136. <col width="20"/>
  137. <col width="20" />
  138. <col width="100" />
  139. <tr>
  140. <th><input type="checkbox" id="" onClick="$('input[name*=\'selected\']').attr('checked', this.checked);" /></th>
  141. <th>ID</th>
  142. <th>Product Name</th>
  143. <th>Price</th>
  144. <th>Product Description</th>
  145. </tr>
  146. <?php
  147. foreach($products as $pr){
  148. $product = Product::getProductByID($pr->id);
  149. echo '<tr>
  150. <td class="centered"><input type="checkbox" id="" name="selected[]" /></td>
  151. <td align="right">'. $product->id .'</td>
  152. <td>'. $product->name.'</td>
  153. <td align="right">'. '$'. number_format($product->price, 2).'</td>
  154. <td>'. $product->products_description->description.'</td>
  155. </tr>';
  156. }
  157. ?>
  158. </table>
  159. </div> -->
  160. </div>
  161. </div>
  162. </form>
  163. <script type="text/javascript"><!--
  164. $.tabs('#tabs a', '<?php echo isset($_POST['selected_tab']) ? $_POST['selected_tab'] : '#tab_general'?>');
  165. //--></script>