how to print file path location in imce drupal? - php

i want display the file location path in the imce :
i opened the imce-file-list.tpl.php and i found that :
<tr id="<?php print $raw = rawurlencode($file['name']); ?>">
<td class="name"><?php print $raw; ?></td>
<td class="size" id="<?php print $file['size']; ?>"><?php print format_size($file['size']); ?></td>
<td class="width"><?php print $file['width']; ?></td>
<td class="height"><?php print $file['height']; ?></td>
<td class="date" id="<?php print $file['date']; ?>"><?php print format_date($file['date'], 'short'); ?></td>
</tr>
i want print $file[path] but it not working

Salaktarus,
Try use $imce['furl'] variable.
From drupal.org/node/1738218#comment-10674360

Related

How can i use the a tag

I have some code and would like to add an hyperlink to each entry on my database
tried using the 'a' tag
<tr>
<td><?php echo $row['id']; ?></td>
<td><a href='details.php'><?php echo $row['game_name']; ?></a></td>
<td><?php echo $row['game_year']; ?></td>
<td><?php echo $row['system']; ?></td>
<td style="text-align: center; color:green"><?php echo $row['owned']; ?></td>
<td style="text-align: center; color:blue"><?php echo $row['completed']; ?></td>
<td><?php echo $row['media']; ?></td>
<td><?php echo $row['launcher']; ?></td>
<tr>
would like to be able to link to a details page
<a href='details.php?gameID=<?=$row['id']?>'>
And in your details.php page you could fetch your DB:
$gameID = (int)$_GET['gameID'] and a bit more error handling

Replace buttons with image in PHP code

I am trying to display images in place of buttons for various activities like Edit Record, Delete Record, Download, Save, Reset. I am able to show the image but the result is very output is looks very childish and nonprofessional. Actually images are coming on button as shown in image
But I want image to display like this
Here is the code which gives the 1st image output.
<tr style="background-color: rgb(253, 253, 183); color: rgb(42, 16, 179);font-size: 13px;" >
<td><?php echo $row->eq_application_no; ?></td>
<td><?php echo $row->eq_class; ?></td>
<td><?php echo $row->eq_name;?></td>
<td><?php echo $row->mid_name; ?></td>
<td><?php echo $row->last_name; ?></td>
<td><?php echo $row->eq_sex; ?></td>
<td><?php echo $row->father_name; ?></td>
<td><?php echo $row->eq_dob; ?></td>
<td><?php echo $row->age.",".$row->month.",".$row->day;?></td>
<td><?php echo $row->scat_id;?></td>
<td><?php echo $row->parent_cate_id;?></td>
<td><?php echo $row->no_of_transfer;?></td>
<td><?php echo $tc_case; ?></td>
<td><?php echo$row->last_school_type; ?></td>
<td><?php echo $row->eq_prv_acdmic;?></td>
<td><?php if($row->kv_tc_date=="1970-01-01"){echo "-";}else{echo $row->kv_tc_date;}?></td>
<td><?php echo $row->kv_tc_no;?></td>
<td><?php echo $row->last_class_cgpa;?></td>
<!--value="Edit"-->
<td><input type="button" id="<?php echo $row->es_enquiryid;?>" onclick="edit_record(<?php echo $row->es_enquiryid;?>)" style="background-image:url(images/edit24.png);width:24px;height:24px;"></td><td>
<!--value="Delete"-->
<input type="button" id="<?php echo $row->es_enquiryid;?>" onclick="delete_record(<?php echo $row->es_enquiryid;?>)" style="background-image:url(images/delete24.png);width:24px;height:24px;" ></td><td><?php
if($eligible=="Y")
{?><input type="checkbox" class="app" name="app[]" d="
<?php echo $row->es_enquiryid;?>" value="<?php echo $row->es_enquiryid;?>">
<?php }
else
{
echo"-";
}
?></td>
</tr>
<?php } ?>
</tbody>
</table>
<table>
<tr>
Add image directly then:
<img src="images/delete24.png" id="<?php echo $row->es_enquiryid;?>" onclick="delete_record(<?php echo $row->es_enquiryid;?>)" style="cursor:pointer;width:24px;height:24px;" />

How to get index/data of html table generated by foreach

I load a xml file and loop on this to generate an html table. On each line of the table, I have two icones update and delete.
When I click on the icone delete (for example), I want to get the index of the line or any information of the line in order to process delete the node in my xml file.
I try with echo $number by passing parameter to php function but the GET is empty in the php file.
Do you know how can I get it please ? Thank in advance.
<table>
<?php
foreach($participants as $participant)
{
$number = $participant->number;
$name = $participant->name;
$note = $participant->note;
$sexe = $participant->sexe;
$group = $participant->group;
$adjust = $participant->adjust;
?>
<tr>
<td align="center"><?php echo($number) ?></td>
<td align="left" style="padding-left:10px"><?php echo($name) ?></td>
<td align="center"><?php echo($note) ?></td>
<td align="center"><?php echo($sexe) ?></td>
<td align="center"><?php echo($group) ?></td>
<td></td>
<td>
<img src="images/migatiEditUser20x20.jpg">
<img src="images/migati_cancel16x16.png">
</td>
</tr>
<?php }?>
</table>
deleteParticipant.php
<?php
echo ($_GET['number']);
?>
Try this:
<table>
<?php
foreach($participants as $participant)
{
$number = $participant->number;
$name = $participant->name;
$note = $participant->note;
$sexe = $participant->sexe;
$group = $participant->group;
$adjust = $participant->adjust;
?>
<tr>
<td align="center"><?php echo $number; ?></td>
<td align="left" style="padding-left:10px"><?php echo $name; ?></td>
<td align="center"><?php echo $note; ?></td>
<td align="center"><?php echo $sexe; ?></td>
<td align="center"><?php echo $group; ?></td>
<td></td>
<td>
<img src="images/migatiEditUser20x20.jpg">
<img src="images/migati_cancel16x16.png">
</td>
</tr>
<?php }?>
</table>
and on your deleteParticipant.php use:
<?php echo $_GET['number']; ?>
You have to know how get works. Adjust the code as deleteParticipent.php?number= <?php echo $number; ?> then from that file. You will recieve it as $_GET['number']

PHP - How to Display Detail Record Fields In Another Browser Window From A ListView

I have a ListView produce via PHP code:
<?php do { ?>
<tr>
<td width="20"> <img src="./images/small_pencil.png" /></td>
<td width="20"> <img src="./images/small_eye2.png" /></td>
<td width="20">
<form name="properties" method="post" action="properties.php?search=<?php echo $row_rsProperties['ms_address']; ?>">
<button type="submit" name="properties"> <img src="./images/newsletter.png" /> </button>
</form>
</td>
<td width="250"><?php echo $row_rsProperties['ms_address']; ?></td>
<td width="140"><?php echo $row_rsProperties['ms_city']; ?></td>
<td width="140"><?php echo $row_rsProperties['ms_state']; ?></td>
<td width="60" align="center"><?php echo $row_rsProperties['ms_zip']; ?></td>
<td width="250"><?php echo $row_rsProperties['ms_mm_owner1']; ?></td>
<td width="250" align="center"><?php echo $row_rsProperties['owner_phone1']; ?></td>
<td width="250" align="center"><?php echo $row_rsProperties['expired']; ?></td>
<td width="250" align="center"><?php echo $row_rsProperties['fsbo']; ?></td>
<td width="250" align="center"><?php echo $row_rsProperties['ms_status']; ?></td>
</tr>
<?php } while ($row_rsProperties = mysql_fetch_assoc($rsProperties)); ?>
How would I get the click on the Edit or View anchors to open in a window (that was opened via javascript code after authentication?
PHP file (performed when the main menu is loaded):
<body onLoad="openDetailWindow()">
Javascript src .js file function:
function openDetailWindow() {
window.open("_blank.php","LMS - Record Detail","fullscreen=0,menubar=0","false");
}
Placed the following code inside of the anchor tag:
onclick="window.open(this.href, 'LMS - Record Detail',
'menubar=0,scrollbars=1,toolbar=0', 'false'); return false;"
So, now the tag now reads as follows:
<td width="20"><a href="edit_property_mktg.php?recID=<?php echo $row_rsProperties['recID']; ?>" onclick="window.open(this.href, 'LMS - Record Detail',
'menubar=0,scrollbars=1,toolbar=0', 'false'); return false;"> <img src="./images/small_pencil.png" /></a></td>

view fetched picture in table

I use table to fetch cars information from my database and each column in this table contain car information's but in the last column i want to view in it car picture which is save in my database, i already have my code to fetch picture from my database and can view it in the browsers directly. but how i can view the picture directly in the table column without open the picture in new windows.
view code
while($rows=mysql_fetch_array($result)){
?>
<tr>
<td class="style1"><?php echo $rows['branch']; ?></td>
<td class="style1"><?php echo $rows['model']; ?></td>
<td class="style1"><?php echo $rows['doors']; ?></td>
<td class="style1"><?php echo $rows['fuel']; ?></td>
<td class="style1"><?php echo $rows['engine']; ?></td>
<td class="style1"><?php echo $rows['colo']; ?></td>
<td class="style1"><?php echo $rows['wheel']; ?></td>
<td class="style1"><?php echo $rows['condit']; ?></td>
<td class="style1"><?php echo $rows['warranty']; ?></td>
<td class="style1" style="width: 47px"><?php echo $rows['price']; ?></td>
<td class="style1"><?php echo $rows['CarOwner']; ?></td>
<td align="center" class="style3"><?php echo $rows['CarOwner']; ?></td>
<td align="center" class="style3"><?php echo "download.php"; ?></td>
and this download image from MySQL
<?php
//$id = $_GET['id'];
include_once 'D_B.php';// Connect to server and select database.
$query = "SELECT `name`, `type`, `size`, `content` FROM `upload` WHERE `id`='1'";
$result = mysql_query($query) or die('Error, query failed');
list($name, $type, $size, $content) =mysql_fetch_array($result);
header("Content-length: $size");
header("Content-type: $type");
echo $content;
exit;
?>
Just use the address of your link as src attribute of <img> tag, like this:
<td><img src="image.php?id=<?php echo $rows['imageId']; ?>"/></td>

Categories