10 if (isset(
$_GET[
'delete']) && (
$_GET[
'delete'] == 1))
12 if (isset(
$_GET[
'id']) && (!empty(
$_GET[
'id'])))
14 if (
$db->query(
"DELETE from {assets_types} WHERE id = $_GET[id]"))
16 alert::draw(
"success",
"$lang[SUCCESS]",
"$lang[ASSET_DEL_OK]",
"",
"800");
20 alert::draw(
"danger",
"$lang[ERROR]",
"$lang[ASSET_DEL_FAILED]",
"",
"2600");
25 if (isset(
$_GET[
'toggle']) &&
$_GET[
'toggle'] == 1)
29 $published =
$db->quote(
$_GET[
'published']);
34 else if ($published == 0)
38 if (
$db->query((
"UPDATE {assets_types}
39 SET published = '" . $published .
"'
40 WHERE id = '" .
$id .
"'")))
42 alert::draw(
"success",
"$lang[SUCCESS]",
"$lang[ASSET_TOGGLE_OK]",
"",
"800");
46 alert::draw(
"danger",
"$lang[ERROR]",
"$lang[ASSET_TOGGLE_FAILED]",
"",
"2600");
51 if (isset($_POST) && (!empty($_POST)))
54 if (isset(
$_GET[
'newAsset']) &&
$_GET[
'newAsset'] ==
true)
57 $assetType =
$db->quote($_POST[
'assetType']);
58 $assetName =
$db->quote($_POST[
'assetName']);
59 $property =
$db->quote($_POST[
'assetName']);
60 $internal =
$db->quote($_POST[
'internal']);
61 $url1 =
$db->quote($_POST[
'url1']);
62 $url2 =
$db->quote($_POST[
'url2']);
63 $url3 =
$db->quote($_POST[
'url3']);
65 $row =
$db->query(
"SELECT MAX(sortation) FROM {assets_types}");
66 $res = mysqli_fetch_row($row);
75 if (
$db->query(
"INSERT INTO {assets_types} (type, sortation, asset, property, internal, url1, url2, url3)
76 VALUES ('".$assetType.
"', '".$sortation.
"', '".$assetName.
"', '".$property.
"', '".$internal.
"',
77 '".$url1.
"', '".$url2.
"', '".$url3.
"')"))
79 alert::draw(
"success",
"$lang[SUCCESS]",
"$lang[ASSET_ADD_OK]",
"",
"1800");
83 alert::draw(
"danger",
"$lang[ERROR]",
"$lang[ASSET_ADD_FAILED]",
"",
"2600");
88 if (isset(
$_GET[
'edit']) &&
$_GET[
'edit'] == 1)
91 $id =
$db->quote($_POST[
'id']);
92 $assetType =
$db->quote($_POST[
'assetType']);
93 $assetName =
$db->quote($_POST[
'assetName']);
94 $property =
$db->quote($_POST[
'assetName']);
95 $internal =
$db->quote($_POST[
'internal']);
96 $url1 =
$db->quote($_POST[
'url1']);
97 $url2 =
$db->quote($_POST[
'url2']);
98 $url3 =
$db->quote($_POST[
'url3']);
99 $sortation =
$db->quote($_POST[
'sortation']);
102 if (
$db->query((
"UPDATE {assets_types}
103 SET type = '" . $assetType .
"',
104 asset = '" . $assetName .
"',
105 property = '" . $property .
"',
106 internal = '" . $internal .
"',
107 url1 = '" . $url1 .
"',
108 url2 = '" . $url2 .
"',
109 url3 = '" . $url3 .
"',
110 sortation = '" . $sortation .
"'
111 WHERE id = '" .
$id .
"'")))
113 alert::draw(
"success",
"$lang[SUCCESS]",
"$lang[ASSET_UPDATE_OK]",
"",
"800");
117 alert::draw(
"danger",
"$lang[ERROR]",
"$lang[ASSET_UPDATE_FAILED]",
"",
"2600");
127 <!-- Content Wrapper. Contains page content -->
128 <div class=\"content-wrapper\" id=\"content-FX\">
129 <!-- Content Header (Page header) -->
130 <section class=\"content-header\">";
132 echo backend::getTitle(
$lang[
'ASSETS'],
$lang[
'SETTINGS']);
133 echo backend::getSettingsBreadcrumbs(
$lang);
134 echo
"</section><!-- Main content -->
135 <section class=\"content\">";
140 <div
class=
"box-body">
141 <div
class=
"col-md-12">
142 <?php echo
"<h4><i class=\"fa fa-puzzle-piece\"></i> $lang[ASSETS] <small>$lang[ASSETS_SUBTEXT]</small></h4>"; ?>
146 <div
class=
"row animated fadeIn">
147 <div
class=
"col-md-8">
149 $res =
$db->query(
"SELECT * FROM {assets_types} ORDER BY asset");
150 while ($row = mysqli_fetch_assoc(
$res))
152 if ($row[
'published'] == 1)
154 $assetStatus =
"<i class=\"label label-success\">$lang[ONLINE]</i>";
158 $assetStatus =
"<i class=\"label label-danger\">$lang[OFFLINE]</i>";
161 if ($row[
'type'] == 1)
163 $assetType1Selected =
"selected";
167 $assetType1Selected =
'';
169 if ($row[
'type'] == 2)
171 $assetType2Selected =
"selected";
175 $assetType2Selected =
'';
177 if ($row[
'type'] == 3)
179 $assetType3Selected =
"selected";
183 $assetType3Selected =
'';
187 <div class=\"box box-default collapsed-box\">
188 <div class=\"box-header with-border\">
189 <h3 class=\"box-title\"><b>$row[sortation].</b> $row[asset] <small>$lang[EDIT]</small></h3>
191 <div class=\"box-tools pull-right\">
192 <small><a href=\"index.php?page=settings-assets&toggle=1&published=$row[published]&id=$row[id]\">$assetStatus</a></small>
193 <button type=\"button\" class=\"btn btn-box-tool\" data-widget=\"collapse\"><i class=\"fa fa-plus\"></i>
198 <div class=\"box-body\" style=\"display: none;\">
200 <form name=\"form\" role=\"form\" action=\"index.php?page=settings-assets&edit=1&id=$row[id]\" method=\"POST\">
201 <input type=\"hidden\" class=\"form-control\" name=\"id\" value=\"$row[id]\">
202 <label for=\"assetName\">$lang[NAME]</label>
203 <input type=\"text\" class=\"form-control\" name=\"assetName\" id=\"assetName\" value=\"$row[asset]\" placeholder=\"$lang[ASSET_NAME_PH]\">
204 <label for=\"internal\">$lang[INTERNAL]</label>
205 <input type=\"text\" class=\"form-control\" name=\"internal\" id=\"internal\" value=\"$row[internal]\" placeholder=\"$lang[ASSET_INTERNAL_PH]\">
206 <label for=\"url1\">$lang[URL] 1</label>
207 <input type=\"text\" class=\"form-control\" name=\"url1\" id=\"url1\" value=\"$row[url1]\" placeholder=\"$lang[ASSET_URL_PH]\">
208 <label for=\"url2\">$lang[URL] 2</label>
209 <input type=\"text\" class=\"form-control\" name=\"url2\" id=\"url2\" value=\"$row[url2]\" placeholder=\"$lang[ASSET_URL_PH]\">
210 <label for=\"url3\">$lang[URL] 3</label>
211 <input type=\"text\" class=\"form-control\" name=\"url3\" id=\"url3\" value=\"$row[url3]\" placeholder=\"$lang[ASSET_URL_PH]\">
212 <label for=\"assetType\">$lang[TYPE]</label>
213 <select class=\"form-control\" name=\"assetType\" id=\"assetType\">
214 <option value=\"1\">$lang[PLEASE_SELECT]</option>
215 <option value=\"1\" $assetType1Selected>$lang[REQUIRED]</option>
216 <option value=\"2\" $assetType2Selected>$lang[OPTIONAL]</option>
217 <option value=\"3\" $assetType3Selected>$lang[USER_DEFINED]</option>
219 <label for=\"sortation\">$lang[LOADING_ORDER]</label>
220 <input type=\"text\" class=\"form-control\" name=\"sortation\" id=\"sortation\" value=\"$row[sortation]\" placeholder=\"$lang[ORDER_PH]\">
221 <a style=\"margin-top:2px;\" role=\"dialog\" data-confirm=\"$lang[ASSET_DEL] «$row[asset]»\"
222 title=\"$lang[ASSET] $lang[DELETE]\" href=\"index.php?page=settings-assets&delete=1&id=$row[id]&asset=$row[asset]\" class=\"btn btn-default pull-left\"><i class=\"fa fa-trash-o\"></i> $lang[DELETE]</a>
223 <button class=\"btn btn-success pull-right\" type=\"submit\" value=\"save\" id=\"savebutton\" title=\"$lang[SAVE]\" name=\"save\" style=\"margin-top:2px;\"><i id=\"savebuttonIcon\" class=\"fa fa-check\"></i> $lang[SAVE_SETTINGS]</button>
232 <div
class=
"col-md-4">
233 <!-- add
new asset form -->
235 <div
class=
"box-header with-border">
236 <h3
class=
"box-title"><?php echo
$lang[
'ASSET']; ?> <small><?php echo
$lang[
'ADD']; ?> </small></h3>
238 <div
class=
"box-body">
239 <form
name=
"newAsset" role=
"form" action=
"index.php?page=settings-assets&newAsset=true" method=
"POST">
240 <label
for=
"assetName"><?php echo
$lang[
'NAME']; ?></label>
241 <input
type=
"text" class=
"form-control" name=
"assetName" id=
"assetName" placeholder=
"<?php echo $lang['ASSET_NAME_PH']; ?>">
242 <label
for=
"internal"><?php echo
$lang[
'INTERNAL']; ?></label>
243 <input
type=
"text" class=
"form-control" name=
"internal" id=
"internal" placeholder=
"<?php echo $lang['ASSET_INTERNAL_PH']; ?>">
244 <label
for=
"url1"><?php echo
$lang[
'URL']; ?> 1</label>
245 <input
type=
"text" class=
"form-control" name=
"url1" id=
"url1" placeholder=
"<?php echo $lang['ASSET_URL_PH']; ?>">
246 <label
for=
"url2"><?php echo
$lang[
'URL']; ?> 2</label>
247 <input
type=
"text" class=
"form-control" name=
"url2" id=
"url2" placeholder=
"<?php echo $lang['ASSET_URL_PH']; ?>">
248 <label
for=
"url3"><?php echo
$lang[
'URL']; ?> 3</label>
249 <input
type=
"text" class=
"form-control" name=
"url3" id=
"url3" placeholder=
"<?php echo $lang['ASSET_URL_PH']; ?>">
250 <label
for=
"assetType"><?php echo
$lang[
'TYPE']; ?></label>
251 <select
class=
"form-control" name=
"assetType" id=
"assetType">
252 <option value=
"1"><?php echo
$lang[
'REQUIRED']; ?></option>
253 <option value=
"2" selected><?php echo
$lang[
'OPTIONAL']; ?></option>
254 <option value=
"3"><?php echo
$lang[
'USER_DEFINED']; ?></option>
256 <button
class=
"btn btn-success pull-right" id=
"newAsset" name=
"newAsset" style=
"margin-top:2px;"><
i id=
"savebuttonIcon" class=
"fa fa-check"></
i>&
nbsp;&
nbsp;<?php echo
$lang[
'ASSET_ADD']; ?></button>
print $lang['FILEMAN_UPLOAD']
Throws a fancy Bootstrap Alert (success, info, warning or danger)
Backend class serves a few useful functions for the admin backend.
Mysqli database class; returns db connection object.
The language class - support multilingual backend.
<!-- backend language -->< h3 >< i class="fa fa-language"></i > & nbsp