shopifine /magehelp/application/views/products/product_details.php

Language PHP Lines 315
MD5 Hash e2f7f6810cf9f117ce79fce1bf92349e Estimated Cost $148 (why?)
Repository https://bitbucket.org/jit_bec/shopifine.git View Raw File View Project SPDX
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
<html><head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title> Add product details and generate barcode</title>
  
<!--  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
  <script type="text/javascript" src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script>
  
  <link rel="stylesheet" type="text/css" href="/css/normalize.css">
  <link rel="stylesheet" type="text/css" href="/css/result-light.css">
  
    
      <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/ui-lightness/jquery-ui.css">
    
    
  
    
    
      <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js"></script>-->
    
  <?php $this->load->view("common/header"); ?>
  <link rel="stylesheet" rev="stylesheet" href="<?php echo base_url();?>css/shopifine.css" />
<!--  <style type="text/css">
    body { font-size: 62.5%; }
        label, input { display:block; }
        input.text { margin-bottom:12px; width:95%; padding: .4em; }
        fieldset { padding:0; border:0; margin-top:25px; }
        h1 { font-size: 1.2em; margin: .6em 0; }
        div#users-contain { width: 350px; margin: 20px 0; }
        div#users-contain table { margin: 1em 0; border-collapse: collapse; width: 100%; }
        div#users-contain table td, div#users-contain table th { border: 1px solid #eee; padding: .6em 10px; text-align: left; }
        .ui-dialog .ui-state-error { padding: .3em; }
        .validateTips { border: 1px solid transparent; padding: 0.3em; }

* { font-family: Verdana; font-size: 96%; }
label { width: 10em; float: left; }
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
p , .column{ clear: both; }
.submit { margin-left: 12em; }
em { font-weight: bold; padding-right: 1em; vertical-align: top; }


  </style>-->
  


<script type="text/javascript">//<![CDATA[ 

$(function() {
        // a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
        $( "#dialog:ui-dialog" ).dialog( "destroy" );

         $( "#productForm" ).validate();   
                 
        
        
        $( "#dialog-form" ).dialog({
            autoOpen: false,
            height: 300,
            width: 350,
            position:[300,200],
            modal: true,
            buttons: {
                "Create the Product": function() {
                    bValid =  $("#productForm").valid();
                    
                    if (bValid ){
                        
                        $.ajax({
                            url:"/echo/html/",
                                                    data: { html: "<tr>" +
                                                    "<td>" +  $( "#name" ).val() + "</td>" + 
                                                    "<td>" + $( "#email" ).val() + "</td>" + 
                                                    "<td>" + $( "#password" ).val() + "</td>" +
                                                    "</tr>"},
                            type:"POST",
                            success:function(response)
                            {
                            console.log(response);
                                $( "#users tbody" ).append(response);
                            }
                        });
                        
                        $( this ).dialog( "close" );
                }
                    
                },
                Cancel: function() {
                    $( this ).dialog( "close" );
                }
            },
            close: function() {
                
            }
        });


        $( "#create-product" )
            .button()
            .click(function() {
                $( "#dialog-form" ).dialog( "open" );
            });
            
            
            $("#mfr").autocomplete({
                source: <?php echo $mfrs ?>,
                focus: function( event, ui ) {
                $( "#mfr" ).val( ui.item.label );
                return false;  
                },   
                select: function( event, ui ) {                 
                    $( "#mfr" ).val( ui.item.label );                 
                    $( "#mfr-hidden" ).val( ui.item.value );                 
                    return false;             
                }
                
            });
         

            $("#model").autocomplete({
                source: "index.php/products/populateBarcodesForStock",
                focus: function( event, ui ) {
                $( "#model" ).val( ui.item.label );
                return false;  
                },   
                select: function( event, ui ) {                 
                    $( "#model" ).val( ui.item.label );                 
                    $( "#model-hidden" ).val( ui.item.value );                 
                    return false;             
                }
            }); 
            
            
    });
    
   


 
//]]>  

</script>


</head>
 <body>
         <?php  $this->load->view("common/menubar"); ?>
        <div id ="dialog-form">
        <h1 id="formHeader">Add New Product Entity</h1>   
        <form id="productForm">
            <fieldset>
                <div class="row">
                        <div class="column">
                            <div class="field">
                                <label for="name">Name of Product Entity:</label>  
                                <input id="name" name ="name" type="text" class="required"/>

                            </div>
                        </div>
                        <div class="column">
                            <div class="field">
                                <label for="desc">Description:</label>  
                                <input id="desc" name ="desc" type="text"/>

                            </div>
                        </div>
                 </div>
                <div class="row">
                        <div class="column">
                            <div class="field">
                                <label for="mfr">Manufacturer:</label>  
                                <input id="mfr" name ="mfr" type="text" class="required"/>

                            </div>
                            <input id="mfr-hidden" name ="mfr-hidden" type="hidden"/>
                        </div>
                        <div class="column">
                            <div class="field">
                                <label for="model">Model:</label>  
                                <input id="model" name ="model" type="text"/>

                            </div>
                            <input id="model-hidden" name ="model-hidden" type="hidden"/>
                        </div>
                 </div>
                
                <div class="row">
                        <div class="column">
                            <div class="field">
                                <label for="categoryOp">Category:</label>  
                                <select name="categoryOp" id ="categoryOp" class="required"> 
                                    <option value=0>Choose 
                                    <?=$categoryOptions?> 
                                </select>

                            </div>
                        </div>
                        <div class="column">
                            <div class="field">
                                <label for="supplierOp">Supplier:</label>  
                                <select name="supplierOp" id ="supplierOp" class="opt required"> 
                                    <option value=0>Choose 
                                    <?=$supplierOptions?> 
                                </select>

                            </div>
                        </div>
                        
                 </div>
                
                <div class="row">
                        <div class="column">
                            <div class="field">
                                <label for="packageOp">Package:</label>  
                                <select name="packageOp" id ="packageOp" class="required"> 
                                    <option value=0>Choose 
                                    <?=$pkgOptions?> 
                                </select>

                            </div>
                        </div>
                        <div class="column">
                            <div class="field">
                                <label for="pkgType">Package Type:</label>  
                                <input id="pkgType" name ="pkgType" type="text"/>

                            </div>
                        </div>
                 </div>
                
                <div class="row">
                        <div class="column">
                            <div class="field">
                                <label for="uomOp">Unit Of Measurement:</label>  
                                <select name="uomOp" id ="uomOp" class="opt required"> 
                                  <option value=0>Choose   
                                </select>

                            </div>
                        </div>
                        <div class="column">
                            <div class="field">
                                <label for="sizeOp">Measurement Denomination:</label>  
                                <select name="sizeOp" id ="sizeOp" class="opt required"> 
                                    <option value=0>Choose 
                                    
                                </select>

                            </div>
                        </div>
                 </div>
               
               
            </fieldset>
        </form>
    </div>
        
    <div id="users-contain" class="ui-widget">
        <h1>Existing Users:</h1>
        <table id="products" class="ui-widget ui-widget-content">
            <thead>
                <tr class="ui-widget-header ">
                    <th>Barcode</th>
                    <th>Product</th>
                    <th>Description</th>
                    <th>Manufacturer</th>
                    <th>Model</th>
                    <th>Supplier</th>
                    <th>Package</th>
                    <th>Package Type</th>

                </tr>
            </thead>
            <tbody>

            </tbody>
        </table>
    </div>
    <button id="create-product">Create new Product</button>
</body>   
</html>


    
    <script type="text/javascript">
   $("#packageOp").change(function(){
                var val = $(this).val();
                $.ajax({type:"post",
                url:"index.php/products/populateMeasurementDropDowns",
                data: {pkgId : val},
                success: function(uomHtml){
                        $("#uomOp").children('option:not(:first)').remove();
                        $("#uomOp").append(uomHtml); 
                }
            }); 
   });
   
   
   $("#uomOp").change(function(){
                var val = $(this).val();
                $.ajax({type:"post",
                    data:{uom:val},
                url:"index.php/products/populateDenomDropdown",
            success: function(sizeHtml){
                        $("#sizeOp").children('option:not(:first)').remove();
                        $("#sizeOp").append(sizeHtml); 
                }}
        )
            });
               
       
       
    </script>


 
Back to Top