Forum

Questions and discussions

Can Site Owner Allocate Credits?

Questions about feature's usage

Can Site Owner Allocate Credits?

Postby moketni » Thu Apr 21, 2011 1:31 pm

Can the site owner allocate credits to to a specific user?

I have a client who does odd jobs here and there, I agreed to credit him as a (registerd user) with a number of credits on my website so he can purchase images.

If so where do I actully do this in the Admin panel?
Kind regards
Mark

"if you can visualize it, you can achieve it"
http://www.selfhelptips.co.za
moketni
 
Posts: 28
Joined: Sun Apr 10, 2011 9:28 am
Location: Bloemfontein, South Africa

Re: Can Site Owner Allocate Credits?

Postby admin » Mon Apr 25, 2011 5:50 am

I will add the option in the new version.
admin
Site Admin
 
Posts: 1465
Joined: Sun Mar 07, 2010 5:55 pm

Re: Can Site Owner Allocate Credits?

Postby lucy » Mon Apr 25, 2011 3:11 pm

If I properly understood moketni this option exists already:
Admin panel/Orders/Credits/Add Credits
lucy
 
Posts: 144
Joined: Mon Apr 12, 2010 2:52 pm

Re: Can Site Owner Allocate Credits?

Postby funmediapicture » Wed May 04, 2011 4:56 pm

In the new version 11.03 is this option from anton disabled.
The older versions have this option.
funmediapicture
 
Posts: 73
Joined: Tue Apr 27, 2010 2:45 pm

Re: Can Site Owner Allocate Credits?

Postby lucy » Wed May 04, 2011 7:38 pm

oh, I am still in 10.11
Why this function was disabled? It was important.
lucy
 
Posts: 144
Joined: Mon Apr 12, 2010 2:52 pm

Re: Can Site Owner Allocate Credits?

Postby admin » Thu May 05, 2011 6:55 am

There was a new interface in Credits admin section.

I just sent you modified files by email so that you will be able to add new credits.
admin
Site Admin
 
Posts: 1465
Joined: Sun Mar 07, 2010 5:55 pm

Re: Can Site Owner Allocate Credits?

Postby funmediapicture » Thu May 05, 2011 9:58 am

Anton has sent the new files to me. I have the file new.php
a little bit modified.

I have replaced the input field: User with a select field.
So it's easier to select a user. The query search only the buyers
from the database: utype=buyer

You see in the select field the login, name and lastname.

Here the new code:

Replace this:

Code: Select all
<div class='admin_field'>
<span><?=word_lang("user")?>:</span>
<input type='text' name='user' style='width:400px' class='ibox' value=''>
</div>


With this:

Code: Select all
<?php
/*
Original entry

<div class='admin_field'>
<span><?=word_lang("user")?>:</span>
<input type='text' name='user' style='width:400px' class='ibox' value=''>
</div>
*/
?>



<div class='admin_field'>
<span><?=word_lang("user")?>:</span>
<select name="user" style="width:400px" class="ibox">
<option value="">Please select...</option>
<?php
$sql="select login,name,lastname from users where utype='buyer'";
$rs->open($sql);
while(!$rs->eof)
{
?>
<option value="<?=$rs->row["login"]?>"><?=$rs->row["login"]?>&nbsp;&nbsp;&nbsp;&nbsp;(<?=$rs->row["name"]?> <?=$rs->row["lastname"]?>)</option>
<?
$rs->movenext();
}
?>
</select>
</div>


Greetings
Alfred
funmediapicture
 
Posts: 73
Joined: Tue Apr 27, 2010 2:45 pm

Re: Can Site Owner Allocate Credits?

Postby admin » Thu May 05, 2011 10:35 am

Hello Alfred,

That's good. But if you have 10000 buyers then it will be difficult to search in the select menu...
admin
Site Admin
 
Posts: 1465
Joined: Sun Mar 07, 2010 5:55 pm

Re: Can Site Owner Allocate Credits?

Postby funmediapicture » Fri May 06, 2011 9:20 am

Hello Anton,

thanks for the info. I have now insert both fields. So can I select.

Changed files:

1.) languages/english.php

2.) admin/credits/new.php
3.) admin/credits/add.php


You can now select which user field you will fill out. If you have
filled out both fields you recieved a error message.


1.) languages/english.php

Insert:

$m_lang["please_select"]="Please select ...";
$m_lang["manual_input"]="manual input";
$m_lang["error_fill_out_only_one_user_field"]="Error!!! Please fill out only one user field.";


2.) admin/credits/new.php


Replace this:

Code: Select all
<?
if(isset($_GET["d"]))
{
echo("<p><b>".word_lang("error")."</b></p>");
}
?>


With this:

Code: Select all
<?php
// Freddy BOF
if(isset($_GET["d"]))
{
if($d==1){echo("<p><b>".word_lang("error")."</b></p>");}
if($d==2){echo("<p><b>".word_lang("error_fill_out_only_one_user_field")."</b></p>");}
}
// Freddy EOF
?>



Replace the user field:

Code: Select all
<div class='admin_field'>
<span><?=word_lang("user")?>:</span>
<input type='text' name='user' style='width:400px' class='ibox' value=''>
</div>


With this:

Code: Select all
<?php // Freddy BOF ?>
<div class='admin_field'>
<span><?=word_lang("user")?> ( <?=word_lang("manual_input")?> ):</span>
<input type='text' name='user' style='width:400px' class='ibox' value=''>
</div>



<div class='admin_field'>
<span><?=word_lang("user")?>:</span>
<select name='user_select_field' style='width:400px' class='ibox'>
<option value=''><?=word_lang("please_select")?></option>
<?php
$sql="select id_parent,login,name,lastname from users where utype='buyer'";
$rs->open($sql);
while(!$rs->eof)
{
?>
<option value="<?=$rs->row["login"]?>"><?=$rs->row["login"]?>&nbsp;&nbsp;&nbsp;&nbsp;(<?=$rs->row["id_parent"]?> <?=$rs->row["name"]?> <?=$rs->row["lastname"]?>)</option>
<?
$rs->movenext();
}
?>
</select>
</div>
<?php // Freddy EOF ?>



3.) admin/credits/add.php

Insert new and replace the $sql="select login... with this:

Copy from the begin up to if((float)$_POST["quantity"]>0)

Code: Select all
<? include("../function/db.php");?>
<?if($_SESSION['entry_admin']!=1){redirect("../auth/");}



// Freddy BOF
$loginuser="";
if($_POST["user"]!="")
{
        $loginuser=result($_POST["user"]);
}

if($_POST["user_select_field"]!="")
{
        $loginuser=result($_POST["user_select_field"]);
}

// Error message if both fields are filled out
if($_POST["user"]!="" and $_POST["user_select_field"]!="")
{
        header("location:new.php?d=2");
        exit();
}



$sql="select login from users where login='".$loginuser."'";
$dd->open($sql);
if(!$dd->eof)
{
// Freddy EOF

   if((float)$_POST["quantity"]>0)


Thats all.

Greetings
Alfred
funmediapicture
 
Posts: 73
Joined: Tue Apr 27, 2010 2:45 pm

Re: Can Site Owner Allocate Credits?

Postby admin » Sat May 07, 2011 6:55 am

Thanks Alfred!
admin
Site Admin
 
Posts: 1465
Joined: Sun Mar 07, 2010 5:55 pm

Next

Return to Usage

Who is online

Users browsing this forum: No registered users and 1 guest

cron
  Photo Store Script

Professional php photo stock script and WordPress plug-in for photographers and video producers.

  Support
  CMSaccount Inc.