Changeset 2620128
- Timestamp:
- 10/26/2021 12:06:45 PM (4 years ago)
- Location:
- mbm-ipak/trunk
- Files:
-
- 4 edited
-
include/ajax/form.php (modified) (8 diffs)
-
mbm-ipak.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
-
view/model/list.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mbm-ipak/trunk/include/ajax/form.php
r2619847 r2620128 77 77 return $this->field_date($field); 78 78 } else if ($field["type"]["type"] == "select") { 79 if(isset($field["type"]["auto-select"]) && $field["type"]["auto-select"]) 80 { 79 if (isset($field["type"]["auto-select"]) && $field["type"]["auto-select"]) { 81 80 return $this->field_select_auto($field); 82 } 83 else 84 { 81 } else { 85 82 return $this->field_select($field); 86 } 87 } 83 } 84 } 88 85 } else { 89 86 $field["type"]["type"] = "text"; … … 122 119 $values["class"] = "col-md-4"; 123 120 124 if (isset($ values["type"]["class"])) {121 if (isset($field["type"]["class"])) { 125 122 $values["class"] = $values["type"]["class"]; 126 123 } … … 128 125 $values["type_field"] = ''; 129 126 130 if ($ values["type"] == "number") {127 if ($field["type"] == "number") { 131 128 $values["type_field"] = ' type="number" '; 132 129 } … … 135 132 $values["input_class"] = ''; 136 133 137 if (isset($ values["type"]["input_class"])) {134 if (isset($field["type"]["input_class"])) { 138 135 $values["input_class"] = $values["type"]["input_class"]; 139 136 } … … 204 201 $values = $this->get_values($field); 205 202 $table = $field["type"]["select"]["model"]; 203 $title_value=""; 204 $ret=''; 205 206 if($values["value"] > 0 || $values["value"] < 0) 207 { 208 $sql="select * from $table where ".$field["type"]["select"]["key"]."=".$values["value"]; 209 $query_string = $wpdb->prepare($sql, array()); 210 $items = $wpdb->get_results($query_string, ARRAY_A); 211 $title_value=$items[0][$field["type"]["select"]["label"]]; 212 // $ret .= $sql; 213 } 206 214 207 215 $where = ''; 208 216 209 if (isset($field["type"]["select"]["where"]) ) {217 if (isset($field["type"]["select"]["where"])&& strlen(trim($field["type"]["select"]["where"]))>0) { 210 218 $where = " and " . $field["type"]["select"]["where"]; 211 219 } 212 220 213 $ret = sprintf('<div id="%s" class="%s form-group auto-select-box">',esc_html($field["title"]."_box_auto"), esc_attr($values["class"]));221 $ret .= sprintf('<div id="%s" class="%s form-group auto-select-box">', esc_html($field["title"] . "_box_auto"), esc_attr($values["class"])); 214 222 $ret .= sprintf('<label class="label-control">%s</label>', esc_html($values["label_title"])); 223 $ret .= sprintf('<input model-label="%s" model-table="%s" model-where="%s" onKeyUp="ipak_auto_select_item_key_down(jQuery(this))" autocomplete="off" target-id="%s" id="%s" class="form-control" value="%s" onclick="ipak_auto_select_input(jQuery(this));" />', $field["type"]["select"]["label"], $table, $where, esc_html($field["title"]), esc_html($field["title"] . "_auto_complete"), esc_html($title_value)); 215 224 $ret .= sprintf('<input type="hidden" id="%s" name="%s" value="%s" />', esc_html($field["title"]), esc_html($field["title"]), esc_html($values["value"])); 216 $ret .= sprintf('<input model-label="%s" model-table="%s" model-where="%s" onKeyUp="ipak_auto_select_item_key_down(jQuery(this))" autocomplete="off" target-id="%s" id="%s" class="form-control" value="%s" onclick="ipak_auto_select_input(jQuery(this));" />',$field["type"]["select"]["label"],$table,$where,esc_html($field["title"]), esc_html($field["title"]."_auto_complete"), esc_html($values["value"])); 217 218 $query_string = $wpdb->prepare("select * from $table where 1=1 " . $where . " limit 100 ", array()); 225 226 $sql="select * from $table where 1=1 " . $where . " limit 100 "; 227 228 $query_string = $wpdb->prepare($sql, array()); 219 229 $items = $wpdb->get_results($query_string, ARRAY_A); 220 230 … … 224 234 $selected = ""; 225 235 if ($values["value"] == $item["id"]) 226 $selected = "selected"; 236 { 237 //$edit_id = $item["id"]; 238 } 239 227 240 // for ($x = 0; $x < 50; $x++) { 228 241 // $ret .= sprintf('<div onclick="ipak_auto_select_item(jQuery(this));" class="auto-select-item" %s value="%s">%s</div>', esc_attr($selected), esc_attr($item["id"]), esc_html($item[$field["type"]["select"]["label"]])); 229 242 // } 230 $ret .= sprintf('<div target-id="%s" onclick="ipak_auto_select_item(jQuery(this));" class="auto-select-item" %s value="%s" title="%s" >%s</div>', esc_html($field["title"]), esc_attr($selected), esc_attr($item["id"]), esc_html($item[$field["type"]["select"]["label"]]), esc_html($item[$field["type"]["select"]["label"]]));243 $ret .= sprintf('<div target-id="%s" onclick="ipak_auto_select_item(jQuery(this));" class="auto-select-item" %s value="%s" title="%s" >%s</div>', esc_html($field["title"]), esc_attr($selected), esc_attr($item[$field["type"]["select"]["key"]]), esc_html($item[$field["type"]["select"]["label"]]), esc_html($item[$field["type"]["select"]["label"]])); 231 244 } 232 245 … … 235 248 $ret .= sprintf('</div>'); 236 249 250 251 //$ret .= $sql; 237 252 return $ret; 238 253 } … … 264 279 $values = $this->get_values($field); 265 280 281 $height = '100px;'; 282 if (isset($field["type"]["height"])) { 283 $height = $field["type"]["height"] . 'px;'; 284 } 285 286 266 287 $ret = sprintf('<div class="%s form-group">', esc_attr($values["class"])); 267 288 $ret .= sprintf('<label class="label-control">%s</label>', esc_html($values["label_title"])); 268 $ret .= sprintf('<textarea id="%s" name="%s" %s class="form-control %s" >%s</textarea>', esc_attr($field["title"]), esc_attr($field["title"]), esc_attr($values["type_field"]), esc_attr($values["input_class"]), esc_html($values["value"]));289 $ret .= sprintf('<textarea style="height: %s" id="%s" name="%s" %s class="form-control %s" >%s</textarea>', $height, esc_attr($field["title"]), esc_attr($field["title"]), esc_attr($values["type_field"]), esc_attr($values["input_class"]), esc_html($values["value"])); 269 290 $ret .= sprintf('</div>'); 270 291 -
mbm-ipak/trunk/mbm-ipak.php
r2619863 r2620128 8 8 * 9 9 * @link http://mbmti.ir 10 * @since 2.0. 610 * @since 2.0.7 11 11 * @package MBM_IPAK 12 12 * … … 15 15 * Plugin URI: http://mbmti.ir 16 16 * Description: سیستم حسابداری ایپک 17 * Version: 2.0. 617 * Version: 2.0.7 18 18 * Author: ایپک 19 19 * Author URI: http://mbmti.ir/our-team … … 27 27 /* General Definition 28 28 ******************************/ 29 define('MBM_IPAK_VERSION', '2.0. 6');29 define('MBM_IPAK_VERSION', '2.0.7'); 30 30 31 31 define('MBM_IPAK_BASE', plugin_dir_path(__FILE__)); -
mbm-ipak/trunk/readme.txt
r2619863 r2620128 5 5 Requires at least: 3.0.1 6 6 Tested up to: 5.8.1 7 Stable tag: 2.0. 67 Stable tag: 2.0.7 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
mbm-ipak/trunk/view/model/list.php
r2615853 r2620128 16 16 17 17 <form action="?page=<?php echo !empty($_REQUEST["page"])?esc_attr(sanitize_text_field($_REQUEST["page"])) : ''; ?>" method="post" class="form-search-table"> 18 <input value="<?php echo esc_attr($this->model_obj->text_search); ?>" id="search-main-table" name="search-main-table" class="form-control" placeholder="جستجو.." />18 <input value="<?php echo !empty($_REQUEST["page"])?esc_attr(get_option(sanitize_text_field($_REQUEST["page"]). "_search")) : ''; ?>" id="search-main-table" name="search-main-table" class="form-control" placeholder="جستجو.." /> 19 19 <input class="btn btn-primary" type="submit" value="بگرد" /> 20 20 </form>
Note: See TracChangeset
for help on using the changeset viewer.