-
Notifications
You must be signed in to change notification settings - Fork 1
/
wps-obj.php
50 lines (46 loc) · 1.4 KB
/
wps-obj.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/*
* $sql = "CREATE TABLE IF NOT EXISTS $table_name (
* id mediumint(9) NOT NULL AUTO_INCREMENT,
funnel_message varchar(255) NOT NULL,
active boolean NOT NULL DEFAULT FALSE,
phone boolean NOT NULL DEFAULT TRUE,
hero_image varchar(255),
header_icon varchar(255),
header_text varchar(255),
header_subtext varchar(255),
button_text varchar(255),
PRIMARY KEY (id)
) $charset_collate;";
*/
class FunnelObject
{
public $id;
public $message;
public $active;
public $phone;
public $hero_image;
public $header_icon;
public $header_text;
public $header_subtext;
public $button_text;
public $send_message;
//-1 id = new object
public function __construct($id = -1, $message = '', $active = true, $phone = true, $hero_image = '', $header_icon = '', $header_text = '', $header_subtext = '', $button_text = '', $send_message = '')
{
$this->id = $id;
$this->message = $message;
$this->active = $active;
$this->phone = $phone;
$this->hero_image = $hero_image;
$this->header_icon = $header_icon;
$this->header_text = FunnelObject::clear_backslashes($header_text);
$this->header_subtext = FunnelObject::clear_backslashes($header_subtext);
$this->button_text = FunnelObject::clear_backslashes($button_text);
$this->send_message = FunnelObject::clear_backslashes($send_message);
}
public static function clear_backslashes($string)
{
return str_replace('\\', '', $string);
}
}