@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | class efqFieldType extends XoopsObject |
45 | 45 | { |
46 | 46 | |
47 | - function efqFieldType($fieldtype=false) |
|
47 | + function efqFieldType($fieldtype = false) |
|
48 | 48 | { |
49 | 49 | global $moddir; |
50 | 50 | $this->db = Database::getInstance(); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $this->assignVars($fieldtype); |
62 | 62 | } else { |
63 | 63 | $fieldtype_handler = new efqFieldTypeHandler($this->db); |
64 | - $objFieldtype =& $fieldtype_handler->get($fieldtype); |
|
64 | + $objFieldtype = & $fieldtype_handler->get($fieldtype); |
|
65 | 65 | foreach ($objFieldtype->vars as $k => $v) { |
66 | 66 | $this->assignVar($k, $v['value']); |
67 | 67 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * |
101 | 101 | * @return bool true if insertion is succesful, false if unsuccesful |
102 | 102 | */ |
103 | - function insertFieldType($obj, $forceQuery=false) { |
|
103 | + function insertFieldType($obj, $forceQuery = false) { |
|
104 | 104 | $tablename = "efqdiralpha1_fieldtypes"; |
105 | 105 | $keyName = "typeid"; |
106 | 106 | $excludedVars = array(); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $strFields = ""; |
118 | 118 | $strValues = ""; |
119 | 119 | foreach ($cleanvars as $k => $v) { |
120 | - if ( !in_array($k, $excludedVars) ) { |
|
120 | + if (!in_array($k, $excludedVars)) { |
|
121 | 121 | $strFields .= $k; |
122 | 122 | $strValues .= "'".$v."'"; |
123 | 123 | if ($i < $countVars) { |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | * |
155 | 155 | * @return bool true if update is succesful, false if unsuccesful |
156 | 156 | */ |
157 | - function updateFieldType($obj, $forceQuery=false) { |
|
157 | + function updateFieldType($obj, $forceQuery = false) { |
|
158 | 158 | $tablename = "efqdiralpha1_fieldtypes"; |
159 | 159 | $keyName = "typeid"; |
160 | 160 | $excludedVars = array(); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | $strSet = ""; |
173 | 173 | $strValues = ""; |
174 | 174 | foreach ($cleanvars as $k => $v) { |
175 | - if ( !in_array($k, $excludedVars) ) { |
|
175 | + if (!in_array($k, $excludedVars)) { |
|
176 | 176 | if ($i < $countVars and $i > 1) { |
177 | 177 | $strSet .= ", "; |
178 | 178 | } |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | return false; |
194 | 194 | } |
195 | 195 | |
196 | - function delete($obj_fieldtype,$force=false) |
|
196 | + function delete($obj_fieldtype, $force = false) |
|
197 | 197 | { |
198 | 198 | if (!is_object($obj_fieldtype)) { |
199 | 199 | return false; |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | * @param int $dirid ID of the directory |
218 | 218 | * @return array $arr or boolean false |
219 | 219 | */ |
220 | - function getByDir($dirid=0) |
|
220 | + function getByDir($dirid = 0) |
|
221 | 221 | { |
222 | 222 | //Get all fieldtypes for the selected directory |
223 | 223 | $sql = "SELECT typeid,title,fieldtype,descr,ext,activeyn FROM ".$this->db->prefix("efqdiralpha1_fieldtypes")." WHERE dirid=".intval($dirid).""; |
@@ -228,8 +228,8 @@ discard block |
||
228 | 228 | $numrows = $this->db->getRowsNum($result); |
229 | 229 | $result = $this->db->query($sql); |
230 | 230 | $arr = array(); |
231 | - while ( list($typeid,$title,$fieldtype,$descr,$ext,$activeyn) = $this->db->fetchRow($result) ) { |
|
232 | - $arr[$typeid] = array('typeid' => $typeid,'title' => $title,'fieldtype' => $fieldtype,'descr' => $descr, 'ext' => $ext, 'activeyn' => $activeyn); |
|
231 | + while (list($typeid, $title, $fieldtype, $descr, $ext, $activeyn) = $this->db->fetchRow($result)) { |
|
232 | + $arr[$typeid] = array('typeid' => $typeid, 'title' => $title, 'fieldtype' => $fieldtype, 'descr' => $descr, 'ext' => $ext, 'activeyn' => $activeyn); |
|
233 | 233 | } |
234 | 234 | return $arr; |
235 | 235 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @param object &$image {@link XoopsImage} |
96 | 96 | * @return bool |
97 | 97 | **/ |
98 | - function insert(&$image, $itemid='0') |
|
98 | + function insert(&$image, $itemid = '0') |
|
99 | 99 | { |
100 | 100 | global $image_name; |
101 | 101 | if ($itemid == '0') { |
@@ -200,9 +200,9 @@ discard block |
||
200 | 200 | $image = new XoopsImage(); |
201 | 201 | $image->assignVars($myrow); |
202 | 202 | if (!$id_as_key) { |
203 | - $ret[] =& $image; |
|
203 | + $ret[] = & $image; |
|
204 | 204 | } else { |
205 | - $ret[$myrow['image_id']] =& $image; |
|
205 | + $ret[$myrow['image_id']] = & $image; |
|
206 | 206 | } |
207 | 207 | unset($image); |
208 | 208 | } |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
222 | 222 | $sql .= ' '.$criteria->renderWhere(); |
223 | 223 | } |
224 | - if (!$result =& $this->db->query($sql)) { |
|
224 | + if (!$result = & $this->db->query($sql)) { |
|
225 | 225 | return 0; |
226 | 226 | } |
227 | 227 | list($count) = $this->db->fetchRow($result); |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | if (isset($image_display)) { |
242 | 242 | $criteria->add(new Criteria('image_display', intval($image_display))); |
243 | 243 | } |
244 | - $images =& $this->getObjects($criteria, false, true); |
|
244 | + $images = & $this->getObjects($criteria, false, true); |
|
245 | 245 | $ret = array(); |
246 | 246 | foreach (array_keys($images) as $i) { |
247 | 247 | $ret[$images[$i]->getVar('image_name')] = $images[$i]->getVar('image_nicename'); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * @param bool $itemtype |
51 | 51 | * @return |
52 | 52 | */ |
53 | - function efqDataType($offer=false) |
|
53 | + function efqDataType($offer = false) |
|
54 | 54 | { |
55 | 55 | global $moddir; |
56 | 56 | $this->db = Database::getInstance(); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * |
90 | 90 | * @return |
91 | 91 | */ |
92 | - function efqDataTypeHandler($obj=false) { |
|
92 | + function efqDataTypeHandler($obj = false) { |
|
93 | 93 | $this->db = Database::getInstance(); |
94 | 94 | $this->objDataType = $obj; |
95 | 95 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | * |
105 | 105 | * @return bool true if insertion is succesful, false if unsuccesful |
106 | 106 | */ |
107 | - function insertDataType($obj, $forceQuery=false) { |
|
107 | + function insertDataType($obj, $forceQuery = false) { |
|
108 | 108 | $tablename = "efqdiralpha1_dtypes"; |
109 | 109 | $keyName = "dtypeid"; |
110 | 110 | $excludedVars = array(); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $strFields = ""; |
122 | 122 | $strValues = ""; |
123 | 123 | foreach ($cleanvars as $k => $v) { |
124 | - if ( !in_array($k, $excludedVars) ) { |
|
124 | + if (!in_array($k, $excludedVars)) { |
|
125 | 125 | $strFields .= $k; |
126 | 126 | $strValues .= "'".$v."'"; |
127 | 127 | if ($i < $countVars) { |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | * |
159 | 159 | * @return bool true if update is succesful, false if unsuccesful |
160 | 160 | */ |
161 | - function updateDataType($obj, $forceQuery=false) { |
|
161 | + function updateDataType($obj, $forceQuery = false) { |
|
162 | 162 | $tablename = "efqdiralpha1_dtypes"; |
163 | 163 | $keyName = "dtypeid"; |
164 | 164 | $excludedVars = array(); |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $strSet = ""; |
177 | 177 | $strValues = ""; |
178 | 178 | foreach ($cleanvars as $k => $v) { |
179 | - if ( !in_array($k, $excludedVars) ) { |
|
179 | + if (!in_array($k, $excludedVars)) { |
|
180 | 180 | if ($i < $countVars and $i > 1) { |
181 | 181 | $strSet .= ", "; |
182 | 182 | } |
@@ -204,14 +204,14 @@ discard block |
||
204 | 204 | * |
205 | 205 | * @return bool true or false |
206 | 206 | */ |
207 | - function setDataType($gpc_dtypeid=0) { |
|
207 | + function setDataType($gpc_dtypeid = 0) { |
|
208 | 208 | $sql = "SELECT dtypeid,title,section,fieldtypeid,uid,defaultyn,created,seq,activeyn,options,custom,icon WHERE dtypeid=".intval($gpc_dtypeid); |
209 | 209 | $result = $this->db->query($sql); |
210 | 210 | $numrows = $this->db->getRowsNum($result); |
211 | - if ( $numrows > 0 ) { |
|
212 | - while (list($dtypeid,$title,$section,$fieldtypeid,$uid,$defaultyn, $activeyn, |
|
213 | - $options,$custom,$icon) = $this->db->fetchRow($result)) { |
|
214 | - if (! $this->objDataType ) { |
|
211 | + if ($numrows > 0) { |
|
212 | + while (list($dtypeid, $title, $section, $fieldtypeid, $uid, $defaultyn, $activeyn, |
|
213 | + $options, $custom, $icon) = $this->db->fetchRow($result)) { |
|
214 | + if (!$this->objDataType) { |
|
215 | 215 | $this->objDataType = new efqDataType(); |
216 | 216 | } |
217 | 217 | $this->objDataType->setVar('dtypeid', $dtypeid); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | |
30 | 30 | function efqCouponHandler() { |
31 | - $this->db =& Database::getInstance(); |
|
31 | + $this->db = & Database::getInstance(); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | function create() { |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | if (isset($_POST['expire_enable']) && ($_POST['expire_enable'] == 1)) { |
41 | 41 | $this->expire = strtotime($_POST['expire']['date']) + $_POST['expire']['time']; |
42 | 42 | } else { |
43 | - $this->expire = 0; |
|
43 | + $this->expire = 0; |
|
44 | 44 | } |
45 | 45 | $this->lbr = $_POST['lbr']; |
46 | 46 | $this->heading = $myts->makeTboxData4Save($_POST['heading']); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | return true; |
87 | 87 | } |
88 | 88 | |
89 | - function get($couponid=false) { |
|
89 | + function get($couponid = false) { |
|
90 | 90 | if ($couponid == false) { |
91 | 91 | //echo 'couponid is false'; |
92 | 92 | return false; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | if (!$result = $this->db->query($sql)) { |
99 | 99 | return false; |
100 | 100 | } |
101 | - while(list($itemid, $descr, $image, $publish, $expire, $heading, $lbr) = $this->db->fetchRow($result)) { |
|
101 | + while (list($itemid, $descr, $image, $publish, $expire, $heading, $lbr) = $this->db->fetchRow($result)) { |
|
102 | 102 | $this->itemid = $itemid; |
103 | 103 | $this->descr = $descr; |
104 | 104 | $this->image = $image; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | * |
125 | 125 | * @return |
126 | 126 | */ |
127 | - function getCountByLink($itemid=0) { |
|
127 | + function getCountByLink($itemid = 0) { |
|
128 | 128 | $ret = 0; |
129 | 129 | $now = time(); |
130 | 130 | $sql = "SELECT count(*) FROM ".$this->db->prefix("efqdiralpha1_coupon")." WHERE itemid=".$itemid.' AND publish < '.$now.' AND (expire = 0 OR expire > '.$now.')'; |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | return $ret; |
137 | 137 | } |
138 | 138 | |
139 | - function getByItem($itemid=0) { |
|
139 | + function getByItem($itemid = 0) { |
|
140 | 140 | if ($itemid == false) { |
141 | 141 | //echo 'couponid is false'; |
142 | 142 | return false; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | if (!$result = $this->db->query($sql)) { |
149 | 149 | return false; |
150 | 150 | } |
151 | - while(list($couponid, $itemid, $descr, $image, $publish, $expire, $heading, $lbr) = $this->db->fetchRow($result)) { |
|
151 | + while (list($couponid, $itemid, $descr, $image, $publish, $expire, $heading, $lbr) = $this->db->fetchRow($result)) { |
|
152 | 152 | if ($publish == 0) { |
153 | 153 | $publish = time(); |
154 | 154 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $expire = formatTimestamp($expire, 's'); |
157 | 157 | } |
158 | 158 | $publish = formatTimestamp($publish, 's'); |
159 | - $ret[] = array('couponid' => $couponid, 'itemid' => $itemid, 'descr' => $descr, 'image' => $image, 'publish' => $publish, 'expire' => $expire, 'heading' => $heading, 'lbr' => $lbr ); |
|
159 | + $ret[] = array('couponid' => $couponid, 'itemid' => $itemid, 'descr' => $descr, 'image' => $image, 'publish' => $publish, 'expire' => $expire, 'heading' => $heading, 'lbr' => $lbr); |
|
160 | 160 | } |
161 | 161 | return $ret; |
162 | 162 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * @param string $name "name" attribute |
79 | 79 | * @param string $value Pre-selected value |
80 | 80 | */ |
81 | - function efqFormRadio($caption, $name, $value = null, $linebreak = null){ |
|
81 | + function efqFormRadio($caption, $name, $value = null, $linebreak = null) { |
|
82 | 82 | $this->setCaption($caption); |
83 | 83 | $this->setName($name); |
84 | 84 | if (isset($value)) { |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * |
97 | 97 | * @return string |
98 | 98 | */ |
99 | - function getValue(){ |
|
99 | + function getValue() { |
|
100 | 100 | return $this->_value; |
101 | 101 | } |
102 | 102 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * |
106 | 106 | * @return string |
107 | 107 | */ |
108 | - function getLineBreak(){ |
|
108 | + function getLineBreak() { |
|
109 | 109 | return $this->_linebreak; |
110 | 110 | } |
111 | 111 | /** |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | * |
114 | 114 | * @param $value string |
115 | 115 | */ |
116 | - function setValue($value){ |
|
116 | + function setValue($value) { |
|
117 | 117 | $this->_value = $value; |
118 | 118 | } |
119 | 119 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * |
123 | 123 | * @param $value string |
124 | 124 | */ |
125 | - function setLineBreak($linebreak){ |
|
125 | + function setLineBreak($linebreak) { |
|
126 | 126 | $this->_linebreak = $linebreak; |
127 | 127 | } |
128 | 128 | |
@@ -132,8 +132,8 @@ discard block |
||
132 | 132 | * @param string $value "value" attribute - This gets submitted as form-data. |
133 | 133 | * @param string $name "name" attribute - This is displayed. If empty, we use the "value" instead. |
134 | 134 | */ |
135 | - function addOption($value, $name=""){ |
|
136 | - if ( $name != "" ) { |
|
135 | + function addOption($value, $name = "") { |
|
136 | + if ($name != "") { |
|
137 | 137 | $this->_options[$value] = $name; |
138 | 138 | } else { |
139 | 139 | $this->_options[$value] = $value; |
@@ -145,9 +145,9 @@ discard block |
||
145 | 145 | * |
146 | 146 | * @param array $options Associative array of value->name pairs. |
147 | 147 | */ |
148 | - function addOptionArray($options){ |
|
149 | - if ( is_array($options) ) { |
|
150 | - foreach ( $options as $k=>$v ) { |
|
148 | + function addOptionArray($options) { |
|
149 | + if (is_array($options)) { |
|
150 | + foreach ($options as $k=>$v) { |
|
151 | 151 | $this->addOption($k, $v); |
152 | 152 | } |
153 | 153 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | * |
159 | 159 | * @return array Associative array of value->name pairs. |
160 | 160 | */ |
161 | - function getOptions(){ |
|
161 | + function getOptions() { |
|
162 | 162 | return $this->_options; |
163 | 163 | } |
164 | 164 | |
@@ -167,12 +167,12 @@ discard block |
||
167 | 167 | * |
168 | 168 | * @return string HTML |
169 | 169 | */ |
170 | - function render(){ |
|
170 | + function render() { |
|
171 | 171 | $ret = ""; |
172 | - foreach ( $this->getOptions() as $value => $name ) { |
|
172 | + foreach ($this->getOptions() as $value => $name) { |
|
173 | 173 | $ret .= "<input type='radio' name='".$this->getName()."' value='".$value."'"; |
174 | 174 | $selected = $this->getValue(); |
175 | - if ( isset($selected) && ($value == $selected) ) { |
|
175 | + if (isset($selected) && ($value == $selected)) { |
|
176 | 176 | $ret .= " checked='checked'"; |
177 | 177 | } |
178 | 178 | $ret .= $this->getExtra()." />".$name."".$this->getLineBreak()."\n"; |
@@ -51,14 +51,14 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | function loadFormFiles() { |
54 | - if ( !$this->formfilesloaded ) { |
|
54 | + if (!$this->formfilesloaded) { |
|
55 | 55 | include_once XOOPS_ROOT_PATH.'/include/xoopscodes.php'; |
56 | 56 | include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
57 | 57 | $this->setFormFilesLoaded(); |
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
61 | - function setFormFilesLoaded($set=true) { |
|
61 | + function setFormFilesLoaded($set = true) { |
|
62 | 62 | $this->formfilesloaded = true; |
63 | 63 | } |
64 | 64 | |
@@ -72,11 +72,11 @@ discard block |
||
72 | 72 | $value = $arr['value']; |
73 | 73 | $custom = $arr['custom']; |
74 | 74 | $customtitle = $arr['customtitle']; |
75 | - $this->createField($title,$name,$fieldtype,$ext,$options,$value,$custom,$customtitle); |
|
75 | + $this->createField($title, $name, $fieldtype, $ext, $options, $value, $custom, $customtitle); |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
79 | - function createField($title="", $name="", $fieldtype="", $ext="", $options="", $value="", $custom='0', $customtitle=NULL) { |
|
79 | + function createField($title = "", $name = "", $fieldtype = "", $ext = "", $options = "", $value = "", $custom = '0', $customtitle = NULL) { |
|
80 | 80 | global $form, $myts, $moddir; |
81 | 81 | $this->loadFormFiles(); |
82 | 82 | if ($customtitle == NULL) { |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | } |
85 | 85 | $multiple = false; |
86 | 86 | if ($ext != "") { |
87 | - $ext_arr = split("[|]",$ext); |
|
88 | - foreach($ext_arr as $ext_item) { |
|
89 | - $ext_item_arr = split("[=]",$ext_item); |
|
87 | + $ext_arr = split("[|]", $ext); |
|
88 | + foreach ($ext_arr as $ext_item) { |
|
89 | + $ext_item_arr = split("[=]", $ext_item); |
|
90 | 90 | $ext_item_name = $ext_item_arr[0]; |
91 | 91 | $ext_item_value = $ext_item_arr[1]; |
92 | 92 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $multiple = true; |
108 | 108 | $size = 5; |
109 | 109 | case "value": |
110 | - if ($ext_item_value != '' and $value == '' ) { |
|
110 | + if ($ext_item_value != '' and $value == '') { |
|
111 | 111 | $value = $ext_item_value; |
112 | 112 | } |
113 | 113 | break; |
@@ -129,14 +129,14 @@ discard block |
||
129 | 129 | $form->addElement(new XoopsFormText($title, $name.$field, 50, 250, $myts->makeTboxData4Show($storedvalue))); |
130 | 130 | } |
131 | 131 | } |
132 | - $form->addElement(new XoopsFormHidden("submitaddress","1")); |
|
132 | + $form->addElement(new XoopsFormHidden("submitaddress", "1")); |
|
133 | 133 | $form->addElement(new XoopsFormHidden($name, $value)); |
134 | 134 | $form->addElement(new XoopsFormHidden("addrid", $value)); |
135 | 135 | break; |
136 | 136 | case "checkbox": |
137 | - $options_arr = split("[|]",$options); |
|
137 | + $options_arr = split("[|]", $options); |
|
138 | 138 | $form_checkbox = new XoopsFormCheckbox($title, $name, $value, 1); |
139 | - foreach($options_arr as $option) { |
|
139 | + foreach ($options_arr as $option) { |
|
140 | 140 | $form_checkbox->addOption($option, $option); |
141 | 141 | } |
142 | 142 | $form->addElement($form_checkbox); |
@@ -178,29 +178,29 @@ discard block |
||
178 | 178 | // $form->addElement(new XoopsFormTextArea(_MD_GMAP_DESCR, $name.'_descr', $gmap_descr, 5, 50)); |
179 | 179 | // break; |
180 | 180 | case "radio": |
181 | - $options_arr = split("[|]",$options); |
|
181 | + $options_arr = split("[|]", $options); |
|
182 | 182 | $form_radio = new XoopsFormRadio($title, $name, $value, 1); |
183 | - foreach($options_arr as $option) { |
|
183 | + foreach ($options_arr as $option) { |
|
184 | 184 | $form_radio->addOption($option, $option); |
185 | 185 | } |
186 | 186 | $form->addElement($form_radio); |
187 | 187 | break; |
188 | 188 | case "rating": |
189 | - $rating_options = array(1,2,3,4,5,6,7,8,9,10); |
|
189 | + $rating_options = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); |
|
190 | 190 | $form_rating = new XoopsFormSelect($title, $name, $value, 1); |
191 | 191 | $form_rating->addOption('0', '----'); |
192 | - foreach($rating_options as $option) { |
|
192 | + foreach ($rating_options as $option) { |
|
193 | 193 | $form_rating->addOption($option, $option); |
194 | 194 | } |
195 | 195 | $form->addElement($form_rating); |
196 | 196 | break; |
197 | 197 | case "select": |
198 | - $options_arr = split("[|]",$options); |
|
199 | - $value_arr = split("[|]",$value); |
|
198 | + $options_arr = split("[|]", $options); |
|
199 | + $value_arr = split("[|]", $value); |
|
200 | 200 | $form_select = new XoopsFormSelect($title, $name, $value, $size, $multiple); |
201 | 201 | $form_select->addOption('-', '----'); |
202 | 202 | $form_select->setValue($value_arr); |
203 | - foreach($options_arr as $key => $option) { |
|
203 | + foreach ($options_arr as $key => $option) { |
|
204 | 204 | $form_select->addOption($option, $option); |
205 | 205 | } |
206 | 206 | $form->addElement($form_select); |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | break; |
234 | 234 | case "url": |
235 | 235 | if ($value != '') { |
236 | - $link = explode('|',$value); |
|
236 | + $link = explode('|', $value); |
|
237 | 237 | } else { |
238 | 238 | $link = array(); |
239 | 239 | $link[0] = ''; |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | } |
388 | 388 | }*/ |
389 | 389 | |
390 | - function createSearchField($title="", $name="", $fieldtype="", $ext="", $options="", $value="", $custom='0', $customtitle=NULL) { |
|
390 | + function createSearchField($title = "", $name = "", $fieldtype = "", $ext = "", $options = "", $value = "", $custom = '0', $customtitle = NULL) { |
|
391 | 391 | global $form, $myts; |
392 | 392 | |
393 | 393 | switch ($fieldtype) { |
@@ -449,12 +449,12 @@ discard block |
||
449 | 449 | 'contains' => _MD_CONTAINS, |
450 | 450 | 'begins' => _MD_BEGINSWITH, |
451 | 451 | 'ends' => _MD_ENDSWITH, |
452 | - 'notcontain' => _MD_NOTCONTAIN ); |
|
452 | + 'notcontain' => _MD_NOTCONTAIN); |
|
453 | 453 | $form_tray = new XoopsFormElementTray($title, "", $name); |
454 | 454 | $form_tray->addElement(new XoopsFormLabel("", "<table><tr><td width=\"150\">")); |
455 | 455 | $form_select_constr = new XoopsFormSelect("", $name."constr", $value, 1); |
456 | 456 | //$form_select->addOption('0', '----'); |
457 | - foreach($options_arr_constr as $optionname => $option) { |
|
457 | + foreach ($options_arr_constr as $optionname => $option) { |
|
458 | 458 | $form_select_constr->addOption($optionname, $option); |
459 | 459 | } |
460 | 460 | $form_tray->addElement($form_select_constr); |
@@ -465,8 +465,8 @@ discard block |
||
465 | 465 | } |
466 | 466 | function createSearchField_checkbox($title = "", $name = "", $value = "", $options = "") { |
467 | 467 | global $form, $myts; |
468 | - $options_arr = split("[|]",$options); |
|
469 | - $countoptions = count($options_arr)+1; |
|
468 | + $options_arr = split("[|]", $options); |
|
469 | + $countoptions = count($options_arr) + 1; |
|
470 | 470 | $form_checkbox = new XoopsFormCheckBox($title, $name, $value); |
471 | 471 | foreach ($options_arr as $optionname) { |
472 | 472 | $form_checkbox->addOption($optionname, $optionname); |
@@ -475,18 +475,18 @@ discard block |
||
475 | 475 | } |
476 | 476 | function createSearchField_select($title = "", $name = "", $value = "", $options = "") { |
477 | 477 | global $form, $myts; |
478 | - $options_arr = split("[|]",$options); |
|
479 | - $options_arr_constr = array('equal' => _MD_EQUAL_TO, 'notequal' => _MD_NOT_EQUAL_TO ); |
|
478 | + $options_arr = split("[|]", $options); |
|
479 | + $options_arr_constr = array('equal' => _MD_EQUAL_TO, 'notequal' => _MD_NOT_EQUAL_TO); |
|
480 | 480 | $form_tray = new XoopsFormElementTray($title, "", $name); |
481 | 481 | $form_tray->addElement(new XoopsFormLabel("", "<table><tr><td width=\"150\">")); |
482 | 482 | $form_select_constr = new XoopsFormSelect("", $name, $value, 1); |
483 | - foreach($options_arr_constr as $option) { |
|
483 | + foreach ($options_arr_constr as $option) { |
|
484 | 484 | $form_select_constr->addOption($option, $option); |
485 | 485 | } |
486 | 486 | $form_tray->addElement($form_select_constr); |
487 | 487 | $form_tray->addElement(new XoopsFormLabel("", "</td><td>")); |
488 | - $countoptions = count($options_arr)+1; |
|
489 | - if ( $countoptions >= 5 ) { |
|
488 | + $countoptions = count($options_arr) + 1; |
|
489 | + if ($countoptions >= 5) { |
|
490 | 490 | $selectformsize = 5; |
491 | 491 | } else { |
492 | 492 | $selectformsize = $countoptions; |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | $form_select = new XoopsFormSelect("", $name, $value, $selectformsize); |
495 | 495 | $form_select->setExtra(" multiple='multiple'"); |
496 | 496 | $form_select->addOption('0', '----'); |
497 | - foreach($options_arr as $option) { |
|
497 | + foreach ($options_arr as $option) { |
|
498 | 498 | $form_select->addOption($option, $option); |
499 | 499 | } |
500 | 500 | $form_tray->addElement($form_select); |
@@ -503,33 +503,33 @@ discard block |
||
503 | 503 | } |
504 | 504 | function createSearchField_rating2($title = "", $name = "", $value = "", $options = "") { |
505 | 505 | global $form, $myts; |
506 | - $options_arr = split("[|]",$options); |
|
507 | - $rating_options = array(1,2,3,4,5,6,7,8,9,10); |
|
506 | + $options_arr = split("[|]", $options); |
|
507 | + $rating_options = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); |
|
508 | 508 | $form_rating = new XoopsFormSelect($title, $name, $value, 1); |
509 | 509 | $form_rating->addOption('0', '----'); |
510 | - foreach($rating_options as $option) { |
|
510 | + foreach ($rating_options as $option) { |
|
511 | 511 | $form_rating->addOption($option, $option); |
512 | 512 | } |
513 | 513 | $form->addElement($form_rating); |
514 | 514 | } |
515 | 515 | function createSearchField_rating($title = "", $name = "", $value = "", $options = "") { |
516 | 516 | global $form, $myts; |
517 | - $options_arr = split("[|]",$options); |
|
518 | - $rating_options = array(1,2,3,4,5,6,7,8,9,10); |
|
517 | + $options_arr = split("[|]", $options); |
|
518 | + $rating_options = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); |
|
519 | 519 | $options_arr_constr = array('equal' => _MD_EQUAL_TO, |
520 | 520 | 'notequal' => _MD_NOT_EQUAL_TO, |
521 | 521 | 'smaller' => _MD_SMALLER_THAN, |
522 | - 'bigger' => _MD_GREATER_THAN ); |
|
522 | + 'bigger' => _MD_GREATER_THAN); |
|
523 | 523 | $form_tray = new XoopsFormElementTray($title, "", $name); |
524 | 524 | $form_tray->addElement(new XoopsFormLabel("", "<table><tr><td width=\"150\">")); |
525 | 525 | $form_select_constr = new XoopsFormSelect("", $name."constr", $value, 1); |
526 | - foreach($options_arr_constr as $optionname => $option) { |
|
526 | + foreach ($options_arr_constr as $optionname => $option) { |
|
527 | 527 | $form_select_constr->addOption($optionname, $option); |
528 | 528 | } |
529 | 529 | $form_tray->addElement($form_select_constr); |
530 | 530 | $form_tray->addElement(new XoopsFormLabel("", "</td><td>")); |
531 | - $countoptions = count($rating_options)+1; |
|
532 | - if ( $countoptions >= 5 ) { |
|
531 | + $countoptions = count($rating_options) + 1; |
|
532 | + if ($countoptions >= 5) { |
|
533 | 533 | $selectformsize = 5; |
534 | 534 | } else { |
535 | 535 | $selectformsize = $rating_options; |
@@ -537,20 +537,20 @@ discard block |
||
537 | 537 | $form_select = new XoopsFormSelect("", $name, $value, $selectformsize); |
538 | 538 | //$form_select->setExtra(" multiple='multiple'"); |
539 | 539 | $form_select->addOption('0', '----'); |
540 | - foreach($rating_options as $option) { |
|
540 | + foreach ($rating_options as $option) { |
|
541 | 541 | $form_select->addOption($option, $option); |
542 | 542 | } |
543 | 543 | $form_tray->addElement($form_select); |
544 | 544 | $form_tray->addElement(new XoopsFormLabel("", "</td></tr></table>")); |
545 | 545 | $form->addElement($form_tray); |
546 | 546 | } |
547 | - function getWidth(){ |
|
547 | + function getWidth() { |
|
548 | 548 | return $this->_width; |
549 | 549 | } |
550 | - function getHeight(){ |
|
550 | + function getHeight() { |
|
551 | 551 | return $this->_height; |
552 | 552 | } |
553 | - function getSrc(){ |
|
553 | + function getSrc() { |
|
554 | 554 | return $this->_src; |
555 | 555 | } |
556 | 556 | /* |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | * |
559 | 559 | * @return bool |
560 | 560 | */ |
561 | - function isMultiple(){ |
|
561 | + function isMultiple() { |
|
562 | 562 | return $this->_multiple; |
563 | 563 | } |
564 | 564 | |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | * |
568 | 568 | * @return int |
569 | 569 | */ |
570 | - function getSize(){ |
|
570 | + function getSize() { |
|
571 | 571 | return $this->_size; |
572 | 572 | } |
573 | 573 | |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | * |
577 | 577 | * @return array |
578 | 578 | */ |
579 | - function getValue(){ |
|
579 | + function getValue() { |
|
580 | 580 | return $this->_value; |
581 | 581 | } |
582 | 582 | |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | * |
586 | 586 | * @param $value mixed |
587 | 587 | */ |
588 | - function setValue($value){ |
|
588 | + function setValue($value) { |
|
589 | 589 | if (is_array($value)) { |
590 | 590 | foreach ($value as $v) { |
591 | 591 | $this->_value[] = $v; |
@@ -601,8 +601,8 @@ discard block |
||
601 | 601 | * @param string $value "value" attribute |
602 | 602 | * @param string $name "name" attribute |
603 | 603 | */ |
604 | - function addOption($value, $name=""){ |
|
605 | - if ( $name != "" ) { |
|
604 | + function addOption($value, $name = "") { |
|
605 | + if ($name != "") { |
|
606 | 606 | $this->_options[$value] = $name; |
607 | 607 | } else { |
608 | 608 | $this->_options[$value] = $value; |
@@ -614,9 +614,9 @@ discard block |
||
614 | 614 | * |
615 | 615 | * @param array $options Associative array of value->name pairs |
616 | 616 | */ |
617 | - function addOptionArray($options){ |
|
618 | - if ( is_array($options) ) { |
|
619 | - foreach ( $options as $k=>$v ) { |
|
617 | + function addOptionArray($options) { |
|
618 | + if (is_array($options)) { |
|
619 | + foreach ($options as $k=>$v) { |
|
620 | 620 | $this->addOption($k, $v); |
621 | 621 | } |
622 | 622 | } |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | * |
628 | 628 | * @return array Associative array of value->name pairs |
629 | 629 | */ |
630 | - function getOptions(){ |
|
630 | + function getOptions() { |
|
631 | 631 | return $this->_options; |
632 | 632 | } |
633 | 633 | |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | * |
638 | 638 | * @return string HTML |
639 | 639 | */ |
640 | - function render(){ |
|
640 | + function render() { |
|
641 | 641 | $ret = "<img src='".$this->getSrc()."' width='".$this->getWidth()."' height='".$this->getHeight()."'"; |
642 | 642 | $ret .= " />"; |
643 | 643 | return $ret; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $this->assignVars($gmap); |
77 | 77 | } else { |
78 | 78 | $$gmap_handler = xoops_getmodulehandler('gmap', $moddir); |
79 | - $objGmap =& $$gmap_handler->get($directory); |
|
79 | + $objGmap = & $$gmap_handler->get($directory); |
|
80 | 80 | foreach ($objGmap->vars as $k => $v) { |
81 | 81 | $this->assignVar($k, $v['value']); |
82 | 82 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
88 | - function setKey($key='') |
|
88 | + function setKey($key = '') |
|
89 | 89 | { |
90 | 90 | $this->_key = $key; |
91 | 91 | } |
@@ -120,13 +120,13 @@ discard block |
||
120 | 120 | $this->_map .= $this->printTrigger(); |
121 | 121 | } |
122 | 122 | |
123 | - function printPlaceHolder($width=700, $height=500) |
|
123 | + function printPlaceHolder($width = 700, $height = 500) |
|
124 | 124 | { |
125 | 125 | return '<div id="map" style="width:'.$width.'px; height:'.$height.'px"></div>'; |
126 | 126 | } |
127 | 127 | |
128 | 128 | |
129 | - function printScript($jsPointsArray='', $key='') |
|
129 | + function printScript($jsPointsArray = '', $key = '') |
|
130 | 130 | { |
131 | 131 | global $icmsPreloadHandler; |
132 | 132 | |
@@ -289,13 +289,13 @@ discard block |
||
289 | 289 | if (!$result = $this->db->query($sql)) { |
290 | 290 | return false; |
291 | 291 | } |
292 | - $gmap =& $this->create(false); |
|
292 | + $gmap = & $this->create(false); |
|
293 | 293 | $javaScript = ''; |
294 | 294 | while ($row = $this->db->fetchArray($result)) { |
295 | 295 | //$row{'descr'} = addslashes($row{'descr'}); |
296 | 296 | $row['descr'] = addslashes($row['descr']); |
297 | 297 | //$row{'descr'} = str_replace(';',',',$row{'descr'}); |
298 | - $row['descr'] = str_replace(';',',',$row['descr']); |
|
298 | + $row['descr'] = str_replace(';', ',', $row['descr']); |
|
299 | 299 | //$javaScript .= "mArray.push('{$row{'lat'}};{$row{'lon'}};{$row{'descr'}}')\n"; |
300 | 300 | //echo $row['lat']; |
301 | 301 | $javaScript .= "mArray.push('{".$row['lat']."};{".$row['lon']."};{".$row['descr']."}')\n"; |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | return true; |
305 | 305 | } |
306 | 306 | |
307 | - function getGmapById($id=0) |
|
307 | + function getGmapById($id = 0) |
|
308 | 308 | { |
309 | 309 | $arr = array(); |
310 | 310 | $sql = sprintf('SELECT * FROM %s WHERE id=%u', |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | return $arr; |
318 | 318 | } |
319 | 319 | |
320 | - function getByDataId($id=0) |
|
320 | + function getByDataId($id = 0) |
|
321 | 321 | { |
322 | 322 | if ($id == false) { |
323 | 323 | return false; |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | if (!$result = $this->db->query($sql)) { |
330 | 330 | return false; |
331 | 331 | } |
332 | - $gmap =& $this->create(false); |
|
332 | + $gmap = & $this->create(false); |
|
333 | 333 | $gmap->assignVars($this->db->fetchArray($result)); |
334 | 334 | return $gmap; |
335 | 335 | } |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | * |
347 | 347 | * @return bool true if insertion is succesful, false if unsuccesful |
348 | 348 | */ |
349 | - function insertGmap($obj, $forceQuery=false) { |
|
349 | + function insertGmap($obj, $forceQuery = false) { |
|
350 | 350 | $tablename = "efqdiralpha1_gmaps"; |
351 | 351 | $keyName = "id"; |
352 | 352 | if ($obj instanceof efqGmap) { |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | * |
399 | 399 | * @return bool true if update is succesful, false if unsuccesful |
400 | 400 | */ |
401 | - function updateGmap($obj, $forceQuery=false) { |
|
401 | + function updateGmap($obj, $forceQuery = false) { |
|
402 | 402 | $tablename = "efqdiralpha1_gmaps"; |
403 | 403 | $keyName = "id"; |
404 | 404 | if ($obj instanceof efqGmap) { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * Constructor |
37 | 37 | * |
38 | 38 | */ |
39 | - function efqSubscription(){ |
|
39 | + function efqSubscription() { |
|
40 | 40 | //Constructor |
41 | 41 | } |
42 | 42 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | * |
52 | 52 | * @return array $arr |
53 | 53 | */ |
54 | - function durationArray($dashes=false) { |
|
54 | + function durationArray($dashes = false) { |
|
55 | 55 | if ($dashes) { |
56 | 56 | $arr = array('0' => '---', '1' => _MD_DAYS, '2' => _MD_WEEKS, '3' => _MD_MONTHS, '4' => _MD_QUARTERS, '5' => _MD_YEARS); |
57 | 57 | } else { |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * @param int $orderid - Default: '0' - Order ID |
102 | 102 | * @param int $userid - Default: '0' - User ID |
103 | 103 | */ |
104 | - function notifyExpireWarning($orderid='0', $userid='0') { |
|
104 | + function notifyExpireWarning($orderid = '0', $userid = '0') { |
|
105 | 105 | global $xoopsConfig, $moddir; |
106 | 106 | include_once(XOOPS_ROOT_PATH."/class/mail/xoopsmultimailer.php"); |
107 | 107 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | { |
136 | 136 | //Instantiate class |
137 | 137 | global $eh; |
138 | - $this->db =& XoopsDatabaseFactory::getDatabaseConnection(); |
|
138 | + $this->db = & XoopsDatabaseFactory::getDatabaseConnection(); |
|
139 | 139 | $this->errorhandler = $eh; |
140 | 140 | } |
141 | 141 | |
@@ -163,8 +163,8 @@ discard block |
||
163 | 163 | * @param int $orderid - Default: '0' - Order ID |
164 | 164 | * @return array $arr |
165 | 165 | */ |
166 | - function delete($orderid='0') { |
|
167 | - if ( $orderid != '0' ) { |
|
166 | + function delete($orderid = '0') { |
|
167 | + if ($orderid != '0') { |
|
168 | 168 | $sql = "DELETE FROM ".$this->db->prefix('efqdiralpha1_subscr_orders')." WHERE orderid=".intval($orderid).""; |
169 | 169 | $this->db->query($sql); |
170 | 170 | return true; |
@@ -186,8 +186,8 @@ discard block |
||
186 | 186 | function createOrder($itemid = 0) { |
187 | 187 | $orderid = 0; |
188 | 188 | if ($itemid != 0) { |
189 | - if ( isset( $_POST['typeofferid'] ) ) { |
|
190 | - $typeofferid = split("_",$_POST['typeofferid']); |
|
189 | + if (isset($_POST['typeofferid'])) { |
|
190 | + $typeofferid = split("_", $_POST['typeofferid']); |
|
191 | 191 | $typeid = $typeofferid[0]; |
192 | 192 | $offerid = $typeofferid[1]; |
193 | 193 | } else { |
@@ -240,12 +240,12 @@ discard block |
||
240 | 240 | return $orderid; |
241 | 241 | }*/ |
242 | 242 | |
243 | - function getOrderItemName($offerid=0) { |
|
243 | + function getOrderItemName($offerid = 0) { |
|
244 | 244 | $sql = "SELECT o.offerid, o.duration, o.count, o.price, o.currency, o.descr, t.typeid, t.typename FROM ".$this->db->prefix("efqdiralpha1_subscr_offers")." o, ".$this->db->prefix("efqdiralpha1_itemtypes")." t WHERE o.typeid=t.typeid AND o.offerid='$offerid' ORDER BY t.typename ASC"; |
245 | 245 | $result = $this->db->query($sql); |
246 | 246 | $numrows = $this->db->getRowsNum($result); |
247 | 247 | $result = $this->db->query($sql); |
248 | - while ( list($offerid, $duration, $count, $price, $currency, $descr, $typeid, $typename) = $this->db->fetchRow($result) ) { |
|
248 | + while (list($offerid, $duration, $count, $price, $currency, $descr, $typeid, $typename) = $this->db->fetchRow($result)) { |
|
249 | 249 | if ($count == '1') { |
250 | 250 | $duration_arr = $this->durationSingleArray(); |
251 | 251 | } else { |
@@ -258,33 +258,33 @@ discard block |
||
258 | 258 | } |
259 | 259 | |
260 | 260 | |
261 | - function updateOrder( $orderid='0', $status='1', $startdate='0', $billto='0' ) { |
|
261 | + function updateOrder($orderid = '0', $status = '1', $startdate = '0', $billto = '0') { |
|
262 | 262 | $ordervars = $this->getOrderVars($orderid); |
263 | 263 | $typeid = $ordervars['typeid']; |
264 | 264 | $itemid = $ordervars['itemid']; |
265 | 265 | $sql = "UPDATE ".$this->db->prefix("efqdiralpha1_subscr_orders")." SET status='$status'"; |
266 | - if ( $startdate != '0' ) { |
|
266 | + if ($startdate != '0') { |
|
267 | 267 | $sql .= ", startdate='$startdate'"; |
268 | 268 | } |
269 | - if ( $billto != '0' ) { |
|
269 | + if ($billto != '0') { |
|
270 | 270 | $sql .= ", billto='$billto'"; |
271 | 271 | } |
272 | 272 | $sql .= " WHERE orderid=".intval($orderid).""; |
273 | 273 | $this->db->queryF($sql); |
274 | - if ( $startdate > time() ) { |
|
275 | - $this->updateScheduler( 'add', $itemid, $typeid, $startdate ); |
|
274 | + if ($startdate > time()) { |
|
275 | + $this->updateScheduler('add', $itemid, $typeid, $startdate); |
|
276 | 276 | } else { |
277 | - $this->updateItem( $itemid, $typeid ); |
|
277 | + $this->updateItem($itemid, $typeid); |
|
278 | 278 | } |
279 | 279 | |
280 | 280 | } |
281 | 281 | |
282 | - function getOrderVars( $orderid='0' ) { |
|
282 | + function getOrderVars($orderid = '0') { |
|
283 | 283 | $sql = "SELECT ord.uid, ord.billto, ord.startdate, ord.typeid, ord.status, ord.itemid, ord.offerid FROM ".$this->db->prefix("efqdiralpha1_subscr_orders")." ord WHERE ord.orderid=".intval($orderid).""; |
284 | 284 | $result = $this->db->query($sql); |
285 | 285 | $numrows = $this->db->getRowsNum($result); |
286 | 286 | $arr = $this->db->fetchArray($result); |
287 | - while ( list($uid, $billto, $startdate, $typeid, $status, $itemid, $offerid ) = $this->db->fetchRow($result) ) { |
|
287 | + while (list($uid, $billto, $startdate, $typeid, $status, $itemid, $offerid) = $this->db->fetchRow($result)) { |
|
288 | 288 | $arr['uid'] = $uid; |
289 | 289 | $arr['billto'] = $billto; |
290 | 290 | $arr['startdate'] = $startdate; |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | return $arr; |
297 | 297 | } |
298 | 298 | |
299 | - function getOfferVars( $offerid='0', $showactive='1' ) { |
|
299 | + function getOfferVars($offerid = '0', $showactive = '1') { |
|
300 | 300 | $sql = "SELECT count, duration FROM ".$this->db->prefix("efqdiralpha1_subscr_offers")." WHERE offerid=".intval($offerid).""; |
301 | 301 | if ($showactive == '1') { |
302 | 302 | $sql .= " AND activeyn='1'"; |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | $numrows = $this->db->getRowsNum($result); |
306 | 306 | $arr = array(); |
307 | 307 | $arr = $this->db->fetchArray($result); |
308 | - while ( list( $count, $duration ) = $this->db->fetchRow($result) ) { |
|
308 | + while (list($count, $duration) = $this->db->fetchRow($result)) { |
|
309 | 309 | $arr['count'] = $count; |
310 | 310 | $arr['duration'] = $duration; |
311 | 311 | } |
@@ -323,8 +323,8 @@ discard block |
||
323 | 323 | } |
324 | 324 | }*/ |
325 | 325 | |
326 | - function updateItem( $itemid='0', $typeid='0' ) { |
|
327 | - if ( $itemid != '0' && $typeid != '0' ) { |
|
326 | + function updateItem($itemid = '0', $typeid = '0') { |
|
327 | + if ($itemid != '0' && $typeid != '0') { |
|
328 | 328 | $sql = "UPDATE ".$this->db->prefix("efqdiralpha1_items")." SET typeid='".intval($typeid)."' WHERE itemid=".intval($itemid).""; |
329 | 329 | $this->db->queryF($sql); |
330 | 330 | return true; |
@@ -335,11 +335,11 @@ discard block |
||
335 | 335 | |
336 | 336 | |
337 | 337 | |
338 | - function getNewBillto($offerid='0') { |
|
338 | + function getNewBillto($offerid = '0') { |
|
339 | 339 | |
340 | 340 | } |
341 | 341 | |
342 | - function changeItemType($itemid=0, $itemtype=0) { |
|
342 | + function changeItemType($itemid = 0, $itemtype = 0) { |
|
343 | 343 | global $xoopsDB, $eh; |
344 | 344 | $sql = "UPDATE ".$this->db->prefix('efqdiralpha1_items')." SET typeid=$itemtype WHERE itemid=intval($itemid)"; |
345 | 345 | $this->db->queryF($sql); |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | if ($dashes != '0') { |
358 | 358 | $arr = array('0' => '---'); |
359 | 359 | } |
360 | - while ( list($offerid, $duration, $count, $price, $currency, $descr, $typeid, $typename) = $this->db->fetchRow($result) ) { |
|
360 | + while (list($offerid, $duration, $count, $price, $currency, $descr, $typeid, $typename) = $this->db->fetchRow($result)) { |
|
361 | 361 | if ($count == '1') { |
362 | 362 | $duration_arr = $this->durationSingleArray(); |
363 | 363 | } else { |
@@ -369,17 +369,17 @@ discard block |
||
369 | 369 | return $arr; |
370 | 370 | } |
371 | 371 | |
372 | - function itemsSelBox($selname="", $none=false, $preselected=0) { |
|
372 | + function itemsSelBox($selname = "", $none = false, $preselected = 0) { |
|
373 | 373 | $sql = "SELECT typeid, typename FROM ".$this->db->prefix("efqdiralpha1_itemtypes").""; |
374 | 374 | $result = $this->db->query($sql); |
375 | 375 | $numrows = $this->db->getRowsNum($result); |
376 | 376 | echo "<select name='".$selname."'"; |
377 | 377 | echo ">\n"; |
378 | - if ( $none ) { |
|
378 | + if ($none) { |
|
379 | 379 | echo "<option value='0'>----</option>\n"; |
380 | 380 | } |
381 | - while ( list($typeid, $typename) = $this->db->fetchRow($result) ) { |
|
382 | - if ( $preselected == $typeid ) { |
|
381 | + while (list($typeid, $typename) = $this->db->fetchRow($result)) { |
|
382 | + if ($preselected == $typeid) { |
|
383 | 383 | $sel = " selected"; |
384 | 384 | } else { |
385 | 385 | $sel = ""; |
@@ -397,13 +397,13 @@ discard block |
||
397 | 397 | if ($dashes != 0) { |
398 | 398 | $arr = array('0' => '---'); |
399 | 399 | } |
400 | - while ( list($typeid, $typename) = $this->db->fetchRow($result) ) { |
|
400 | + while (list($typeid, $typename) = $this->db->fetchRow($result)) { |
|
401 | 401 | $arr[$typeid] = $typename; |
402 | 402 | } |
403 | 403 | return $arr; |
404 | 404 | } |
405 | 405 | |
406 | - function countSubscriptionsForType($typeid=0) { |
|
406 | + function countSubscriptionsForType($typeid = 0) { |
|
407 | 407 | $sql = "SELECT COUNT(itemid) FROM ".$this->db->prefix("efqdiralpha1_items")." WHERE typeid=".intval($typeid).""; |
408 | 408 | if (!$result = $this->db->query($sql)) { |
409 | 409 | return false; |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | return $ret; |
413 | 413 | } |
414 | 414 | |
415 | - function getOffers($dirid=0) { |
|
415 | + function getOffers($dirid = 0) { |
|
416 | 416 | $extendedwhere = ''; |
417 | 417 | if ($dirid != 0) { |
418 | 418 | $extendedwhere = ' AND o.dirid='.intval($dirid); |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | $sql = "SELECT o.dirid, o.offerid, o.typeid, o.title, o.duration, o.count, o.price, o.activeyn, o.currency, o.descr, t.typename, t.level FROM ".$this->db->prefix("efqdiralpha1_itemtypes")." t, ".$this->db->prefix("efqdiralpha1_subscr_offers")." o WHERE o.typeid=t.typeid".$extendedwhere; |
421 | 421 | $result = $this->db->query($sql) or $this->errorhandler->show("0013"); |
422 | 422 | $arr = array(); |
423 | - while(list($dirid, $offerid, $typeid, $title, $duration, $count, $price, $activeyn, $currency, $descr, $typename, $level) = $this->db->fetchRow($result)) { |
|
423 | + while (list($dirid, $offerid, $typeid, $title, $duration, $count, $price, $activeyn, $currency, $descr, $typename, $level) = $this->db->fetchRow($result)) { |
|
424 | 424 | $arr[] = array('dirid' => $dirid, |
425 | 425 | 'offerid' => $offerid, |
426 | 426 | 'typeid' => $typeid, |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | 'currency' => $currency, |
433 | 433 | 'descr' => $descr, |
434 | 434 | 'typename' => $typename, |
435 | - 'level' => $level ); |
|
435 | + 'level' => $level); |
|
436 | 436 | } |
437 | 437 | return $arr; |
438 | 438 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * @param bool $itemtype |
51 | 51 | * @return |
52 | 52 | */ |
53 | - function efqItemType($obj=false) |
|
53 | + function efqItemType($obj = false) |
|
54 | 54 | { |
55 | 55 | global $moddir; |
56 | 56 | $this->db = Database::getInstance(); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * |
97 | 97 | * @return bool true if insertion is succesful, false if unsuccesful |
98 | 98 | */ |
99 | - function insert($obj, $forceQuery=false) { |
|
99 | + function insert($obj, $forceQuery = false) { |
|
100 | 100 | $tablename = "efqdiralpha1_itemtypes"; |
101 | 101 | $keyName = "typeid"; |
102 | 102 | $excludedVars = array(); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $strFields = ""; |
114 | 114 | $strValues = ""; |
115 | 115 | foreach ($cleanvars as $k => $v) { |
116 | - if ( !in_array($k, $excludedVars) ) { |
|
116 | + if (!in_array($k, $excludedVars)) { |
|
117 | 117 | $strFields .= $k; |
118 | 118 | $strValues .= "'".$v."'"; |
119 | 119 | if ($i < $countVars) { |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | * |
151 | 151 | * @return bool true if update is succesful, false if unsuccesful |
152 | 152 | */ |
153 | - function update($obj, $forceQuery=false) { |
|
153 | + function update($obj, $forceQuery = false) { |
|
154 | 154 | $tablename = "efqdiralpha1_itemtypes"; |
155 | 155 | $keyName = "typeid"; |
156 | 156 | $excludedVars = array(); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $strSet = ""; |
169 | 169 | $strValues = ""; |
170 | 170 | foreach ($cleanvars as $k => $v) { |
171 | - if ( !in_array($k, $excludedVars) ) { |
|
171 | + if (!in_array($k, $excludedVars)) { |
|
172 | 172 | if ($i < $countVars and $i > 0) { |
173 | 173 | $strSet .= ", "; |
174 | 174 | } |
@@ -196,13 +196,13 @@ discard block |
||
196 | 196 | * |
197 | 197 | * @return bool true or false |
198 | 198 | */ |
199 | - function set($typeid=0) { |
|
199 | + function set($typeid = 0) { |
|
200 | 200 | $sql = "SELECT typeid,typename,level,dirid FROM ".$this->db->prefix("efqdiralpha1_itemtypes")." WHERE typeid=".intval($typeid).""; |
201 | 201 | $result = $this->db->query($sql); |
202 | 202 | $numrows = $this->db->getRowsNum($result); |
203 | - if ( $numrows > 0 ) { |
|
203 | + if ($numrows > 0) { |
|
204 | 204 | while (list($typeid, $typename, $level, $dirid) = $this->db->fetchRow($result)) { |
205 | - if (! $this->objItemType) { |
|
205 | + if (!$this->objItemType) { |
|
206 | 206 | $this->objItemType = new efqSubscriptionOffer(); |
207 | 207 | } |
208 | 208 | $this->objItemType->setVar('typeid', $typeid); |
@@ -226,15 +226,15 @@ discard block |
||
226 | 226 | * @param integer $dirid |
227 | 227 | * @return array $arr or boolean false |
228 | 228 | */ |
229 | - function getByDir($dirid=0) { |
|
229 | + function getByDir($dirid = 0) { |
|
230 | 230 | $arr = array(); |
231 | 231 | $sql = "SELECT typeid,typename,level FROM ".$this->db->prefix("efqdiralpha1_itemtypes")." WHERE dirid=".intval($dirid).""; |
232 | 232 | if (!$result = $this->db->query($sql)) { |
233 | 233 | return false; |
234 | 234 | } |
235 | 235 | $numrows = $this->db->getRowsNum($result); |
236 | - while ( list($typeid,$typename,$level) = $this->db->fetchRow($result) ) { |
|
237 | - $arr[$typeid] = array('typeid' => $typeid,'typename' => $typename,'level' => $level); |
|
236 | + while (list($typeid, $typename, $level) = $this->db->fetchRow($result)) { |
|
237 | + $arr[$typeid] = array('typeid' => $typeid, 'typename' => $typename, 'level' => $level); |
|
238 | 238 | } |
239 | 239 | return $arr; |
240 | 240 | } |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | $tablename = "efqdiralpha1_itemtypes"; |
254 | 254 | $keyName = "typeid"; |
255 | 255 | $id = $obj->getVar($keyName); |
256 | - if ( $id != 0 ) { |
|
256 | + if ($id != 0) { |
|
257 | 257 | $sql = "DELETE FROM ".$this->db->prefix($tablename)." WHERE ".$keyName."=".intval($id).""; |
258 | 258 | $this->db->queryF($sql); |
259 | 259 | return true; |