OXIESEC PANEL
- Current Dir:
/
/
home
/
u116888525
/
domains
/
aretetesting.in
/
public_html
/
imc_testing
/
adminold
Server IP: 82.112.239.19
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
10/11/2024 05:53:15 AM
rwxr-xr-x
📄
.htaccess
129 bytes
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
.htpasswd
48 bytes
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
WS_FTP.LOG
61.05 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
access_control.php
6.46 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
admin_details.inc
961 bytes
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
admin_footer.inc
501 bytes
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
admin_footer.php
48 bytes
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
admin_header.php
4.2 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
admin_header.php.1.6.2015
3.94 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
admin_links.inc
1.1 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
admin_login.php
2.21 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
admin_new-06-02-2019.php
30.19 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
admin_new.php
30.6 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
admin_setup.sql
1.82 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
admin_style.inc
652 bytes
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
admin_style.sql
1.67 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
admin_table.php
829 bytes
10/11/2024 05:50:59 AM
rw-rw-rw-
📁
assetmanager
-
10/11/2024 05:50:59 AM
rwxr-xr-x
📄
banners.inc
867 bytes
10/11/2024 05:50:59 AM
rw-rw-rw-
📁
bootstrap
-
10/11/2024 05:50:59 AM
rwxr-xr-x
📄
cms_links.inc
1.65 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
commitee-4.10.19.inc
2.38 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
commitee-4.7.19.inc
2.33 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
commitee.inc
2.53 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
committee_main_cat.inc
1.63 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
committee_sub_cat.inc
1.74 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
contact_form.inc
1.6 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
content.inc
2.14 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
dblib.php
4.55 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
dblib.php.old
4.25 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
event_budget.inc
1.91 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
event_documents.inc
1.73 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
event_gallery.inc
1.71 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
events.inc
2.46 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
func_lib.php
33.68 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
gallery.inc
1.57 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
genmodfile.php
4.61 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
headers.inc
825 bytes
10/11/2024 05:50:59 AM
rw-rw-rw-
📁
images
-
10/11/2024 05:50:59 AM
rwxr-xr-x
📄
imc_journals.inc
1.78 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
index.html
227 bytes
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
index.php
1.47 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
industry_notifications.inc
1.89 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
international_collaborations.inc
1.51 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
job_applications.inc
1.69 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
job_opportunities.inc
2.02 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📁
js
-
10/11/2024 05:50:59 AM
rwxr-xr-x
📄
leaders.inc
1.71 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
mailtest.php
772 bytes
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
main_category.inc
1.55 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
maincat.inc
852 bytes
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
media_coverage.inc
1.87 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
member_contacts.inc
2.67 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
membership_appr_committe.inc
1.81 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
membership_cost.inc
2.05 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
membership_reg.inc
5.67 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
membership_track.inc
1.82 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
membership_type.inc
1.83 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
milestones.inc
1.56 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
newsletter.inc
1.54 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
presentations.inc
1.69 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
press_release.inc
1.69 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
publications.inc
1.57 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
sample.inc
1.87 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
save_to_excel.php
1.71 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📁
scripts
-
10/11/2024 05:50:59 AM
rwxr-xr-x
📄
setup_wizard.php
3.31 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📁
style
-
10/11/2024 05:50:59 AM
rwxr-xr-x
📄
subcat.inc
1.14 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
testimonials.inc
1.72 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
upload.inc
1.23 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
upload_file_new.php
2.37 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
users.inc
1.71 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
vendors.inc
1.95 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
venue.inc
2.18 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
📄
videos.inc
1.83 KB
10/11/2024 05:50:59 AM
rw-rw-rw-
Editing: admin_new.php
Close
<?php /*ini_set('display_errors', 'On'); error_reporting(E_ALL);*/ session_start(); include('dblib.php'); include('func_lib.php'); //Replace the code below with get & post on top of every page $getar = $_GET; $getkeys = array_keys($getar); for($i=0; $i<count($getkeys); $i++){ $k = $getkeys[$i]; $v = $getar[$k]; ${$k}=cleanQuery($v,"yes"); } $getar = $_POST; $getkeys = array_keys($getar); for($i=0; $i<count($getkeys); $i++){ $k = $getkeys[$i]; $v = $getar[$k]; ${$k}=cleanQuery($v,"yes"); } $admin_user = $_SESSION["admin_user"]; $num_records = $_SESSION["num_records"]; $return_url = $_SESSION["return_url"]; include('admin_header.php'); // Include File Selection if ($zid == "admin") { include('admin_table.php'); } else { include($zid.'.inc');} if ($admin_user) { $this_filename = "admin_new.php?zid=".$zid."&"; if ($add_filter == 1) { $temp_num = sizeof($filter_list); for ($k=0;$k<=$temp_num-1;$k++) { $temp = $filter_list[$k]; $dd_arr = $$temp; $temp2 = $dd_arr[1]; if (count($dd_arr) > 0 && $$temp2 != "") { $filter_variables .= "&".$dd_arr[1]."=".$$temp2; } } } //-------------------------------------------------------------------------------------------- // VIEW/EDIT CATALOG //-------------------------------------------------------------------------------------------- if ($action == "view_catalog" || $action == "" || $action == "search_item" || $action == "filter") { //Number of Items per page if ($num_records == "") { $num_records = 50; } // Generate Query String $return_url = "admin_new.php?zid=".$zid; $export_url = ""; if ($action != "") { $return_url .= "&action=".$action; } if ($keyword != "") { $return_url .= "&keyword=".$keyword; } if ($filter_variables != "") { $return_url .= $filter_variables; $export_url .= $filter_variables; } $return_url_without_sortby = $return_url; if ($sortby != "") { $return_url .= "&sortby=".$sortby; } $return_url_without_start = $return_url; if ($start != "") { $return_url .= "&start=".$start; } $_SESSION['return_url'] = $return_url; if ($action == "") { $action = "view_catalog"; } // Algorithm for breaking results into pages if ($start == "") { $start = 0; } // Determine Sort Order if Empty if ($sortby == "") {$sortby = "sr_no"; } echo "<div class=\"row\" style=\"padding:5px 0px;\">\n"; echo "<h4>".strtoupper($admin_title)."</h4>\n"; echo "</div>\n"; // Search Form echo "<div class=\"row\" style=\"padding:10px 0px 20px 0px;\">\n"; echo "<form action=\"admin_new.php?zid=".$zid."&action=search_item\" method=\"post\" name=\"form1\" class=\"form-inline\">\n"; echo "Search: <input type=\"text\" size=\"25\" name=\"keyword\" class=\"form-control input-sm\" value=\"".$keyword."\">\n"; echo "<input type=\"submit\" class=\"btn btn-default btn-sm\" value=\"Go\">\n"; echo "</form>\n"; echo "</div>\n"; // Filter Form if ($add_filter == "1") { echo "<div class=\"row\" style=\"padding:15px 0px 30px 0px;\">\n"; echo "<form action=\"admin_new.php?zid=".$zid."&action=filter\" method=\"post\" name=\"form_filter\" class=\"form-inline\">\n"; echo "Quick Filter: \n"; $filter_size = sizeof($filter_list); for ($j=0;$j<=$filter_size-1;$j++) { $tempnew = $filter_list[$j]; $dd_arr = $$tempnew; $sql_dd = "select $dd_arr[2], $dd_arr[3] from $dd_arr[0]"; if ($dd_arr[0] == $table_name) { $sql_dd .= " group by $dd_arr[2]";} $qid_dd = db_query($sql_dd); $num_dd = db_num_rows($qid_dd); echo "<select name=\"$dd_arr[1]\" class=\"form-control input-sm\">\n"; echo "<option value=\"\">-- $dd_arr[5] --</option>\n"; for ($y=0;$y<=$num_dd-1;$y++) { $result_dd = db_fetch_row($qid_dd); echo "<option value=\"$result_dd[0]\""; $temp2 = $dd_arr[1]; if ($result_dd[0] == $temp2) { echo " selected";} echo ">".$result_dd[1]."</option>\n"; } echo "</select>"; echo " \n"; } echo "<input type=\"submit\" class=\"btn btn-default btn-sm\" value=\"Go\">\n"; echo "</form>\n"; echo "</div>\n"; } // Build Query List $query_list = implode(", ",$table_query_list); // Query for Search if ($action == "search_item") { $sql = "select ".$query_list." from ".$table_name." where ("; $num = sizeof($search_list); for ($k=0; $k<=$num-1;$k++) { $sql = $sql.$search_list[$k]." like \"%".$keyword."%\" or "; } $sql = substr($sql,0,strlen($sql)-4); $sql = $sql.") "; } //Query For Filter if ($action == "filter") { $sql = "select ".$query_list." from ".$table_name." where "; $temp_num = sizeof($filter_list); for ($j=0;$j<=$temp_num-1;$j++) { $temp = $filter_list[$j]; $dd_arr = $$temp; $temp2 = $dd_arr[1]; if (count($temp_num) > 0 && $$temp2 != "") { $sql .= $dd_arr[1]." = '".$$temp2."' and "; } } $sql = substr($sql,0,strlen($sql)-5); } // Query For General Listing if ($action == "" || $action == "view_catalog") { $sql = "select ".$query_list." from ".$table_name." "; } // Add Sort Order and Pagination Limits to query $sql = $sql." order by ".$sortby; $sql_pagination = $sql; $sql = $sql." limit ".$start.", ".$num_records; //echo $sql; $qid = db_query($sql); $num = db_num_rows($qid); echo "<script>\n"; echo "function save_to_excel() \n"; echo "{ \n"; echo "for (var i=0;i < document.form5.elements.length;i++)\n"; echo " {\n"; echo " var e = document.form5.elements[i];\n"; echo " if (e.type == \"checkbox\" && e.checked)\n"; echo " {\n"; echo " var flagh = 1 \n"; echo " }\n"; echo " }\n"; echo "document.form5.action = \"save_to_excel.php?zid=".$zid."&tablename=".$table_name."&flagh=\"+flagh+\"&".$back_query_string."\"; \n"; echo "document.form5.submit(); \n"; echo "} \n"; echo "function redirect_form(num) \n"; echo "{ \n"; echo "if (num == 1) \n"; echo "{ \n"; echo "var answer = confirm (\"Are you sure you want to delete this record?\")\n"; echo "if (answer)\n"; echo "{ \n"; echo "document.form5.action = \"admin_new.php?zid=".$zid."&action=new_del&".$back_query_string."\"; \n"; echo "document.form5.submit(); \n"; echo "} \n"; echo "} \n"; echo "} \n"; echo "function change_pagenum()\n"; echo "{\n"; echo "document.location = \"admin_new.php?zid=".$zid."&action=change_pagenum&pagenum=\" + document.form5.pagenum.value + \"&".$back_query_string."\"; \n"; echo "}\n"; echo "function CheckAll(chk)\n"; echo "{\n"; echo "for (var i=0;i < document.form5.elements.length;i++)\n"; echo " {\n"; echo " var e = document.form5.elements[i];\n"; echo " if (e.type == \"checkbox\")\n"; echo " {\n"; echo " e.checked = chk.checked;\n"; echo " }\n"; echo " }\n"; echo "}\n"; echo "function delete_confirm(id)\n"; echo "{\n"; echo "var answer = confirm (\"Are you sure you want to delete this record?\")\n"; echo "if (answer)\n"; echo "{ \n"; echo "document.location = \"".$this_filename."action=del_item&id=\"+id; \n"; echo " }\n"; echo "}\n"; echo "</script>\n"; echo "<form name=\"form5\" method=\"post\" class=\"form-inline\">\n"; echo "<div class=\"row\" style=\"padding:5px 0px;\">\n"; echo "<div class=\"col-lg-6 col-md-6 col-sm-6\" style=\"border:0px solid red;\">\n"; echo "<a href=\"".$this_filename."action=add_item&".$back_query_string."\" class=\"btn btn-primary btn-sm\"><span class=\"glyphicon glyphicon-plus\" aria-hidden=\"true\"></span> Add an Item</a></span>\n"; echo "<a href=\"admin_new.php?zid=$zid&sortby=$sortby\" class=\"btn btn-primary btn-sm\">View All</a>\n"; echo "<a href=\"save_to_excel.php?tablename=".$table_name.$export_url."\" class=\"btn btn-primary btn-sm\"><span class=\"glyphicon glyphicon-export\" aria-hidden=\"true\"></span> Export to Excel</a>\n"; // Total records for display and pagination $qid_pagination = db_query($sql_pagination); $num_pagination = db_num_rows($qid_pagination); echo "<span style=\"margin-left:20px;\">".$num_pagination." records found.</span>\n"; echo "</div>\n"; echo "<div class=\"col-lg-6 col-md-6 col-sm-6\" style=\"text-align:right;\">\n"; echo "Items per page \n"; echo "<select name=\"pagenum\" onchange=\"javascript:change_pagenum();\" class=\"form-control input-sm\">\n"; echo "<option value=\"5\""; if ($num_records == 5) { echo " selected"; } echo ">5\n"; echo "<option value=\"10\""; if ($num_records == 10) { echo " selected"; } echo ">10\n"; echo "<option value=\"25\""; if ($num_records == 25) { echo " selected"; } echo ">25\n"; echo "<option value=\"50\""; if ($num_records == 50) { echo " selected"; } echo ">50\n"; echo "<option value=\"100\""; if ($num_records == 100) { echo " selected"; } echo ">100\n"; echo "<option value=\"150\""; if ($num_records == 150) { echo " selected"; } echo ">150\n"; echo "<option value=\"200\""; if ($num_records == 200) { echo " selected"; } echo ">200\n"; echo "</select> \n"; echo "<a href=\"javascript:redirect_form(1)\" class=\"btn btn-primary btn-sm\">Delete Selected</a>\n"; echo "</div>\n"; echo "</div>\n"; if ($zid == "content" || $zid == "admin") { $column_span = sizeof($table_query_list)+5; } else { $column_span = sizeof($table_query_list)+4; } echo "<div class=\"row\" style=\"padding:5px 0px;\">\n"; echo "<table class=\"table table-striped table-hover\"> \n"; echo "<tr><td colspan=\"".$column_span."\">\n"; // Generate the pagination code $pagination_code = ""; $pagination_code .= "<div style=\"width:auto; margin-left:10px; height:auto; float:right;\">\n"; $pagination_code .= " Jump to "; $pagination_code .= "<select name=\"jump_to_1\" id=\"jump_to_1\" onchange=\"javascript:jumpto(1);\" class=\"form-control input-sm\">\n"; $ctr = 1; for ($i=0;$i<=$num_pagination-1;$i += $num_records) { $pagination_code .= "<option value=\"".$i."\""; if ($start == $i) { $pagination_code .= " selected "; } $pagination_code .= ">".$ctr."</option>\n"; $ctr ++; } $pagination_code .= "</select></div>\n"; $pagination_code .= "<div style=\"float:right;\">\n"; $pagination_code .= "<ul class=\"pagination pagination-sm\" style=\"margin:0px;\">\n"; $ctr = 1; for ($i=0;$i<=$num_pagination-1;$i += $num_records) { if ($i >= ($start - ($num_records*5)) && $i <= ($start + ($num_records*5)) ) { if ($start == $i) { $pagination_code .= "<li class=\"active\"><a href=\"#\">".$ctr."</a></li>"; } else { $pagination_code .= "<li><a href=\"".$return_url_without_start."&start=".$i."\">".$ctr."</a></li>"; } } $ctr ++; } $pagination_code .= "</ul></div>\n"; $pagination_code .= "<div style=\"float:right; padding-top:5px;\">Pages: </div>\n"; $pagination_code .= "<script>\n"; $pagination_code .= "function jumpto(num)\n"; $pagination_code .= "{\n"; $pagination_code .= "document.location = '".$return_url_without_start."&start=' + $('#jump_to_' + num).val(); \n"; $pagination_code .= "} \n"; $pagination_code .= "</script>\n"; echo $pagination_code; echo "</td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td valign=\"center\" style=\"padding-top:25px;\"><input type=checkbox onclick=\"javascript:CheckAll(this);\" value=\"Check All\"></td>\n"; // Display Header $header_num = sizeof($table_query_list); for ($i=0; $i<=$header_num-1; $i++) { echo "<td>\n"; echo "<a href=\"".$return_url_without_sortby."&sortby=".$table_query_list[$i]."&start=".$start."\"><img src=\"images/triangle-u.gif\" hspace=0 vspace=0 border=0></a><br />\n"; echo "<span class=\"table_headings\">".$table_header_list[$i]."</span><br />\n"; echo "<a href=\"".$return_url_without_sortby."&sortby=".$table_query_list[$i]."+desc&start=".$start."\"><img src=\"images/triangle-d.gif\" hspace=0 vspace=0 border=0></a>\n"; echo "</td>\n"; } echo "<td valign=\"center\" style=\"padding-top:25px;\">View</td>\n"; echo "<td valign=\"center\" style=\"padding-top:25px;\">Edit</td>\n"; echo "<td valign=\"center\" style=\"padding-top:25px;\">Delete</td>\n"; if ($zid == "admin") { echo "<td align=\"right\" style=\"padding-top:25px;\">Access Distrib</span> | Change Password</td>\n"; } $max_value = 0; for ($j=0;$j<=$num-1;$j++) { $result = db_fetch_row($qid); if ($result[0] > $max_value) { $max_value = $result[0]; } echo "<tr>\n"; echo "<td><input type=\"checkbox\" name=\"item".$result[0]."\" value=\"$result[0]\"></td>\n"; $num2 = sizeof($result); for ($k=0;$k<=$num2-1;$k++) { echo "<td>".$result[$k]."</td>\n"; } echo "<td align=\"center\"><a href=\"admin_new.php?zid=".$zid."&action=view_item&id=".$result[0]."\" title=\"View\"><span class=\"glyphicon glyphicon-search\" aria-hidden=\"true\"></span></a></td>\n"; //<span class=\"glyphicon glyphicon-remove\" aria-hidden=\"true\"></span> echo "<td align=\"center\"><a href=\"admin_new.php?zid=".$zid."&action=edit_item&id=".$result[0]."\" title=\"Edit\" rel=\"Edit\"><span class=\"glyphicon glyphicon-pencil\" aria-hidden=\"true\"></span></a></td>\n"; echo "<td align=\"center\"><a href=\"javascript:delete_confirm(".$result[0].")\" title=\"Delete\"><span class=\"glyphicon glyphicon-remove\" aria-hidden=\"true\"></span></a></td>\n"; if ($zid == "admin") { echo "<td align=\"right\">\n"; echo "<a href=\"access_control.php?sr_no=".$result[0]."\">Access distrib</a>\n"; echo " | "; echo "<a href=\"access_control.php?action=change_password&sr_no=".$result[0]."\">Change Password</a>\n"; echo "</td>\n"; } echo "</tr>\n"; } // Pagination Starts echo "<tr><td colspan=\"".$column_span."\" align=\"right\">\n"; $pagination_code = str_replace("jump_to_1","jump_to_2",$pagination_code); $pagination_code = str_replace("jumpto(1)","jumpto(2)",$pagination_code); echo $pagination_code; echo "<input type=\"hidden\" value=\"".$max_value."\" name=\"max_value\">\n"; echo "</td>\n"; echo "</tr>\n"; echo "</table>\n"; echo "</div>\n"; echo "</form>\n"; } //-------------------------------------------------------------------------------------------- // VIEW ITEM //-------------------------------------------------------------------------------------------- if ($action == "view_item") { $sql = "select "; $num = sizeof($add_edit_query); for ($k = 0; $k<=$num-1;$k++) { $sql = $sql.$add_edit_query[$k].","; } $sql = substr($sql,0,strlen($sql)-1); $sql = $sql . " from ".$table_name." where sr_no = \"".$id."\""; $qid = db_query($sql); $result = db_fetch_row($qid); echo "<div class=\"row\" style=\"padding:5px 0px; text-align:right;\">\n"; echo "<a href=\"".$return_url."\" class=\"btn btn-primary btn-sm\"><span class=\"glyphicon glyphicon-share-alt\" aria-hidden=\"true\"></span> Back</a>\n"; echo "</div>\n"; echo "<div class=\"row\" style=\"padding:5px 0px;\">\n"; echo "<h4>".$admin_title." > View Item</h4>\n"; echo "</div>\n"; echo "<div class=\"row\" style=\"padding:5px 0px;\">\n"; echo "<table class=\"table table-striped table-hover\">\n"; $num = sizeof($add_edit_list); echo "<tr bgcolor=\"#ffffff\">\n"; echo "<td valign=\"top\"><span class=\"table_headings\">Sr No</span></td>\n"; echo "<td valign=\"top\">".$result[0]."</td></tr>\n"; for ($i=1;$i<=$num-1;$i++) { echo "<tr bgcolor=\"#ffffff\">\n"; echo "<td valign=\"top\" class=\"table_headings\">\n"; echo $add_edit_list[$i]; echo "</td><td valign=\"top\">\n"; if ($add_edit_type[$i] == "textareabig" || $add_edit_type[$i] == "textarea") { echo nl2br($result[$i]); } else if ($add_edit_type[$i] == "upload") { $ext = substr($result[$i], strrpos($result[$i], ".") + 1); if ($ext == "jpg" || $ext == "JPG" || $ext == "jpeg" || $ext == "JPEG" || $ext == "gif" || $ext == "GIF" || $ext == "png" || $ext == "PNG") { echo "<img src=\"".$upload_dir."/".$result[$i]."\" class=\"img-responsive\" />\n"; } else { echo "<a href=\"".$upload_dir."/".$result[$i]."\">Download File</a>\n"; } } else { echo $result[$i]; } echo "</td></tr>\n"; } echo "</table>\n"; echo "</div>\n"; } //-------------------------------------------------------------------------------------------- // ADD ITEM //-------------------------------------------------------------------------------------------- if ($action == "add_item") { echo "<div class=\"row\" style=\"padding:5px 0px; text-align:right;\">\n"; echo "<a href=\"".$return_url."\" class=\"btn btn-primary btn-sm\"><span class=\"glyphicon glyphicon-share-alt\" aria-hidden=\"true\"></span> Back</a>\n"; echo "</div>\n"; echo "<div style=\"width:100%; height:auto; float:left; margin:10px 0px;\">\n"; echo "<h4>".$admin_title." > Add An Item</h4>\n"; echo "</div>\n"; echo "<div style=\"width:100%; height:auto; float:left; margin:10px 0px;\">\n"; echo "<form action=\"".$this_filename."action=save_new_item\" method=\"post\" name=\"form1\" class=\"form-inline\">\n"; echo "<input type=hidden name=sr_no value=\"".$id."\">"; echo "<div class=\"row\" style=\"padding:5px 0px;\">\n"; echo "<table class=\"table table-striped table-hover\">\n"; $num = sizeof($add_edit_list); for ($i=1;$i<=$num-1;$i++) { echo "<tr><td valign=\"top\">\n"; echo $add_edit_list[$i]; echo "</td><td valign=\"top\">\n"; // ------------------------------------------- // ALL EXCEPTIONS AND SET FLAG FOR EXCEPTIONS // -------------------------------------------- $flag=0; // Exception 1 if ($add_edit_list[$i] == "Status" || $add_edit_list[$i] == "status") { echo "<input type=text name=\"status\" size=25 value=\"active\" class=\"form-control input-sm\">\n"; $flag=1; } // -------------------------------------------- // IF NO FLAG FOR EXCEPTIONS CONTINUE AS USUAL if ($flag == 0) { // DEFINE TEXT AREAS AND TEXT BOXES AND OTHER TYPES if ($add_edit_type[$i] == "upload") { $img_container_id = "img_container_".$i; echo "<input type=text name=\"".$add_edit_query[$i]."\" id=\"".$add_edit_query[$i]."\" size=\"35\" ><br />\n"; echo "<iframe src =\"upload_file_new.php?up_dir=".$upload_dir."¶m=".$add_edit_query[$i]."&img_container_id=".$img_container_id."\" frameborder=\"0\" width=\"350\" height=\"85\" ></iframe>"; echo "<div id=\"".$img_container_id."\">\n"; if ($result[$i] != "") { echo "<img src=\"".$upload_dir."/".$result[$i]."\" hspace=\"0\" vspace=\"0\" border=\"0\">\n"; } echo "</div>\n"; } if ($add_edit_type[$i] == "text") { echo "<input type=text name=\"".$add_edit_query[$i]."\" size=\"25\" class=\"form-control input-sm\">\n"; } if ($add_edit_type[$i] == "textarea") { echo "<textarea cols=40 rows=4 name=\"".$add_edit_query[$i]."\" class=\"form-control input-sm\"></textarea>\n"; } if ($add_edit_type[$i] == "textareabig") { echo "<textarea cols=65 rows=20 name=\"".$add_edit_query[$i]."\" class=\"form-control input-sm\"></textarea>\n"; } if ($add_edit_type[$i] == "html") { echo "<textarea id=\"".$add_edit_query[$i]."\" name=\"".$add_edit_query[$i]."\" rows=\"14\" cols=\"50\" class=\"form-control input-sm\">\n"; echo "</textarea>\n"; ?> <script type="text/javascript"> $(document).ready(function () { $('#<?php echo $add_edit_query[$i]; ?>').liveEdit({ css: ['../style/class.css'], returnKeyMode: 2, fileBrowser: 'assetmanager/asset.php', groups: [ ["group1", "", ["Bold", "Italic", "Underline", "Styles", "FontName", "FontSize", "ForeColor", "TextDialog", "RemoveFormat"]], ["group2", "", ["Bullets", "Numbering", "JustifyLeft", "JustifyCenter", "JustifyRight"]], ["group3", "", ["LinkDialog", "ImageDialog", "YoutubeDialog", "TableDialog"]], ["group4", "", ["Undo", "Redo", "FullScreen", "SourceDialog"]] ] /* Toolbar configuration */ }); $('#<?php echo $add_edit_query[$i]; ?>').data('liveEdit').startedit(); /* Run the Editor */ }); </script> <?php $flag=1; } if (preg_match('/dropdown/',$add_edit_type[$i])) { $ddn_str = explode(':',$add_edit_type[$i]); $temp = $ddn_str[1]; $dd_arr = $$temp; if (count($dd_arr) > 0) { $sql_dd = "select $dd_arr[2], $dd_arr[3] from $dd_arr[0]"; $qid_dd = db_query($sql_dd); $num_dd = db_num_rows($qid_dd); echo "<select name=\"$dd_arr[1]\">\n"; echo "<option value=\"\">-- $dd_arr[5] --</option>\n"; for ($y=0;$y<=$num_dd-1;$y++) { $result_dd = db_fetch_row($qid_dd); echo "<option value=\"$result_dd[0]\">".$result_dd[1]."</option>\n"; } echo "</select>"; } } if ($add_edit_type[$i] == "increment") { echo "<input type=text name=\"$add_edit_query[$i]\" size=\"25\" value=\"".get_max($table_name,$add_edit_query[$i])."\">\n"; } if ($add_edit_type[$i] == "date") { echo "<input type=text name=\"$add_edit_query[$i]\" size=\"25\" value=\"".date('Y-m-d')."\">\n"; } } echo "</td></tr>\n"; } echo "<tr>\n"; echo "<td colspan=\"2\"><input type=\"submit\" value=\"Add Item\" class=\"btn btn-primary\">\n"; echo " <input type=\"checkbox\" name=\"re_edit\" value=\"yes\""; if ($_SESSION['re_edit'] == "yes") { echo " checked "; } echo "> <span style=\"line-height:16px;\">Save & Edit this record?</span> \n"; echo "</td>\n"; echo "<input type=\"hidden\" name=\"tp1\" value=\"".count($add_edit_query)."\" >"; echo "<input type=\"hidden\" id=\"uploaddir\" value=\"".$upload_dir."\" >"; echo "</tr>\n"; echo "</table>\n"; echo "</div>\n"; echo "</form>\n"; } //-------------------------------------------------------------------------------------------- // ADD NEW ITEM //-------------------------------------------------------------------------------------------- if ($action == "save_new_item") { $sr_no = get_max($table_name,"sr_no"); $sql = "insert into ".$table_name." ("; $num = sizeof($add_edit_list); for ($i=0;$i<=$num-1;$i++) { $sql = $sql." ".$add_edit_query[$i].","; } $sql = substr($sql,0,strlen($sql)-1); $sql = $sql.") values ("; for ($i=0;$i<=$num-1;$i++) { $temp = "$".$add_edit_query[$i]; eval( "\$temp = \"$temp\";" ); $sql = $sql."'".$temp."',"; } $sql = substr($sql,0,strlen($sql)-1); $sql = $sql.")"; $qid = db_query($sql); $_SESSION['interstitial'] = "Record Added!"; if ($re_edit == "yes") { $_SESSION['re_edit'] = "yes"; } else { $_SESSION['re_edit'] = ""; } echo "<script>\n"; if ($re_edit == "") { echo "document.location = \"".$return_url."\"; \n"; } else { echo "document.location = \"admin_new.php?zid=".$zid."&action=edit_item&id=".$sr_no."\"; \n"; } echo "</script>\n"; } //-------------------------------------------------------------------------------------------- // EDIT ITEM //-------------------------------------------------------------------------------------------- if ($action == "edit_item") { echo "<div class=\"row\" style=\"padding:5px 0px; text-align:right;\">\n"; echo "<a href=\"".$return_url."\" class=\"btn btn-primary btn-sm\"><span class=\"glyphicon glyphicon-share-alt\" aria-hidden=\"true\"></span> Back</a>\n"; echo "</div>\n"; echo "<div class=\"row\" style=\"padding:5px 0px;\">\n"; echo "<h4>".$admin_title." > Edit Item</h4>\n"; echo "</div>\n"; $sql = "select "; $num = sizeof($add_edit_query); for ($k = 0; $k<=$num-1;$k++) { $sql = $sql.$add_edit_query[$k].","; } $sql = substr($sql,0,strlen($sql)-1); $sql = $sql . " from ".$table_name." where sr_no = \"".$id."\""; $qid = db_query($sql); $result = db_fetch_row($qid); function encodeHTML($sHTML) { $sHTML=str_replace("&","&",$sHTML); $sHTML=str_replace("<","<",$sHTML); $sHTML=str_replace(">",">",$sHTML); return $sHTML; } echo "<form action=\"".$this_filename."action=save_item\" method=\"post\" name=\"form1\" class=\"form-inline\">\n"; echo "<input type=\"hidden\" name=\"sr_no\" value=\"".$id."\">"; echo "<div class=\"row\" style=\"padding:5px 0px;\">\n"; echo "<table class=\"table table-striped table-hover\">\n"; $num = sizeof($add_edit_list); echo "<tr>\n"; echo "<td valign=\"top\">Sr No</span></td>\n"; echo "<td valign=\"top\">".$result[0]."</td>\n"; echo "</tr>\n"; for ($i=1;$i<=$num-1;$i++) { echo "<tr>\n"; echo "<td valign=\"top\">\n"; echo $add_edit_list[$i]; echo "</td>\n"; echo "<td valign=\"top\">\n"; // DEFINE TEXT AREAS AND TEXT BOXES AND OTHER TYPES if ($add_edit_type[$i] == "text" || $add_edit_type[$i] == "increment") { echo "<input type=text name=\"".$add_edit_query[$i]."\" size=25 value=\"".stripslashes($result[$i])."\" class=\"form-control input-sm\">\n"; } if ($add_edit_type[$i] == "textarea") { echo "<textarea cols=40 rows=4 name=\"".$add_edit_query[$i]."\" class=\"form-control input-sm\">".stripslashes($result[$i])."</textarea>\n"; } if ($add_edit_type[$i] == "textareabig") { echo "<textarea cols=55 rows=12 name=\"".$add_edit_query[$i]."\" class=\"form-control input-sm\">".stripslashes($result[$i])."</TEXTAREA>\n"; } if ($add_edit_type[$i] == "date") { if ($result[$i] != "0000-00-00" && $result[$i] != "") { echo "<input type=text name=\"$add_edit_query[$i]\" size=\"25\" value=\"".$result[$i]."\" class=\"form-control input-sm\">\n"; } else { echo "<input type=text name=\"$add_edit_query[$i]\" size=\"25\" class=\"form-control input-sm\" >\n"; } } if ($add_edit_type[$i] == "html") { echo "<textarea id=\"".$add_edit_query[$i]."\" name=\"".$add_edit_query[$i]."\" rows=4 cols=30>\n"; $sContent=stripslashes($result[$i]); //Remove slashes echo encodeHTML($sContent); echo "</textarea>\n"; ?> <script type="text/javascript"> $(document).ready(function () { $('#<?php echo $add_edit_query[$i]; ?>').liveEdit({ css: ['../style/class.css'], returnKeyMode: 2, fileBrowser: '../../assetmanager/assetmanager.php', groups: [ ["group1", "", ["Bold", "Italic", "Underline", "Styles", "FontName", "FontSize", "ForeColor", "TextDialog", "RemoveFormat"]], ["group2", "", ["Bullets", "Numbering", "JustifyLeft", "JustifyCenter", "JustifyRight"]], ["group3", "", ["LinkDialog", "ImageDialog", "YoutubeDialog", "TableDialog"]], ["group4", "", ["Undo", "Redo", "FullScreen", "SourceDialog"]] ] /* Toolbar configuration */ }); $('#<?php echo $add_edit_query[$i]; ?>').data('liveEdit').startedit(); /* Run the Editor */ }); </script> <?php } if ($add_edit_type[$i] == "upload") { $img_container_id = "img_container_".$i; echo "<input type=text name=\"".$add_edit_query[$i]."\" id=\"".$add_edit_query[$i]."\" size=25 value=\"".stripslashes($result[$i])."\" class=\"form-control input-sm\"><br />\n"; echo "<iframe src =\"upload_file_new.php?up_dir=".$upload_dir."¶m=".$add_edit_query[$i]."&img_container_id=".$img_container_id."\" frameborder=\"0\" width=\"350\" height=\"85\"></iframe>"; echo "<div id=\"".$img_container_id."\">\n"; if ($result[$i] != "") { echo "<img src=\"".$upload_dir."/".$result[$i]."\" hspace=\"0\" vspace=\"0\" border=\"0\">\n"; } echo "</div>\n"; } if (preg_match('/dropdown/',$add_edit_type[$i])) { $ddn_str = explode(':',$add_edit_type[$i]); $temp = $ddn_str[1]; $dd_arr=$$temp; if (count($dd_arr) > 0) { $sql_dd = "select $dd_arr[2], $dd_arr[3] from $dd_arr[0]"; $qid_dd = db_query($sql_dd); $num_dd = db_num_rows($qid_dd); echo "<select name=\"$dd_arr[1]\" class=\"form-control input-sm\">\n"; echo "<option value=\"\">-- $dd_arr[5] --</option>\n"; for ($y=0;$y<=$num_dd-1;$y++) { $result_dd = db_fetch_row($qid_dd); echo "<option value=\"$result_dd[0]\""; if ($result[$i] == $result_dd[0]) { echo " selected";} echo ">".$result_dd[1]."</option>\n"; } echo "</select>"; } } echo "</td></tr>\n"; } echo "<tr>\n"; echo "<td colspan=\"2\">\n"; echo "<input type=\"submit\" value=\"Save Changes\" class=\"btn btn-primary\">\n"; echo " <input type=\"checkbox\" id=\"re_edit\" name=\"re_edit\" value=\"yes\""; if ($_SESSION['re_edit'] == "yes") { echo " checked "; } echo "> <span style=\"line-height:16px;\">Save & Edit this record?</span> \n"; echo "</td>\n"; echo "</tr>\n"; echo "</table>\n"; echo "</div>\n"; echo "<input type=\"hidden\" name=\"tp1\" value=\"".count($add_edit_query)."\" >"; echo "<input type=\"hidden\" id=\"uploaddir\" value=\"".$upload_dir."\" >"; echo "</form>\n"; } //-------------------------------------------------------------------------------------------- // SAVE EDITED ITEM //-------------------------------------------------------------------------------------------- if ($action == "save_item") { $sql = "update ".$table_name. " set "; $num = sizeof($add_edit_query); for ($k = 1; $k<=$num-1;$k++) { $temp = "$".$add_edit_query[$k]; eval( "\$temp = \"$temp\";" ); $sql = $sql.$add_edit_query[$k]."=\"".$temp."\", "; } $sql = substr($sql,0,strlen($sql)-2); $sql = $sql." where sr_no = ".$sr_no; $qid = db_query($sql); $_SESSION['interstitial'] = "Changes Saved!"; if ($re_edit == "yes") { $_SESSION['re_edit'] = "yes"; } else { $_SESSION['re_edit'] = ""; } echo "<script>\n"; if ($re_edit == "") { echo "document.location = \"".$return_url."\"; \n"; } else { echo "document.location = \"admin_new.php?zid=".$zid."&action=edit_item&id=".$sr_no."\"; \n"; } echo "</script>\n"; } //-------------------------------------------------------------------------------------------- // DELETE ITEM //-------------------------------------------------------------------------------------------- if ($action == "del_item") { $sql = "delete from ".$table_name." where sr_no = ".$id; $qid = db_query($sql); $_SESSION['interstitial'] = "Record deleted!"; echo "<script>\n"; echo "document.location = \"".$return_url."\"; \n"; echo "</script>\n"; } //-------------------------------------------------------------------------------------------- // CHANGE NUMBER OF ITEMS DISPLAYED PER PAGE //-------------------------------------------------------------------------------------------- if ($action == "change_pagenum") { $_SESSION["num_records"]=$pagenum; $_SESSION['interstitial'] = "Items per page changed!"; echo "<script>\n"; echo "document.location = \"".$return_url."\"; \n"; echo "</script>\n"; } //-------------------------------------------------------------------------------------------- // NEW DELETE ITEM //-------------------------------------------------------------------------------------------- if ($action == "new_del") { for($i=0;$i<=$max_value;$i++) { eval("\$curr=\"\$item$i\";"); if ($curr != "") { $sql = "delete from ".$table_name." where sr_no = ".$curr; $qid = db_query($sql); } } $_SESSION['interstitial'] = "Records deleted!"; echo "<script>\n"; echo "document.location = \"".$return_url."\"; \n"; echo "</script>\n"; } include('admin_footer.php'); } else { echo "<script>\n"; echo "document.location = \"index.php\"; \n"; echo "</script>\n"; } ?>