dolibarr  7.0.0-beta
index.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
3  * Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
4  * Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
26 // Set and init common variables
27 // This include will set: config file variable $dolibarr_xxx, $conf, $langs and $mysoc objects
28 require_once '../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
30 
31 $langs->load("admin");
32 $langs->load("cashdesk");
33 
34 // Test if user logged
35 if ( $_SESSION['uid'] > 0 )
36 {
37  header('Location: '.DOL_URL_ROOT.'/cashdesk/affIndex.php');
38  exit;
39 }
40 
41 $usertxt=GETPOST('user','',1);
42 $err=GETPOST("err");
43 
44 
45 /*
46  * View
47  */
48 
49 $form=new Form($db);
50 $formproduct=new FormProduct($db);
51 
52 $arrayofcss=array('/cashdesk/css/style.css');
53 top_htmlhead('','',0,0,'',$arrayofcss);
54 ?>
55 
56 <body>
57 <div class="conteneur">
58 <div class="conteneur_img_gauche">
59 <div class="conteneur_img_droite">
60 
61 <div class="menu_principal hideonsmartphone">
62 <div class="logo">
63 <?php
64 if (! empty($mysoc->logo_small))
65 {
66  print '<img class="logopos" alt="Logo company" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('/thumbs/'.$mysoc->logo_small).'">';
67 }
68 else
69 {
70  print '<div class="logopos">'.$mysoc->name.'</div>';
71 }
72 ?>
73 </div>
74 </div>
75 
76 <div class="contenu">
77 <div class="inline-block" style="vertical-align: top">
78 <div class="principal_login">
79 <?php if ($err) print dol_escape_htmltag($err)."<br><br>\n"; ?>
80 <fieldset class="cadre_facturation"><legend class="titre1"><?php echo $langs->trans("Identification"); ?></legend>
81 <form id="frmLogin" method="POST" action="index_verif.php">
82  <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
83 
84 <table>
85 
86  <tr>
87  <td class="label1"><?php echo $langs->trans("Login"); ?></td>
88  <td><input name="txtUsername" class="texte_login" type="text" value="<?php echo $usertxt; ?>" /></td>
89  </tr>
90  <tr>
91  <td class="label1"><?php echo $langs->trans("Password"); ?></td>
92  <td><input name="pwdPassword" class="texte_login" type="password" value="" /></td>
93  </tr>
94 
95  <tr>
96  <td colspan="2">
97  &nbsp;
98  </td>
99  </tr>
100 
101 <?php
102 print "<tr>";
103 print '<td class="label1">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
104 print '<td>';
105 $disabled=0;
106 $langs->load("companies");
107 if (! empty($conf->global->CASHDESK_ID_THIRDPARTY)) $disabled=1; // If a particular third party is defined, we disable choice
108 print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):$conf->global->CASHDESK_ID_THIRDPARTY, 'socid', 's.client in (1,3) AND s.status = 1', !$disabled, $disabled, 1);
109 //print '<input name="warehouse_id" class="texte_login" type="warehouse_id" value="" />';
110 print '</td>';
111 print "</tr>\n";
112 
113 if (! empty($conf->stock->enabled) && empty($conf->global->CASHDESK_NO_DECREASE_STOCK))
114 {
115  $langs->load("stocks");
116  print "<tr>";
117  print '<td class="label1">'.$langs->trans("Warehouse").'</td>';
118  print '<td>';
119  $disabled=0;
120  if ($conf->global->CASHDESK_ID_WAREHOUSE > 0) $disabled=1; // If a particular stock is defined, we disable choice
121  print $formproduct->selectWarehouses((GETPOST('warehouseid')?GETPOST('warehouseid','int'):(empty($conf->global->CASHDESK_ID_WAREHOUSE)?'ifone':$conf->global->CASHDESK_ID_WAREHOUSE)),'warehouseid','',!$disabled,$disabled);
122  print '</td>';
123  print "</tr>\n";
124 }
125 
126 print "<tr>";
127 print '<td class="label1">'.$langs->trans("CashDeskBankAccountForSell").'</td>';
128 print '<td>';
129 $defaultknown=0;
130 if (! empty($conf->global->CASHDESK_ID_BANKACCOUNT_CASH) && $conf->global->CASHDESK_ID_BANKACCOUNT_CASH > 0) $defaultknown=1; // If a particular stock is defined, we disable choice
131 print $form->select_comptes(((GETPOST('bankid_cash') > 0)?GETPOST('bankid_cash'):$conf->global->CASHDESK_ID_BANKACCOUNT_CASH),'CASHDESK_ID_BANKACCOUNT_CASH',0,"courant=2",($defaultknown?0:2));
132 print '</td>';
133 print "</tr>\n";
134 
135 print "<tr>";
136 print '<td class="label1">'.$langs->trans("CashDeskBankAccountForCheque").'</td>';
137 print '<td>';
138 $defaultknown=0;
139 if (! empty($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE) && $conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE > 0) $defaultknown=1; // If a particular stock is defined, we disable choice
140 print $form->select_comptes(((GETPOST('bankid_cheque') > 0)?GETPOST('bankid_cheque'):$conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE),'CASHDESK_ID_BANKACCOUNT_CHEQUE',0,"courant=1",($defaultknown?0:2));
141 print '</td>';
142 print "</tr>\n";
143 
144 print "<tr>";
145 print '<td class="label1">'.$langs->trans("CashDeskBankAccountForCB").'</td>';
146 print '<td>';
147 $defaultknown=0;
148 if (! empty($conf->global->CASHDESK_ID_BANKACCOUNT_CB) && $conf->global->CASHDESK_ID_BANKACCOUNT_CB > 0) $defaultknown=1; // If a particular stock is defined, we disable choice
149 print $form->select_comptes(((GETPOST('bankid_cb') > 0)?GETPOST('bankid_cb'):$conf->global->CASHDESK_ID_BANKACCOUNT_CB),'CASHDESK_ID_BANKACCOUNT_CB',0,"courant=1",($defaultknown?0:2));
150 print '</td>';
151 print "</tr>\n";
152 
153 ?>
154 
155  <tr>
156  <td colspan="2">
157  &nbsp;
158  </td>
159  </tr>
160 
161 
162 </table>
163 <br>
164 
165 <div align="center"><span class="bouton_login"><input class="button" name="sbmtConnexion" type="submit" value=<?php echo $langs->trans("Connection"); ?> /></span></div>
166 
167 </form>
168 </fieldset>
169 
170 
171 <?php
172 if ($_GET['err'] < 0)
173 {
174  echo ('<script type="text/javascript">');
175  echo (' document.getElementById(\'frmLogin\').pwdPassword.focus();');
176  echo ('</script>');
177 }
178 else
179 {
180  echo ('<script type="text/javascript">');
181  echo (' document.getElementById(\'frmLogin\').txtUsername.focus();');
182  echo ('</script>');
183 }
184 ?>
185 
186 </div>
187 </div>
188 </div>
189 
190 <?php include 'affPied.php'; ?></div>
191 </div>
192 </div>
193 </body>
194 
195 <?php
196 print '</html>';
if(empty($reshook)) $form
View.
Definition: perms.php:103
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...
GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class with static methods for building HTML components related to products Only components common to ...
Class to manage generation of HTML components Only common components must be here.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:104
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $disablejmobile=0, $disablenofollow=0)
Ouput html header of a page.
Definition: main.inc.php:1091
print
Draft customers invoices.
Definition: index.php:91
type
Definition: viewcat.php:283