root/experimental_v2/A2BCustomer_UI/A2B_entity_callerid.php

Revision 595, 2.8 kB (checked in by stavros, 11 months ago)

UPDATE: eliminate all(?) the remaining usage of troublesome PHP short-tags

  • Property svn:executable set to *
Line 
1 <?php
2 include ("./lib/customer.defines.php");
3 include ("./lib/customer.module.access.php");
4 include ("./lib/Form/Class.FormHandler.inc.php");
5 include ("./form_data/FG_var_callerid.inc");
6 include ("lib/customer.smarty.php");
7
8
9 if (! has_rights (ACX_ACCESS)){
10     Header ("HTTP/1.0 401 Unauthorized");
11     Header ("Location: PP_error.php?c=accessdenied");
12     die();
13 }
14
15
16 if (!$A2B->config["webcustomerui"]['callerid']) exit();
17
18
19
20 getpost_ifset(array('add_callerid'));
21
22 $HD_Form -> setDBHandler (DbConnect());
23 $HD_Form -> init();
24
25 /************************************  ADD SPEED DIAL  ***********************************************/
26 if (strlen($add_callerid)>&& is_numeric($add_callerid)){
27     
28     $instance_sub_table = new Table('cc_callerid');
29     $QUERY = "SELECT count(*) FROM cc_callerid WHERE id_cc_card='".$_SESSION["card_id"]."'";
30     $result = $instance_sub_table -> SQLExec ($HD_Form -> DBHandle, $QUERY, 1);
31     
32     // CHECK IF THE AMOUNT OF CALLERID IS LESS THAN THE LIMIT
33     if ($result[0][0] < $A2B->config["webcustomerui"]['limit_callerid']){
34         
35         $QUERY = "INSERT INTO cc_callerid (id_cc_card, cid) VALUES ('".$_SESSION["card_id"]."', '".$add_callerid."')";
36         $result = $instance_sub_table -> SQLExec ($HD_Form -> DBHandle, $QUERY, 0);
37         
38     }
39 }
40 /***********************************************************************************/
41
42
43 if ($id!="" || !is_null($id)){
44     $HD_Form -> FG_EDITION_CLAUSE = str_replace("%id", "$id", $HD_Form -> FG_EDITION_CLAUSE);
45 }
46
47
48 if (!isset($form_action))  $form_action="list"; //ask-add
49 if (!isset($action)) $action = $form_action;
50
51
52 $list = $HD_Form -> perform_action($form_action);
53
54
55
56 // #### HEADER SECTION
57 $smarty->display( 'main.tpl');
58
59
60
61 if ($form_action == "list")
62 {
63     // My code for Creating two functionalities in a page
64     $HD_Form -> create_toppage ("ask-add");
65     if (strlen($_GET["menu"])>0) $_SESSION["menu"] = $_GET["menu"];
66     
67
68     if (isset($update_msg) && strlen($update_msg)>0) echo $update_msg;
69
70 ?>
71       </center>
72        <table align="center"  border="0" width="55%" class="bgcolor_006">
73         <form name="theForm" action="<?php  $_SERVER["PHP_SELF"]?>">
74         <tr class="bgcolor_001" >
75
76         <td align="center" valign="top">
77                 <?php gettext("CALLER ID :");?>
78                 <input class="form_input_text" name="add_callerid" size="15" maxlength="60">
79             </td>
80             <td align="center" valign="middle">
81                         <input class="form_input_button"  value="<?php echo gettext("ADD NEW CALLERID"); ?>"  type="submit">
82         </td>
83         </tr>
84     </form>
85       </table>
86       <br>
87     <?php
88     // END END END My code for Creating two functionalities in a page
89 }
90
91 // #### TOP SECTION PAGE
92 $HD_Form -> create_toppage ($form_action);
93
94
95 // #### CREATE FORM OR LIST
96 //$HD_Form -> CV_TOPVIEWER = "menu";
97 if (strlen($_GET["menu"])>0) $_SESSION["menu"] = $_GET["menu"];
98
99 $HD_Form -> create_form ($form_action, $list, $id=null) ;
100
101
102 // #### FOOTER SECTION
103 $smarty->display( 'footer.tpl');
104 ?>
105
Note: See TracBrowser for help on using the browser.


Google