}
// First check if ID exist with requested ID
$result = '0';
$result = tchsp_cls_dbquery::tchsp_image_details_count($did);
if ($result != '1') {
    ?>
<div class="error fade"><p><strong><?php 
    _e('Oops, selected details doesnt exist.', TCHSP_TDOMAIN);
    ?>
</strong></p></div><?php 
} else {
    $tchsp_errors = array();
    $tchsp_success = '';
    $tchsp_error_found = FALSE;
    $data = array();
    $data = tchsp_cls_dbquery::tchsp_image_details_select($did);
    // Preset the form fields
    $form = array('img_id' => $data[0]['img_id'], 'img_title' => $data[0]['img_title'], 'img_imageurl' => $data[0]['img_imageurl'], 'img_link' => $data[0]['img_link'], 'img_linktarget' => $data[0]['img_linktarget'], 'img_display' => $data[0]['img_display'], 'img_gal_id' => $data[0]['img_gal_id']);
}
// Form submitted, check the data
if (isset($_POST['tchsp_form_submit']) && $_POST['tchsp_form_submit'] == 'yes') {
    //	Just security thingy that wordpress offers us
    check_admin_referer('tchsp_form_edit');
    $form['img_title'] = isset($_POST['img_title']) ? $_POST['img_title'] : '';
    if ($form['img_title'] == '') {
        $tchsp_errors[] = __('Enter image title.', TCHSP_TDOMAIN);
        $tchsp_error_found = TRUE;
    }
    $form['img_imageurl'] = isset($_POST['img_imageurl']) ? $_POST['img_imageurl'] : '';
    if ($form['img_imageurl'] == '') {
        $tchsp_errors[] = __('Enter tiny-carousel popup url. url must start with either http or https.', TCHSP_TDOMAIN);
?>

<div class="wrap">
  <div id="icon-edit" class="icon32 icon32-posts-post"></div>
    <h2><?php 
_e(TCHSP_PLUGIN_DISPLAY, TCHSP_TDOMAIN);
?>
</h2>
    <h3><?php 
_e('Image Details', TCHSP_TDOMAIN);
?>
</h3>
	<div class="tool-box">
	<?php 
$myData = array();
$myData = tchsp_cls_dbquery::tchsp_image_details_select(0);
?>

		<script language="JavaScript" src="<?php 
echo TCHSP_URL;
?>
page/setting.js"></script>
		<form name="frm_tchsp_display" method="post">
      <table width="100%" class="widefat" id="straymanage">
        <thead>
          <tr>
			<th class="check-column" scope="col" style="padding: 8px 2px;">
			<input type="checkbox" name="tchsp_checkall" id="tchsp_checkall" onClick="_tchsp_checkall('frm_tchsp_display', 'chk_delete[]', this.checked);" /></th>
            <th scope="col"><?php 
_e('Image Title', TCHSP_TDOMAIN);
?>