request("sb","string","list");
/** \file
* \brief Called from the module "Gestion" to manage the customer
*/
$href=basename($_SERVER['PHP_SELF']);
// by default open liste
if ($low_action == "")
$low_action = "list";
//-----------------------------------------------------
// Remove a card
//-----------------------------------------------------
if (isset($_POST['action_fiche']))
{
if ( $_POST['action_fiche'] == 'delete_card')
{
if ($g_user->check_action(FICADD) == 0)
{
alert(j(_('Vous ne pouvez pas enlever de fiche')));
return;
}
$f_id = $http->request('f_id',"number");
$fiche = new Customer($cn, $f_id);
$fiche->remove();
$low_action = "list";
}
}
//-----------------------------------------------------
// list of customer
//-----------------------------------------------------
if ($low_action == "list")
{
?>
get("query","string","");
$sql = "";
if (isset($_GET['cat']))
{
$cat=$http->get("cat","number");
if ($cat!= -1)
$sql = sprintf(" and fd_id = %s", $cat);
}
$noop = (isset($_GET['noop'])) ? false : true;
echo '
';
echo $client->Summary($search, 'customer', $sql, $noop);
echo '
';
echo '
';
echo '
';
/* Add button */
$f_add_button = new IButton('add_card');
$f_add_button->class="smallbutton";
$f_add_button->label = _('Créer une nouvelle fiche');
$f_add_button->set_attribute('ipopup', 'ipop_newcard');
$f_add_button->set_attribute('win_refresh', 'yes');
// $list=$cn->make_list("select fd_id from fiche_def where frd_id=$1",array(FICHE_TYPE_CLIENT));
$f_add_button->set_attribute('type_cat', FICHE_TYPE_CLIENT);
$f_add_button->javascript = " select_card_type(this);";
echo $f_add_button->input();
$f_cat_button=new IButton('add_cat');
$f_cat_button->set_attribute('ipopup','ipop_cat');
$f_cat_button->set_attribute('type_cat',FICHE_TYPE_CLIENT);
$f_cat_button->label=_('Ajout d\'une catégorie');
$f_cat_button->javascript='add_category(this)';
echo $f_cat_button->input();
echo '
';
echo '
';
}
/*----------------------------------------------------------------------
* Detail for a card, Suivi, Contact, Operation,... *
* cc stands for customer card
*----------------------------------------------------------------------*/
if ( $low_action == 'detail')
{
/* Menu */
require_once NOALYSS_INCLUDE.'/category_card.inc.php';
return;
}
html_page_stop();
?>