@@ -41,11 +41,11 @@ public function index($start_record=0)
41
41
$ config ['base_url ' ] = base_url ()."/admin/message/index " ;
42
42
$ config ['total_rows ' ] = $ this ->messagemodel ->get_count ();
43
43
$ this ->pagination ->initialize ($ config );
44
- $ data ["pagination_helper " ] = $ this ->pagination ;
44
+ $ this -> data ["pagination_helper " ] = $ this ->pagination ;
45
45
46
46
$ messages = $ this ->messagemodel ->get_by_range ($ start_record ,$ config ['per_page ' ]);
47
- $ data ["messages " ] = $ messages ;
48
- return $ this ->view ($ data );
47
+ $ this -> data ["messages " ] = $ messages ;
48
+ return $ this ->view ($ this -> data );
49
49
}
50
50
catch (Exception $ err )
51
51
{
@@ -65,24 +65,24 @@ public function edit($id)
65
65
try
66
66
{
67
67
$ forms = $ this ->config ->item ("rules " );
68
- $ data ["message_form " ] = $ forms ["contact " ];
68
+ $ this -> data ["message_form " ] = $ forms ["contact " ];
69
69
70
70
if ($ this ->input ->post ("submit " )){
71
71
72
72
$ this ->load ->library ('form_validation ' );
73
73
$ this ->load ->helper ('form ' );
74
74
$ fv = $ this ->form_validation ;
75
- $ fv ->set_rules ($ data ["message_form " ]);
75
+ $ fv ->set_rules ($ this -> data ["message_form " ]);
76
76
77
77
if ($ fv ->run ())
78
78
{
79
79
$ message = $ this ->messagemodel ->get ($ id );
80
80
//print_r($message);exit;
81
- $ message = $ this ->mapper ->formToMessage ($ this ->input ,$ data ["message_form " ],$ message );
81
+ $ message = $ this ->mapper ->formToMessage ($ this ->input ,$ this -> data ["message_form " ],$ message );
82
82
if ($ this ->messagemodel ->save ($ message ))
83
83
{
84
- $ data ["status " ]->message = "City saved successfully " ;
85
- $ data ["status " ]->success = TRUE ;
84
+ $ this -> data ["status " ]->message = "City saved successfully " ;
85
+ $ this -> data ["status " ]->success = TRUE ;
86
86
}
87
87
else
88
88
{
@@ -91,15 +91,15 @@ public function edit($id)
91
91
}
92
92
else
93
93
{
94
- $ data ["status " ]->message = validation_errors ();
95
- $ data ["status " ]->success = FALSE ;
94
+ $ this -> data ["status " ]->message = validation_errors ();
95
+ $ this -> data ["status " ]->success = FALSE ;
96
96
}
97
97
}
98
98
99
- $ data ["message " ] = $ this ->messagemodel ->get ($ id );
100
- $ data ["action_url " ] = base_url ()."admin/message/edit/ " .$ id ;
99
+ $ this -> data ["message " ] = $ this ->messagemodel ->get ($ id );
100
+ $ this -> data ["action_url " ] = base_url ()."admin/message/edit/ " .$ id ;
101
101
102
- return $ this ->view ($ data );
102
+ return $ this ->view ($ this -> data );
103
103
}
104
104
catch (Exception $ err )
105
105
{
@@ -119,21 +119,21 @@ public function add()
119
119
try
120
120
{
121
121
$ forms = $ this ->config ->item ("rules " );
122
- $ data ["message_form " ] = $ forms ["contact " ];
122
+ $ this -> data ["message_form " ] = $ forms ["contact " ];
123
123
124
124
if ($ this ->input ->post ("submit " )){
125
125
$ this ->load ->library ('form_validation ' );
126
126
$ this ->load ->helper ('form ' );
127
127
$ fv = $ this ->form_validation ;
128
- $ fv ->set_rules ($ data ["message_form " ]);
128
+ $ fv ->set_rules ($ this -> data ["message_form " ]);
129
129
130
130
if ($ fv ->run ())
131
131
{
132
- $ message = $ this ->mapper ->formToMessage ($ this ->input ,$ data ["message_form " ]);
132
+ $ message = $ this ->mapper ->formToMessage ($ this ->input ,$ this -> data ["message_form " ]);
133
133
if ($ this ->messagemodel ->save ($ message ))
134
134
{
135
- $ data ["status " ]->message = "Message added successfully " ;
136
- $ data ["status " ]->success = TRUE ;
135
+ $ this -> data ["status " ]->message = "Message added successfully " ;
136
+ $ this -> data ["status " ]->success = TRUE ;
137
137
}
138
138
else
139
139
{
@@ -143,14 +143,14 @@ public function add()
143
143
}
144
144
else
145
145
{
146
- $ data ["status " ]->message = validation_errors ();
147
- $ data ["status " ]->success = FALSE ;
146
+ $ this -> data ["status " ]->message = validation_errors ();
147
+ $ this -> data ["status " ]->success = FALSE ;
148
148
}
149
149
}
150
150
151
- $ data ["action_url " ] = base_url ()."admin/message/add " ;
152
- $ data ["message " ] = new PdContact ();
153
- return $ this ->view ($ data );
151
+ $ this -> data ["action_url " ] = base_url ()."admin/message/add " ;
152
+ $ this -> data ["message " ] = new PdContact ();
153
+ return $ this ->view ($ this -> data );
154
154
}
155
155
catch (Exception $ err )
156
156
{
0 commit comments