File: /home/pricecom/public_html/phonerepair/feedback.php
<?php
include('include/files.php');
$imageName=time();
$module=15;
include('include/user_rights.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $site_settings['title']; ?> - Admin Panel</title>
<link href="styles/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table cellpadding="0" cellspacing="0" border="0" align="center">
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0" width="918">
<?php include('include/header.php'); ?>
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td valign="top">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td bgcolor="#FFFFFF" width="100%" height="" class="bor" valign="top">
<table cellpadding="4" cellspacing="0" border="0" width="918">
<tr>
<td>
<table cellpadding="0" cellspacing="0" align="center" width="100%">
<tr><td height="25"></td></tr>
<tr>
<td width="30"></td>
<td valign="top">
<table cellpadding="0" cellspacing="0" align="center" width="700">
<tr>
<td colspan="5" class="abouthd">Feedback Management</td>
</tr>
<tr><td height="10"></td></tr>
<tr>
<Td valign="top">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td>
<?php
################################################################################
## +---------------------------------------------------------------------------+
## | 1. Creating & Calling: |
## +---------------------------------------------------------------------------+
## *** define a relative (virtual) path to datagrid.class.php file
## *** (relatively to the current file)
## *** RELATIVE PATH ONLY ***
define("DATAGRID_DIR", ""); /* Ex.: "datagrid/" */
require_once(DATAGRID_DIR.'datagrid.class.php');
// includes database connection parameters
include_once('install/config.inc.php');
ob_start();
## *** set needed options
$debug_mode = false;
$messaging = true;
$unique_prefix = "f_";
$dgrid = new DataGrid($debug_mode, $messaging, $unique_prefix);
## *** defines postback method for DataGrid: AJAX, POST(default) or GET
$postback_method = 'AJAX';
$dgrid->SetPostBackMethod($postback_method);
## *** make sure your tmp/cache/ dir has 755 (write) permissions
## *** parameters: 1st - allow caching, 2nd - cache lifetime in minutes
//$dgrid->SetCachingParameters(true, 5);
## *** delete all caching pages
/// $dgrid->DeleteCache();
## *** datagrid layouts: '0' - tabular(horizontal) - default, '1' - columnar(vertical), '2' - customized
## *** use 'view'=>'0' and "edit"=>"0" only if you work on the same tables
## *** filter layouts: '0' - tabular(horizontal) - default, '1' - columnar(vertical), '2' - advanced(inline)
//$layouts = array('view'=>2, 'edit'=>1, 'filter'=>1);
//$dgrid->SetLayouts($layouts);
## *** set modes for operations ('type' = 'link|button|image'),
## *** set CSS class for datagrid
## *** 'default|blue|gray|green|pink|empty|x-blue|x-gray|x-green' or your own css style
$css_class = $css_co;
$dgrid->SetCssClass($css_class);
$modes = array(
'add' => array('view'=>$right_add, 'edit'=>false, 'type'=>'link', 'show_button'=>true, 'show_add_button'=>'inside|outside'),
'edit' => array('view'=>$right_edit, 'edit'=>true, 'type'=>'link', 'show_button'=>true, 'byFieldValue'=>''),
'details' => array('view'=>$right_view, 'edit'=>false, 'type'=>'link', 'show_button'=>true),
'delete' => array('view'=>$right_del, 'edit'=>false, 'type'=>'image', 'show_button'=>true)
);
$dgrid->SetModes($modes);
## *** set data source with needed options
## *** put a primary key on the first place
$sql=" SELECT "
." feedback.feid, "
." feedback.name, "
." feedback.designation, "
." feedback.company, "
." feedback.approved, "
." feedback.message, "
." feedback.pic, "
." feedback.edit_date "
."FROM feedback";
$default_order = array("feid"=>"DESC");
$dgrid->DataSource("PEAR", "mysql", $DB_HOST, $DB_NAME, $DB_USER, $DB_PASS, $sql, $default_order);
$dg_caption = '';
$dgrid->SetCaption($dg_caption);
## *** set filtering option: true or false(default)
## *** tips: use ',' (comma) if you want to make search by some words, for ex.: hello, bye, hi
$filtering_option = false;
$show_search_type = true;
$dgrid->AllowFiltering($filtering_option, $show_search_type);
$filtering_fields = array(
"Enter Title"=>array("type"=>"textbox", "table"=>"content_pages", "field"=>"title", "filter_condition"=>"", "show_operator"=>"false", "default_operator"=>"%like%", "case_sensitive"=>"false", "comparison_type"=>"string|numeric|binary", "width"=>"", "on_js_event"=>"", "default"=>""),
);
$dgrid->SetFieldsFiltering($filtering_fields);
$fill_position_array = array("1"=>"Header Top", "2"=>"Top", "3"=>"Below Nav Bar", "4"=>"Listing", "5"=>"Right", "6"=>"Left", "7"=>"Footer", "8"=>"Home Page Top");
$fill_yes_no_array = array("1"=>"Yes", "0"=>"No");
## +---------------------------------------------------------------------------+
## | 6. View Mode Settings: |
## +---------------------------------------------------------------------------+
## *** set columns in view mode
$dgrid->SetAutoColumnsInViewMode(true);
$vm_table_properties = array("width"=>"90%");
$dgrid->SetViewModeTableProperties($vm_table_properties);
## *** set columns in view mode
$vm_colimns = array(
"name" => array("header"=>"Name", "type"=>"text", "align"=>"center", "width"=>"", "wrap"=>"nowrap", "text_length"=>"-1", "tooltip"=>"false", "tooltip_type"=>"floating|simple", "case"=>"normal", "summarize"=>"false", "sort_type"=>"string", "sort_by"=>"", "visible"=>"true", "decimal_places"=>"2", "dec_separator"=>".", "thousands_separator"=>",", "on_js_event"=>""),
"company" => array("header"=>"Company", "type"=>"text", "align"=>"center", "width"=>"", "wrap"=>"nowrap", "text_length"=>"-1", "tooltip"=>"false", "tooltip_type"=>"floating|simple", "case"=>"normal", "summarize"=>"false", "sort_type"=>"string", "sort_by"=>"", "visible"=>"true", "decimal_places"=>"2", "dec_separator"=>".", "thousands_separator"=>",", "on_js_event"=>""),
"designation" => array("header"=>"Designation", "type"=>"text", "align"=>"center", "width"=>"", "wrap"=>"nowrap", "text_length"=>"-1", "tooltip"=>"false", "tooltip_type"=>"floating|simple", "case"=>"normal", "summarize"=>"false", "sort_type"=>"string", "sort_by"=>"", "visible"=>"true", "decimal_places"=>"2", "dec_separator"=>".", "thousands_separator"=>",", "on_js_event"=>""),
"approved" => array("header"=>"Approved", "type"=>"enum", "align"=>"center", "width"=>"", "wrap"=>"nowrap", "text_length"=>"-1", "tooltip"=>"false", "tooltip_type"=>"floating|simple", "case"=>"normal", "summarize"=>"false", "sort_type"=>"string", "sort_by"=>"", "visible"=>"true", "decimal_places"=>"2", "dec_separator"=>".", "thousands_separator"=>",", "on_js_event"=>"", "source"=>$fill_yes_no_array),
"pic" =>array("header"=>"Client Logo", "type"=>"image", "align"=>"center", "width"=>"", "wrap"=>"nowrap", "text_length"=>"-1", "case"=>"normal", "summarize"=>false, "on_js_event"=>"", "target_path"=>"../ads/", "default"=>"", "image_width"=>"100px", "image_height"=>""),
);
$dgrid->SetColumnsInViewMode($vm_colimns);
## *** set foreign keys for add/edit/details modes (if there are linked tables)
## *** Ex.: 'condition'=>'Table_1.FieldName > "a" AND Table_1.FieldName < "c"'
## *** Ex.: 'on_js_event'=>'onclick="alert(\'Yes!!!\');"'
## +---------------------------------------------------------------------------+
## | 7. Add/Edit/Details Mode settings: |
## +---------------------------------------------------------------------------+
## *** set settings for edit/details mode
## *** set add/edit mode table properties
$em_table_properties = array("width"=>"60%");
$dgrid->SetEditModeTableProperties($em_table_properties);
## *** set details mode table properties
$dm_table_properties = array("width"=>"60%");
$dgrid->SetDetailsModeTableProperties($dm_table_properties);
$dgrid->firstFieldFocusAllowed = true;
$table_name = "feedback";
$primary_key = "feid";
$condition = "";
$dgrid->SetTableEdit($table_name, $primary_key, $condition);
$dgrid->SetAutoColumnsInEditMode(true);
$em_columns = array(
"edit_date" =>array("header"=>"", "type"=>"hidden", "req_type"=>"st", "default"=>date("Y-m-d H:i:s"), "value"=>date("Y-m-d H:i:s"), "unique"=>"false", "visible"=>"false"),
"name" =>array("header"=>"Name", "type"=>"text", "aligh"=>"left", "req_type"=>"rt", "width"=>"325px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>""),
"company" =>array("header"=>"Company", "type"=>"text", "aligh"=>"left", "req_type"=>"rt", "width"=>"325px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>""),
"designation" =>array("header"=>"Designation", "type"=>"text", "aligh"=>"left", "req_type"=>"rt", "width"=>"325px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>""),
"message" =>array("header"=>"Feedback", "type"=>"textarea", "aligh"=>"left", "req_type"=>"rt", "width"=>"325px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>""),
"pic" =>array("header"=>"Client Image", "type"=>"image", "req_type"=>"st", "width"=>"210px", "title"=>"Picture", "readonly"=>false, "maxlength"=>"-1", "default"=>"", "unique"=>false, "unique_condition"=>"", "on_js_event"=>"", "target_path"=>"../ads/", "max_file_size"=>"5000K", "image_width"=>"100px", "image_height"=>"100px", "file_name"=>"", "resize_image"=>"false", "resize_height"=>"", "allowed_extensions"=>"jpg,gif,png,bmp", "file_name"=>$imageName, "host"=>"local"),
"approved" =>array("header"=>"Approved", "type"=>"enum", "aligh"=>"left", "req_type"=>"st", "width"=>"325px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"Pakistan", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "source"=>$fill_yes_no_array),
);
$dgrid->SetColumnsInEditMode($em_columns);
## *** set printing option: true(default) or false
$printing_option = true;
$dgrid->AllowPrinting($printing_option);
## *** initialize the session with session_start();
## *** default exporting directory (requires write permissions): tmp/export/
$exporting_option = false;
$export_all = false;
$dgrid->AllowExporting($exporting_option, $export_all);
$exporting_types = array(
'csv'=>'false', 'xls'=>'false', 'pdf'=>'false', 'xml'=>'false', 'doc'=>'false'
);
$dgrid->AllowExportingTypes($exporting_types);
## +---------------------------------------------------------------------------+
## | 8. Bind the DataGrid: |
## +---------------------------------------------------------------------------+
## *** set debug mode & messaging options
$dgrid->Bind();
ob_end_flush();
?>
</td>
</tr>
</table>
</Td>
</tr>
</table>
</td>
</tr>
<tr><td height="25"></td></tr>
</table>
</td>
</tr>
</table>
</td>
<td width="15"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr><td height="22"></td></tr>
<td><?php include('include/footer.php'); ?></td>
<tr><td height="20"></td></tr>
</table>
</td>
</tr>
</table>
</body>
</html>