PageRenderTime 40ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/admin/admin_template/printed_settings.inc.php

https://gitlab.com/mucill/sman7
PHP | 185 lines | 122 code | 18 blank | 45 comment | 5 complexity | 086935ef384e1f3d27ce1b88430cd464 MD5 | raw file
  1. <?php
  2. /**
  3. * SENAYAN application printable data configuration
  4. *
  5. * Copyright (C) 2007,2008 Arie Nugraha (dicarve@yahoo.com)
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. *
  21. */
  22. /**
  23. * Function to load and override print settings from database
  24. */
  25. function loadPrintSettings($dbs, $type) {
  26. global $sysconf;
  27. $barcode_settings_q = $dbs->query("SELECT setting_value FROM setting WHERE setting_name='".$type."_print_settings'");
  28. if ($barcode_settings_q->num_rows) {
  29. $barcode_settings_d = $barcode_settings_q->fetch_row();
  30. if ($barcode_settings_d[0]) {
  31. $barcode_settings = @unserialize($barcode_settings_d[0]);
  32. if (is_array($barcode_settings) && count($barcode_settings) > 0) {
  33. foreach ($barcode_settings as $setting_name => $val) {
  34. $sysconf['print'][$type][$setting_name] = $val;
  35. }
  36. }
  37. return $sysconf['print'][$type];
  38. }
  39. }
  40. }
  41. // label print settings
  42. /* measurement in cm */
  43. $sysconf['print']['label']['page_margin'] = 0.2;
  44. $sysconf['print']['label']['items_per_row'] = 3;
  45. $sysconf['print']['label']['items_margin'] = 0.05;
  46. $sysconf['print']['label']['box_width'] = 8;
  47. $sysconf['print']['label']['box_height'] = 3.3;
  48. $sysconf['print']['label']['include_header_text'] = 1; // change to 0 if dont want to use header in each label
  49. $sysconf['print']['label']['header_text'] = ''; // keep empty if you want to use Library Name as a header text
  50. $sysconf['print']['label']['fonts'] = "Arial, Verdana, Helvetica, 'Trebuchet MS'";
  51. $sysconf['print']['label']['font_size'] = 11;
  52. $sysconf['print']['label']['border_size'] = 1; // in pixels
  53. // item barcode print settings
  54. /* measurement in cm */
  55. $sysconf['print']['barcode']['barcode_page_margin'] = 0.2;
  56. $sysconf['print']['barcode']['barcode_items_per_row'] = 3;
  57. $sysconf['print']['barcode']['barcode_items_margin'] = 0.1;
  58. $sysconf['print']['barcode']['barcode_box_width'] = 7;
  59. $sysconf['print']['barcode']['barcode_box_height'] = 5;
  60. $sysconf['print']['barcode']['barcode_include_header_text'] = 1; // change to 0 if dont want to use header in each barcode
  61. $sysconf['print']['barcode']['barcode_cut_title'] = 50; // maximum characters in title to appear in each barcode. change to 0 if you dont want the title cutted
  62. $sysconf['print']['barcode']['barcode_header_text'] = ''; // keep empty if you want to use Library Name as a header text
  63. $sysconf['print']['barcode']['barcode_fonts'] = "Arial, Verdana, Helvetica, 'Trebuchet MS'"; // font to use
  64. $sysconf['print']['barcode']['barcode_font_size'] = 11;
  65. $sysconf['print']['barcode']['barcode_scale'] = 70; // barcode scale in percent relative to box width and height
  66. $sysconf['print']['barcode']['barcode_border_size'] = 1; // in pixels
  67. // barcode generator print settings
  68. $sysconf['print']['barcodegen']['box_width'] = 6;
  69. $sysconf['print']['barcodegen']['page_margin'] = 0.2;
  70. $sysconf['print']['barcodegen']['items_margin'] = 0.05;
  71. $sysconf['print']['barcodegen']['include_border'] = 0;
  72. $sysconf['print']['barcodegen']['items_per_row'] = 3;
  73. /* Receipt Printing */
  74. $sysconf['print']['receipt']['receipt_width'] = '7cm';
  75. $sysconf['print']['receipt']['receipt_font'] = 'Courier';
  76. $sysconf['print']['receipt']['receipt_color'] = '#000';
  77. $sysconf['print']['receipt']['receipt_margin'] = '5px';
  78. $sysconf['print']['receipt']['receipt_padding'] = '10px';
  79. $sysconf['print']['receipt']['receipt_border'] = '1px dashed #000';
  80. $sysconf['print']['receipt']['receipt_fontSize'] = '7pt';
  81. $sysconf['print']['receipt']['receipt_header_fontSize'] = '7pt';
  82. $sysconf['print']['receipt']['receipt_titleLength'] = 100;
  83. // member card print settings
  84. /* measurement in cm */
  85. $sysconf['print']['membercard']['page_margin'] = 0.2;
  86. $sysconf['print']['membercard']['items_margin'] = 0.1;
  87. $sysconf['print']['membercard']['items_per_row'] = 1; //
  88. // by Jushadi Arman Saz
  89. /* measurement in cm*/
  90. $sysconf['print']['membercard']['factor'] = "37.795275591"; //cm to px
  91. // Items Settings
  92. // change to 0 if dont want to use selected items
  93. $sysconf['print']['membercard']['include_id_label'] = 1; // id
  94. $sysconf['print']['membercard']['include_name_label'] = 1; // name
  95. $sysconf['print']['membercard']['include_pin_label'] = 1; // identify
  96. $sysconf['print']['membercard']['include_inst_label'] = 0; // institution
  97. $sysconf['print']['membercard']['include_email_label'] = 0; // mail address
  98. $sysconf['print']['membercard']['include_address_label'] = 1; // home or office address
  99. $sysconf['print']['membercard']['include_barcode_label'] = 1; // barcode
  100. $sysconf['print']['membercard']['include_expired_label'] = 1; // expired date
  101. // Cardbox Settings
  102. $sysconf['print']['membercard']['box_width'] = 8.6;
  103. $sysconf['print']['membercard']['box_height'] = 5.4;
  104. $sysconf['print']['membercard']['front_side_image'] = 'membercard_background.jpg';
  105. $sysconf['print']['membercard']['back_side_image'] = 'membercard_background.jpg';
  106. // Logo Setting
  107. $sysconf['print']['membercard']['logo'] = "logo.png";
  108. $sysconf['print']['membercard']['front_logo_width'] = "";
  109. $sysconf['print']['membercard']['front_logo_height'] = "";
  110. $sysconf['print']['membercard']['front_logo_left'] = "";
  111. $sysconf['print']['membercard']['front_logo_top'] = "";
  112. $sysconf['print']['membercard']['back_logo_width'] = "";
  113. $sysconf['print']['membercard']['back_logo_height'] = "";
  114. $sysconf['print']['membercard']['back_logo_left'] = "";
  115. $sysconf['print']['membercard']['back_logo_top'] = "";
  116. // Photo Settings
  117. $sysconf['print']['membercard']['photo_left'] = "";
  118. $sysconf['print']['membercard']['photo_top'] = "";
  119. $sysconf['print']['membercard']['photo_width'] = 1.5;
  120. $sysconf['print']['membercard']['photo_height'] = 1.8;
  121. // Header Settings
  122. $sysconf['print']['membercard']['front_header1_text'] = 'Library Member Card'; // use <br /> tag to make another line
  123. $sysconf['print']['membercard']['front_header1_font_size'] = '12';
  124. $sysconf['print']['membercard']['front_header2_text'] = 'My Library';
  125. $sysconf['print']['membercard']['front_header2_font_size'] = '12';
  126. $sysconf['print']['membercard']['back_header1_text'] = 'My Library';
  127. $sysconf['print']['membercard']['back_header1_font_size'] = "12";
  128. $sysconf['print']['membercard']['back_header2_text'] = 'My Library Full Address and Website';
  129. $sysconf['print']['membercard']['back_header2_font_size'] = "5";
  130. $sysconf['print']['membercard']['header_color'] = "#0066FF"; //e.g. :#0066FF, green, etc.
  131. //biodata settings
  132. $sysconf['print']['membercard']['bio_font_size'] = "11";
  133. $sysconf['print']['membercard']['bio_font_weight'] = "bold";
  134. $sysconf['print']['membercard']['bio_label_width'] = "100";
  135. // Stamp Settings
  136. $sysconf['print']['membercard']['city'] = "City Name";
  137. $sysconf['print']['membercard']['title'] = "Library Manager";
  138. $sysconf['print']['membercard']['officials'] = "Librarian Name";
  139. $sysconf['print']['membercard']['officials_id'] = "Librarian ID";
  140. $sysconf['print']['membercard']['stamp_file'] = "stamp.png"; // stamp image, use transparent image
  141. $sysconf['print']['membercard']['signature_file'] = "signature.png"; // sign picture, use transparent image
  142. $sysconf['print']['membercard']['stamp_left'] = "";
  143. $sysconf['print']['membercard']['stamp_top'] = "";
  144. $sysconf['print']['membercard']['stamp_width'] = "";
  145. $sysconf['print']['membercard']['stamp_height'] = "";
  146. //expired
  147. $sysconf['print']['membercard']['exp_left'] = "";
  148. $sysconf['print']['membercard']['exp_top'] = "";
  149. $sysconf['print']['membercard']['exp_width'] = "";
  150. $sysconf['print']['membercard']['exp_height'] = "";
  151. // Barcode Setting
  152. $sysconf['print']['membercard']['barcode_scale'] = 100; // barcode scale in percent relative to box width and height
  153. $sysconf['print']['membercard']['barcode_left'] = "";
  154. $sysconf['print']['membercard']['barcode_top'] = "";
  155. $sysconf['print']['membercard']['barcode_width'] = "";
  156. $sysconf['print']['membercard']['barcode_height'] = "";
  157. // Rules
  158. $sysconf['print']['membercard']['rules'] = "<ul>
  159. <li>This card is published by Library.</li>
  160. <li>Please return this card to its owner if you found it.</li>
  161. </ul>";
  162. $sysconf['print']['membercard']['rules_font_size'] = "8";
  163. // address
  164. $sysconf['print']['membercard']['address'] = 'My Library<br />website: http://slims.web.id, email : librarian@slims.web.id';
  165. $sysconf['print']['membercard']['address_font_size'] = "7";
  166. $sysconf['print']['membercard']['address_left'] = "";
  167. $sysconf['print']['membercard']['address_top'] = "";