I am from South Africa, my budget is a bit limited, but I am willing to offer US$ 50 for the person that can help me customise photo_shop_admin.php
I have been trying for almost three weeks now doing my own scripting, but with no luck.
My website (
www.youth-sport-fotos.com/2009/index.php )
I have added a button on the "Admin" page with this script:
<a style="font-family: Verdana; font-size: 7pt; font-weight: bold; border: 1px solid #666666; padding-left: 3px; padding-right: 3px; padding-top: 1px; padding-bottom: 1px" class="admin_menu" href="javascript:opentracking('http://www.youth-sport-fotos.com/2009/plugins/photo_shop/addtracking-form.php?oid=$oid')">ADD TRACKING NUMBER</a>
This will open a new form page called "addtracking.php"
<?php
//BEGIN OF CODING
$host="localhost"; // Host name
$username="username"; // Mysql username
$password="password"; // Mysql password
$db_name="darabase name"; // Database name
$tbl_name="cpg_shop"; // Table name
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// Get values from form
$oid='$_REQUEST[oid]';
//$tracking='$_POST[tracking]';
// Insert data into mysql
$sql="INSERT INTO $tbl_name (tracking) VALUES ($tracking) WHERE cd=1 AND oid ='$oid' AND status = '7' LIMIT=1";
$result=mysql_query($sql);
// if successfully insert data into database, displays message "Successful".
if($result){
echo "Successful";
echo "<BR>";
echo "<a href='insert.php'>Back to main page</a>";
}
else {
echo "ERROR";
}
// close connection
mysql_close();
?>
Secondly, the form page uses addracking.php to insert data "tracking" (which is a tracking number for photos mailed) to the database, using the specific "oid", based on WHERE cd=1 AND status=7 ( I have included a function paid &sent which works fine in spite of ticking "set paid" and submit the form, and then again "set sent" and submitting it one again.
The code for addracking.php
<?php
$oid=$_REQUEST["oid"];
//$tracking=$_POST["tracking"];
echo <<<EOT
<html><body>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td><form action="addtracking.php" method="post" \>
<table width="100%" border="0" cellspacing="1" cellpadding="3" \>
<tr>
<td colspan="2" bgcolor="#8AA5B5">
<p align="center"><font face="Verdana"><strong>INSERT TRACKING NUMBER FOR ORDER <?php "echo {$oid}"; ?></strong></font></td>
</tr>
<tr><br><br>
<td width="185"><b><font face="Verdana" style="font-size: 9pt">Tracking Number:</font></b></td>
<td width="198"><input type="text" id="tracking" name="tracking" /></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="Submit" value="ADD TRACKING NUMBER"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
EOT;
?>
I am still stupid with php to get this working.
Alternatively, I added a "text field" on the left side of where you select the order status (paid, sent, not sent, not paid) to get rid of the two seperate pages I made.
<td align="left">ADD TRACKING NUMBER: <input type="text" name="tracking" value="{$tracking}" class="textinput" /> <input type="submit" class="button" value="{$lang_photoshop_admin['go']}" /></td>
The code for the function is:
function tracking($text, $tracking)
{
$result10 = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_SHOP']} WHERE oid=".$oid." AND cd=1 AND status='7'");
$row = mysql_fetch_assoc($result10);
$value10 = $tracking;
cpg_db_query("UPDATE {$CONFIG['TABLE_SHOP']} SET `tracking` = '$value10' WHERE cd=1 AND oid ='".$oid." AND status='7' ");
mysql_free_result($result10);
}
All my effords is in vain.
I think this could be an added value to a new release, I am sure many will fine this usefull.
Mods: I hope I am posting this now on the right tread.
Thanx